diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7bf34e..7c1c012 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} cancel-in-progress: true - jobs: formatting: runs-on: ubuntu-latest @@ -26,10 +25,9 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - # workaround for https://github.com/NomicFoundation/hardhat/issues/3877 - uses: actions/setup-node@v4 with: - node-version: 18.15 + node-version: 22 - run: npm install - run: npm test - uses: actions/cache@v4 @@ -53,9 +51,9 @@ jobs: - name: Install Java uses: actions/setup-java@v4 with: - distribution: 'zulu' - java-version: '11' - java-package: 'jre' + distribution: "zulu" + java-version: "11" + java-package: "jre" - name: Install Certora CLI run: pip3 install certora-cli==7.10.2 @@ -88,4 +86,3 @@ jobs: rule: - verify:marketplace - verify:state_changes - diff --git a/.gitignore b/.gitignore index f267262..9afc5ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,10 @@ artifacts deployment-localhost.json crytic-export .certora_internal +coverage +coverage.json + +# Ignore localhost deployments files +ignition/deployments/chain-31337 + +ignition/deployments/**/build-info diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 27552eb..0000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -nodejs 18.15.0 diff --git a/Readme.md b/Readme.md index c5e8872..6b93f5f 100644 --- a/Readme.md +++ b/Readme.md @@ -22,9 +22,28 @@ To start a local Ethereum node with the contracts deployed, execute: npm start -This will create a `deployment-localhost.json` file containing the addresses of -the deployed contracts. +Deployment +---------- +To deploy the marketplace, you need to specify the network using `--network MY_NETWORK`: + +```bash +npm run deploy -- --network localhost +``` + +Hardhat uses [reconciliation](https://hardhat.org/ignition/docs/advanced/reconciliation) to recover from +errors or resume a previous deployment. In our case, we will likely redeploy a new contract every time, +so we will need to [clear the previous deployment](https://hardhat.org/ignition/docs/guides/modifications#clearing-an-existing-deployment-with-reset): + +```bash +npm run deploy -- --network testnet --reset +``` + +To reuse a previously deployed `Token` contract, define the environment variable `TOKEN_ADDRESS`. +The deployment script will use `contractAt` from Hardhat Ignition to retrieve the existing contract +instead of deploying a new one. + +The deployment files are kept under version control [as recommended by Hardhat](https://hardhat.org/ignition/docs/advanced/versioning), except the build files, which are 18 MB. Running the prover ------------------ diff --git a/deploy/marketplace.js b/deploy/marketplace.js deleted file mode 100644 index d1cb51d..0000000 --- a/deploy/marketplace.js +++ /dev/null @@ -1,53 +0,0 @@ -const { loadZkeyHash } = require("../verifier/verifier.js") -const { loadConfiguration } = require("../configuration/configuration.js") - -async function mine256blocks({ network, ethers }) { - if (network.tags.local) { - await ethers.provider.send("hardhat_mine", ["0x100"]) - } -} - -// deploys a marketplace with a real Groth16 verifier -async function deployMarketplace({ deployments, getNamedAccounts }) { - const token = await deployments.get("TestToken") - const verifier = await deployments.get("Groth16Verifier") - const zkeyHash = loadZkeyHash(network.name) - let configuration = loadConfiguration(network.name) - configuration.proofs.zkeyHash = zkeyHash - const args = [configuration, token.address, verifier.address] - const { deployer: from } = await getNamedAccounts() - const marketplace = await deployments.deploy("Marketplace", { args, from }) - console.log("Deployed Marketplace with Groth16 Verifier at:") - console.log(marketplace.address) - console.log() -} - -// deploys a marketplace with a testing verifier -async function deployTestMarketplace({ - network, - deployments, - getNamedAccounts, -}) { - if (network.tags.local) { - const token = await deployments.get("TestToken") - const verifier = await deployments.get("TestVerifier") - const zkeyHash = loadZkeyHash(network.name) - let configuration = loadConfiguration(network.name) - configuration.proofs.zkeyHash = zkeyHash - const args = [configuration, token.address, verifier.address] - const { deployer: from } = await getNamedAccounts() - const marketplace = await deployments.deploy("Marketplace", { args, from }) - console.log("Deployed Marketplace with Test Verifier at:") - console.log(marketplace.address) - console.log() - } -} - -module.exports = async (environment) => { - await mine256blocks(environment) - await deployMarketplace(environment) - await deployTestMarketplace(environment) -} - -module.exports.tags = ["Marketplace"] -module.exports.dependencies = ["TestToken", "Verifier"] diff --git a/deploy/token.js b/deploy/token.js deleted file mode 100644 index 4e473d4..0000000 --- a/deploy/token.js +++ /dev/null @@ -1,36 +0,0 @@ -const MINTED_TOKENS = 1_000_000_000_000_000 - -module.exports = async ({ - deployments, - getNamedAccounts, - getUnnamedAccounts, - network, -}) => { - const { deployer } = await getNamedAccounts() - const tokenDeployment = await deployments.deploy("TestToken", { - from: deployer, - skipIfAlreadyDeployed: true, - }) - const token = await hre.ethers.getContractAt( - "TestToken", - tokenDeployment.address - ) - - const accounts = [ - ...Object.values(await getNamedAccounts()), - ...(await getUnnamedAccounts()), - ] - if (network.tags.local) { - for (const account of accounts) { - console.log(`Minting ${MINTED_TOKENS} tokens to address ${account}`) - - const transaction = await token.mint(account, MINTED_TOKENS, { - from: deployer, - }) - await transaction.wait() - } - console.log() - } -} - -module.exports.tags = ["TestToken"] diff --git a/deploy/verifier.js b/deploy/verifier.js deleted file mode 100644 index a2ff561..0000000 --- a/deploy/verifier.js +++ /dev/null @@ -1,24 +0,0 @@ -const { loadVerificationKey } = require("../verifier/verifier.js") - -async function deployVerifier({ deployments, getNamedAccounts }) { - const { deployer } = await getNamedAccounts() - const verificationKey = loadVerificationKey(network.name) - await deployments.deploy("Groth16Verifier", { - args: [verificationKey], - from: deployer, - }) -} - -async function deployTestVerifier({ network, deployments, getNamedAccounts }) { - if (network.tags.local) { - const { deployer } = await getNamedAccounts() - await deployments.deploy("TestVerifier", { from: deployer }) - } -} - -module.exports = async (environment) => { - await deployVerifier(environment) - await deployTestVerifier(environment) -} - -module.exports.tags = ["Verifier"] diff --git a/deployments/.gitignore b/deployments/.gitignore deleted file mode 100644 index 8bd5dde..0000000 --- a/deployments/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -localhost -codexdisttestnetwork diff --git a/deployments/codex_testnet/.chainId b/deployments/codex_testnet/.chainId deleted file mode 100644 index b20355e..0000000 --- a/deployments/codex_testnet/.chainId +++ /dev/null @@ -1 +0,0 @@ -789987 \ No newline at end of file diff --git a/deployments/codex_testnet/Groth16Verifier.json b/deployments/codex_testnet/Groth16Verifier.json deleted file mode 100644 index 5180ec9..0000000 --- a/deployments/codex_testnet/Groth16Verifier.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "address": "0x81D85B7dBAFB5B51bD2a24f15BBB77010316F71a", - "abi": [ - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "alpha1", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "beta2", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "gamma2", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "delta2", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point[]", - "name": "ic", - "type": "tuple[]" - } - ], - "internalType": "struct Groth16Verifier.VerifyingKey", - "name": "key", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - }, - { - "internalType": "uint256[]", - "name": "input", - "type": "uint256[]" - } - ], - "name": "verify", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xc4237a4c863a86af0eb532909f5d0df69a7c1bf0e24fe94d9843bbbd912c13cb", - "receipt": { - "to": null, - "from": "0x3A39904B71595608524274BFD8c20FCfd9e77236", - "contractAddress": "0x81D85B7dBAFB5B51bD2a24f15BBB77010316F71a", - "transactionIndex": 0, - "gasUsed": "1053025", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1e9aa79dec4cba95815c37aee85998209350bb483fa3bb6695c309ceaaf0c4cb", - "transactionHash": "0xc4237a4c863a86af0eb532909f5d0df69a7c1bf0e24fe94d9843bbbd912c13cb", - "logs": [], - "blockNumber": 4000540, - "cumulativeGasUsed": "1053025", - "status": 1, - "byzantium": true - }, - "args": [ - { - "alpha1": { - "x": "20491192805390485299153009773594534940189261866228447918068658471970481763042", - "y": "9383485363053290200918347156157836566562967994039712273449902621266178545958" - }, - "beta2": { - "x": { - "real": "6375614351688725206403948262868962793625744043794305715222011528459656738731", - "imag": "4252822878758300859123897981450591353533073413197771768651442665752259397132" - }, - "y": { - "real": "10505242626370262277552901082094356697409835680220590971873171140371331206856", - "imag": "21847035105528745403288232691147584728191162732299865338377159692350059136679" - } - }, - "gamma2": { - "x": { - "real": "10857046999023057135944570762232829481370756359578518086990519993285655852781", - "imag": "11559732032986387107991004021392285783925812861821192530917403151452391805634" - }, - "y": { - "real": "8495653923123431417604973247489272438418190587263600148770280649306958101930", - "imag": "4082367875863433681332203403145435568316851327593401208105741076214120093531" - } - }, - "delta2": { - "x": { - "real": "530364867487621862494857990870110718475170112084792159097488435549565467124", - "imag": "5569089924334373824418960853436586803630522384187404973286136753077815395827" - }, - "y": { - "real": "13320541513712223925568802310300463212889432778937328171416932615384576283093", - "imag": "1079831517535234899475391024252771579135484487347274232337619383102009679847" - } - }, - "ic": [ - { - "x": "11919420103024546168896650006162652130022732573970705849225139177428442519914", - "y": "17747753383929265689844293401689552935018333420134132157824903795680624926572" - }, - { - "x": "13158415194355348546090070151711085027834066488127676886518524272551654481129", - "y": "18831701962118195025265682681702066674741422770850028135520336928884612556978" - }, - { - "x": "20882269691461568155321689204947751047717828445545223718893788782534717197527", - "y": "11996193054822748526485644723594571195813487505803351159052936325857690315211" - }, - { - "x": "18155166643053044822201627105588517913195535693446564472247126736722594445000", - "y": "13816319482622393060406816684195314200198627617641073470088058848129378231754" - } - ] - } - ], - "numDeployments": 4, - "solcInputHash": "eae4c6107a8ac2a19ef4d8c910f117dc", - "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"alpha1\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"beta2\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"gamma2\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"delta2\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point[]\",\"name\":\"ic\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Groth16Verifier.VerifyingKey\",\"name\":\"key\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"internalType\":\"uint256[]\",\"name\":\"input\",\"type\":\"uint256[]\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Groth16Verifier.sol\":\"Groth16Verifier\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/Groth16.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nstruct G1Point {\\n uint256 x;\\n uint256 y;\\n}\\n\\n// A field element F_{p^2} encoded as `real + i * imag`.\\n// We chose to not represent this as an array of 2 numbers, because both Circom\\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\\nstruct Fp2Element {\\n uint256 real;\\n uint256 imag;\\n}\\n\\nstruct G2Point {\\n Fp2Element x;\\n Fp2Element y;\\n}\\n\\nstruct Groth16Proof {\\n G1Point a;\\n G2Point b;\\n G1Point c;\\n}\\n\\ninterface IGroth16Verifier {\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] calldata pubSignals\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x3694cd68f518dc4dfeb2f9a9d18f594b5511b110e129018348f21db25de1ed92\",\"license\":\"MIT\"},\"contracts/Groth16Verifier.sol\":{\"content\":\"// Copyright 2017 Christian Reitwiessner\\n// Copyright 2019 OKIMS\\n// Copyright 2024 Codex\\n// Permission is hereby granted, free of charge, to any person obtaining a copy\\n// of this software and associated documentation files (the \\\"Software\\\"), to deal\\n// in the Software without restriction, including without limitation the rights\\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\n// copies of the Software, and to permit persons to whom the Software is\\n// furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in\\n// all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\n// SOFTWARE.\\n// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\nimport \\\"./Groth16.sol\\\";\\n\\ncontract Groth16Verifier is IGroth16Verifier {\\n uint256 private constant _P =\\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n uint256 private constant _R =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n VerifyingKey private _verifyingKey;\\n\\n struct VerifyingKey {\\n G1Point alpha1;\\n G2Point beta2;\\n G2Point gamma2;\\n G2Point delta2;\\n G1Point[] ic;\\n }\\n\\n constructor(VerifyingKey memory key) {\\n _verifyingKey.alpha1 = key.alpha1;\\n _verifyingKey.beta2 = key.beta2;\\n _verifyingKey.gamma2 = key.gamma2;\\n _verifyingKey.delta2 = key.delta2;\\n for (uint i = 0; i < key.ic.length; i++) {\\n _verifyingKey.ic.push(key.ic[i]);\\n }\\n }\\n\\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\\n return G1Point(point.x, (_P - point.y) % _P);\\n }\\n\\n function _add(\\n G1Point memory point1,\\n G1Point memory point2\\n ) private view returns (bool success, G1Point memory sum) {\\n // Call the precompiled contract for addition on the alt_bn128 curve.\\n // The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\\n\\n uint256[4] memory input;\\n input[0] = point1.x;\\n input[1] = point1.y;\\n input[2] = point2.x;\\n input[3] = point2.y;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 6, input, 128, sum, 64)\\n }\\n }\\n\\n function _multiply(\\n G1Point memory point,\\n uint256 scalar\\n ) private view returns (bool success, G1Point memory product) {\\n // Call the precompiled contract for scalar multiplication on the alt_bn128\\n // curve. The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\\n\\n uint256[3] memory input;\\n input[0] = point.x;\\n input[1] = point.y;\\n input[2] = scalar;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 7, input, 96, product, 64)\\n }\\n }\\n\\n function _checkPairing(\\n G1Point memory a1,\\n G2Point memory a2,\\n G1Point memory b1,\\n G2Point memory b2,\\n G1Point memory c1,\\n G2Point memory c2,\\n G1Point memory d1,\\n G2Point memory d2\\n ) private view returns (bool success, uint256 outcome) {\\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\\n // The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-197#specification\\n\\n uint256[24] memory input; // 4 pairs of G1 and G2 points\\n uint256[1] memory output;\\n\\n input[0] = a1.x;\\n input[1] = a1.y;\\n input[2] = a2.x.imag;\\n input[3] = a2.x.real;\\n input[4] = a2.y.imag;\\n input[5] = a2.y.real;\\n\\n input[6] = b1.x;\\n input[7] = b1.y;\\n input[8] = b2.x.imag;\\n input[9] = b2.x.real;\\n input[10] = b2.y.imag;\\n input[11] = b2.y.real;\\n\\n input[12] = c1.x;\\n input[13] = c1.y;\\n input[14] = c2.x.imag;\\n input[15] = c2.x.real;\\n input[16] = c2.y.imag;\\n input[17] = c2.y.real;\\n\\n input[18] = d1.x;\\n input[19] = d1.y;\\n input[20] = d2.x.imag;\\n input[21] = d2.x.real;\\n input[22] = d2.y.imag;\\n input[23] = d2.y.real;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 8, input, 768, output, 32)\\n }\\n return (success, output[0]);\\n }\\n\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] memory input\\n ) public view returns (bool success) {\\n // Check amount of public inputs\\n if (input.length + 1 != _verifyingKey.ic.length) {\\n return false;\\n }\\n // Check that public inputs are field elements\\n for (uint i = 0; i < input.length; i++) {\\n if (input[i] >= _R) {\\n return false;\\n }\\n }\\n // Compute the linear combination\\n G1Point memory combination = _verifyingKey.ic[0];\\n for (uint i = 0; i < input.length; i++) {\\n G1Point memory product;\\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\\n if (!success) {\\n return false;\\n }\\n (success, combination) = _add(combination, product);\\n if (!success) {\\n return false;\\n }\\n }\\n // Check the pairing\\n uint256 outcome;\\n (success, outcome) = _checkPairing(\\n _negate(proof.a),\\n proof.b,\\n _verifyingKey.alpha1,\\n _verifyingKey.beta2,\\n combination,\\n _verifyingKey.gamma2,\\n proof.c,\\n _verifyingKey.delta2\\n );\\n if (!success) {\\n return false;\\n }\\n return outcome == 1;\\n }\\n}\\n\",\"keccak256\":\"0x9e2288fb822e47b5bd24c7d1b4bffb8e8210761bf85759d1845df5b8fc060901\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50604051610bbd380380610bbd83398101604081905261002f91610208565b805180516000908155602091820151600155818301518051805160025583015160035582015180516004558201516005556040830151805180516006558301516007558201518051600855820151600955606083015180518051600a55830151600b558201518051600c5590910151600d555b816080015151811015610100576000600e01826080015182815181106100ca576100ca610343565b602090810291909101810151825460018181018555600094855293839020825160029092020190815591015190820155016100a2565b5050610359565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561013f5761013f610107565b60405290565b60405160a081016001600160401b038111828210171561013f5761013f610107565b604051601f8201601f191681016001600160401b038111828210171561018f5761018f610107565b604052919050565b6000604082840312156101a957600080fd5b6101b161011d565b825181526020928301519281019290925250919050565b6000608082840312156101da57600080fd5b6101e261011d565b90506101ee8383610197565b81526101fd8360408401610197565b602082015292915050565b60006020828403121561021a57600080fd5b81516001600160401b0381111561023057600080fd5b82016101e0818503121561024357600080fd5b61024b610145565b6102558583610197565b815261026485604084016101c8565b60208201526102768560c084016101c8565b60408201526102898561014084016101c8565b60608201526101c08201516001600160401b038111156102a857600080fd5b80830192505084601f8301126102bd57600080fd5b81516001600160401b038111156102d6576102d6610107565b6102e560208260051b01610167565b8082825260208201915060208360061b86010192508783111561030757600080fd5b6020850194505b82851015610333576103208886610197565b825260208201915060408501945061030e565b6080840152509095945050505050565b634e487b7160e01b600052603260045260246000fd5b610855806103686000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806394c8919d14610030575b600080fd5b61004361003e366004610647565b610057565b604051901515815260200160405180910390f35b600e5481516000919061006b90600161072c565b146100785750600061030c565b60005b82518110156100d6577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018382815181106100b7576100b761073f565b6020026020010151106100ce57600091505061030c565b60010161007b565b50600080600e016000815481106100ef576100ef61073f565b600091825260208083206040805180820190915260029093020180548352600101549082015291505b83518110156101e05760408051808201909152600080825260208201526101a1600e61014584600161072c565b815481106101555761015561073f565b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508684815181106101945761019461073f565b6020026020010151610312565b9094509050836101b7576000935050505061030c565b6101c18382610361565b9094509250836101d7576000935050505061030c565b50600101610118565b5060006102f06101fd6101f836889003880188610786565b6103bc565b61020f368890038801604089016107a9565b604080518082018252600054815260015460208083019190915282516080808201855260025482860190815260035460608085019190915290835285518087018752600454815260055481860152838501528551918201865260065482870190815260075491830191909152815284518086019095526008548552600954858401529182019390935290919087906102af368d90038d0160c08e01610786565b60408051608081018252600a54818301908152600b54606083015281528151808301909252600c548252600d54602083810191909152810191909152610448565b9093509050826103055760009250505061030c565b6001149150505b92915050565b6000610331604051806040016040528060008152602001600081525090565b61033961055e565b845181526020808601519082015260408082018590528260608360075afa9250509250929050565b6000610380604051806040016040528060008152602001600081525090565b61038861057c565b845181526020808601518183015284516040808401919091529085015160608301528260808360065afa9250509250929050565b60408051808201909152600080825260208201526040518060400160405280836000015181526020017f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4784602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4761043691906107ea565b61044091906107fd565b905292915050565b60008061045361059a565b61045b6105b9565b8b5182526020808d0151818401528b5181015160408401528b515160608401528b810180518201516080850152515160a08401528a5160c08401528a81015160e08401528951810151610100840152895151610120840152898101805182015161014085015251516101608401528851610180840152888101516101a084015287518101516101c08401528751516101e08401528781018051820151610200850152515161022084015286516102408401528681015161026084015285518101516102808401528551516102a084015285810180518201516102c085015251516102e0840152816103008460085afa9051909c909b509950505050505050505050565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610610576106106105d7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561063f5761063f6105d7565b604052919050565b60008082840361012081121561065c57600080fd5b61010081121561066b57600080fd5b5082915061010083013567ffffffffffffffff81111561068a57600080fd5b8301601f8101851361069b57600080fd5b803567ffffffffffffffff8111156106b5576106b56105d7565b8060051b6106c560208201610616565b918252602081840181019290810190888411156106e157600080fd5b6020850194505b83851015610707578435808352602095860195909350909101906106e8565b80955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c610716565b634e487b7160e01b600052603260045260246000fd5b60006040828403121561076757600080fd5b61076f6105ed565b823581526020928301359281019290925250919050565b60006040828403121561079857600080fd5b6107a28383610755565b9392505050565b600060808284031280156107bc57600080fd5b506107c56105ed565b6107cf8484610755565b81526107de8460408501610755565b60208201529392505050565b8181038181111561030c5761030c610716565b60008261081a57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220e999442315398e0b48870ac7727735b77e41ded2e66e2cdcccc8c4255b3b7dfb64736f6c634300081c0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806394c8919d14610030575b600080fd5b61004361003e366004610647565b610057565b604051901515815260200160405180910390f35b600e5481516000919061006b90600161072c565b146100785750600061030c565b60005b82518110156100d6577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018382815181106100b7576100b761073f565b6020026020010151106100ce57600091505061030c565b60010161007b565b50600080600e016000815481106100ef576100ef61073f565b600091825260208083206040805180820190915260029093020180548352600101549082015291505b83518110156101e05760408051808201909152600080825260208201526101a1600e61014584600161072c565b815481106101555761015561073f565b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508684815181106101945761019461073f565b6020026020010151610312565b9094509050836101b7576000935050505061030c565b6101c18382610361565b9094509250836101d7576000935050505061030c565b50600101610118565b5060006102f06101fd6101f836889003880188610786565b6103bc565b61020f368890038801604089016107a9565b604080518082018252600054815260015460208083019190915282516080808201855260025482860190815260035460608085019190915290835285518087018752600454815260055481860152838501528551918201865260065482870190815260075491830191909152815284518086019095526008548552600954858401529182019390935290919087906102af368d90038d0160c08e01610786565b60408051608081018252600a54818301908152600b54606083015281528151808301909252600c548252600d54602083810191909152810191909152610448565b9093509050826103055760009250505061030c565b6001149150505b92915050565b6000610331604051806040016040528060008152602001600081525090565b61033961055e565b845181526020808601519082015260408082018590528260608360075afa9250509250929050565b6000610380604051806040016040528060008152602001600081525090565b61038861057c565b845181526020808601518183015284516040808401919091529085015160608301528260808360065afa9250509250929050565b60408051808201909152600080825260208201526040518060400160405280836000015181526020017f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4784602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4761043691906107ea565b61044091906107fd565b905292915050565b60008061045361059a565b61045b6105b9565b8b5182526020808d0151818401528b5181015160408401528b515160608401528b810180518201516080850152515160a08401528a5160c08401528a81015160e08401528951810151610100840152895151610120840152898101805182015161014085015251516101608401528851610180840152888101516101a084015287518101516101c08401528751516101e08401528781018051820151610200850152515161022084015286516102408401528681015161026084015285518101516102808401528551516102a084015285810180518201516102c085015251516102e0840152816103008460085afa9051909c909b509950505050505050505050565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610610576106106105d7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561063f5761063f6105d7565b604052919050565b60008082840361012081121561065c57600080fd5b61010081121561066b57600080fd5b5082915061010083013567ffffffffffffffff81111561068a57600080fd5b8301601f8101851361069b57600080fd5b803567ffffffffffffffff8111156106b5576106b56105d7565b8060051b6106c560208201610616565b918252602081840181019290810190888411156106e157600080fd5b6020850194505b83851015610707578435808352602095860195909350909101906106e8565b80955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c610716565b634e487b7160e01b600052603260045260246000fd5b60006040828403121561076757600080fd5b61076f6105ed565b823581526020928301359281019290925250919050565b60006040828403121561079857600080fd5b6107a28383610755565b9392505050565b600060808284031280156107bc57600080fd5b506107c56105ed565b6107cf8484610755565b81526107de8460408501610755565b60208201529392505050565b8181038181111561030c5761030c610716565b60008261081a57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220e999442315398e0b48870ac7727735b77e41ded2e66e2cdcccc8c4255b3b7dfb64736f6c634300081c0033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 7152, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "_verifyingKey", - "offset": 0, - "slot": "0", - "type": "t_struct(VerifyingKey)7169_storage" - } - ], - "types": { - "t_array(t_struct(G1Point)7104_storage)dyn_storage": { - "base": "t_struct(G1Point)7104_storage", - "encoding": "dynamic_array", - "label": "struct G1Point[]", - "numberOfBytes": "32" - }, - "t_struct(Fp2Element)7109_storage": { - "encoding": "inplace", - "label": "struct Fp2Element", - "members": [ - { - "astId": 7106, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "real", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 7108, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "imag", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(G1Point)7104_storage": { - "encoding": "inplace", - "label": "struct G1Point", - "members": [ - { - "astId": 7101, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 7103, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "y", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(G2Point)7116_storage": { - "encoding": "inplace", - "label": "struct G2Point", - "members": [ - { - "astId": 7112, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_struct(Fp2Element)7109_storage" - }, - { - "astId": 7115, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "y", - "offset": 0, - "slot": "2", - "type": "t_struct(Fp2Element)7109_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(VerifyingKey)7169_storage": { - "encoding": "inplace", - "label": "struct Groth16Verifier.VerifyingKey", - "members": [ - { - "astId": 7155, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "alpha1", - "offset": 0, - "slot": "0", - "type": "t_struct(G1Point)7104_storage" - }, - { - "astId": 7158, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "beta2", - "offset": 0, - "slot": "2", - "type": "t_struct(G2Point)7116_storage" - }, - { - "astId": 7161, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "gamma2", - "offset": 0, - "slot": "6", - "type": "t_struct(G2Point)7116_storage" - }, - { - "astId": 7164, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "delta2", - "offset": 0, - "slot": "10", - "type": "t_struct(G2Point)7116_storage" - }, - { - "astId": 7168, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "ic", - "offset": 0, - "slot": "14", - "type": "t_array(t_struct(G1Point)7104_storage)dyn_storage" - } - ], - "numberOfBytes": "480" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/Marketplace.json b/deployments/codex_testnet/Marketplace.json deleted file mode 100644 index f402a02..0000000 --- a/deployments/codex_testnet/Marketplace.json +++ /dev/null @@ -1,2319 +0,0 @@ -{ - "address": "0x5378a4EA5dA2a548ce22630A3AE74b052000C62D", - "abi": [ - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "validatorRewardPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "period", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "timeout", - "type": "uint64" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "downtimeProduct", - "type": "uint8" - }, - { - "internalType": "string", - "name": "zkeyHash", - "type": "string" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "maxReservations", - "type": "uint8" - } - ], - "internalType": "struct SlotReservationsConfig", - "name": "reservations", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "requestDurationLimit", - "type": "uint64" - } - ], - "internalType": "struct MarketplaceConfig", - "name": "config", - "type": "tuple" - }, - { - "internalType": "contract IERC20", - "name": "token_", - "type": "address" - }, - { - "internalType": "contract IGroth16Verifier", - "name": "verifier", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "Marketplace_AlreadyPaid", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_DurationExceedsLimit", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientCollateral", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientDuration", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientProofProbability", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientReward", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientSlots", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidCid", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidClientAddress", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidExpiry", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidMaxSlotLoss", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidSlot", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidSlotHost", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidState", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_MaximumSlashingTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_NothingToWithdraw", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_ProofNotSubmittedByHost", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_RepairRewardPercentageTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_RequestAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_ReservationRequired", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlashPercentageTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotIsFree", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotNotAcceptingProofs", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotNotFree", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_StartNotBeforeExpiry", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_TransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_UnknownRequest", - "type": "error" - }, - { - "inputs": [], - "name": "Periods_InvalidSecondsPerPeriod", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_InsufficientBlockHeight", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_InvalidProof", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_PeriodNotEnded", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofAlreadyMarkedMissing", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofAlreadySubmitted", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofNotMissing", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofNotRequired", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ValidationTimedOut", - "type": "error" - }, - { - "inputs": [], - "name": "SlotReservations_ReservationNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "ProofSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFulfilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotFilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotFreed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotReservationsFull", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "indexed": false, - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - } - ], - "name": "StorageRequested", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "Periods.Period", - "name": "period", - "type": "uint64" - } - ], - "name": "canMarkProofAsMissing", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "canReserveSlot", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "configuration", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "validatorRewardPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "period", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "timeout", - "type": "uint64" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "downtimeProduct", - "type": "uint8" - }, - { - "internalType": "string", - "name": "zkeyHash", - "type": "string" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "maxReservations", - "type": "uint8" - } - ], - "internalType": "struct SlotReservationsConfig", - "name": "reservations", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "requestDurationLimit", - "type": "uint64" - } - ], - "internalType": "struct MarketplaceConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "currentCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "fillSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "rewardRecipient", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralRecipient", - "type": "address" - } - ], - "name": "freeSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "freeSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getActiveSlot", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "internalType": "struct Marketplace.ActiveSlot", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getHost", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getPointer", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "getRequest", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "isProofRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "Periods.Period", - "name": "period", - "type": "uint64" - } - ], - "name": "markProofAsMissing", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "missingProofs", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "myRequests", - "outputs": [ - { - "internalType": "RequestId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mySlots", - "outputs": [ - { - "internalType": "SlotId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestEnd", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestExpiry", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestState", - "outputs": [ - { - "internalType": "enum RequestState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - } - ], - "name": "requestStorage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "reserveSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "slotProbability", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "slotState", - "outputs": [ - { - "internalType": "enum SlotState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "submitProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "willProofBeRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "withdrawRecipient", - "type": "address" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x706255a41084cdf622d21a554485559d5ff2c91dcaeef869f2c394fe3b6566e6", - "receipt": { - "to": null, - "from": "0x3A39904B71595608524274BFD8c20FCfd9e77236", - "contractAddress": "0x5378a4EA5dA2a548ce22630A3AE74b052000C62D", - "transactionIndex": 0, - "gasUsed": "4320966", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x50fc04d1b8c2e0c6efac5729d29a67f1f18eef5475f32d7bf6ffe5afd3c8b944", - "transactionHash": "0x706255a41084cdf622d21a554485559d5ff2c91dcaeef869f2c394fe3b6566e6", - "logs": [], - "blockNumber": 4000541, - "cumulativeGasUsed": "4320966", - "status": 1, - "byzantium": true - }, - "args": [ - { - "collateral": { - "repairRewardPercentage": 10, - "maxNumberOfSlashes": 2, - "slashPercentage": 20, - "validatorRewardPercentage": 20 - }, - "proofs": { - "period": 120, - "timeout": 30, - "downtime": 64, - "downtimeProduct": 67, - "zkeyHash": "fd338cf5f846a3385efce8d10db33f262bafd0260b2211e27b5e461a45a8df94" - }, - "reservations": { - "maxReservations": 3 - }, - "requestDurationLimit": 2592000 - }, - "0x34a22f3911De437307c6f4485931779670f78764", - "0x81D85B7dBAFB5B51bD2a24f15BBB77010316F71a" - ], - "numDeployments": 11, - "solcInputHash": "eae4c6107a8ac2a19ef4d8c910f117dc", - "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"validatorRewardPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"period\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timeout\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"downtimeProduct\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"zkeyHash\",\"type\":\"string\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"maxReservations\",\"type\":\"uint8\"}],\"internalType\":\"struct SlotReservationsConfig\",\"name\":\"reservations\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"requestDurationLimit\",\"type\":\"uint64\"}],\"internalType\":\"struct MarketplaceConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"contract IERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"contract IGroth16Verifier\",\"name\":\"verifier\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"Marketplace_AlreadyPaid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_DurationExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientDuration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientProofProbability\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientReward\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientSlots\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidCid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidClientAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidExpiry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidMaxSlotLoss\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidSlot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidSlotHost\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_MaximumSlashingTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_NothingToWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_ProofNotSubmittedByHost\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_RepairRewardPercentageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_RequestAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_ReservationRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlashPercentageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotIsFree\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotNotAcceptingProofs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotNotFree\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_StartNotBeforeExpiry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_UnknownRequest\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Periods_InvalidSecondsPerPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_InsufficientBlockHeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_PeriodNotEnded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofAlreadyMarkedMissing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofAlreadySubmitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofNotMissing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofNotRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ValidationTimedOut\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SlotReservations_ReservationNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"ProofSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotFreed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotReservationsFull\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"StorageRequested\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"Periods.Period\",\"name\":\"period\",\"type\":\"uint64\"}],\"name\":\"canMarkProofAsMissing\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"canReserveSlot\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"configuration\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"validatorRewardPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"period\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timeout\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"downtimeProduct\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"zkeyHash\",\"type\":\"string\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"maxReservations\",\"type\":\"uint8\"}],\"internalType\":\"struct SlotReservationsConfig\",\"name\":\"reservations\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"requestDurationLimit\",\"type\":\"uint64\"}],\"internalType\":\"struct MarketplaceConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"currentCollateral\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"fillSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"rewardRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collateralRecipient\",\"type\":\"address\"}],\"name\":\"freeSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"freeSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getActiveSlot\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"internalType\":\"struct Marketplace.ActiveSlot\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getChallenge\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getHost\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getPointer\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"isProofRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"Periods.Period\",\"name\":\"period\",\"type\":\"uint64\"}],\"name\":\"markProofAsMissing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"missingProofs\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"myRequests\",\"outputs\":[{\"internalType\":\"RequestId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mySlots\",\"outputs\":[{\"internalType\":\"SlotId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestEnd\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestExpiry\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestState\",\"outputs\":[{\"internalType\":\"enum RequestState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"}],\"name\":\"requestStorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"reserveSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"slotProbability\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"slotState\",\"outputs\":[{\"internalType\":\"enum SlotState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"submitProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"willProofBeRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"withdrawRecipient\",\"type\":\"address\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))\":{\"params\":{\"proof\":\"Groth16 proof procing possession of the slot data.\",\"requestId\":\"RequestId identifying the request containing the slot to fill.\",\"slotIndex\":\"Index of the slot in the request.\"}},\"freeSlot(bytes32)\":{\"details\":\"The host that filled the slot must have initiated the transaction (msg.sender). This overload allows `rewardRecipient` and `collateralRecipient` to be optional.\",\"params\":{\"slotId\":\"id of the slot to free\"}},\"freeSlot(bytes32,address,address)\":{\"params\":{\"collateralRecipient\":\"address to refund collateral to\",\"rewardRecipient\":\"address to send rewards to\",\"slotId\":\"id of the slot to free\"}},\"getChallenge(bytes32)\":{\"params\":{\"id\":\"Slot's ID for which the challenge should be calculated\"},\"returns\":{\"_0\":\"Challenge for current Period that should be used for generation of proofs\"}},\"getPointer(bytes32)\":{\"details\":\"For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\",\"params\":{\"id\":\"Slot's ID for which the pointer should be calculated\"},\"returns\":{\"_0\":\"Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\"}},\"isProofRequired(bytes32)\":{\"params\":{\"id\":\"Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\"},\"returns\":{\"_0\":\"bool indicating if proof is required for current period\"}},\"missingProofs(bytes32)\":{\"returns\":{\"_0\":\"Number of missed proofs since Slot was Filled\"}},\"willProofBeRequired(bytes32)\":{\"details\":\"for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\",\"params\":{\"id\":\"SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\"},\"returns\":{\"_0\":\"bool\"}},\"withdrawFunds(bytes32)\":{\"details\":\"Request must be cancelled, failed or finished, and the transaction must originate from the depositor address.\",\"params\":{\"requestId\":\"the id of the request\"}},\"withdrawFunds(bytes32,address)\":{\"details\":\"Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\",\"params\":{\"requestId\":\"the id of the request\",\"withdrawRecipient\":\"address to return the remaining funds to\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))\":{\"notice\":\"Fills a slot. Reverts if an invalid proof of the slot data is provided.\"},\"freeSlot(bytes32)\":{\"notice\":\"Frees a slot, paying out rewards and returning collateral for finished or cancelled requests to the host that has filled the slot.\"},\"freeSlot(bytes32,address,address)\":{\"notice\":\"Frees a slot, paying out rewards and returning collateral for finished or cancelled requests.\"},\"willProofBeRequired(bytes32)\":{\"notice\":\"Proof Downtime specifies part of the Period when the proof is not required even if the proof should be required. This function returns true if the pointer is in downtime (hence no proof required now) and at the same time the proof will be required later on in the Period.\"},\"withdrawFunds(bytes32)\":{\"notice\":\"Withdraws remaining storage request funds back to the client that deposited them.\"},\"withdrawFunds(bytes32,address)\":{\"notice\":\"Withdraws storage request funds to the provided address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Marketplace.sol\":\"Marketplace\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-20 standard as defined in the ERC.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the value of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the value of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\\n * caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 value) external returns (bool);\\n\\n /**\\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\\n * allowance mechanism. `value` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 value) external returns (bool);\\n}\\n\",\"keccak256\":\"0xe06a3f08a987af6ad2e1c1e774405d4fe08f1694b67517438b467cecf0da0ef7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Arrays.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Arrays.sol)\\n// This file was procedurally generated from scripts/generate/templates/Arrays.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Comparators} from \\\"./Comparators.sol\\\";\\nimport {SlotDerivation} from \\\"./SlotDerivation.sol\\\";\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\nimport {Math} from \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to array types.\\n */\\nlibrary Arrays {\\n using SlotDerivation for bytes32;\\n using StorageSlot for bytes32;\\n\\n /**\\n * @dev Sort an array of uint256 (in memory) following the provided comparator function.\\n *\\n * This function does the sorting \\\"in place\\\", meaning that it overrides the input. The object is returned for\\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\\n *\\n * NOTE: this function's cost is `O(n \\u00b7 log(n))` in average and `O(n\\u00b2)` in the worst case, with n the length of the\\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\\n * consume more gas than is available in a block, leading to potential DoS.\\n *\\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\\n */\\n function sort(\\n uint256[] memory array,\\n function(uint256, uint256) pure returns (bool) comp\\n ) internal pure returns (uint256[] memory) {\\n _quickSort(_begin(array), _end(array), comp);\\n return array;\\n }\\n\\n /**\\n * @dev Variant of {sort} that sorts an array of uint256 in increasing order.\\n */\\n function sort(uint256[] memory array) internal pure returns (uint256[] memory) {\\n sort(array, Comparators.lt);\\n return array;\\n }\\n\\n /**\\n * @dev Sort an array of address (in memory) following the provided comparator function.\\n *\\n * This function does the sorting \\\"in place\\\", meaning that it overrides the input. The object is returned for\\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\\n *\\n * NOTE: this function's cost is `O(n \\u00b7 log(n))` in average and `O(n\\u00b2)` in the worst case, with n the length of the\\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\\n * consume more gas than is available in a block, leading to potential DoS.\\n *\\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\\n */\\n function sort(\\n address[] memory array,\\n function(address, address) pure returns (bool) comp\\n ) internal pure returns (address[] memory) {\\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\\n return array;\\n }\\n\\n /**\\n * @dev Variant of {sort} that sorts an array of address in increasing order.\\n */\\n function sort(address[] memory array) internal pure returns (address[] memory) {\\n sort(_castToUint256Array(array), Comparators.lt);\\n return array;\\n }\\n\\n /**\\n * @dev Sort an array of bytes32 (in memory) following the provided comparator function.\\n *\\n * This function does the sorting \\\"in place\\\", meaning that it overrides the input. The object is returned for\\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\\n *\\n * NOTE: this function's cost is `O(n \\u00b7 log(n))` in average and `O(n\\u00b2)` in the worst case, with n the length of the\\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\\n * consume more gas than is available in a block, leading to potential DoS.\\n *\\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\\n */\\n function sort(\\n bytes32[] memory array,\\n function(bytes32, bytes32) pure returns (bool) comp\\n ) internal pure returns (bytes32[] memory) {\\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\\n return array;\\n }\\n\\n /**\\n * @dev Variant of {sort} that sorts an array of bytes32 in increasing order.\\n */\\n function sort(bytes32[] memory array) internal pure returns (bytes32[] memory) {\\n sort(_castToUint256Array(array), Comparators.lt);\\n return array;\\n }\\n\\n /**\\n * @dev Performs a quick sort of a segment of memory. The segment sorted starts at `begin` (inclusive), and stops\\n * at end (exclusive). Sorting follows the `comp` comparator.\\n *\\n * Invariant: `begin <= end`. This is the case when initially called by {sort} and is preserved in subcalls.\\n *\\n * IMPORTANT: Memory locations between `begin` and `end` are not validated/zeroed. This function should\\n * be used only if the limits are within a memory array.\\n */\\n function _quickSort(uint256 begin, uint256 end, function(uint256, uint256) pure returns (bool) comp) private pure {\\n unchecked {\\n if (end - begin < 0x40) return;\\n\\n // Use first element as pivot\\n uint256 pivot = _mload(begin);\\n // Position where the pivot should be at the end of the loop\\n uint256 pos = begin;\\n\\n for (uint256 it = begin + 0x20; it < end; it += 0x20) {\\n if (comp(_mload(it), pivot)) {\\n // If the value stored at the iterator's position comes before the pivot, we increment the\\n // position of the pivot and move the value there.\\n pos += 0x20;\\n _swap(pos, it);\\n }\\n }\\n\\n _swap(begin, pos); // Swap pivot into place\\n _quickSort(begin, pos, comp); // Sort the left side of the pivot\\n _quickSort(pos + 0x20, end, comp); // Sort the right side of the pivot\\n }\\n }\\n\\n /**\\n * @dev Pointer to the memory location of the first element of `array`.\\n */\\n function _begin(uint256[] memory array) private pure returns (uint256 ptr) {\\n assembly (\\\"memory-safe\\\") {\\n ptr := add(array, 0x20)\\n }\\n }\\n\\n /**\\n * @dev Pointer to the memory location of the first memory word (32bytes) after `array`. This is the memory word\\n * that comes just after the last element of the array.\\n */\\n function _end(uint256[] memory array) private pure returns (uint256 ptr) {\\n unchecked {\\n return _begin(array) + array.length * 0x20;\\n }\\n }\\n\\n /**\\n * @dev Load memory word (as a uint256) at location `ptr`.\\n */\\n function _mload(uint256 ptr) private pure returns (uint256 value) {\\n assembly {\\n value := mload(ptr)\\n }\\n }\\n\\n /**\\n * @dev Swaps the elements memory location `ptr1` and `ptr2`.\\n */\\n function _swap(uint256 ptr1, uint256 ptr2) private pure {\\n assembly {\\n let value1 := mload(ptr1)\\n let value2 := mload(ptr2)\\n mstore(ptr1, value2)\\n mstore(ptr2, value1)\\n }\\n }\\n\\n /// @dev Helper: low level cast address memory array to uint256 memory array\\n function _castToUint256Array(address[] memory input) private pure returns (uint256[] memory output) {\\n assembly {\\n output := input\\n }\\n }\\n\\n /// @dev Helper: low level cast bytes32 memory array to uint256 memory array\\n function _castToUint256Array(bytes32[] memory input) private pure returns (uint256[] memory output) {\\n assembly {\\n output := input\\n }\\n }\\n\\n /// @dev Helper: low level cast address comp function to uint256 comp function\\n function _castToUint256Comp(\\n function(address, address) pure returns (bool) input\\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\\n assembly {\\n output := input\\n }\\n }\\n\\n /// @dev Helper: low level cast bytes32 comp function to uint256 comp function\\n function _castToUint256Comp(\\n function(bytes32, bytes32) pure returns (bool) input\\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\\n assembly {\\n output := input\\n }\\n }\\n\\n /**\\n * @dev Searches a sorted `array` and returns the first index that contains\\n * a value greater or equal to `element`. If no such index exists (i.e. all\\n * values in the array are strictly less than `element`), the array length is\\n * returned. Time complexity O(log n).\\n *\\n * NOTE: The `array` is expected to be sorted in ascending order, and to\\n * contain no repeated elements.\\n *\\n * IMPORTANT: Deprecated. This implementation behaves as {lowerBound} but lacks\\n * support for repeated elements in the array. The {lowerBound} function should\\n * be used instead.\\n */\\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n if (high == 0) {\\n return 0;\\n }\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds towards zero (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\\n return low - 1;\\n } else {\\n return low;\\n }\\n }\\n\\n /**\\n * @dev Searches an `array` sorted in ascending order and returns the first\\n * index that contains a value greater or equal than `element`. If no such index\\n * exists (i.e. all values in the array are strictly less than `element`), the array\\n * length is returned. Time complexity O(log n).\\n *\\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/lower_bound[lower_bound].\\n */\\n function lowerBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n if (high == 0) {\\n return 0;\\n }\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds towards zero (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value < element) {\\n // this cannot overflow because mid < high\\n unchecked {\\n low = mid + 1;\\n }\\n } else {\\n high = mid;\\n }\\n }\\n\\n return low;\\n }\\n\\n /**\\n * @dev Searches an `array` sorted in ascending order and returns the first\\n * index that contains a value strictly greater than `element`. If no such index\\n * exists (i.e. all values in the array are strictly less than `element`), the array\\n * length is returned. Time complexity O(log n).\\n *\\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/upper_bound[upper_bound].\\n */\\n function upperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n if (high == 0) {\\n return 0;\\n }\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds towards zero (it does integer division with truncation).\\n if (unsafeAccess(array, mid).value > element) {\\n high = mid;\\n } else {\\n // this cannot overflow because mid < high\\n unchecked {\\n low = mid + 1;\\n }\\n }\\n }\\n\\n return low;\\n }\\n\\n /**\\n * @dev Same as {lowerBound}, but with an array in memory.\\n */\\n function lowerBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n if (high == 0) {\\n return 0;\\n }\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds towards zero (it does integer division with truncation).\\n if (unsafeMemoryAccess(array, mid) < element) {\\n // this cannot overflow because mid < high\\n unchecked {\\n low = mid + 1;\\n }\\n } else {\\n high = mid;\\n }\\n }\\n\\n return low;\\n }\\n\\n /**\\n * @dev Same as {upperBound}, but with an array in memory.\\n */\\n function upperBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\\n uint256 low = 0;\\n uint256 high = array.length;\\n\\n if (high == 0) {\\n return 0;\\n }\\n\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n\\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\\n // because Math.average rounds towards zero (it does integer division with truncation).\\n if (unsafeMemoryAccess(array, mid) > element) {\\n high = mid;\\n } else {\\n // this cannot overflow because mid < high\\n unchecked {\\n low = mid + 1;\\n }\\n }\\n }\\n\\n return low;\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {\\n bytes32 slot;\\n assembly (\\\"memory-safe\\\") {\\n slot := arr.slot\\n }\\n return slot.deriveArray().offset(pos).getAddressSlot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {\\n bytes32 slot;\\n assembly (\\\"memory-safe\\\") {\\n slot := arr.slot\\n }\\n return slot.deriveArray().offset(pos).getBytes32Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {\\n bytes32 slot;\\n assembly (\\\"memory-safe\\\") {\\n slot := arr.slot\\n }\\n return slot.deriveArray().offset(pos).getUint256Slot();\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {\\n assembly {\\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeMemoryAccess(bytes32[] memory arr, uint256 pos) internal pure returns (bytes32 res) {\\n assembly {\\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\\n }\\n }\\n\\n /**\\n * @dev Access an array in an \\\"unsafe\\\" way. Skips solidity \\\"index-out-of-range\\\" check.\\n *\\n * WARNING: Only use if you are certain `pos` is lower than the array length.\\n */\\n function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {\\n assembly {\\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\\n }\\n }\\n\\n /**\\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\\n *\\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\\n */\\n function unsafeSetLength(address[] storage array, uint256 len) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(array.slot, len)\\n }\\n }\\n\\n /**\\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\\n *\\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\\n */\\n function unsafeSetLength(bytes32[] storage array, uint256 len) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(array.slot, len)\\n }\\n }\\n\\n /**\\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\\n *\\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\\n */\\n function unsafeSetLength(uint256[] storage array, uint256 len) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(array.slot, len)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x55a4fdb408e3db950b48f4a6131e538980be8c5f48ee59829d92d66477140cd6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Comparators.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Comparators.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides a set of functions to compare values.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Comparators {\\n function lt(uint256 a, uint256 b) internal pure returns (bool) {\\n return a < b;\\n }\\n\\n function gt(uint256 a, uint256 b) internal pure returns (bool) {\\n return a > b;\\n }\\n}\\n\",\"keccak256\":\"0x302eecd8cf323b4690e3494a7d960b3cbce077032ab8ef655b323cdd136cec58\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/SlotDerivation.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/SlotDerivation.sol)\\n// This file was procedurally generated from scripts/generate/templates/SlotDerivation.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for computing storage (and transient storage) locations from namespaces and deriving slots\\n * corresponding to standard patterns. The derivation method for array and mapping matches the storage layout used by\\n * the solidity language / compiler.\\n *\\n * See https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays[Solidity docs for mappings and dynamic arrays.].\\n *\\n * Example usage:\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using StorageSlot for bytes32;\\n * using SlotDerivation for bytes32;\\n *\\n * // Declare a namespace\\n * string private constant _NAMESPACE = \\\"\\\"; // eg. OpenZeppelin.Slot\\n *\\n * function setValueInNamespace(uint256 key, address newValue) internal {\\n * _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value = newValue;\\n * }\\n *\\n * function getValueInNamespace(uint256 key) internal view returns (address) {\\n * return _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {StorageSlot}.\\n *\\n * NOTE: This library provides a way to manipulate storage locations in a non-standard way. Tooling for checking\\n * upgrade safety will ignore the slots accessed through this library.\\n *\\n * _Available since v5.1._\\n */\\nlibrary SlotDerivation {\\n /**\\n * @dev Derive an ERC-7201 slot from a string (namespace).\\n */\\n function erc7201Slot(string memory namespace) internal pure returns (bytes32 slot) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1))\\n slot := and(keccak256(0x00, 0x20), not(0xff))\\n }\\n }\\n\\n /**\\n * @dev Add an offset to a slot to get the n-th element of a structure or an array.\\n */\\n function offset(bytes32 slot, uint256 pos) internal pure returns (bytes32 result) {\\n unchecked {\\n return bytes32(uint256(slot) + pos);\\n }\\n }\\n\\n /**\\n * @dev Derive the location of the first element in an array from the slot where the length is stored.\\n */\\n function deriveArray(bytes32 slot) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, slot)\\n result := keccak256(0x00, 0x20)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, address key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, and(key, shr(96, not(0))))\\n mstore(0x20, slot)\\n result := keccak256(0x00, 0x40)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, bool key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, iszero(iszero(key)))\\n mstore(0x20, slot)\\n result := keccak256(0x00, 0x40)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, bytes32 key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, key)\\n mstore(0x20, slot)\\n result := keccak256(0x00, 0x40)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, uint256 key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, key)\\n mstore(0x20, slot)\\n result := keccak256(0x00, 0x40)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, int256 key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, key)\\n mstore(0x20, slot)\\n result := keccak256(0x00, 0x40)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, string memory key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n let length := mload(key)\\n let begin := add(key, 0x20)\\n let end := add(begin, length)\\n let cache := mload(end)\\n mstore(end, slot)\\n result := keccak256(begin, add(length, 0x20))\\n mstore(end, cache)\\n }\\n }\\n\\n /**\\n * @dev Derive the location of a mapping element from the key.\\n */\\n function deriveMapping(bytes32 slot, bytes memory key) internal pure returns (bytes32 result) {\\n assembly (\\\"memory-safe\\\") {\\n let length := mload(key)\\n let begin := add(key, 0x20)\\n let end := add(begin, length)\\n let cache := mload(end)\\n mstore(end, slot)\\n result := keccak256(begin, add(length, 0x20))\\n mstore(end, cache)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67672e4ca1dafdcc661d4eba8475cfac631fa0933309258e3af7644b92e1fb26\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Return the 512-bit addition of two uint256.\\n *\\n * The result is stored in two 256 variables such that sum = high * 2\\u00b2\\u2075\\u2076 + low.\\n */\\n function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\\n assembly (\\\"memory-safe\\\") {\\n low := add(a, b)\\n high := lt(low, a)\\n }\\n }\\n\\n /**\\n * @dev Return the 512-bit multiplication of two uint256.\\n *\\n * The result is stored in two 256 variables such that product = high * 2\\u00b2\\u2075\\u2076 + low.\\n */\\n function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\\n // 512-bit multiply [high low] = x * y. Compute the product mod 2\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = high * 2\\u00b2\\u2075\\u2076 + low.\\n assembly (\\\"memory-safe\\\") {\\n let mm := mulmod(a, b, not(0))\\n low := mul(a, b)\\n high := sub(sub(mm, low), lt(mm, low))\\n }\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n success = c >= a;\\n result = c * SafeCast.toUint(success);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a - b;\\n success = c <= a;\\n result = c * SafeCast.toUint(success);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a * b;\\n assembly (\\\"memory-safe\\\") {\\n // Only true when the multiplication doesn't overflow\\n // (c / a == b) || (a == 0)\\n success := or(eq(div(c, a), b), iszero(a))\\n }\\n // equivalent to: success ? c : 0\\n result = c * SafeCast.toUint(success);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n success = b > 0;\\n assembly (\\\"memory-safe\\\") {\\n // The `DIV` opcode returns zero when the denominator is 0.\\n result := div(a, b)\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n success = b > 0;\\n assembly (\\\"memory-safe\\\") {\\n // The `MOD` opcode returns zero when the denominator is 0.\\n result := mod(a, b)\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsigned saturating addition, bounds to `2\\u00b2\\u2075\\u2076 - 1` instead of overflowing.\\n */\\n function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\\n (bool success, uint256 result) = tryAdd(a, b);\\n return ternary(success, result, type(uint256).max);\\n }\\n\\n /**\\n * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\\n */\\n function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\\n (, uint256 result) = trySub(a, b);\\n return result;\\n }\\n\\n /**\\n * @dev Unsigned saturating multiplication, bounds to `2\\u00b2\\u2075\\u2076 - 1` instead of overflowing.\\n */\\n function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\\n (bool success, uint256 result) = tryMul(a, b);\\n return ternary(success, result, type(uint256).max);\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a > b, a, b);\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return ternary(a < b, a, b);\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n (uint256 high, uint256 low) = mul512(x, y);\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (high == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return low / denominator;\\n }\\n\\n // Make sure the result is less than 2\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= high) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [high low].\\n uint256 remainder;\\n assembly (\\\"memory-safe\\\") {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n high := sub(high, gt(remainder, low))\\n low := sub(low, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\n assembly (\\\"memory-safe\\\") {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [high low] by twos.\\n low := div(low, twos)\\n\\n // Flip twos such that it is 2\\u00b2\\u2075\\u2076 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from high into low.\\n low |= high * twos;\\n\\n // Invert denominator mod 2\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, this is the final result. We don't need to compute the high bits of the result and high\\n // is no longer required.\\n result = low * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\\n */\\n function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\\n unchecked {\\n (uint256 high, uint256 low) = mul512(x, y);\\n if (high >= 1 << n) {\\n Panic.panic(Panic.UNDER_OVERFLOW);\\n }\\n return (high << (256 - n)) | (low >> n);\\n }\\n }\\n\\n /**\\n * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\\n */\\n function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\\n return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 x) internal pure returns (uint256 r) {\\n // If value has upper 128 bits set, log2 result is at least 128\\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\\n // If upper 64 bits of 128-bit half set, add 64 to result\\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\\n // If upper 32 bits of 64-bit half set, add 32 to result\\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\\n // If upper 16 bits of 32-bit half set, add 16 to result\\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\\n // If upper 8 bits of 16-bit half set, add 8 to result\\n r |= SafeCast.toUint((x >> r) > 0xff) << 3;\\n // If upper 4 bits of 8-bit half set, add 4 to result\\n r |= SafeCast.toUint((x >> r) > 0xf) << 2;\\n\\n // Shifts value right by the current result and use it as an index into this lookup table:\\n //\\n // | x (4 bits) | index | table[index] = MSB position |\\n // |------------|---------|-----------------------------|\\n // | 0000 | 0 | table[0] = 0 |\\n // | 0001 | 1 | table[1] = 0 |\\n // | 0010 | 2 | table[2] = 1 |\\n // | 0011 | 3 | table[3] = 1 |\\n // | 0100 | 4 | table[4] = 2 |\\n // | 0101 | 5 | table[5] = 2 |\\n // | 0110 | 6 | table[6] = 2 |\\n // | 0111 | 7 | table[7] = 2 |\\n // | 1000 | 8 | table[8] = 3 |\\n // | 1001 | 9 | table[9] = 3 |\\n // | 1010 | 10 | table[10] = 3 |\\n // | 1011 | 11 | table[11] = 3 |\\n // | 1100 | 12 | table[12] = 3 |\\n // | 1101 | 13 | table[13] = 3 |\\n // | 1110 | 14 | table[14] = 3 |\\n // | 1111 | 15 | table[15] = 3 |\\n //\\n // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\\n assembly (\\\"memory-safe\\\") {\\n r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 x) internal pure returns (uint256 r) {\\n // If value has upper 128 bits set, log2 result is at least 128\\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\\n // If upper 64 bits of 128-bit half set, add 64 to result\\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\\n // If upper 32 bits of 64-bit half set, add 32 to result\\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\\n // If upper 16 bits of 32-bit half set, add 16 to result\\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\\n // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\\n return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0x1225214420c83ebcca88f2ae2b50f053aaa7df7bd684c3e878d334627f2edfc6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Arrays} from \\\"../Arrays.sol\\\";\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n * - Set can be cleared (all elements removed) in O(n).\\n *\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position is the index of the value in the `values` array plus 1.\\n // Position 0 is used to mean a value is not in the set.\\n mapping(bytes32 value => uint256) _positions;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._positions[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We cache the value's position to prevent multiple reads from the same storage slot\\n uint256 position = set._positions[value];\\n\\n if (position != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 valueIndex = position - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (valueIndex != lastIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the lastValue to the index where the value to delete is\\n set._values[valueIndex] = lastValue;\\n // Update the tracked position of the lastValue (that was just moved)\\n set._positions[lastValue] = position;\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the tracked position for the deleted slot\\n delete set._positions[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes all the values from a set. O(n).\\n *\\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\\n */\\n function _clear(Set storage set) private {\\n uint256 len = _length(set);\\n for (uint256 i = 0; i < len; ++i) {\\n delete set._positions[set._values[i]];\\n }\\n Arrays.unsafeSetLength(set._values, 0);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._positions[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes all the values from a set. O(n).\\n *\\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\\n */\\n function clear(Bytes32Set storage set) internal {\\n _clear(set._inner);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n assembly (\\\"memory-safe\\\") {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes all the values from a set. O(n).\\n *\\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\\n */\\n function clear(AddressSet storage set) internal {\\n _clear(set._inner);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n assembly (\\\"memory-safe\\\") {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes all the values from a set. O(n).\\n *\\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\\n */\\n function clear(UintSet storage set) internal {\\n _clear(set._inner);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n assembly (\\\"memory-safe\\\") {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xecd5f3c702f549fb88555e44e5f2415a4dfd6db09081aec7e98c26b6a3739c06\",\"license\":\"MIT\"},\"contracts/Configuration.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nstruct MarketplaceConfig {\\n CollateralConfig collateral;\\n ProofConfig proofs;\\n SlotReservationsConfig reservations;\\n uint64 requestDurationLimit;\\n}\\n\\nstruct CollateralConfig {\\n /// @dev percentage of collateral that is used as repair reward\\n uint8 repairRewardPercentage;\\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\\n uint8 slashPercentage; // percentage of the collateral that is slashed\\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\\n}\\n\\nstruct ProofConfig {\\n uint64 period; // proofs requirements are calculated per period (in seconds)\\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\\n uint8 downtime; // ignore this much recent blocks for proof requirements\\n // Ensures the pointer does not remain in downtime for many consecutive\\n // periods. For each period increase, move the pointer `pointerProduct`\\n // blocks. Should be a prime number to ensure there are no cycles.\\n uint8 downtimeProduct;\\n string zkeyHash; // hash of the zkey file which is linked to the verifier\\n}\\n\\nstruct SlotReservationsConfig {\\n // Number of allowed reservations per slot\\n uint8 maxReservations;\\n}\\n\",\"keccak256\":\"0x1d6cbbf7fff2b6807f29d46c8550a71b95c076b1136a30999c9578145174b36c\",\"license\":\"MIT\"},\"contracts/Endian.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ncontract Endian {\\n /// reverses byte order to allow conversion between little endian and big\\n /// endian integers\\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\\n output = output | bytes1(input);\\n for (uint i = 1; i < 32; i++) {\\n output = output >> 8;\\n output = output | bytes1(input << (i * 8));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa721187e8bda9245ce16ad989fda5812874f2bf70ae4009bbeb0951c65ba6a2b\",\"license\":\"MIT\"},\"contracts/Groth16.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nstruct G1Point {\\n uint256 x;\\n uint256 y;\\n}\\n\\n// A field element F_{p^2} encoded as `real + i * imag`.\\n// We chose to not represent this as an array of 2 numbers, because both Circom\\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\\nstruct Fp2Element {\\n uint256 real;\\n uint256 imag;\\n}\\n\\nstruct G2Point {\\n Fp2Element x;\\n Fp2Element y;\\n}\\n\\nstruct Groth16Proof {\\n G1Point a;\\n G2Point b;\\n G1Point c;\\n}\\n\\ninterface IGroth16Verifier {\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] calldata pubSignals\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x3694cd68f518dc4dfeb2f9a9d18f594b5511b110e129018348f21db25de1ed92\",\"license\":\"MIT\"},\"contracts/Marketplace.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Proofs.sol\\\";\\nimport \\\"./SlotReservations.sol\\\";\\nimport \\\"./StateRetrieval.sol\\\";\\nimport \\\"./Endian.sol\\\";\\nimport \\\"./Groth16.sol\\\";\\n\\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\\n error Marketplace_RepairRewardPercentageTooHigh();\\n error Marketplace_SlashPercentageTooHigh();\\n error Marketplace_MaximumSlashingTooHigh();\\n error Marketplace_InvalidExpiry();\\n error Marketplace_InvalidMaxSlotLoss();\\n error Marketplace_InsufficientSlots();\\n error Marketplace_InsufficientDuration();\\n error Marketplace_InsufficientProofProbability();\\n error Marketplace_InsufficientCollateral();\\n error Marketplace_InsufficientReward();\\n error Marketplace_InvalidClientAddress();\\n error Marketplace_RequestAlreadyExists();\\n error Marketplace_InvalidSlot();\\n error Marketplace_InvalidCid();\\n error Marketplace_SlotNotFree();\\n error Marketplace_InvalidSlotHost();\\n error Marketplace_AlreadyPaid();\\n error Marketplace_TransferFailed();\\n error Marketplace_UnknownRequest();\\n error Marketplace_InvalidState();\\n error Marketplace_StartNotBeforeExpiry();\\n error Marketplace_SlotNotAcceptingProofs();\\n error Marketplace_ProofNotSubmittedByHost();\\n error Marketplace_SlotIsFree();\\n error Marketplace_ReservationRequired();\\n error Marketplace_NothingToWithdraw();\\n error Marketplace_DurationExceedsLimit();\\n\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n using Requests for Request;\\n using AskHelpers for Ask;\\n\\n IERC20 private immutable _token;\\n MarketplaceConfig private _config;\\n\\n mapping(RequestId => Request) private _requests;\\n mapping(RequestId => RequestContext) internal _requestContexts;\\n mapping(SlotId => Slot) internal _slots;\\n\\n MarketplaceTotals internal _marketplaceTotals;\\n\\n struct RequestContext {\\n RequestState state;\\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\\n /// This is the amount that will be paid out to the host when the request successfully finishes.\\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\\n /// This is possible, because technically it is not possible for this variable to reach 0 in \\\"natural\\\" way as\\n /// that would require all the slots to be filled at the same block as the request was created.\\n uint256 fundsToReturnToClient;\\n uint64 slotsFilled;\\n uint64 startedAt;\\n uint64 endsAt;\\n uint64 expiresAt;\\n }\\n\\n struct Slot {\\n SlotState state;\\n RequestId requestId;\\n /// @notice Timestamp that signals when slot was filled\\n /// @dev Used for calculating payouts as hosts are paid\\n /// based on time they actually host the content\\n uint64 filledAt;\\n uint64 slotIndex;\\n /// @notice Tracks the current amount of host's collateral that is\\n /// to be payed out at the end of Slot's lifespan.\\n /// @dev When Slot is filled, the collateral is collected in amount\\n /// of request.ask.collateralPerByte * request.ask.slotSize\\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\\n /// @dev When Host is slashed for missing a proof the slashed amount is\\n /// reflected in this variable\\n uint256 currentCollateral;\\n /// @notice address used for collateral interactions and identifying hosts\\n address host;\\n }\\n\\n struct ActiveSlot {\\n Request request;\\n uint64 slotIndex;\\n }\\n\\n constructor(\\n MarketplaceConfig memory config,\\n IERC20 token_,\\n IGroth16Verifier verifier\\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\\n _token = token_;\\n\\n if (config.collateral.repairRewardPercentage > 100)\\n revert Marketplace_RepairRewardPercentageTooHigh();\\n if (config.collateral.slashPercentage > 100)\\n revert Marketplace_SlashPercentageTooHigh();\\n\\n if (\\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\\n 100\\n ) {\\n revert Marketplace_MaximumSlashingTooHigh();\\n }\\n _config = config;\\n }\\n\\n function configuration() public view returns (MarketplaceConfig memory) {\\n return _config;\\n }\\n\\n function token() public view returns (IERC20) {\\n return _token;\\n }\\n\\n function currentCollateral(SlotId slotId) public view returns (uint256) {\\n return _slots[slotId].currentCollateral;\\n }\\n\\n function requestStorage(Request calldata request) public {\\n RequestId id = request.id();\\n\\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\\n if (_requests[id].client != address(0)) {\\n revert Marketplace_RequestAlreadyExists();\\n }\\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\\n revert Marketplace_InvalidExpiry();\\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\\n if (request.ask.maxSlotLoss > request.ask.slots)\\n revert Marketplace_InvalidMaxSlotLoss();\\n if (request.ask.duration == 0) {\\n revert Marketplace_InsufficientDuration();\\n }\\n if (request.ask.proofProbability == 0) {\\n revert Marketplace_InsufficientProofProbability();\\n }\\n if (request.ask.collateralPerByte == 0) {\\n revert Marketplace_InsufficientCollateral();\\n }\\n if (request.ask.pricePerBytePerSecond == 0) {\\n revert Marketplace_InsufficientReward();\\n }\\n if (bytes(request.content.cid).length == 0) {\\n revert Marketplace_InvalidCid();\\n }\\n if (request.ask.duration > _config.requestDurationLimit) {\\n revert Marketplace_DurationExceedsLimit();\\n }\\n\\n _requests[id] = request;\\n _requestContexts[id].endsAt =\\n uint64(block.timestamp) +\\n request.ask.duration;\\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\\n\\n _addToMyRequests(request.client, id);\\n\\n uint256 amount = request.maxPrice();\\n _requestContexts[id].fundsToReturnToClient = amount;\\n _marketplaceTotals.received += amount;\\n _transferFrom(msg.sender, amount);\\n\\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\\n }\\n\\n /**\\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\\n provided.\\n * @param requestId RequestId identifying the request containing the slot to\\n fill.\\n * @param slotIndex Index of the slot in the request.\\n * @param proof Groth16 proof procing possession of the slot data.\\n */\\n function fillSlot(\\n RequestId requestId,\\n uint64 slotIndex,\\n Groth16Proof calldata proof\\n ) public requestIsKnown(requestId) {\\n Request storage request = _requests[requestId];\\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\\n\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n\\n if (!_reservations[slotId].contains(msg.sender))\\n revert Marketplace_ReservationRequired();\\n\\n Slot storage slot = _slots[slotId];\\n slot.requestId = requestId;\\n slot.slotIndex = slotIndex;\\n RequestContext storage context = _requestContexts[requestId];\\n\\n if (\\n slotState(slotId) != SlotState.Free &&\\n slotState(slotId) != SlotState.Repair\\n ) {\\n revert Marketplace_SlotNotFree();\\n }\\n\\n slot.host = msg.sender;\\n slot.filledAt = uint64(block.timestamp);\\n\\n _startRequiringProofs(slotId);\\n submitProof(slotId, proof);\\n\\n context.slotsFilled += 1;\\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\\n\\n // Collect collateral\\n uint256 collateralAmount;\\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\\n if (slotState(slotId) == SlotState.Repair) {\\n // Host is repairing a slot and is entitled for repair reward, so he gets \\\"discounted collateral\\\"\\n // in this way he gets \\\"physically\\\" the reward at the end of the request when the full amount of collateral\\n // is returned to him.\\n collateralAmount =\\n collateralPerSlot -\\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\\n } else {\\n collateralAmount = collateralPerSlot;\\n }\\n _transferFrom(msg.sender, collateralAmount);\\n _marketplaceTotals.received += collateralAmount;\\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\\n\\n _addToMySlots(slot.host, slotId);\\n\\n slot.state = SlotState.Filled;\\n emit SlotFilled(requestId, slotIndex);\\n\\n if (\\n context.slotsFilled == request.ask.slots &&\\n context.state == RequestState.New // Only New requests can \\\"start\\\" the requests\\n ) {\\n context.state = RequestState.Started;\\n context.startedAt = uint64(block.timestamp);\\n emit RequestFulfilled(requestId);\\n }\\n }\\n\\n /**\\n * @notice Frees a slot, paying out rewards and returning collateral for\\n finished or cancelled requests to the host that has filled the slot.\\n * @param slotId id of the slot to free\\n * @dev The host that filled the slot must have initiated the transaction\\n (msg.sender). This overload allows `rewardRecipient` and\\n `collateralRecipient` to be optional.\\n */\\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\\n return freeSlot(slotId, msg.sender, msg.sender);\\n }\\n\\n /**\\n * @notice Frees a slot, paying out rewards and returning collateral for\\n finished or cancelled requests.\\n * @param slotId id of the slot to free\\n * @param rewardRecipient address to send rewards to\\n * @param collateralRecipient address to refund collateral to\\n */\\n function freeSlot(\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) public slotIsNotFree(slotId) {\\n Slot storage slot = _slots[slotId];\\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\\n\\n SlotState state = slotState(slotId);\\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\\n\\n if (state == SlotState.Finished) {\\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\\n } else if (state == SlotState.Cancelled) {\\n _payoutCancelledSlot(\\n slot.requestId,\\n slotId,\\n rewardRecipient,\\n collateralRecipient\\n );\\n } else if (state == SlotState.Failed) {\\n _removeFromMySlots(msg.sender, slotId);\\n } else if (state == SlotState.Filled) {\\n // free slot without returning collateral, effectively a 100% slash\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n\\n function _challengeToFieldElement(\\n bytes32 challenge\\n ) internal pure returns (uint256) {\\n // use only 31 bytes of the challenge to ensure that it fits into the field\\n bytes32 truncated = bytes32(bytes31(challenge));\\n // convert from little endian to big endian\\n bytes32 bigEndian = _byteSwap(truncated);\\n // convert bytes to integer\\n return uint256(bigEndian);\\n }\\n\\n function _merkleRootToFieldElement(\\n bytes32 merkleRoot\\n ) internal pure returns (uint256) {\\n // convert from little endian to big endian\\n bytes32 bigEndian = _byteSwap(merkleRoot);\\n // convert bytes to integer\\n return uint256(bigEndian);\\n }\\n\\n function submitProof(\\n SlotId id,\\n Groth16Proof calldata proof\\n ) public requestIsKnown(_slots[id].requestId) {\\n Slot storage slot = _slots[id];\\n\\n if (msg.sender != slot.host) {\\n revert Marketplace_ProofNotSubmittedByHost();\\n }\\n\\n Request storage request = _requests[slot.requestId];\\n uint256[] memory pubSignals = new uint256[](3);\\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\\n pubSignals[2] = slot.slotIndex;\\n _proofReceived(id, proof, pubSignals);\\n }\\n\\n function canMarkProofAsMissing(\\n SlotId slotId,\\n Period period\\n ) public view slotAcceptsProofs(slotId) {\\n _canMarkProofAsMissing(slotId, period);\\n }\\n\\n function markProofAsMissing(\\n SlotId slotId,\\n Period period\\n ) public slotAcceptsProofs(slotId) {\\n _markProofAsMissing(slotId, period);\\n\\n Slot storage slot = _slots[slotId];\\n Request storage request = _requests[slot.requestId];\\n\\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\\n _config.collateral.slashPercentage) / 100;\\n\\n uint256 validatorRewardAmount = (slashedAmount *\\n _config.collateral.validatorRewardPercentage) / 100;\\n _marketplaceTotals.sent += validatorRewardAmount;\\n\\n if (!_token.transfer(msg.sender, validatorRewardAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n slot.currentCollateral -= slashedAmount;\\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\\n // When the number of slashings is at or above the allowed amount,\\n // free the slot.\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n\\n /**\\n * @notice Abandons the slot without returning collateral, effectively slashing the\\n entire collateral.\\n * @param slotId SlotId of the slot to free.\\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\\n to 0.\\n */\\n function _forciblyFreeSlot(SlotId slotId) internal {\\n Slot storage slot = _slots[slotId];\\n RequestId requestId = slot.requestId;\\n RequestContext storage context = _requestContexts[requestId];\\n\\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\\n // we keep correctly the track of the funds that needs to be returned at the end.\\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\\n\\n _removeFromMySlots(slot.host, slotId);\\n _reservations[slotId].clear(); // We purge all the reservations for the slot\\n slot.state = SlotState.Repair;\\n slot.filledAt = 0;\\n slot.currentCollateral = 0;\\n slot.host = address(0);\\n context.slotsFilled -= 1;\\n emit SlotFreed(requestId, slot.slotIndex);\\n _resetMissingProofs(slotId);\\n\\n Request storage request = _requests[requestId];\\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\\n if (\\n slotsLost > request.ask.maxSlotLoss &&\\n context.state == RequestState.Started\\n ) {\\n context.state = RequestState.Failed;\\n context.endsAt = uint64(block.timestamp) - 1;\\n emit RequestFailed(requestId);\\n }\\n }\\n\\n function _payoutSlot(\\n RequestId requestId,\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) private requestIsKnown(requestId) {\\n RequestContext storage context = _requestContexts[requestId];\\n Request storage request = _requests[requestId];\\n context.state = RequestState.Finished;\\n Slot storage slot = _slots[slotId];\\n\\n _removeFromMyRequests(request.client, requestId);\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\\n uint256 collateralAmount = slot.currentCollateral;\\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\\n slot.state = SlotState.Paid;\\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n }\\n\\n /**\\n * @notice Pays out a host for duration of time that the slot was filled, and\\n returns the collateral.\\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\\n to the host address.\\n * @param requestId RequestId of the request that contains the slot to be paid\\n out.\\n * @param slotId SlotId of the slot to be paid out.\\n */\\n function _payoutCancelledSlot(\\n RequestId requestId,\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) private requestIsKnown(requestId) {\\n Slot storage slot = _slots[slotId];\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 payoutAmount = _slotPayout(\\n requestId,\\n slot.filledAt,\\n requestExpiry(requestId)\\n );\\n uint256 collateralAmount = slot.currentCollateral;\\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\\n slot.state = SlotState.Paid;\\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n }\\n\\n /**\\n * @notice Withdraws remaining storage request funds back to the client that\\n deposited them.\\n * @dev Request must be cancelled, failed or finished, and the\\n transaction must originate from the depositor address.\\n * @param requestId the id of the request\\n */\\n function withdrawFunds(RequestId requestId) public {\\n withdrawFunds(requestId, msg.sender);\\n }\\n\\n /**\\n * @notice Withdraws storage request funds to the provided address.\\n * @dev Request must be expired, must be in RequestState.New, and the\\n transaction must originate from the depositer address.\\n * @param requestId the id of the request\\n * @param withdrawRecipient address to return the remaining funds to\\n */\\n function withdrawFunds(\\n RequestId requestId,\\n address withdrawRecipient\\n ) public requestIsKnown(requestId) {\\n Request storage request = _requests[requestId];\\n RequestContext storage context = _requestContexts[requestId];\\n\\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\\n\\n RequestState state = requestState(requestId);\\n if (\\n state != RequestState.Cancelled &&\\n state != RequestState.Failed &&\\n state != RequestState.Finished\\n ) {\\n revert Marketplace_InvalidState();\\n }\\n\\n // fundsToReturnToClient == 0 is used for \\\"double-spend\\\" protection, once the funds are withdrawn\\n // then this variable is set to 0.\\n if (context.fundsToReturnToClient == 0)\\n revert Marketplace_NothingToWithdraw();\\n\\n if (state == RequestState.Cancelled) {\\n context.state = RequestState.Cancelled;\\n emit RequestCancelled(requestId);\\n\\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\\n // When requests are cancelled, funds earmarked for payment for the duration\\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\\n // Update `fundsToReturnToClient` to reflect this.\\n context.fundsToReturnToClient +=\\n context.slotsFilled *\\n _slotPayout(requestId, requestExpiry(requestId));\\n } else if (state == RequestState.Failed) {\\n // For Failed requests the client is refunded whole amount.\\n context.fundsToReturnToClient = request.maxPrice();\\n } else {\\n context.state = RequestState.Finished;\\n }\\n\\n _removeFromMyRequests(request.client, requestId);\\n\\n uint256 amount = context.fundsToReturnToClient;\\n _marketplaceTotals.sent += amount;\\n\\n if (!_token.transfer(withdrawRecipient, amount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n // We zero out the funds tracking in order to prevent double-spends\\n context.fundsToReturnToClient = 0;\\n }\\n\\n function getActiveSlot(\\n SlotId slotId\\n ) public view returns (ActiveSlot memory) {\\n // Modifier `slotIsNotFree(slotId)` works here, but using the modifier\\n // causes hardhat to return an error \\\"reverted with an unrecognized custom\\n // error (return data: 0x8b41ec7f)\\\".\\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\\n Slot storage slot = _slots[slotId];\\n ActiveSlot memory activeSlot;\\n activeSlot.request = _requests[slot.requestId];\\n activeSlot.slotIndex = slot.slotIndex;\\n return activeSlot;\\n }\\n\\n modifier requestIsKnown(RequestId requestId) {\\n if (_requests[requestId].client == address(0))\\n revert Marketplace_UnknownRequest();\\n\\n _;\\n }\\n\\n function getRequest(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (Request memory) {\\n return _requests[requestId];\\n }\\n\\n modifier slotIsNotFree(SlotId slotId) {\\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\\n _;\\n }\\n\\n modifier slotAcceptsProofs(SlotId slotId) {\\n if (slotState(slotId) != SlotState.Filled)\\n revert Marketplace_SlotNotAcceptingProofs();\\n _;\\n }\\n\\n function requestEnd(RequestId requestId) public view returns (uint64) {\\n RequestState state = requestState(requestId);\\n if (state == RequestState.New || state == RequestState.Started) {\\n return _requestContexts[requestId].endsAt;\\n }\\n if (state == RequestState.Cancelled) {\\n return _requestContexts[requestId].expiresAt;\\n }\\n return\\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\\n }\\n\\n function requestExpiry(RequestId requestId) public view returns (uint64) {\\n return _requestContexts[requestId].expiresAt;\\n }\\n\\n /**\\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\\n * @param requestId RequestId of the request used to calculate the payout\\n * amount.\\n * @param startingTimestamp timestamp indicating when a host filled a slot and\\n * started providing proofs.\\n */\\n function _slotPayout(\\n RequestId requestId,\\n uint64 startingTimestamp\\n ) private view returns (uint256) {\\n return\\n _slotPayout(\\n requestId,\\n startingTimestamp,\\n _requestContexts[requestId].endsAt\\n );\\n }\\n\\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\\n function _slotPayout(\\n RequestId requestId,\\n uint64 startingTimestamp,\\n uint64 endingTimestamp\\n ) private view returns (uint256) {\\n Request storage request = _requests[requestId];\\n if (startingTimestamp >= endingTimestamp)\\n revert Marketplace_StartNotBeforeExpiry();\\n return\\n (endingTimestamp - startingTimestamp) *\\n request.ask.pricePerSlotPerSecond();\\n }\\n\\n function getHost(SlotId slotId) public view returns (address) {\\n return _slots[slotId].host;\\n }\\n\\n function requestState(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (RequestState) {\\n RequestContext storage context = _requestContexts[requestId];\\n if (\\n context.state == RequestState.New &&\\n uint64(block.timestamp) > requestExpiry(requestId)\\n ) {\\n return RequestState.Cancelled;\\n } else if (\\n (context.state == RequestState.Started ||\\n context.state == RequestState.New) &&\\n uint64(block.timestamp) > context.endsAt\\n ) {\\n return RequestState.Finished;\\n } else {\\n return context.state;\\n }\\n }\\n\\n function slotState(\\n SlotId slotId\\n ) public view override(Proofs, SlotReservations) returns (SlotState) {\\n Slot storage slot = _slots[slotId];\\n if (RequestId.unwrap(slot.requestId) == 0) {\\n return SlotState.Free;\\n }\\n RequestState reqState = requestState(slot.requestId);\\n if (slot.state == SlotState.Paid) {\\n return SlotState.Paid;\\n }\\n if (reqState == RequestState.Cancelled) {\\n return SlotState.Cancelled;\\n }\\n if (reqState == RequestState.Finished) {\\n return SlotState.Finished;\\n }\\n if (reqState == RequestState.Failed) {\\n return SlotState.Failed;\\n }\\n return slot.state;\\n }\\n\\n function slotProbability(\\n SlotId slotId\\n ) public view override returns (uint256) {\\n Slot storage slot = _slots[slotId];\\n Request storage request = _requests[slot.requestId];\\n return\\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\\n }\\n\\n function _transferFrom(address sender, uint256 amount) internal {\\n address receiver = address(this);\\n if (!_token.transferFrom(sender, receiver, amount))\\n revert Marketplace_TransferFailed();\\n }\\n\\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\\n event RequestFulfilled(RequestId indexed requestId);\\n event RequestFailed(RequestId indexed requestId);\\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\\n event RequestCancelled(RequestId indexed requestId);\\n\\n struct MarketplaceTotals {\\n uint256 received;\\n uint256 sent;\\n }\\n}\\n\",\"keccak256\":\"0x75c0b6093ecef560e888d3c43541452ddd2ac9417dd87538f2d9d55bc8b87920\",\"license\":\"MIT\"},\"contracts/Periods.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ncontract Periods {\\n error Periods_InvalidSecondsPerPeriod();\\n\\n type Period is uint64;\\n\\n uint64 internal immutable _secondsPerPeriod;\\n\\n constructor(uint64 secondsPerPeriod) {\\n if (secondsPerPeriod == 0) {\\n revert Periods_InvalidSecondsPerPeriod();\\n }\\n _secondsPerPeriod = secondsPerPeriod;\\n }\\n\\n function _periodOf(uint64 timestamp) internal view returns (Period) {\\n return Period.wrap(timestamp / _secondsPerPeriod);\\n }\\n\\n function _blockPeriod() internal view returns (Period) {\\n return _periodOf(uint64(block.timestamp));\\n }\\n\\n function _nextPeriod(Period period) internal pure returns (Period) {\\n return Period.wrap(Period.unwrap(period) + 1);\\n }\\n\\n function _periodStart(Period period) internal view returns (uint64) {\\n return Period.unwrap(period) * _secondsPerPeriod;\\n }\\n\\n function _periodEnd(Period period) internal view returns (uint64) {\\n return _periodStart(_nextPeriod(period));\\n }\\n\\n function _isBefore(Period a, Period b) internal pure returns (bool) {\\n return Period.unwrap(a) < Period.unwrap(b);\\n }\\n\\n function _isAfter(Period a, Period b) internal pure returns (bool) {\\n return _isBefore(b, a);\\n }\\n}\\n\",\"keccak256\":\"0xd8b259c4b2b8f94f1a5530c7028ec5ecebccd7c97de5cb3283d4e51c24ac4b05\",\"license\":\"MIT\"},\"contracts/Proofs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Periods.sol\\\";\\nimport \\\"./Groth16.sol\\\";\\n\\n/**\\n * @title Proofs\\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\\n */\\nabstract contract Proofs is Periods {\\n error Proofs_InsufficientBlockHeight();\\n error Proofs_InvalidProof();\\n error Proofs_ProofAlreadySubmitted();\\n error Proofs_PeriodNotEnded();\\n error Proofs_ValidationTimedOut();\\n error Proofs_ProofNotMissing();\\n error Proofs_ProofNotRequired();\\n error Proofs_ProofAlreadyMarkedMissing();\\n\\n ProofConfig private _config;\\n IGroth16Verifier private _verifier;\\n\\n /**\\n * Creation of the contract requires at least 256 mined blocks!\\n * @param config Proving configuration\\n */\\n constructor(\\n ProofConfig memory config,\\n IGroth16Verifier verifier\\n ) Periods(config.period) {\\n if (block.number <= 256) {\\n revert Proofs_InsufficientBlockHeight();\\n }\\n\\n _config = config;\\n _verifier = verifier;\\n }\\n\\n mapping(SlotId => uint64) private _slotStarts;\\n mapping(SlotId => uint64) private _missed;\\n mapping(SlotId => mapping(Period => bool)) private _received;\\n mapping(SlotId => mapping(Period => bool)) private _missing;\\n\\n function slotState(SlotId id) public view virtual returns (SlotState);\\n\\n /**\\n * @param id Slot's ID\\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\\n */\\n function slotProbability(SlotId id) public view virtual returns (uint256);\\n\\n /**\\n * @return Number of missed proofs since Slot was Filled\\n */\\n function missingProofs(SlotId slotId) public view returns (uint64) {\\n return _missed[slotId];\\n }\\n\\n /**\\n * @param slotId Slot's ID for which the proofs should be reset\\n * @notice Resets the missing proofs counter to zero\\n */\\n function _resetMissingProofs(SlotId slotId) internal {\\n _missed[slotId] = 0;\\n }\\n\\n /**\\n * @param id Slot's ID for which the proofs should be started to require\\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\\n * and saves the required probability.\\n */\\n function _startRequiringProofs(SlotId id) internal {\\n _slotStarts[id] = uint64(block.timestamp);\\n }\\n\\n /**\\n * @param id Slot's ID for which the pointer should be calculated\\n * @param period Period for which the pointer should be calculated\\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\\n */\\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\\n uint256 blockNumber = block.number % 256;\\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\\n 256;\\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\\n return uint8(pointer);\\n }\\n\\n /**\\n * @param id Slot's ID for which the pointer should be calculated\\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\\n */\\n function getPointer(SlotId id) public view returns (uint8) {\\n return _getPointer(id, _blockPeriod());\\n }\\n\\n /**\\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @return Challenge that should be used for generation of proofs\\n */\\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\\n bytes32 hash = blockhash(block.number - 1 - pointer);\\n assert(uint256(hash) != 0);\\n return keccak256(abi.encode(hash));\\n }\\n\\n /**\\n * @param id Slot's ID for which the challenge should be calculated\\n * @param period Period for which the challenge should be calculated\\n * @return Challenge that should be used for generation of proofs\\n */\\n function _getChallenge(\\n SlotId id,\\n Period period\\n ) internal view returns (bytes32) {\\n return _getChallenge(_getPointer(id, period));\\n }\\n\\n /**\\n * @param id Slot's ID for which the challenge should be calculated\\n * @return Challenge for current Period that should be used for generation of proofs\\n */\\n function getChallenge(SlotId id) public view returns (bytes32) {\\n return _getChallenge(id, _blockPeriod());\\n }\\n\\n /**\\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\\n * @param period Period for which the requirements are gathered.\\n */\\n function _getProofRequirement(\\n SlotId id,\\n Period period\\n ) internal view returns (bool isRequired, uint8 pointer) {\\n SlotState state = slotState(id);\\n Period start = _periodOf(_slotStarts[id]);\\n if (state != SlotState.Filled || !_isAfter(period, start)) {\\n return (false, 0);\\n }\\n pointer = _getPointer(id, period);\\n bytes32 challenge = _getChallenge(pointer);\\n\\n /// Scaling of the probability according the downtime configuration\\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\\n uint256 probability = slotProbability(id);\\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\\n }\\n\\n /**\\n * See isProofRequired\\n */\\n function _isProofRequired(\\n SlotId id,\\n Period period\\n ) internal view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, period);\\n return isRequired && pointer >= _config.downtime;\\n }\\n\\n /**\\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\\n * @return bool indicating if proof is required for current period\\n */\\n function isProofRequired(SlotId id) public view returns (bool) {\\n return _isProofRequired(id, _blockPeriod());\\n }\\n\\n /**\\n * Proof Downtime specifies part of the Period when the proof is not required even\\n * if the proof should be required. This function returns true if the pointer is\\n * in downtime (hence no proof required now) and at the same time the proof\\n * will be required later on in the Period.\\n *\\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\\n * @return bool\\n */\\n function willProofBeRequired(SlotId id) public view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\\n return isRequired && pointer < _config.downtime;\\n }\\n\\n /**\\n * Function used for submitting and verification of the proofs.\\n *\\n * @dev Reverts when proof is invalid or had been already submitted.\\n * @dev Emits ProofSubmitted event.\\n * @param id Slot's ID for which the proof requirements should be checked\\n * @param proof Groth16 proof\\n * @param pubSignals Proofs public input\\n */\\n function _proofReceived(\\n SlotId id,\\n Groth16Proof calldata proof,\\n uint[] memory pubSignals\\n ) internal {\\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\\n\\n _received[id][_blockPeriod()] = true;\\n emit ProofSubmitted(id);\\n }\\n\\n /**\\n * Function used to mark proof as missing.\\n *\\n * @param id Slot's ID for which the proof is missing\\n * @param missedPeriod Period for which the proof was missed\\n * @dev Reverts when:\\n * - missedPeriod has not ended yet ended\\n * - missing proof was time-barred\\n * - proof was submitted\\n * - proof was not required for missedPeriod period\\n * - proof was already marked as missing\\n */\\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\\n _canMarkProofAsMissing(id, missedPeriod);\\n\\n _missing[id][missedPeriod] = true;\\n _missed[id] += 1;\\n }\\n\\n function _canMarkProofAsMissing(\\n SlotId id,\\n Period missedPeriod\\n ) internal view {\\n uint256 end = _periodEnd(missedPeriod);\\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\\n if (block.timestamp >= end + _config.timeout)\\n revert Proofs_ValidationTimedOut();\\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\\n }\\n\\n event ProofSubmitted(SlotId id);\\n}\\n\",\"keccak256\":\"0xf553cc7cf6f3ec5473dc3212a7d3bfeed65df67e34244d2521ba6f6ecf1c032b\",\"license\":\"MIT\"},\"contracts/Requests.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ntype RequestId is bytes32;\\ntype SlotId is bytes32;\\n\\nstruct Request {\\n address client;\\n Ask ask;\\n Content content;\\n uint64 expiry; // amount of seconds since start of the request at which this request expires\\n bytes32 nonce; // random nonce to differentiate between similar requests\\n}\\n\\nstruct Ask {\\n uint256 proofProbability; // how often storage proofs are required\\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\\n uint64 slots; // the number of requested slots\\n uint64 slotSize; // amount of storage per slot (in number of bytes)\\n uint64 duration; // how long content should be stored (in seconds)\\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\\n}\\n\\nstruct Content {\\n bytes cid; // content id, used to download the dataset\\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\\n}\\n\\nenum RequestState {\\n New, // [default] waiting to fill slots\\n Started, // all slots filled, accepting regular proofs\\n Cancelled, // not enough slots filled before expiry\\n Finished, // successfully completed\\n Failed // too many nodes have failed to provide proofs, data lost\\n}\\n\\nenum SlotState {\\n Free, // [default] not filled yet\\n Filled, // host has filled slot\\n Finished, // successfully completed\\n Failed, // the request has failed\\n Paid, // host has been paid\\n Cancelled, // when request was cancelled then slot is cancelled as well\\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\\n}\\n\\nlibrary AskHelpers {\\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\\n return ask.collateralPerByte * ask.slotSize;\\n }\\n\\n function pricePerSlotPerSecond(\\n Ask memory ask\\n ) internal pure returns (uint256) {\\n return ask.pricePerBytePerSecond * ask.slotSize;\\n }\\n}\\n\\nlibrary Requests {\\n using AskHelpers for Ask;\\n\\n function id(Request memory request) internal pure returns (RequestId) {\\n return RequestId.wrap(keccak256(abi.encode(request)));\\n }\\n\\n function slotId(\\n RequestId requestId,\\n uint64 slotIndex\\n ) internal pure returns (SlotId) {\\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\\n }\\n\\n function toRequestIds(\\n bytes32[] memory ids\\n ) internal pure returns (RequestId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function toSlotIds(\\n bytes32[] memory ids\\n ) internal pure returns (SlotId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function maxPrice(Request memory request) internal pure returns (uint256) {\\n return\\n request.ask.slots *\\n request.ask.duration *\\n request.ask.pricePerSlotPerSecond();\\n }\\n}\\n\",\"keccak256\":\"0x48ae7387078d0c3175d0b7fb8c0b7a2fc82a7e98ac28953904d0cca67e47e352\",\"license\":\"MIT\"},\"contracts/SlotReservations.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Configuration.sol\\\";\\n\\nabstract contract SlotReservations {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n error SlotReservations_ReservationNotAllowed();\\n\\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\\n SlotReservationsConfig private _config;\\n\\n constructor(SlotReservationsConfig memory config) {\\n _config = config;\\n }\\n\\n function slotState(SlotId id) public view virtual returns (SlotState);\\n\\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\\n if (!canReserveSlot(requestId, slotIndex))\\n revert SlotReservations_ReservationNotAllowed();\\n\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n _reservations[slotId].add(msg.sender);\\n\\n if (_reservations[slotId].length() == _config.maxReservations) {\\n emit SlotReservationsFull(requestId, slotIndex);\\n }\\n }\\n\\n function canReserveSlot(\\n RequestId requestId,\\n uint64 slotIndex\\n ) public view returns (bool) {\\n address host = msg.sender;\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n SlotState state = slotState(slotId);\\n return\\n // TODO: add in check for address inside of expanding window\\n (state == SlotState.Free || state == SlotState.Repair) &&\\n (_reservations[slotId].length() < _config.maxReservations) &&\\n (!_reservations[slotId].contains(host));\\n }\\n\\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\\n}\\n\",\"keccak256\":\"0x71240f6081b4955f522e5c5fa8f7748c10b2a20c9cb0d6ba0839911c7c479c98\",\"license\":\"MIT\"},\"contracts/StateRetrieval.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Requests.sol\\\";\\n\\ncontract StateRetrieval {\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using Requests for bytes32[];\\n\\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\\n\\n function myRequests() public view returns (RequestId[] memory) {\\n return _requestsPerClient[msg.sender].values().toRequestIds();\\n }\\n\\n function mySlots() public view returns (SlotId[] memory) {\\n return _slotsPerHost[msg.sender].values().toSlotIds();\\n }\\n\\n function _hasSlots(address host) internal view returns (bool) {\\n return _slotsPerHost[host].length() > 0;\\n }\\n\\n function _addToMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\\n }\\n\\n function _addToMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\\n }\\n\\n function _removeFromMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\\n }\\n\\n function _removeFromMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\\n }\\n}\\n\",\"keccak256\":\"0xedc2d20f718aa5bd75e250ab5e2c11eae7849057391eb06996245899922ee6cf\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c060405234801561001057600080fd5b50604051614fab380380614fab83398101604081905261002f9161053b565b602083015180516040850151516001805460ff191660ff90921691909117905582906001600160401b03811660000361007b5760405163015536c760e51b815260040160405180910390fd5b6001600160401b031660805261010043116100a9576040516338f5f66160e11b815260040160405180910390fd5b8151600280546020850151604086015160608701516001600160401b039586166001600160801b0319909416939093176801000000000000000095909216949094021761ffff60801b1916600160801b60ff9485160260ff60881b191617600160881b9390911692909202919091178155608083015183919060039061012f90826106d9565b5050600480546001600160a01b0319166001600160a01b0393841617905550831660a05250825151606460ff909116111561017d576040516302bd816360e41b815260040160405180910390fd5b606483600001516040015160ff1611156101aa576040516354e5e0ab60e11b815260040160405180910390fd5b825160408101516020909101516064916101c391610797565b60ff1611156101e5576040516317ff9d0f60e21b815260040160405180910390fd5b82518051600b805460208085015160408087015160609788015160ff90811663010000000263ff0000001992821662010000029290921663ffff0000199482166101000261ffff1990971698821698909817959095179290921695909517178355808801518051600c80549383015196830151978301518516600160881b0260ff60881b1998909516600160801b029790971661ffff60801b196001600160401b0397881668010000000000000000026001600160801b031990951697909216969096179290921791909116939093171783556080820151869391929190600d906102d090826106d9565b50505060408201515160038201805460ff191660ff909216919091179055606090910151600490910180546001600160401b0319166001600160401b03909216919091179055506107c8915050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b03811182821017156103575761035761031f565b60405290565b604051608081016001600160401b03811182821017156103575761035761031f565b604051601f8201601f191681016001600160401b03811182821017156103a7576103a761031f565b604052919050565b805160ff811681146103c057600080fd5b919050565b80516001600160401b03811681146103c057600080fd5b600060a082840312156103ee57600080fd5b6103f6610335565b9050610401826103c5565b815261040f602083016103c5565b6020820152610420604083016103af565b6040820152610431606083016103af565b606082015260808201516001600160401b0381111561044f57600080fd5b8201601f8101841361046057600080fd5b80516001600160401b038111156104795761047961031f565b61048c601f8201601f191660200161037f565b8181528560208385010111156104a157600080fd5b60005b828110156104c0576020818501810151838301820152016104a4565b5060006020838301015280608085015250505092915050565b6000602082840312156104eb57600080fd5b604051602081016001600160401b038111828210171561050d5761050d61031f565b60405290508061051c836103af565b905292915050565b80516001600160a01b03811681146103c057600080fd5b60008060006060848603121561055057600080fd5b83516001600160401b0381111561056657600080fd5b840180860360e081121561057957600080fd5b61058161035d565b608082121561058f57600080fd5b61059761035d565b91506105a2836103af565b82526105b0602084016103af565b60208301526105c1604084016103af565b60408301526105d2606084016103af565b60608301529081526080820151906001600160401b038211156105f457600080fd5b610600888385016103dc565b60208201526106128860a085016104d9565b604082015261062360c084016103c5565b6060820152945061063991505060208501610524565b915061064760408501610524565b90509250925092565b600181811c9082168061066457607f821691505b60208210810361068457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106d457806000526020600020601f840160051c810160208510156106b15750805b601f840160051c820191505b818110156106d157600081556001016106bd565b50505b505050565b81516001600160401b038111156106f2576106f261031f565b610706816107008454610650565b8461068a565b6020601f82116001811461073a57600083156107225750848201515b600019600385901b1c1916600184901b1784556106d1565b600084815260208120601f198516915b8281101561076a578785015182556020948501946001909201910161074a565b50848210156107885786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60ff81811683821602908116908181146107c157634e487b7160e01b600052601160045260246000fd5b5092915050565b60805160a051614786610825600039600081816104dd01528181610f76015281816120350152818161266401528181612714015281816128a3015281816129530152612d750152600081816135b401526138b901526147866000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636e2b54ee11610104578063c0cc4add116100a2578063e8aa0a0711610071578063e8aa0a071461047f578063f752196b14610492578063fb1e61ca146104bb578063fc0c546a146104db57600080fd5b8063c0cc4add14610433578063c5d4335114610446578063d02bbe3314610459578063d1bb36b61461046c57600080fd5b8063a29c29a4116100de578063a29c29a4146103bd578063a3a0807e146103d0578063b396dc79146103f3578063be5cdc481461041357600080fd5b80636e2b54ee1461038f5780639777b72c146103a257806399b6da0c146103aa57600080fd5b8063329b5a0b1161017157806351a766421161014b57806351a766421461030e5780635da73835146103215780636b00c8cf146103365780636c70bee91461037a57600080fd5b8063329b5a0b146102a3578063458d2bf1146102d65780634641dce6146102e957600080fd5b806312827602116101ad57806312827602146102395780631d873c1b1461024c578063237d84821461025f57806326d6f8341461027257600080fd5b806302fa8e65146101d457806305b90773146102045780630aefaabe14610224575b600080fd5b6101e76101e2366004613954565b610501565b6040516001600160401b0390911681526020015b60405180910390f35b610217610212366004613954565b6105df565b6040516101fb9190613983565b6102376102323660046139b2565b610702565b005b610237610247366004613a19565b610895565b61023761025a366004613a5c565b610966565b61023761026d366004613a19565b610e18565b610295610280366004613954565b60009081526012602052604090206003015490565b6040519081526020016101fb565b6101e76102b1366004613954565b600090815260116020526040902060020154600160c01b90046001600160401b031690565b6102956102e4366004613954565b611066565b6102fc6102f7366004613954565b61107f565b60405160ff90911681526020016101fb565b61029561031c366004613954565b611092565b6103296110f1565b6040516101fb9190613a9c565b610362610344366004613954565b6000908152601260205260409020600401546001600160a01b031690565b6040516001600160a01b0390911681526020016101fb565b610382611118565b6040516101fb9190613b7a565b61023761039d366004613954565b61128f565b61032961129c565b6102376103b8366004613c02565b6112bb565b6102376103cb366004613954565b611801565b6103e36103de366004613954565b611853565b60405190151581526020016101fb565b610406610401366004613954565b61188f565b6040516101fb9190613d31565b610426610421366004613954565b611b6d565b6040516101fb9190613d6c565b6103e3610441366004613954565b611c3b565b610237610454366004613d80565b611c4e565b6103e3610467366004613a19565b6120cf565b61023761047a366004613a19565b612171565b61023761048d366004613da5565b6121b6565b6101e76104a0366004613954565b6000908152600660205260409020546001600160401b031690565b6104ce6104c9366004613954565b61232f565b6040516101fb9190613dd3565b7f0000000000000000000000000000000000000000000000000000000000000000610362565b60008061050d836105df565b905060008160048111156105235761052361396d565b14806105405750600181600481111561053e5761053e61396d565b145b1561056c575050600090815260116020526040902060020154600160801b90046001600160401b031690565b60028160048111156105805761058061396d565b036105ac575050600090815260116020526040902060020154600160c01b90046001600160401b031690565b6000838152601160205260409020600201546105d890600160801b90046001600160401b031642612545565b9392505050565b60008181526010602052604081205482906001600160a01b031661061657604051635eeb253d60e11b815260040160405180910390fd5b600083815260116020526040812090815460ff16600481111561063b5761063b61396d565b14801561067a5750600084815260116020526040902060020154600160c01b90046001600160401b03166001600160401b0316426001600160401b0316115b156106895760029250506106fc565b6001815460ff1660048111156106a1576106a161396d565b14806106c257506000815460ff1660048111156106c0576106c061396d565b145b80156106e6575060028101546001600160401b03600160801b909104811642909116115b156106f55760039250506106fc565b5460ff1691505b50919050565b826000808281526012602052604090205460ff1660068111156107275761072761396d565b0361074557604051638b41ec7f60e01b815260040160405180910390fd5b600084815260126020526040902060048101546001600160a01b03163314610799576040517f57a6f4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107a486611b6d565b905060048160068111156107ba576107ba61396d565b036107f1576040517fc2cbf77700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160068111156108055761080561396d565b0361081f5761081a8260010154878787612555565b61088d565b60058160068111156108335761083361396d565b036108485761081a826001015487878761279e565b600381600681111561085c5761085c61396d565b0361086b5761081a33876129e7565b600181600681111561087f5761087f61396d565b0361088d5761088d86612a09565b505050505050565b61089f82826120cf565b6108d5576040517f424a04ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108e18383612c59565b60008181526020819052604090209091506108fc9033612c9e565b50600154600082815260208190526040902060ff9091169061091d90612cb3565b03610961576040516001600160401b038316815283907fc8e6c955744189a19222ec226b72ac1435d88d5745252dac56e6f679f64c037a9060200160405180910390a25b505050565b60008381526010602052604090205483906001600160a01b031661099d57604051635eeb253d60e11b815260040160405180910390fd5b600084815260106020526040902060048101546001600160401b03908116908516106109f5576040517f3b920b8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610a018686612c59565b6000818152602081905260409020909150610a1c9033612cbd565b610a52576040517fd651ce1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601260209081526040808320600181018a90556002810180546fffffffffffffffff00000000000000001916600160401b6001600160401b038c1602179055898452601190925282209091610aab84611b6d565b6006811115610abc57610abc61396d565b14158015610ae457506006610ad084611b6d565b6006811115610ae157610ae161396d565b14155b15610b1b576040517fff556acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048201805473ffffffffffffffffffffffffffffffffffffffff1916331790556002820180546001600160401b03421667ffffffffffffffff19909116179055610b8c83600090815260056020526040902080546001600160401b03421667ffffffffffffffff19909116179055565b610b9683876121b6565b60028101805460019190600090610bb79084906001600160401b0316613dfc565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610bfc888360020160009054906101000a90046001600160401b0316612cdf565b816001016000828254610c0f9190613e1b565b90915550506040805160e081018252600186015481526002860154602082015260038601549181019190915260048501546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526000908190610c8890612d0e565b90506006610c9586611b6d565b6006811115610ca657610ca661396d565b03610cd957600b54606490610cbe9060ff1683613e2e565b610cc89190613e5b565b610cd29082613e1b565b9150610cdd565b8091505b610ce73383612d2d565b8160136000016000828254610cfc9190613e6f565b9091555050600384018190556004840154610d20906001600160a01b031686612e01565b835460ff191660011784556040516001600160401b038a1681528a907f8f301470a994578b52323d625dfbf827ca5208c81747d3459be7b8867baec3ec9060200160405180910390a2600486015460028401546001600160401b039081169116148015610da257506000835460ff166004811115610da057610da061396d565b145b15610e0c57825460ff191660011783556002830180546001600160401b034216600160401b026fffffffffffffffff0000000000000000199091161790556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b816001610e2482611b6d565b6006811115610e3557610e3561396d565b14610e535760405163ae9dcffd60e01b815260040160405180910390fd5b610e5d8383612e23565b6000838152601260209081526040808320600180820154855260108452828520600b54845160e08101865292820154835260028201549583019590955260038101549382019390935260048301546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152909391926064916201000090910460ff1690610f0090612d0e565b610f0a9190613e2e565b610f149190613e5b565b600b54909150600090606490610f34906301000000900460ff1684613e2e565b610f3e9190613e5b565b90508060136001016000828254610f559190613e6f565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610feb9190613e82565b61100857604051637c2ccffd60e11b815260040160405180910390fd5b8184600301600082825461101c9190613e1b565b9091555050600b5460008881526006602052604090205461010090910460ff16906001600160401b03166001600160401b03161061105d5761105d87612a09565b50505050505050565b600061107982611074612ea6565b612eb1565b92915050565b60006110798261108d612ea6565b612ec5565b60008181526012602090815260408083206001810154845260109092528220600c54610100906110cc90600160801b900460ff1682613ea4565b60018301546110df9161ffff1690613e2e565b6110e99190613e5b565b949350505050565b336000908152600a602052604090206060906111139061111090612f57565b90565b905090565b6111206138de565b604080516101008082018352600b805460ff8082166080808701918252948304821660a080880191909152620100008404831660c08801526301000000909304821660e0870152855285519182018652600c80546001600160401b038082168552600160401b820416602085810191909152600160801b82048416988501989098527101000000000000000000000000000000000090049091166060830152600d80549596939593870194929391928401916111db90613ebe565b80601f016020809104026020016040519081016040528092919081815260200182805461120790613ebe565b80156112545780601f1061122957610100808354040283529160200191611254565b820191906000526020600020905b81548152906001019060200180831161123757829003601f168201915b5050509190925250505081526040805160208181018352600385015460ff1682528301526004909201546001600160401b0316910152919050565b6112998133611c4e565b50565b3360009081526009602052604090206060906111139061111090612f57565b60006112ce6112c98361404f565b612f64565b9050336112de6020840184614158565b6001600160a01b031614611305576040516334c69e3160e11b815260040160405180910390fd5b6000818152601060205260409020546001600160a01b031615611354576040517ffc7d069000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61136661014083016101208401614175565b6001600160401b031615806113ad575061138660e0830160c08401614175565b6001600160401b03166113a161014084016101208501614175565b6001600160401b031610155b156113e4576040517fdf63f61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113f460a0830160808401614175565b6001600160401b0316600003611436576040517f535ed2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61144660a0830160808401614175565b6001600160401b0316611460610100840160e08501614175565b6001600160401b031611156114a1576040517fb9551ab100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114b160e0830160c08401614175565b6001600160401b03166000036114f3576040517f090a5ecd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020820135600003611531576040517f6aba7aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606082013560000361156f576040517ffb7df0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201356000036115ad576040517f47ba51c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115bb610100830183614192565b6115c590806141b2565b9050600003611600576040517f86f8cf9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160401b031661161c60e0840160c08501614175565b6001600160401b0316111561165d576040517f1267b3f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260106020526040902082906116778282614352565b5061168a905060e0830160c08401614175565b6116949042613dfc565b600082815260116020526040902060020180546001600160401b0392909216600160801b0267ffffffffffffffff60801b199092169190911790556116e161014083016101208401614175565b6116eb9042613dfc565b600082815260116020908152604090912060020180546001600160401b0393909316600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff9093169290921790915561174c9061174690840184614158565b82612f94565b600061175f61175a8461404f565b612fb6565b600083815260116020526040812060010182905560138054929350839290919061178a908490613e6f565b9091555061179a90503382612d2d565b6000828152601160209081526040918290206002015491517f1bf9c457accf8703dbf7cdf1b58c2f74ddf2e525f98155c70b3d318d74609bd8926117f492869290880191600160c01b90046001600160401b031690614506565b60405180910390a1505050565b806000808281526012602052604090205460ff1660068111156118265761182661396d565b0361184457604051638b41ec7f60e01b815260040160405180910390fd5b61184f823333610702565b5050565b600080600061186984611864612ea6565b612ff2565b90925090508180156110e95750600254600160801b900460ff9081169116109392505050565b61191260405180604001604052806139476040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526012602052604081205460ff1660068111156119355761193561396d565b0361195357604051638b41ec7f60e01b815260040160405180910390fd5b60008281526012602052604090206119e460405180604001604052806139476040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b600180830154600090815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e08101865295830154865260028301548685015260038301548686015260048301546001600160401b038082166060890152600160401b820481166080890152600160801b8204811692880192909252600160c01b90041660c0860152918201939093528151808301835260058401805492949385019282908290611a9990613ebe565b80601f0160208091040260200160405190810160405280929190818152602001828054611ac590613ebe565b8015611b125780601f10611ae757610100808354040283529160200191611b12565b820191906000526020600020905b815481529060010190602001808311611af557829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0390811683830152600890930154604090920191909152918352600290930154600160401b90049092169181019190915292915050565b600081815260126020526040812060018101548203611b8f5750600092915050565b6000611b9e82600101546105df565b90506004825460ff166006811115611bb857611bb861396d565b03611bc7575060049392505050565b6002816004811115611bdb57611bdb61396d565b03611bea575060059392505050565b6003816004811115611bfe57611bfe61396d565b03611c0d575060029392505050565b6004816004811115611c2157611c2161396d565b03611c30575060039392505050565b505460ff1692915050565b600061107982611c49612ea6565b6130aa565b60008281526010602052604090205482906001600160a01b0316611c8557604051635eeb253d60e11b815260040160405180910390fd5b6000838152601060209081526040808320601190925290912081546001600160a01b03163314611cc8576040516334c69e3160e11b815260040160405180910390fd5b6000611cd3866105df565b90506002816004811115611ce957611ce961396d565b14158015611d0957506004816004811115611d0657611d0661396d565b14155b8015611d2757506003816004811115611d2457611d2461396d565b14155b15611d5e576040517fc00b5b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010154600003611d9c576040517fbd8bdd9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816004811115611db057611db061396d565b03611e4e57815460ff1916600217825560405186907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a2600086815260116020526040902060020154611e18908790600160c01b90046001600160401b0316612cdf565b6002830154611e3091906001600160401b0316613e2e565b826001016000828254611e439190613e6f565b90915550611fdb9050565b6004816004811115611e6257611e6261396d565b03611fcf576040805160a0808201835285546001600160a01b03168252825160e08101845260018701548152600287015460208281019190915260038801548286015260048801546001600160401b038082166060850152600160401b820481166080850152600160801b8204811694840194909452600160c01b900490921660c08201529082015281518083018352600586018054611fc594889390850192909182908290611f1190613ebe565b80601f0160208091040260200160405190810160405280929190818152602001828054611f3d90613ebe565b8015611f8a5780601f10611f5f57610100808354040283529160200191611f8a565b820191906000526020600020905b815481529060010190602001808311611f6d57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b031690820152600890910154604090910152612fb6565b6001830155611fdb565b815460ff191660031782555b8254611ff0906001600160a01b0316876130e4565b60018201546014805482919060009061200a908490613e6f565b909155505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561207e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a29190613e82565b6120bf57604051637c2ccffd60e11b815260040160405180910390fd5b5050600060019091015550505050565b600033816120dd8585612c59565b905060006120ea82611b6d565b905060008160068111156121005761210061396d565b148061211d5750600681600681111561211b5761211b61396d565b145b80156121465750600154600083815260208190526040902060ff9091169061214490612cb3565b105b8015612167575060008281526020819052604090206121659084612cbd565b155b9695505050505050565b81600161217d82611b6d565b600681111561218e5761218e61396d565b146121ac5760405163ae9dcffd60e01b815260040160405180910390fd5b6109618383613106565b6000828152601260209081526040808320600101548084526010909252909120546001600160a01b03166121fd57604051635eeb253d60e11b815260040160405180910390fd5b600083815260126020526040902060048101546001600160a01b03163314612251576040517fce351b9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154600090815260106020526040808220815160038082526080820190935290929181602001602082028036833701905050905061229961229487611066565b6132a3565b816000815181106122ac576122ac6145b3565b602090810291909101015260068201546122c5906132b4565b816001815181106122d8576122d86145b3565b6020026020010181815250508260020160089054906101000a90046001600160401b03166001600160401b031681600281518110612318576123186145b3565b60200260200101818152505061088d8686836132c0565b6123a46040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526010602052604090205482906001600160a01b03166123db57604051635eeb253d60e11b815260040160405180910390fd5b600083815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186526001840154815260028401548186015260038401548187015260048401546001600160401b038082166060840152600160401b820481166080840152600160801b8204811693830193909352600160c01b900490911660c0820152928101929092528251808401845260058201805493949293928501928290829061248f90613ebe565b80601f01602080910402602001604051908101604052809291908181526020018280546124bb90613ebe565b80156125085780601f106124dd57610100808354040283529160200191612508565b820191906000526020600020905b8154815290600101906020018083116124eb57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0316908201526008909101546040909101529392505050565b60008282188284100282186105d8565b60008481526010602052604090205484906001600160a01b031661258c57604051635eeb253d60e11b815260040160405180910390fd5b600085815260116020908152604080832060108352818420815460ff191660031782558885526012909352922081546125ce906001600160a01b0316896130e4565b60048101546125e6906001600160a01b0316886129e7565b6002810154600090612602908a906001600160401b0316612cdf565b60038301549091506126148183613e6f565b60148054600090612626908490613e6f565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156126ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d19190613e82565b6126ee57604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038881166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561275d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127819190613e82565b610e0c57604051637c2ccffd60e11b815260040160405180910390fd5b60008481526010602052604090205484906001600160a01b03166127d557604051635eeb253d60e11b815260040160405180910390fd5b600084815260126020526040902060048101546127fb906001600160a01b0316866129e7565b60028101546000906128419088906001600160401b031661283c826000908152601160205260409020600201546001600160401b03600160c01b9091041690565b61345e565b60038301549091506128538183613e6f565b60148054600090612865908490613e6f565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156128ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129109190613e82565b61292d57604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561299c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c09190613e82565b6129dd57604051637c2ccffd60e11b815260040160405180910390fd5b5050505050505050565b6001600160a01b0382166000908152600a60205260409020610961908261353d565b60008181526012602090815260408083206001810154808552601190935292206002830154612a429083906001600160401b0316612cdf565b816001016000828254612a559190613e6f565b90915550506004830154612a72906001600160a01b0316856129e7565b6000848152602081905260409020612a8990613549565b825460ff191660061783556002808401805467ffffffffffffffff1916905560006003850181905560048501805473ffffffffffffffffffffffffffffffffffffffff19169055908201805460019290612aed9084906001600160401b03166145c9565b82546101009290920a6001600160401b038181021990931691831602179091556002850154604051600160401b90910490911681528391507f33ba8f7627565d89f7ada2a6b81ea532b7aa9b11e91a78312d6e1fca0bfcd1dc9060200160405180910390a26000848152600660205260409020805467ffffffffffffffff19169055600082815260106020526040812060028301546004820154919291612ba0916001600160401b0390811691166145c9565b60048301546001600160401b039182169250600160c01b90041681118015612bdd57506001835460ff166004811115612bdb57612bdb61396d565b145b1561088d57825460ff19166004178355612bf86001426145c9565b6002840180546001600160401b0392909216600160801b0267ffffffffffffffff60801b1990921691909117905560405184907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a2505050505050565b60008282604051602001612c809291909182526001600160401b0316602082015260400190565b60405160208183030381529060405280519060200120905092915050565b60006105d8836001600160a01b038416613552565b6000611079825490565b6001600160a01b038116600090815260018301602052604081205415156105d8565b6000828152601160205260408120600201546105d89084908490600160801b90046001600160401b031661345e565b600081608001516001600160401b031682604001516110799190613e2e565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015612dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612de49190613e82565b61096157604051637c2ccffd60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600a6020526040902061096190826135a1565b612e2d8282613106565b60008281526008602090815260408083206001600160401b038086168552908352818420805460ff1916600190811790915586855260069093529083208054929390929091612e7e91859116613dfc565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050565b6000611113426135ad565b60006105d8612ec08484612ec5565b6135d9565b600080612ed4610100436145e8565b60025490915060009061010090612f039071010000000000000000000000000000000000900460ff16866145fc565b612f0d919061461e565b6001600160401b031690506000612f26610100876145e8565b9050600061010082612f388587613e6f565b612f429190613e6f565b612f4c91906145e8565b979650505050505050565b606060006105d883613633565b600081604051602001612f779190613dd3565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216600090815260096020526040902061096190826135a1565b6000612fc5826020015161368f565b602083015160a0810151606090910151612fdf91906145fc565b6001600160401b03166110799190613e2e565b600080600061300085611b6d565b60008681526005602052604081205491925090613025906001600160401b03166135ad565b9050600182600681111561303b5761303b61396d565b14158061304f575061304d85826136ae565b155b15613062576000809350935050506130a3565b61306c8686612ec5565b92506000613079846135d9565b9050600061308688611092565b905080158061309c575061309a81836145e8565b155b9550505050505b9250929050565b60008060006130b98585612ff2565b90925090508180156130db575060025460ff600160801b909104811690821610155b95945050505050565b6001600160a01b0382166000908152600960205260409020610961908261353d565b6000613111826136c4565b6001600160401b03169050428110613155576040517f6b4b1a4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025461317290600160401b90046001600160401b031682613e6f565b42106131aa576040517fde55698e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602090815260408083206001600160401b038616845290915290205460ff1615613206576040517efab7d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61321083836130aa565b613246576040517fd3ffa66b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038616845290915290205460ff1615610961576040517f98e7e55100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060ff198216816110e9826136d7565b6000806105d8836136d7565b6000838152600760205260408120906132d7612ea6565b6001600160401b0316815260208101919091526040016000205460ff161561332b576040517f3edef7db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116916394c8919d9161337591869186910161464c565b602060405180830381865afa158015613392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b69190613e82565b6133ec576040517ffcd03a4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600760205260408120600191613405612ea6565b6001600160401b031681526020808201929092526040908101600020805460ff19169315159390931790925590518481527f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d91016117f4565b60008381526010602052604081206001600160401b03808416908516106134b1576040517f56607cb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081018252600183015481526002830154602082015260038301549181019190915260048201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526135209061368f565b61352a85856145c9565b6001600160401b03166130db9190613e2e565b60006105d88383613749565b61129981613843565b600081815260018301602052604081205461359957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611079565b506000611079565b60006105d88383613552565b60006110797f0000000000000000000000000000000000000000000000000000000000000000836146f6565b60008060ff83166135eb600143613e1b565b6135f59190613e1b565b409050600081900361360957613609614724565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561368357602002820191906000526020600020905b81548152602001906001019080831161366f575b50505050509050919050565b600081608001516001600160401b031682602001516110799190613e2e565b60006001600160401b03808416908316106105d8565b60006110796136d2836138a5565b6138b2565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b60208110156106fc57600891821c91613717908290613e2e565b83901b7fff000000000000000000000000000000000000000000000000000000000000001691909117906001016136fd565b6000818152600183016020526040812054801561383257600061376d600183613e1b565b855490915060009061378190600190613e1b565b90508082146137e65760008660000182815481106137a1576137a16145b3565b90600052602060002001549050808760000184815481106137c4576137c46145b3565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806137f7576137f761473a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611079565b6000915050611079565b5092915050565b600061384d825490565b905060005b8181101561389d57826001016000846000018381548110613875576138756145b3565b9060005260206000200154815260200190815260200160002060009055806001019050613852565b505060009055565b6000611079826001613dfc565b60006110797f0000000000000000000000000000000000000000000000000000000000000000836145fc565b60408051610100810182526000608080830182815260a080850184905260c0850184905260e08501849052908452845190810185528281526020808201849052818601849052606080830185905292820192909252818401528351908101845290815290918201905b8152600060209091015290565b60006020828403121561396657600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106139975761399761396d565b91905290565b6001600160a01b038116811461129957600080fd5b6000806000606084860312156139c757600080fd5b8335925060208401356139d98161399d565b915060408401356139e98161399d565b809150509250925092565b6001600160401b038116811461129957600080fd5b8035613a14816139f4565b919050565b60008060408385031215613a2c57600080fd5b823591506020830135613a3e816139f4565b809150509250929050565b600061010082840312156106fc57600080fd5b60008060006101408486031215613a7257600080fd5b833592506020840135613a84816139f4565b9150613a938560408601613a49565b90509250925092565b602080825282518282018190526000918401906040840190835b81811015613ad4578351835260209384019390920191600101613ab6565b509095945050505050565b6000815180845260005b81811015613b0557602081850181015186830182015201613ae9565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160401b0381511682526001600160401b03602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160a060808501526110e960a0850182613adf565b602081526000825160ff815116602084015260ff602082015116604084015260ff604082015116606084015260ff606082015116608084015250602083015160e060a0840152613bce610100840182613b25565b90506040840151613be560c08501825160ff169052565b5060608401516001600160401b03811660e0850152509392505050565b600060208284031215613c1457600080fd5b81356001600160401b03811115613c2a57600080fd5b820161016081850312156105d857600080fd5b6000815160408452613c526040850182613adf565b602093840151949093019390935250919050565b6001600160a01b038151168252600060208201518051602085015260208101516040850152604081015160608501526001600160401b0360608201511660808501526001600160401b0360808201511660a08501526001600160401b0360a08201511660c08501526001600160401b0360c08201511660e0850152506040820151610160610100850152613cfe610160850182613c3d565b90506060830151613d1b6101208601826001600160401b03169052565b5060808301516101408501528091505092915050565b602081526000825160406020840152613d4d6060840182613c66565b90506001600160401b0360208501511660408401528091505092915050565b60208101600783106139975761399761396d565b60008060408385031215613d9357600080fd5b823591506020830135613a3e8161399d565b6000806101208385031215613db957600080fd5b82359150613dca8460208501613a49565b90509250929050565b6020815260006105d86020830184613c66565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019081111561107957611079613de6565b8181038181111561107957611079613de6565b808202811582820484141761107957611079613de6565b634e487b7160e01b600052601260045260246000fd5b600082613e6a57613e6a613e45565b500490565b8082018082111561107957611079613de6565b600060208284031215613e9457600080fd5b815180151581146105d857600080fd5b61ffff828116828216039081111561107957611079613de6565b600181811c90821680613ed257607f821691505b6020821081036106fc57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613f2a57613f2a613ef2565b60405290565b60405160a081016001600160401b0381118282101715613f2a57613f2a613ef2565b60405160e081016001600160401b0381118282101715613f2a57613f2a613ef2565b604051601f8201601f191681016001600160401b0381118282101715613f9c57613f9c613ef2565b604052919050565b600060408284031215613fb657600080fd5b613fbe613f08565b905081356001600160401b03811115613fd657600080fd5b8201601f81018413613fe757600080fd5b80356001600160401b0381111561400057614000613ef2565b614013601f8201601f1916602001613f74565b81815285602083850101111561402857600080fd5b81602084016020830137600060209282018301528352928301359282019290925292915050565b600081360361016081121561406357600080fd5b61406b613f30565b83356140768161399d565b815260e0601f198301121561408a57600080fd5b614092613f52565b602085810135825260408087013591830191909152606086013590820152915060808401356140c0816139f4565b606083015260a08401356140d3816139f4565b608083015260c08401356140e6816139f4565b60a083015260e08401356140f9816139f4565b60c08301526020810191909152610100830135906001600160401b0382111561412157600080fd5b61412d36838601613fa4565b604082015261413f6101208501613a09565b6060820152610140939093013560808401525090919050565b60006020828403121561416a57600080fd5b81356105d88161399d565b60006020828403121561418757600080fd5b81356105d8816139f4565b60008235603e198336030181126141a857600080fd5b9190910192915050565b6000808335601e198436030181126141c957600080fd5b8301803591506001600160401b038211156141e357600080fd5b6020019150368190038213156130a357600080fd5b60008135611079816139f4565b601f82111561096157806000526020600020601f840160051c8101602085101561422c5750805b601f840160051c820191505b8181101561424c5760008155600101614238565b5050505050565b8135601e1983360301811261426757600080fd5b820180356001600160401b038111801561428057600080fd5b81360360208401131561429257600080fd5b600090506142aa826142a48654613ebe565b86614205565b80601f8311600181146142df578284156142c75750848201602001355b600019600386901b1c1916600185901b17865561433e565b600086815260209020601f19851690845b82811015614312576020858901810135835594850194600190920191016142f0565b50858210156143325760001960f88760031b161c19602085890101351681555b505060018460011b0186555b505050505060209190910135600190910155565b813561435d8161399d565b815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03919091161781556020820135600182015560408201356002820155606082013560038201556004810160808301356143b5816139f4565b815467ffffffffffffffff19166001600160401b0382161782555060a08301356143de816139f4565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617815561445261441d60c085016141f8565b825467ffffffffffffffff60801b191660809190911b77ffffffffffffffff0000000000000000000000000000000016178255565b6144aa61446160e085016141f8565b825477ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b7fffffffffffffffff00000000000000000000000000000000000000000000000016178255565b506144c56144bc610100840184614192565b60058301614253565b6144f66144d561012084016141f8565b600783016001600160401b0382166001600160401b03198254161781555050565b6101409190910135600890910155565b838152823560208083019190915283013560408083019190915283013560608083019190915261012082019084013561453e816139f4565b6001600160401b038116608084015250608084013561455c816139f4565b6001600160401b03811660a08401525060a084013561457a816139f4565b6001600160401b03811660c08401525061459660c08501613a09565b6001600160401b0390811660e084015283166101008301526110e9565b634e487b7160e01b600052603260045260246000fd5b6001600160401b03828116828216039081111561107957611079613de6565b6000826145f7576145f7613e45565b500690565b6001600160401b03818116838216029081169081811461383c5761383c613de6565b60006001600160401b0383168061463757614637613e45565b806001600160401b0384160691505092915050565b82358152602080840135908201526000610120820161467b604084016040870180358252602090810135910152565b614695608084016080870180358252602090810135910152565b6146af60c0840160c0870180358252602090810135910152565b610120610100840152835190819052602084019061014084019060005b818110156146ea5783518352602093840193909201916001016146cc565b50909695505050505050565b60006001600160401b0383168061470f5761470f613e45565b806001600160401b0384160491505092915050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603160045260246000fdfea26469706673582212206dff77c91b35d52a507921036c4f144a6da81a73042b293f820f8cf1bc1728f264736f6c634300081c0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636e2b54ee11610104578063c0cc4add116100a2578063e8aa0a0711610071578063e8aa0a071461047f578063f752196b14610492578063fb1e61ca146104bb578063fc0c546a146104db57600080fd5b8063c0cc4add14610433578063c5d4335114610446578063d02bbe3314610459578063d1bb36b61461046c57600080fd5b8063a29c29a4116100de578063a29c29a4146103bd578063a3a0807e146103d0578063b396dc79146103f3578063be5cdc481461041357600080fd5b80636e2b54ee1461038f5780639777b72c146103a257806399b6da0c146103aa57600080fd5b8063329b5a0b1161017157806351a766421161014b57806351a766421461030e5780635da73835146103215780636b00c8cf146103365780636c70bee91461037a57600080fd5b8063329b5a0b146102a3578063458d2bf1146102d65780634641dce6146102e957600080fd5b806312827602116101ad57806312827602146102395780631d873c1b1461024c578063237d84821461025f57806326d6f8341461027257600080fd5b806302fa8e65146101d457806305b90773146102045780630aefaabe14610224575b600080fd5b6101e76101e2366004613954565b610501565b6040516001600160401b0390911681526020015b60405180910390f35b610217610212366004613954565b6105df565b6040516101fb9190613983565b6102376102323660046139b2565b610702565b005b610237610247366004613a19565b610895565b61023761025a366004613a5c565b610966565b61023761026d366004613a19565b610e18565b610295610280366004613954565b60009081526012602052604090206003015490565b6040519081526020016101fb565b6101e76102b1366004613954565b600090815260116020526040902060020154600160c01b90046001600160401b031690565b6102956102e4366004613954565b611066565b6102fc6102f7366004613954565b61107f565b60405160ff90911681526020016101fb565b61029561031c366004613954565b611092565b6103296110f1565b6040516101fb9190613a9c565b610362610344366004613954565b6000908152601260205260409020600401546001600160a01b031690565b6040516001600160a01b0390911681526020016101fb565b610382611118565b6040516101fb9190613b7a565b61023761039d366004613954565b61128f565b61032961129c565b6102376103b8366004613c02565b6112bb565b6102376103cb366004613954565b611801565b6103e36103de366004613954565b611853565b60405190151581526020016101fb565b610406610401366004613954565b61188f565b6040516101fb9190613d31565b610426610421366004613954565b611b6d565b6040516101fb9190613d6c565b6103e3610441366004613954565b611c3b565b610237610454366004613d80565b611c4e565b6103e3610467366004613a19565b6120cf565b61023761047a366004613a19565b612171565b61023761048d366004613da5565b6121b6565b6101e76104a0366004613954565b6000908152600660205260409020546001600160401b031690565b6104ce6104c9366004613954565b61232f565b6040516101fb9190613dd3565b7f0000000000000000000000000000000000000000000000000000000000000000610362565b60008061050d836105df565b905060008160048111156105235761052361396d565b14806105405750600181600481111561053e5761053e61396d565b145b1561056c575050600090815260116020526040902060020154600160801b90046001600160401b031690565b60028160048111156105805761058061396d565b036105ac575050600090815260116020526040902060020154600160c01b90046001600160401b031690565b6000838152601160205260409020600201546105d890600160801b90046001600160401b031642612545565b9392505050565b60008181526010602052604081205482906001600160a01b031661061657604051635eeb253d60e11b815260040160405180910390fd5b600083815260116020526040812090815460ff16600481111561063b5761063b61396d565b14801561067a5750600084815260116020526040902060020154600160c01b90046001600160401b03166001600160401b0316426001600160401b0316115b156106895760029250506106fc565b6001815460ff1660048111156106a1576106a161396d565b14806106c257506000815460ff1660048111156106c0576106c061396d565b145b80156106e6575060028101546001600160401b03600160801b909104811642909116115b156106f55760039250506106fc565b5460ff1691505b50919050565b826000808281526012602052604090205460ff1660068111156107275761072761396d565b0361074557604051638b41ec7f60e01b815260040160405180910390fd5b600084815260126020526040902060048101546001600160a01b03163314610799576040517f57a6f4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107a486611b6d565b905060048160068111156107ba576107ba61396d565b036107f1576040517fc2cbf77700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160068111156108055761080561396d565b0361081f5761081a8260010154878787612555565b61088d565b60058160068111156108335761083361396d565b036108485761081a826001015487878761279e565b600381600681111561085c5761085c61396d565b0361086b5761081a33876129e7565b600181600681111561087f5761087f61396d565b0361088d5761088d86612a09565b505050505050565b61089f82826120cf565b6108d5576040517f424a04ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108e18383612c59565b60008181526020819052604090209091506108fc9033612c9e565b50600154600082815260208190526040902060ff9091169061091d90612cb3565b03610961576040516001600160401b038316815283907fc8e6c955744189a19222ec226b72ac1435d88d5745252dac56e6f679f64c037a9060200160405180910390a25b505050565b60008381526010602052604090205483906001600160a01b031661099d57604051635eeb253d60e11b815260040160405180910390fd5b600084815260106020526040902060048101546001600160401b03908116908516106109f5576040517f3b920b8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610a018686612c59565b6000818152602081905260409020909150610a1c9033612cbd565b610a52576040517fd651ce1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601260209081526040808320600181018a90556002810180546fffffffffffffffff00000000000000001916600160401b6001600160401b038c1602179055898452601190925282209091610aab84611b6d565b6006811115610abc57610abc61396d565b14158015610ae457506006610ad084611b6d565b6006811115610ae157610ae161396d565b14155b15610b1b576040517fff556acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048201805473ffffffffffffffffffffffffffffffffffffffff1916331790556002820180546001600160401b03421667ffffffffffffffff19909116179055610b8c83600090815260056020526040902080546001600160401b03421667ffffffffffffffff19909116179055565b610b9683876121b6565b60028101805460019190600090610bb79084906001600160401b0316613dfc565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610bfc888360020160009054906101000a90046001600160401b0316612cdf565b816001016000828254610c0f9190613e1b565b90915550506040805160e081018252600186015481526002860154602082015260038601549181019190915260048501546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526000908190610c8890612d0e565b90506006610c9586611b6d565b6006811115610ca657610ca661396d565b03610cd957600b54606490610cbe9060ff1683613e2e565b610cc89190613e5b565b610cd29082613e1b565b9150610cdd565b8091505b610ce73383612d2d565b8160136000016000828254610cfc9190613e6f565b9091555050600384018190556004840154610d20906001600160a01b031686612e01565b835460ff191660011784556040516001600160401b038a1681528a907f8f301470a994578b52323d625dfbf827ca5208c81747d3459be7b8867baec3ec9060200160405180910390a2600486015460028401546001600160401b039081169116148015610da257506000835460ff166004811115610da057610da061396d565b145b15610e0c57825460ff191660011783556002830180546001600160401b034216600160401b026fffffffffffffffff0000000000000000199091161790556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b816001610e2482611b6d565b6006811115610e3557610e3561396d565b14610e535760405163ae9dcffd60e01b815260040160405180910390fd5b610e5d8383612e23565b6000838152601260209081526040808320600180820154855260108452828520600b54845160e08101865292820154835260028201549583019590955260038101549382019390935260048301546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152909391926064916201000090910460ff1690610f0090612d0e565b610f0a9190613e2e565b610f149190613e5b565b600b54909150600090606490610f34906301000000900460ff1684613e2e565b610f3e9190613e5b565b90508060136001016000828254610f559190613e6f565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610feb9190613e82565b61100857604051637c2ccffd60e11b815260040160405180910390fd5b8184600301600082825461101c9190613e1b565b9091555050600b5460008881526006602052604090205461010090910460ff16906001600160401b03166001600160401b03161061105d5761105d87612a09565b50505050505050565b600061107982611074612ea6565b612eb1565b92915050565b60006110798261108d612ea6565b612ec5565b60008181526012602090815260408083206001810154845260109092528220600c54610100906110cc90600160801b900460ff1682613ea4565b60018301546110df9161ffff1690613e2e565b6110e99190613e5b565b949350505050565b336000908152600a602052604090206060906111139061111090612f57565b90565b905090565b6111206138de565b604080516101008082018352600b805460ff8082166080808701918252948304821660a080880191909152620100008404831660c08801526301000000909304821660e0870152855285519182018652600c80546001600160401b038082168552600160401b820416602085810191909152600160801b82048416988501989098527101000000000000000000000000000000000090049091166060830152600d80549596939593870194929391928401916111db90613ebe565b80601f016020809104026020016040519081016040528092919081815260200182805461120790613ebe565b80156112545780601f1061122957610100808354040283529160200191611254565b820191906000526020600020905b81548152906001019060200180831161123757829003601f168201915b5050509190925250505081526040805160208181018352600385015460ff1682528301526004909201546001600160401b0316910152919050565b6112998133611c4e565b50565b3360009081526009602052604090206060906111139061111090612f57565b60006112ce6112c98361404f565b612f64565b9050336112de6020840184614158565b6001600160a01b031614611305576040516334c69e3160e11b815260040160405180910390fd5b6000818152601060205260409020546001600160a01b031615611354576040517ffc7d069000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61136661014083016101208401614175565b6001600160401b031615806113ad575061138660e0830160c08401614175565b6001600160401b03166113a161014084016101208501614175565b6001600160401b031610155b156113e4576040517fdf63f61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113f460a0830160808401614175565b6001600160401b0316600003611436576040517f535ed2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61144660a0830160808401614175565b6001600160401b0316611460610100840160e08501614175565b6001600160401b031611156114a1576040517fb9551ab100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114b160e0830160c08401614175565b6001600160401b03166000036114f3576040517f090a5ecd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020820135600003611531576040517f6aba7aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606082013560000361156f576040517ffb7df0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201356000036115ad576040517f47ba51c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115bb610100830183614192565b6115c590806141b2565b9050600003611600576040517f86f8cf9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160401b031661161c60e0840160c08501614175565b6001600160401b0316111561165d576040517f1267b3f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260106020526040902082906116778282614352565b5061168a905060e0830160c08401614175565b6116949042613dfc565b600082815260116020526040902060020180546001600160401b0392909216600160801b0267ffffffffffffffff60801b199092169190911790556116e161014083016101208401614175565b6116eb9042613dfc565b600082815260116020908152604090912060020180546001600160401b0393909316600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff9093169290921790915561174c9061174690840184614158565b82612f94565b600061175f61175a8461404f565b612fb6565b600083815260116020526040812060010182905560138054929350839290919061178a908490613e6f565b9091555061179a90503382612d2d565b6000828152601160209081526040918290206002015491517f1bf9c457accf8703dbf7cdf1b58c2f74ddf2e525f98155c70b3d318d74609bd8926117f492869290880191600160c01b90046001600160401b031690614506565b60405180910390a1505050565b806000808281526012602052604090205460ff1660068111156118265761182661396d565b0361184457604051638b41ec7f60e01b815260040160405180910390fd5b61184f823333610702565b5050565b600080600061186984611864612ea6565b612ff2565b90925090508180156110e95750600254600160801b900460ff9081169116109392505050565b61191260405180604001604052806139476040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526012602052604081205460ff1660068111156119355761193561396d565b0361195357604051638b41ec7f60e01b815260040160405180910390fd5b60008281526012602052604090206119e460405180604001604052806139476040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b600180830154600090815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e08101865295830154865260028301548685015260038301548686015260048301546001600160401b038082166060890152600160401b820481166080890152600160801b8204811692880192909252600160c01b90041660c0860152918201939093528151808301835260058401805492949385019282908290611a9990613ebe565b80601f0160208091040260200160405190810160405280929190818152602001828054611ac590613ebe565b8015611b125780601f10611ae757610100808354040283529160200191611b12565b820191906000526020600020905b815481529060010190602001808311611af557829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0390811683830152600890930154604090920191909152918352600290930154600160401b90049092169181019190915292915050565b600081815260126020526040812060018101548203611b8f5750600092915050565b6000611b9e82600101546105df565b90506004825460ff166006811115611bb857611bb861396d565b03611bc7575060049392505050565b6002816004811115611bdb57611bdb61396d565b03611bea575060059392505050565b6003816004811115611bfe57611bfe61396d565b03611c0d575060029392505050565b6004816004811115611c2157611c2161396d565b03611c30575060039392505050565b505460ff1692915050565b600061107982611c49612ea6565b6130aa565b60008281526010602052604090205482906001600160a01b0316611c8557604051635eeb253d60e11b815260040160405180910390fd5b6000838152601060209081526040808320601190925290912081546001600160a01b03163314611cc8576040516334c69e3160e11b815260040160405180910390fd5b6000611cd3866105df565b90506002816004811115611ce957611ce961396d565b14158015611d0957506004816004811115611d0657611d0661396d565b14155b8015611d2757506003816004811115611d2457611d2461396d565b14155b15611d5e576040517fc00b5b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010154600003611d9c576040517fbd8bdd9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816004811115611db057611db061396d565b03611e4e57815460ff1916600217825560405186907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a2600086815260116020526040902060020154611e18908790600160c01b90046001600160401b0316612cdf565b6002830154611e3091906001600160401b0316613e2e565b826001016000828254611e439190613e6f565b90915550611fdb9050565b6004816004811115611e6257611e6261396d565b03611fcf576040805160a0808201835285546001600160a01b03168252825160e08101845260018701548152600287015460208281019190915260038801548286015260048801546001600160401b038082166060850152600160401b820481166080850152600160801b8204811694840194909452600160c01b900490921660c08201529082015281518083018352600586018054611fc594889390850192909182908290611f1190613ebe565b80601f0160208091040260200160405190810160405280929190818152602001828054611f3d90613ebe565b8015611f8a5780601f10611f5f57610100808354040283529160200191611f8a565b820191906000526020600020905b815481529060010190602001808311611f6d57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b031690820152600890910154604090910152612fb6565b6001830155611fdb565b815460ff191660031782555b8254611ff0906001600160a01b0316876130e4565b60018201546014805482919060009061200a908490613e6f565b909155505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561207e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120a29190613e82565b6120bf57604051637c2ccffd60e11b815260040160405180910390fd5b5050600060019091015550505050565b600033816120dd8585612c59565b905060006120ea82611b6d565b905060008160068111156121005761210061396d565b148061211d5750600681600681111561211b5761211b61396d565b145b80156121465750600154600083815260208190526040902060ff9091169061214490612cb3565b105b8015612167575060008281526020819052604090206121659084612cbd565b155b9695505050505050565b81600161217d82611b6d565b600681111561218e5761218e61396d565b146121ac5760405163ae9dcffd60e01b815260040160405180910390fd5b6109618383613106565b6000828152601260209081526040808320600101548084526010909252909120546001600160a01b03166121fd57604051635eeb253d60e11b815260040160405180910390fd5b600083815260126020526040902060048101546001600160a01b03163314612251576040517fce351b9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001810154600090815260106020526040808220815160038082526080820190935290929181602001602082028036833701905050905061229961229487611066565b6132a3565b816000815181106122ac576122ac6145b3565b602090810291909101015260068201546122c5906132b4565b816001815181106122d8576122d86145b3565b6020026020010181815250508260020160089054906101000a90046001600160401b03166001600160401b031681600281518110612318576123186145b3565b60200260200101818152505061088d8686836132c0565b6123a46040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526010602052604090205482906001600160a01b03166123db57604051635eeb253d60e11b815260040160405180910390fd5b600083815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186526001840154815260028401548186015260038401548187015260048401546001600160401b038082166060840152600160401b820481166080840152600160801b8204811693830193909352600160c01b900490911660c0820152928101929092528251808401845260058201805493949293928501928290829061248f90613ebe565b80601f01602080910402602001604051908101604052809291908181526020018280546124bb90613ebe565b80156125085780601f106124dd57610100808354040283529160200191612508565b820191906000526020600020905b8154815290600101906020018083116124eb57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0316908201526008909101546040909101529392505050565b60008282188284100282186105d8565b60008481526010602052604090205484906001600160a01b031661258c57604051635eeb253d60e11b815260040160405180910390fd5b600085815260116020908152604080832060108352818420815460ff191660031782558885526012909352922081546125ce906001600160a01b0316896130e4565b60048101546125e6906001600160a01b0316886129e7565b6002810154600090612602908a906001600160401b0316612cdf565b60038301549091506126148183613e6f565b60148054600090612626908490613e6f565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156126ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d19190613e82565b6126ee57604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038881166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561275d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127819190613e82565b610e0c57604051637c2ccffd60e11b815260040160405180910390fd5b60008481526010602052604090205484906001600160a01b03166127d557604051635eeb253d60e11b815260040160405180910390fd5b600084815260126020526040902060048101546127fb906001600160a01b0316866129e7565b60028101546000906128419088906001600160401b031661283c826000908152601160205260409020600201546001600160401b03600160c01b9091041690565b61345e565b60038301549091506128538183613e6f565b60148054600090612865908490613e6f565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156128ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129109190613e82565b61292d57604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561299c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129c09190613e82565b6129dd57604051637c2ccffd60e11b815260040160405180910390fd5b5050505050505050565b6001600160a01b0382166000908152600a60205260409020610961908261353d565b60008181526012602090815260408083206001810154808552601190935292206002830154612a429083906001600160401b0316612cdf565b816001016000828254612a559190613e6f565b90915550506004830154612a72906001600160a01b0316856129e7565b6000848152602081905260409020612a8990613549565b825460ff191660061783556002808401805467ffffffffffffffff1916905560006003850181905560048501805473ffffffffffffffffffffffffffffffffffffffff19169055908201805460019290612aed9084906001600160401b03166145c9565b82546101009290920a6001600160401b038181021990931691831602179091556002850154604051600160401b90910490911681528391507f33ba8f7627565d89f7ada2a6b81ea532b7aa9b11e91a78312d6e1fca0bfcd1dc9060200160405180910390a26000848152600660205260409020805467ffffffffffffffff19169055600082815260106020526040812060028301546004820154919291612ba0916001600160401b0390811691166145c9565b60048301546001600160401b039182169250600160c01b90041681118015612bdd57506001835460ff166004811115612bdb57612bdb61396d565b145b1561088d57825460ff19166004178355612bf86001426145c9565b6002840180546001600160401b0392909216600160801b0267ffffffffffffffff60801b1990921691909117905560405184907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a2505050505050565b60008282604051602001612c809291909182526001600160401b0316602082015260400190565b60405160208183030381529060405280519060200120905092915050565b60006105d8836001600160a01b038416613552565b6000611079825490565b6001600160a01b038116600090815260018301602052604081205415156105d8565b6000828152601160205260408120600201546105d89084908490600160801b90046001600160401b031661345e565b600081608001516001600160401b031682604001516110799190613e2e565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015612dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612de49190613e82565b61096157604051637c2ccffd60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600a6020526040902061096190826135a1565b612e2d8282613106565b60008281526008602090815260408083206001600160401b038086168552908352818420805460ff1916600190811790915586855260069093529083208054929390929091612e7e91859116613dfc565b92506101000a8154816001600160401b0302191690836001600160401b031602179055505050565b6000611113426135ad565b60006105d8612ec08484612ec5565b6135d9565b600080612ed4610100436145e8565b60025490915060009061010090612f039071010000000000000000000000000000000000900460ff16866145fc565b612f0d919061461e565b6001600160401b031690506000612f26610100876145e8565b9050600061010082612f388587613e6f565b612f429190613e6f565b612f4c91906145e8565b979650505050505050565b606060006105d883613633565b600081604051602001612f779190613dd3565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216600090815260096020526040902061096190826135a1565b6000612fc5826020015161368f565b602083015160a0810151606090910151612fdf91906145fc565b6001600160401b03166110799190613e2e565b600080600061300085611b6d565b60008681526005602052604081205491925090613025906001600160401b03166135ad565b9050600182600681111561303b5761303b61396d565b14158061304f575061304d85826136ae565b155b15613062576000809350935050506130a3565b61306c8686612ec5565b92506000613079846135d9565b9050600061308688611092565b905080158061309c575061309a81836145e8565b155b9550505050505b9250929050565b60008060006130b98585612ff2565b90925090508180156130db575060025460ff600160801b909104811690821610155b95945050505050565b6001600160a01b0382166000908152600960205260409020610961908261353d565b6000613111826136c4565b6001600160401b03169050428110613155576040517f6b4b1a4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025461317290600160401b90046001600160401b031682613e6f565b42106131aa576040517fde55698e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602090815260408083206001600160401b038616845290915290205460ff1615613206576040517efab7d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61321083836130aa565b613246576040517fd3ffa66b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038616845290915290205460ff1615610961576040517f98e7e55100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600060ff198216816110e9826136d7565b6000806105d8836136d7565b6000838152600760205260408120906132d7612ea6565b6001600160401b0316815260208101919091526040016000205460ff161561332b576040517f3edef7db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116916394c8919d9161337591869186910161464c565b602060405180830381865afa158015613392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b69190613e82565b6133ec576040517ffcd03a4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600760205260408120600191613405612ea6565b6001600160401b031681526020808201929092526040908101600020805460ff19169315159390931790925590518481527f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d91016117f4565b60008381526010602052604081206001600160401b03808416908516106134b1576040517f56607cb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081018252600183015481526002830154602082015260038301549181019190915260048201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526135209061368f565b61352a85856145c9565b6001600160401b03166130db9190613e2e565b60006105d88383613749565b61129981613843565b600081815260018301602052604081205461359957508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611079565b506000611079565b60006105d88383613552565b60006110797f0000000000000000000000000000000000000000000000000000000000000000836146f6565b60008060ff83166135eb600143613e1b565b6135f59190613e1b565b409050600081900361360957613609614724565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561368357602002820191906000526020600020905b81548152602001906001019080831161366f575b50505050509050919050565b600081608001516001600160401b031682602001516110799190613e2e565b60006001600160401b03808416908316106105d8565b60006110796136d2836138a5565b6138b2565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b60208110156106fc57600891821c91613717908290613e2e565b83901b7fff000000000000000000000000000000000000000000000000000000000000001691909117906001016136fd565b6000818152600183016020526040812054801561383257600061376d600183613e1b565b855490915060009061378190600190613e1b565b90508082146137e65760008660000182815481106137a1576137a16145b3565b90600052602060002001549050808760000184815481106137c4576137c46145b3565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806137f7576137f761473a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611079565b6000915050611079565b5092915050565b600061384d825490565b905060005b8181101561389d57826001016000846000018381548110613875576138756145b3565b9060005260206000200154815260200190815260200160002060009055806001019050613852565b505060009055565b6000611079826001613dfc565b60006110797f0000000000000000000000000000000000000000000000000000000000000000836145fc565b60408051610100810182526000608080830182815260a080850184905260c0850184905260e08501849052908452845190810185528281526020808201849052818601849052606080830185905292820192909252818401528351908101845290815290918201905b8152600060209091015290565b60006020828403121561396657600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106139975761399761396d565b91905290565b6001600160a01b038116811461129957600080fd5b6000806000606084860312156139c757600080fd5b8335925060208401356139d98161399d565b915060408401356139e98161399d565b809150509250925092565b6001600160401b038116811461129957600080fd5b8035613a14816139f4565b919050565b60008060408385031215613a2c57600080fd5b823591506020830135613a3e816139f4565b809150509250929050565b600061010082840312156106fc57600080fd5b60008060006101408486031215613a7257600080fd5b833592506020840135613a84816139f4565b9150613a938560408601613a49565b90509250925092565b602080825282518282018190526000918401906040840190835b81811015613ad4578351835260209384019390920191600101613ab6565b509095945050505050565b6000815180845260005b81811015613b0557602081850181015186830182015201613ae9565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160401b0381511682526001600160401b03602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160a060808501526110e960a0850182613adf565b602081526000825160ff815116602084015260ff602082015116604084015260ff604082015116606084015260ff606082015116608084015250602083015160e060a0840152613bce610100840182613b25565b90506040840151613be560c08501825160ff169052565b5060608401516001600160401b03811660e0850152509392505050565b600060208284031215613c1457600080fd5b81356001600160401b03811115613c2a57600080fd5b820161016081850312156105d857600080fd5b6000815160408452613c526040850182613adf565b602093840151949093019390935250919050565b6001600160a01b038151168252600060208201518051602085015260208101516040850152604081015160608501526001600160401b0360608201511660808501526001600160401b0360808201511660a08501526001600160401b0360a08201511660c08501526001600160401b0360c08201511660e0850152506040820151610160610100850152613cfe610160850182613c3d565b90506060830151613d1b6101208601826001600160401b03169052565b5060808301516101408501528091505092915050565b602081526000825160406020840152613d4d6060840182613c66565b90506001600160401b0360208501511660408401528091505092915050565b60208101600783106139975761399761396d565b60008060408385031215613d9357600080fd5b823591506020830135613a3e8161399d565b6000806101208385031215613db957600080fd5b82359150613dca8460208501613a49565b90509250929050565b6020815260006105d86020830184613c66565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019081111561107957611079613de6565b8181038181111561107957611079613de6565b808202811582820484141761107957611079613de6565b634e487b7160e01b600052601260045260246000fd5b600082613e6a57613e6a613e45565b500490565b8082018082111561107957611079613de6565b600060208284031215613e9457600080fd5b815180151581146105d857600080fd5b61ffff828116828216039081111561107957611079613de6565b600181811c90821680613ed257607f821691505b6020821081036106fc57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613f2a57613f2a613ef2565b60405290565b60405160a081016001600160401b0381118282101715613f2a57613f2a613ef2565b60405160e081016001600160401b0381118282101715613f2a57613f2a613ef2565b604051601f8201601f191681016001600160401b0381118282101715613f9c57613f9c613ef2565b604052919050565b600060408284031215613fb657600080fd5b613fbe613f08565b905081356001600160401b03811115613fd657600080fd5b8201601f81018413613fe757600080fd5b80356001600160401b0381111561400057614000613ef2565b614013601f8201601f1916602001613f74565b81815285602083850101111561402857600080fd5b81602084016020830137600060209282018301528352928301359282019290925292915050565b600081360361016081121561406357600080fd5b61406b613f30565b83356140768161399d565b815260e0601f198301121561408a57600080fd5b614092613f52565b602085810135825260408087013591830191909152606086013590820152915060808401356140c0816139f4565b606083015260a08401356140d3816139f4565b608083015260c08401356140e6816139f4565b60a083015260e08401356140f9816139f4565b60c08301526020810191909152610100830135906001600160401b0382111561412157600080fd5b61412d36838601613fa4565b604082015261413f6101208501613a09565b6060820152610140939093013560808401525090919050565b60006020828403121561416a57600080fd5b81356105d88161399d565b60006020828403121561418757600080fd5b81356105d8816139f4565b60008235603e198336030181126141a857600080fd5b9190910192915050565b6000808335601e198436030181126141c957600080fd5b8301803591506001600160401b038211156141e357600080fd5b6020019150368190038213156130a357600080fd5b60008135611079816139f4565b601f82111561096157806000526020600020601f840160051c8101602085101561422c5750805b601f840160051c820191505b8181101561424c5760008155600101614238565b5050505050565b8135601e1983360301811261426757600080fd5b820180356001600160401b038111801561428057600080fd5b81360360208401131561429257600080fd5b600090506142aa826142a48654613ebe565b86614205565b80601f8311600181146142df578284156142c75750848201602001355b600019600386901b1c1916600185901b17865561433e565b600086815260209020601f19851690845b82811015614312576020858901810135835594850194600190920191016142f0565b50858210156143325760001960f88760031b161c19602085890101351681555b505060018460011b0186555b505050505060209190910135600190910155565b813561435d8161399d565b815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03919091161781556020820135600182015560408201356002820155606082013560038201556004810160808301356143b5816139f4565b815467ffffffffffffffff19166001600160401b0382161782555060a08301356143de816139f4565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617815561445261441d60c085016141f8565b825467ffffffffffffffff60801b191660809190911b77ffffffffffffffff0000000000000000000000000000000016178255565b6144aa61446160e085016141f8565b825477ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b7fffffffffffffffff00000000000000000000000000000000000000000000000016178255565b506144c56144bc610100840184614192565b60058301614253565b6144f66144d561012084016141f8565b600783016001600160401b0382166001600160401b03198254161781555050565b6101409190910135600890910155565b838152823560208083019190915283013560408083019190915283013560608083019190915261012082019084013561453e816139f4565b6001600160401b038116608084015250608084013561455c816139f4565b6001600160401b03811660a08401525060a084013561457a816139f4565b6001600160401b03811660c08401525061459660c08501613a09565b6001600160401b0390811660e084015283166101008301526110e9565b634e487b7160e01b600052603260045260246000fd5b6001600160401b03828116828216039081111561107957611079613de6565b6000826145f7576145f7613e45565b500690565b6001600160401b03818116838216029081169081811461383c5761383c613de6565b60006001600160401b0383168061463757614637613e45565b806001600160401b0384160691505092915050565b82358152602080840135908201526000610120820161467b604084016040870180358252602090810135910152565b614695608084016080870180358252602090810135910152565b6146af60c0840160c0870180358252602090810135910152565b610120610100840152835190819052602084019061014084019060005b818110156146ea5783518352602093840193909201916001016146cc565b50909695505050505050565b60006001600160401b0383168061470f5761470f613e45565b806001600160401b0384160491505092915050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052603160045260246000fdfea26469706673582212206dff77c91b35d52a507921036c4f144a6da81a73042b293f820f8cf1bc1728f264736f6c634300081c0033", - "devdoc": { - "kind": "dev", - "methods": { - "fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))": { - "params": { - "proof": "Groth16 proof procing possession of the slot data.", - "requestId": "RequestId identifying the request containing the slot to fill.", - "slotIndex": "Index of the slot in the request." - } - }, - "freeSlot(bytes32)": { - "details": "The host that filled the slot must have initiated the transaction (msg.sender). This overload allows `rewardRecipient` and `collateralRecipient` to be optional.", - "params": { - "slotId": "id of the slot to free" - } - }, - "freeSlot(bytes32,address,address)": { - "params": { - "collateralRecipient": "address to refund collateral to", - "rewardRecipient": "address to send rewards to", - "slotId": "id of the slot to free" - } - }, - "getChallenge(bytes32)": { - "params": { - "id": "Slot's ID for which the challenge should be calculated" - }, - "returns": { - "_0": "Challenge for current Period that should be used for generation of proofs" - } - }, - "getPointer(bytes32)": { - "details": "For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)", - "params": { - "id": "Slot's ID for which the pointer should be calculated" - }, - "returns": { - "_0": "Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration." - } - }, - "isProofRequired(bytes32)": { - "params": { - "id": "Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned." - }, - "returns": { - "_0": "bool indicating if proof is required for current period" - } - }, - "missingProofs(bytes32)": { - "returns": { - "_0": "Number of missed proofs since Slot was Filled" - } - }, - "willProofBeRequired(bytes32)": { - "details": "for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)", - "params": { - "id": "SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned." - }, - "returns": { - "_0": "bool" - } - }, - "withdrawFunds(bytes32)": { - "details": "Request must be cancelled, failed or finished, and the transaction must originate from the depositor address.", - "params": { - "requestId": "the id of the request" - } - }, - "withdrawFunds(bytes32,address)": { - "details": "Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.", - "params": { - "requestId": "the id of the request", - "withdrawRecipient": "address to return the remaining funds to" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))": { - "notice": "Fills a slot. Reverts if an invalid proof of the slot data is provided." - }, - "freeSlot(bytes32)": { - "notice": "Frees a slot, paying out rewards and returning collateral for finished or cancelled requests to the host that has filled the slot." - }, - "freeSlot(bytes32,address,address)": { - "notice": "Frees a slot, paying out rewards and returning collateral for finished or cancelled requests." - }, - "willProofBeRequired(bytes32)": { - "notice": "Proof Downtime specifies part of the Period when the proof is not required even if the proof should be required. This function returns true if the pointer is in downtime (hence no proof required now) and at the same time the proof will be required later on in the Period." - }, - "withdrawFunds(bytes32)": { - "notice": "Withdraws remaining storage request funds back to the client that deposited them." - }, - "withdrawFunds(bytes32,address)": { - "notice": "Withdraws storage request funds to the provided address." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 10789, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_reservations", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_struct(AddressSet)6593_storage)" - }, - { - "astId": 10792, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "1", - "type": "t_struct(SlotReservationsConfig)6945_storage" - }, - { - "astId": 10009, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "2", - "type": "t_struct(ProofConfig)6942_storage" - }, - { - "astId": 10012, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_verifier", - "offset": 0, - "slot": "4", - "type": "t_contract(IGroth16Verifier)7138" - }, - { - "astId": 10049, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotStarts", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_uint64)" - }, - { - "astId": 10054, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missed", - "offset": 0, - "slot": "6", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_uint64)" - }, - { - "astId": 10062, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_received", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_mapping(t_userDefinedValueType(Period)9839,t_bool))" - }, - { - "astId": 10070, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missing", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_mapping(t_userDefinedValueType(Period)9839,t_bool))" - }, - { - "astId": 10949, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestsPerClient", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_address,t_struct(Bytes32Set)6459_storage)" - }, - { - "astId": 10954, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotsPerHost", - "offset": 0, - "slot": "10", - "type": "t_mapping(t_address,t_struct(Bytes32Set)6459_storage)" - }, - { - "astId": 7823, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "11", - "type": "t_struct(MarketplaceConfig)6921_storage" - }, - { - "astId": 7829, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requests", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_userDefinedValueType(RequestId)10598,t_struct(Request)10613_storage)" - }, - { - "astId": 7835, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestContexts", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_userDefinedValueType(RequestId)10598,t_struct(RequestContext)7859_storage)" - }, - { - "astId": 7841, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slots", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_userDefinedValueType(SlotId)10600,t_struct(Slot)7877_storage)" - }, - { - "astId": 7844, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_marketplaceTotals", - "offset": 0, - "slot": "19", - "type": "t_struct(MarketplaceTotals)9832_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_bytes32)dyn_storage": { - "base": "t_bytes32", - "encoding": "dynamic_array", - "label": "bytes32[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_contract(IGroth16Verifier)7138": { - "encoding": "inplace", - "label": "contract IGroth16Verifier", - "numberOfBytes": "20" - }, - "t_enum(RequestState)10639": { - "encoding": "inplace", - "label": "enum RequestState", - "numberOfBytes": "1" - }, - "t_enum(SlotState)10647": { - "encoding": "inplace", - "label": "enum SlotState", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_struct(Bytes32Set)6459_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.Bytes32Set)", - "numberOfBytes": "32", - "value": "t_struct(Bytes32Set)6459_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_userDefinedValueType(Period)9839,t_bool)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(Period)9839", - "label": "mapping(Periods.Period => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_userDefinedValueType(RequestId)10598,t_struct(Request)10613_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)10598", - "label": "mapping(RequestId => struct Request)", - "numberOfBytes": "32", - "value": "t_struct(Request)10613_storage" - }, - "t_mapping(t_userDefinedValueType(RequestId)10598,t_struct(RequestContext)7859_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)10598", - "label": "mapping(RequestId => struct Marketplace.RequestContext)", - "numberOfBytes": "32", - "value": "t_struct(RequestContext)7859_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)10600,t_mapping(t_userDefinedValueType(Period)9839,t_bool))": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)10600", - "label": "mapping(SlotId => mapping(Periods.Period => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_userDefinedValueType(Period)9839,t_bool)" - }, - "t_mapping(t_userDefinedValueType(SlotId)10600,t_struct(AddressSet)6593_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)10600", - "label": "mapping(SlotId => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)6593_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)10600,t_struct(Slot)7877_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)10600", - "label": "mapping(SlotId => struct Marketplace.Slot)", - "numberOfBytes": "32", - "value": "t_struct(Slot)7877_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)10600,t_uint64)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)10600", - "label": "mapping(SlotId => uint64)", - "numberOfBytes": "32", - "value": "t_uint64" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(AddressSet)6593_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 6592, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)6222_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Ask)10628_storage": { - "encoding": "inplace", - "label": "struct Ask", - "members": [ - { - "astId": 10615, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofProbability", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 10617, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "pricePerBytePerSecond", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 10619, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateralPerByte", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 10621, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slots", - "offset": 0, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 10623, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotSize", - "offset": 8, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 10625, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "duration", - "offset": 16, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 10627, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxSlotLoss", - "offset": 24, - "slot": "3", - "type": "t_uint64" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Bytes32Set)6459_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Bytes32Set", - "members": [ - { - "astId": 6458, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)6222_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(CollateralConfig)6931_storage": { - "encoding": "inplace", - "label": "struct CollateralConfig", - "members": [ - { - "astId": 6924, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "repairRewardPercentage", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 6926, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxNumberOfSlashes", - "offset": 1, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 6928, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slashPercentage", - "offset": 2, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 6930, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "validatorRewardPercentage", - "offset": 3, - "slot": "0", - "type": "t_uint8" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Content)10633_storage": { - "encoding": "inplace", - "label": "struct Content", - "members": [ - { - "astId": 10630, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "cid", - "offset": 0, - "slot": "0", - "type": "t_bytes_storage" - }, - { - "astId": 10632, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "merkleRoot", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_struct(MarketplaceConfig)6921_storage": { - "encoding": "inplace", - "label": "struct MarketplaceConfig", - "members": [ - { - "astId": 6912, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateral", - "offset": 0, - "slot": "0", - "type": "t_struct(CollateralConfig)6931_storage" - }, - { - "astId": 6915, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofs", - "offset": 0, - "slot": "1", - "type": "t_struct(ProofConfig)6942_storage" - }, - { - "astId": 6918, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "reservations", - "offset": 0, - "slot": "3", - "type": "t_struct(SlotReservationsConfig)6945_storage" - }, - { - "astId": 6920, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "requestDurationLimit", - "offset": 0, - "slot": "4", - "type": "t_uint64" - } - ], - "numberOfBytes": "160" - }, - "t_struct(MarketplaceTotals)9832_storage": { - "encoding": "inplace", - "label": "struct Marketplace.MarketplaceTotals", - "members": [ - { - "astId": 9829, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "received", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 9831, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "sent", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(ProofConfig)6942_storage": { - "encoding": "inplace", - "label": "struct ProofConfig", - "members": [ - { - "astId": 6933, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "period", - "offset": 0, - "slot": "0", - "type": "t_uint64" - }, - { - "astId": 6935, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "timeout", - "offset": 8, - "slot": "0", - "type": "t_uint64" - }, - { - "astId": 6937, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "downtime", - "offset": 16, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 6939, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "downtimeProduct", - "offset": 17, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 6941, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "zkeyHash", - "offset": 0, - "slot": "1", - "type": "t_string_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Request)10613_storage": { - "encoding": "inplace", - "label": "struct Request", - "members": [ - { - "astId": 10602, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "client", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 10605, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "ask", - "offset": 0, - "slot": "1", - "type": "t_struct(Ask)10628_storage" - }, - { - "astId": 10608, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "content", - "offset": 0, - "slot": "5", - "type": "t_struct(Content)10633_storage" - }, - { - "astId": 10610, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "expiry", - "offset": 0, - "slot": "7", - "type": "t_uint64" - }, - { - "astId": 10612, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "nonce", - "offset": 0, - "slot": "8", - "type": "t_bytes32" - } - ], - "numberOfBytes": "288" - }, - "t_struct(RequestContext)7859_storage": { - "encoding": "inplace", - "label": "struct Marketplace.RequestContext", - "members": [ - { - "astId": 7847, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(RequestState)10639" - }, - { - "astId": 7850, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "fundsToReturnToClient", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 7852, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotsFilled", - "offset": 0, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 7854, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "startedAt", - "offset": 8, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 7856, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "endsAt", - "offset": 16, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 7858, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "expiresAt", - "offset": 24, - "slot": "2", - "type": "t_uint64" - } - ], - "numberOfBytes": "96" - }, - "t_struct(Set)6222_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 6217, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 6221, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_positions", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Slot)7877_storage": { - "encoding": "inplace", - "label": "struct Marketplace.Slot", - "members": [ - { - "astId": 7862, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(SlotState)10647" - }, - { - "astId": 7865, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "requestId", - "offset": 0, - "slot": "1", - "type": "t_userDefinedValueType(RequestId)10598" - }, - { - "astId": 7868, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "filledAt", - "offset": 0, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 7870, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotIndex", - "offset": 8, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 7873, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "currentCollateral", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 7876, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "host", - "offset": 0, - "slot": "4", - "type": "t_address" - } - ], - "numberOfBytes": "160" - }, - "t_struct(SlotReservationsConfig)6945_storage": { - "encoding": "inplace", - "label": "struct SlotReservationsConfig", - "members": [ - { - "astId": 6944, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxReservations", - "offset": 0, - "slot": "0", - "type": "t_uint8" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint64": { - "encoding": "inplace", - "label": "uint64", - "numberOfBytes": "8" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - }, - "t_userDefinedValueType(Period)9839": { - "encoding": "inplace", - "label": "Periods.Period", - "numberOfBytes": "8" - }, - "t_userDefinedValueType(RequestId)10598": { - "encoding": "inplace", - "label": "RequestId", - "numberOfBytes": "32" - }, - "t_userDefinedValueType(SlotId)10600": { - "encoding": "inplace", - "label": "SlotId", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/TestToken.json b/deployments/codex_testnet/TestToken.json deleted file mode 100644 index f552180..0000000 --- a/deployments/codex_testnet/TestToken.json +++ /dev/null @@ -1,447 +0,0 @@ -{ - "address": "0x34a22f3911De437307c6f4485931779670f78764", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x2a8f752c0b33e552e18b5b31264e692f4ce777df274b0e4341f7a4198088bea1", - "receipt": { - "to": null, - "from": "0x3A39904B71595608524274BFD8c20FCfd9e77236", - "contractAddress": "0x34a22f3911De437307c6f4485931779670f78764", - "transactionIndex": 0, - "gasUsed": "669435", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x812c30b169b8986399c9d762a7a22ec64702ab019254e73f063b5358af31342c", - "transactionHash": "0x2a8f752c0b33e552e18b5b31264e692f4ce777df274b0e4341f7a4198088bea1", - "logs": [], - "blockNumber": 1269339, - "cumulativeGasUsed": "669435", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "c09963445d55f04ec1cd7dd500a29a55", - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TestToken.sol\":\"TestToken\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/TestToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.23;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestToken is ERC20 {\\n // solhint-disable-next-line no-empty-blocks\\n constructor() ERC20(\\\"TestToken\\\", \\\"TST\\\") {}\\n\\n function mint(address holder, uint256 amount) public {\\n _mint(holder, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5309533bbc28cb677cba8b08248622a4a5b413a6c9c94a17f3e698dfba318981\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051806040016040528060098152602001682a32b9ba2a37b5b2b760b91b815250604051806040016040528060038152602001621514d560ea1b815250816003908162000061919062000120565b50600462000070828262000120565b505050620001ec565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000a457607f821691505b602082108103620000c557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200011b576000816000526020600020601f850160051c81016020861015620000f65750805b601f850160051c820191505b81811015620001175782815560010162000102565b5050505b505050565b81516001600160401b038111156200013c576200013c62000079565b62000154816200014d84546200008f565b84620000cb565b602080601f8311600181146200018c5760008415620001735750858301515b600019600386901b1c1916600185901b17855562000117565b600085815260208120601f198616915b82811015620001bd578886015182559484019460019091019084016200019c565b5085821015620001dc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610a3c80620001fc6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610885565b60405180910390f35b61010a6101053660046108f0565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091a565b6102b2565b604051601281526020016100ee565b61010a61015c3660046108f0565b6102d6565b61017461016f3660046108f0565b610315565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610323565b61010a6101b53660046108f0565b610332565b61010a6101c83660046108f0565b6103e1565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ef565b60019150505b92915050565b6000336102c0858285610547565b6102cb8585856105d9565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a690829086906103109087906109e5565b6103ef565b61031f82826107c6565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102cb82868684036103ef565b6000336102a68185856105d9565b6001600160a01b03831661046a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166104e65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d357818110156105c65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103cb565b6105d384848484036103ef565b50505050565b6001600160a01b0383166106555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166106d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b038316600090815260208190526040902054818110156107605760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d3565b6001600160a01b03821661081c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103cb565b806002600082825461082e91906109e5565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60006020808352835180602085015260005b818110156108b357858101830151858201604001528201610897565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146108eb57600080fd5b919050565b6000806040838503121561090357600080fd5b61090c836108d4565b946020939093013593505050565b60008060006060848603121561092f57600080fd5b610938846108d4565b9250610946602085016108d4565b9150604084013590509250925092565b60006020828403121561096857600080fd5b610971826108d4565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d4565b91506109a2602084016108d4565b90509250929050565b600181811c908216806109bf57607f821691505b6020821081036109df57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156102ac57634e487b7160e01b600052601160045260246000fdfea26469706673582212204eafe4550d61bb2fcf0857f2ebf845a3221c02c92b6ca8c325f21def0c0b324564736f6c63430008170033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610885565b60405180910390f35b61010a6101053660046108f0565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091a565b6102b2565b604051601281526020016100ee565b61010a61015c3660046108f0565b6102d6565b61017461016f3660046108f0565b610315565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610323565b61010a6101b53660046108f0565b610332565b61010a6101c83660046108f0565b6103e1565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ef565b60019150505b92915050565b6000336102c0858285610547565b6102cb8585856105d9565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a690829086906103109087906109e5565b6103ef565b61031f82826107c6565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102cb82868684036103ef565b6000336102a68185856105d9565b6001600160a01b03831661046a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166104e65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d357818110156105c65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103cb565b6105d384848484036103ef565b50505050565b6001600160a01b0383166106555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166106d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b038316600090815260208190526040902054818110156107605760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d3565b6001600160a01b03821661081c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103cb565b806002600082825461082e91906109e5565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b60006020808352835180602085015260005b818110156108b357858101830151858201604001528201610897565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146108eb57600080fd5b919050565b6000806040838503121561090357600080fd5b61090c836108d4565b946020939093013593505050565b60008060006060848603121561092f57600080fd5b610938846108d4565b9250610946602085016108d4565b9150604084013590509250925092565b60006020828403121561096857600080fd5b610971826108d4565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d4565b91506109a2602084016108d4565b90509250929050565b600181811c908216806109bf57607f821691505b6020821081036109df57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156102ac57634e487b7160e01b600052601160045260246000fdfea26469706673582212204eafe4550d61bb2fcf0857f2ebf845a3221c02c92b6ca8c325f21def0c0b324564736f6c63430008170033", - "devdoc": { - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." - } - }, - "kind": "dev", - "methods": { - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/063703ecb615b883c30155e6265b09d5.json b/deployments/codex_testnet/solcInputs/063703ecb615b883c30155e6265b09d5.json deleted file mode 100644 index 7afa8c2..0000000 --- a/deployments/codex_testnet/solcInputs/063703ecb615b883c30155e6265b09d5.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" - }, - "@openzeppelin/contracts/interfaces/IERC1363.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n /*\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n * 0xb0202a11 ===\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n */\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @param data Additional data with no specified format, sent in call to `spender`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/interfaces/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" - }, - "@openzeppelin/contracts/interfaces/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" - }, - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * Both values are immutable: they can only be set once during construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Skips emitting an {Approval} event indicating an allowance update. This is not\n * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n *\n * ```solidity\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance < type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n /**\n * @dev An operation with an ERC-20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n */\n function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n */\n function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n *\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n * set here.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n safeTransfer(token, to, value);\n } else if (!token.transferAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferFromAndCallRelaxed(\n IERC1363 token,\n address from,\n address to,\n uint256 value,\n bytes memory data\n ) internal {\n if (to.code.length == 0) {\n safeTransferFrom(token, from, to, value);\n } else if (!token.transferFromAndCall(from, to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n * once without retrying, and relies on the returned value to be true.\n *\n * Reverts if the returned value is other than `true`.\n */\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n forceApprove(token, to, value);\n } else if (!token.approveAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n // bubble errors\n if iszero(success) {\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize())\n revert(ptr, returndatasize())\n }\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n bool success;\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Arrays.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Arrays.sol)\n// This file was procedurally generated from scripts/generate/templates/Arrays.js.\n\npragma solidity ^0.8.20;\n\nimport {Comparators} from \"./Comparators.sol\";\nimport {SlotDerivation} from \"./SlotDerivation.sol\";\nimport {StorageSlot} from \"./StorageSlot.sol\";\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary Arrays {\n using SlotDerivation for bytes32;\n using StorageSlot for bytes32;\n\n /**\n * @dev Sort an array of uint256 (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n uint256[] memory array,\n function(uint256, uint256) pure returns (bool) comp\n ) internal pure returns (uint256[] memory) {\n _quickSort(_begin(array), _end(array), comp);\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of uint256 in increasing order.\n */\n function sort(uint256[] memory array) internal pure returns (uint256[] memory) {\n sort(array, Comparators.lt);\n return array;\n }\n\n /**\n * @dev Sort an array of address (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n address[] memory array,\n function(address, address) pure returns (bool) comp\n ) internal pure returns (address[] memory) {\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of address in increasing order.\n */\n function sort(address[] memory array) internal pure returns (address[] memory) {\n sort(_castToUint256Array(array), Comparators.lt);\n return array;\n }\n\n /**\n * @dev Sort an array of bytes32 (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n bytes32[] memory array,\n function(bytes32, bytes32) pure returns (bool) comp\n ) internal pure returns (bytes32[] memory) {\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of bytes32 in increasing order.\n */\n function sort(bytes32[] memory array) internal pure returns (bytes32[] memory) {\n sort(_castToUint256Array(array), Comparators.lt);\n return array;\n }\n\n /**\n * @dev Performs a quick sort of a segment of memory. The segment sorted starts at `begin` (inclusive), and stops\n * at end (exclusive). Sorting follows the `comp` comparator.\n *\n * Invariant: `begin <= end`. This is the case when initially called by {sort} and is preserved in subcalls.\n *\n * IMPORTANT: Memory locations between `begin` and `end` are not validated/zeroed. This function should\n * be used only if the limits are within a memory array.\n */\n function _quickSort(uint256 begin, uint256 end, function(uint256, uint256) pure returns (bool) comp) private pure {\n unchecked {\n if (end - begin < 0x40) return;\n\n // Use first element as pivot\n uint256 pivot = _mload(begin);\n // Position where the pivot should be at the end of the loop\n uint256 pos = begin;\n\n for (uint256 it = begin + 0x20; it < end; it += 0x20) {\n if (comp(_mload(it), pivot)) {\n // If the value stored at the iterator's position comes before the pivot, we increment the\n // position of the pivot and move the value there.\n pos += 0x20;\n _swap(pos, it);\n }\n }\n\n _swap(begin, pos); // Swap pivot into place\n _quickSort(begin, pos, comp); // Sort the left side of the pivot\n _quickSort(pos + 0x20, end, comp); // Sort the right side of the pivot\n }\n }\n\n /**\n * @dev Pointer to the memory location of the first element of `array`.\n */\n function _begin(uint256[] memory array) private pure returns (uint256 ptr) {\n assembly (\"memory-safe\") {\n ptr := add(array, 0x20)\n }\n }\n\n /**\n * @dev Pointer to the memory location of the first memory word (32bytes) after `array`. This is the memory word\n * that comes just after the last element of the array.\n */\n function _end(uint256[] memory array) private pure returns (uint256 ptr) {\n unchecked {\n return _begin(array) + array.length * 0x20;\n }\n }\n\n /**\n * @dev Load memory word (as a uint256) at location `ptr`.\n */\n function _mload(uint256 ptr) private pure returns (uint256 value) {\n assembly {\n value := mload(ptr)\n }\n }\n\n /**\n * @dev Swaps the elements memory location `ptr1` and `ptr2`.\n */\n function _swap(uint256 ptr1, uint256 ptr2) private pure {\n assembly {\n let value1 := mload(ptr1)\n let value2 := mload(ptr2)\n mstore(ptr1, value2)\n mstore(ptr2, value1)\n }\n }\n\n /// @dev Helper: low level cast address memory array to uint256 memory array\n function _castToUint256Array(address[] memory input) private pure returns (uint256[] memory output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast bytes32 memory array to uint256 memory array\n function _castToUint256Array(bytes32[] memory input) private pure returns (uint256[] memory output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast address comp function to uint256 comp function\n function _castToUint256Comp(\n function(address, address) pure returns (bool) input\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast bytes32 comp function to uint256 comp function\n function _castToUint256Comp(\n function(bytes32, bytes32) pure returns (bool) input\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n assembly {\n output := input\n }\n }\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * NOTE: The `array` is expected to be sorted in ascending order, and to\n * contain no repeated elements.\n *\n * IMPORTANT: Deprecated. This implementation behaves as {lowerBound} but lacks\n * support for repeated elements in the array. The {lowerBound} function should\n * be used instead.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Searches an `array` sorted in ascending order and returns the first\n * index that contains a value greater or equal than `element`. If no such index\n * exists (i.e. all values in the array are strictly less than `element`), the array\n * length is returned. Time complexity O(log n).\n *\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/lower_bound[lower_bound].\n */\n function lowerBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value < element) {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n } else {\n high = mid;\n }\n }\n\n return low;\n }\n\n /**\n * @dev Searches an `array` sorted in ascending order and returns the first\n * index that contains a value strictly greater than `element`. If no such index\n * exists (i.e. all values in the array are strictly less than `element`), the array\n * length is returned. Time complexity O(log n).\n *\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/upper_bound[upper_bound].\n */\n function upperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n }\n }\n\n return low;\n }\n\n /**\n * @dev Same as {lowerBound}, but with an array in memory.\n */\n function lowerBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeMemoryAccess(array, mid) < element) {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n } else {\n high = mid;\n }\n }\n\n return low;\n }\n\n /**\n * @dev Same as {upperBound}, but with an array in memory.\n */\n function upperBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeMemoryAccess(array, mid) > element) {\n high = mid;\n } else {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n }\n }\n\n return low;\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getUint256Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(bytes32[] memory arr, uint256 pos) internal pure returns (bytes32 res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(address[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(bytes32[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(uint256[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Comparators.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Comparators.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides a set of functions to compare values.\n *\n * _Available since v5.1._\n */\nlibrary Comparators {\n function lt(uint256 a, uint256 b) internal pure returns (bool) {\n return a < b;\n }\n\n function gt(uint256 a, uint256 b) internal pure returns (bool) {\n return a > b;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Return the 512-bit addition of two uint256.\n *\n * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n */\n function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n assembly (\"memory-safe\") {\n low := add(a, b)\n high := lt(low, a)\n }\n }\n\n /**\n * @dev Return the 512-bit multiplication of two uint256.\n *\n * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n */\n function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = high * 2²⁵⁶ + low.\n assembly (\"memory-safe\") {\n let mm := mulmod(a, b, not(0))\n low := mul(a, b)\n high := sub(sub(mm, low), lt(mm, low))\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n success = c >= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a - b;\n success = c <= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a * b;\n assembly (\"memory-safe\") {\n // Only true when the multiplication doesn't overflow\n // (c / a == b) || (a == 0)\n success := or(eq(div(c, a), b), iszero(a))\n }\n // equivalent to: success ? c : 0\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `DIV` opcode returns zero when the denominator is 0.\n result := div(a, b)\n }\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `MOD` opcode returns zero when the denominator is 0.\n result := mod(a, b)\n }\n }\n }\n\n /**\n * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryAdd(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n */\n function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n (, uint256 result) = trySub(a, b);\n return result;\n }\n\n /**\n * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryMul(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n\n // Handle non-overflow cases, 256 by 256 division.\n if (high == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return low / denominator;\n }\n\n // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n if (denominator <= high) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [high low].\n uint256 remainder;\n assembly (\"memory-safe\") {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n high := sub(high, gt(remainder, low))\n low := sub(low, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly (\"memory-safe\") {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [high low] by twos.\n low := div(low, twos)\n\n // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from high into low.\n low |= high * twos;\n\n // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n // is no longer required.\n result = low * inverse;\n return result;\n }\n }\n\n /**\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n */\n function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n if (high >= 1 << n) {\n Panic.panic(Panic.UNDER_OVERFLOW);\n }\n return (high << (256 - n)) | (low >> n);\n }\n }\n\n /**\n * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n */\n function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // If upper 8 bits of 16-bit half set, add 8 to result\n r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n // If upper 4 bits of 8-bit half set, add 4 to result\n r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n // Shifts value right by the current result and use it as an index into this lookup table:\n //\n // | x (4 bits) | index | table[index] = MSB position |\n // |------------|---------|-----------------------------|\n // | 0000 | 0 | table[0] = 0 |\n // | 0001 | 1 | table[1] = 0 |\n // | 0010 | 2 | table[2] = 1 |\n // | 0011 | 3 | table[3] = 1 |\n // | 0100 | 4 | table[4] = 2 |\n // | 0101 | 5 | table[5] = 2 |\n // | 0110 | 6 | table[6] = 2 |\n // | 0111 | 7 | table[7] = 2 |\n // | 1000 | 8 | table[8] = 3 |\n // | 1001 | 9 | table[9] = 3 |\n // | 1010 | 10 | table[10] = 3 |\n // | 1011 | 11 | table[11] = 3 |\n // | 1100 | 12 | table[12] = 3 |\n // | 1101 | 13 | table[13] = 3 |\n // | 1110 | 14 | table[14] = 3 |\n // | 1111 | 15 | table[15] = 3 |\n //\n // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n assembly (\"memory-safe\") {\n r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n }\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Panic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n bool private _paused;\n\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n /**\n * @dev The operation failed because the contract is paused.\n */\n error EnforcedPause();\n\n /**\n * @dev The operation failed because the contract is not paused.\n */\n error ExpectedPause();\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n if (paused()) {\n revert EnforcedPause();\n }\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n if (!paused()) {\n revert ExpectedPause();\n }\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/utils/SlotDerivation.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/SlotDerivation.sol)\n// This file was procedurally generated from scripts/generate/templates/SlotDerivation.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for computing storage (and transient storage) locations from namespaces and deriving slots\n * corresponding to standard patterns. The derivation method for array and mapping matches the storage layout used by\n * the solidity language / compiler.\n *\n * See https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays[Solidity docs for mappings and dynamic arrays.].\n *\n * Example usage:\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using StorageSlot for bytes32;\n * using SlotDerivation for bytes32;\n *\n * // Declare a namespace\n * string private constant _NAMESPACE = \"\"; // eg. OpenZeppelin.Slot\n *\n * function setValueInNamespace(uint256 key, address newValue) internal {\n * _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value = newValue;\n * }\n *\n * function getValueInNamespace(uint256 key) internal view returns (address) {\n * return _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {StorageSlot}.\n *\n * NOTE: This library provides a way to manipulate storage locations in a non-standard way. Tooling for checking\n * upgrade safety will ignore the slots accessed through this library.\n *\n * _Available since v5.1._\n */\nlibrary SlotDerivation {\n /**\n * @dev Derive an ERC-7201 slot from a string (namespace).\n */\n function erc7201Slot(string memory namespace) internal pure returns (bytes32 slot) {\n assembly (\"memory-safe\") {\n mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1))\n slot := and(keccak256(0x00, 0x20), not(0xff))\n }\n }\n\n /**\n * @dev Add an offset to a slot to get the n-th element of a structure or an array.\n */\n function offset(bytes32 slot, uint256 pos) internal pure returns (bytes32 result) {\n unchecked {\n return bytes32(uint256(slot) + pos);\n }\n }\n\n /**\n * @dev Derive the location of the first element in an array from the slot where the length is stored.\n */\n function deriveArray(bytes32 slot) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, slot)\n result := keccak256(0x00, 0x20)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, address key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, and(key, shr(96, not(0))))\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bool key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, iszero(iszero(key)))\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bytes32 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, uint256 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, int256 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, string memory key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n let length := mload(key)\n let begin := add(key, 0x20)\n let end := add(begin, length)\n let cache := mload(end)\n mstore(end, slot)\n result := keccak256(begin, add(length, 0x20))\n mstore(end, cache)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bytes memory key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n let length := mload(key)\n let begin := add(key, 0x20)\n let end := add(begin, length)\n let cache := mload(end)\n mstore(end, slot)\n result := keccak256(begin, add(length, 0x20))\n mstore(end, cache)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.20;\n\nimport {Arrays} from \"../Arrays.sol\";\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n * - Set can be cleared (all elements removed) in O(n).\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value => uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function _clear(Set storage set) private {\n uint256 len = _length(set);\n for (uint256 i = 0; i < len; ++i) {\n delete set._positions[set._values[i]];\n }\n Arrays.unsafeSetLength(set._values, 0);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(Bytes32Set storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(AddressSet storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(UintSet storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n uint64 requestDurationLimit;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20),\n 60 * 60 * 24 * 30 // 30 days\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_ProofNotSubmittedByHost();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n error Marketplace_DurationExceedsLimit();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0)) {\n revert Marketplace_RequestAlreadyExists();\n }\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n if (request.ask.duration > _config.requestDurationLimit) {\n revert Marketplace_DurationExceedsLimit();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n\n if (msg.sender != slot.host) {\n revert Marketplace_ProofNotSubmittedByHost();\n }\n\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n assert(_token.transfer(msg.sender, validatorRewardAmount));\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n _reservations[slotId].clear(); // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return _requestContexts[requestId].endsAt;\n }\n if (state == RequestState.Cancelled) {\n return _requestContexts[requestId].expiresAt;\n }\n return\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(\n SlotId slotId\n ) public view override(Proofs, SlotReservations) returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n SlotState state = slotState(slotId);\n return\n // TODO: add in check for address inside of expanding window\n (state == SlotState.Free || state == SlotState.Repair) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - }, - "contracts/Vault.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Pausable.sol\";\nimport \"./vault/VaultBase.sol\";\n\n/// A vault provides a means for smart contracts to control allocation of ERC20\n/// tokens without the need to hold the ERC20 tokens themselves, thereby\n/// decreasing their own attack surface.\n///\n/// A vault keeps track of funds for a smart contract. This smart contract is\n/// called the controller of the funds. Each controller has its own independent\n/// set of funds. Each fund has a number of accounts.\n///\n/// Vault -> Controller -> Fund -> Account\n///\n/// Funds are identified by a unique 32 byte identifier, chosen by the\n/// controller.\n///\n/// An account has a balance, of which a part can be designated. Designated\n/// tokens can no longer be transfered to another account, although they can be\n/// burned.\n/// Accounts are identified by the address of the account holder, and an id that\n/// can be used to create different accounts for the same holder.\n///\n/// A typical flow in which a controller uses the vault to handle funds:\n/// 1. the controller chooses a unique id for the fund\n/// 2. the controller locks the fund for an amount of time\n/// 3. the controller deposits ERC20 tokens into the fund\n/// 4. the controller transfers tokens between accounts in the fund\n/// 5. the fund unlocks after a while, freezing the account balances\n/// 6. the controller withdraws ERC20 tokens from the fund for an account holder,\n/// or the account holder initiates the withdrawal itself\n///\n/// The vault makes it harder for an attacker to extract funds, through several\n/// mechanisms:\n/// - tokens in a fund can only be reassigned while the fund is time-locked, and\n/// only be withdrawn after the lock unlocks, delaying an attacker's attempt\n/// at extraction of tokens from the vault\n/// - tokens in a fund can not be reassigned when the lock unlocks, ensuring\n/// that they can no longer be reassigned to an attacker\n/// - when storing collateral, it can be designated for the collateral provider,\n/// ensuring that it cannot be reassigned to an attacker\n/// - malicious upgrades to a fund controller cannot prevent account holders\n/// from withdrawing their tokens\n/// - burning tokens in a fund ensures that these tokens can no longer be\n/// extracted by an attacker\n///\ncontract Vault is VaultBase, Pausable, Ownable {\n constructor(IERC20 token) VaultBase(token) Ownable(msg.sender) {}\n\n /// Creates an account id that encodes the address of the account holder, and\n /// a discriminator. The discriminator can be used to create different\n /// accounts within a fund that all belong to the same account holder.\n function encodeAccountId(\n address holder,\n bytes12 discriminator\n ) public pure returns (AccountId) {\n return Accounts.encodeId(holder, discriminator);\n }\n\n /// Extracts the address of the account holder and the discriminator from the\n /// account id.\n function decodeAccountId(\n AccountId id\n ) public pure returns (address holder, bytes12 discriminator) {\n return Accounts.decodeId(id);\n }\n\n /// The amount of tokens that are currently in an account.\n /// This includes available and designated tokens. Available tokens can be\n /// transfered to other accounts, but designated tokens cannot.\n function getBalance(\n FundId fundId,\n AccountId accountId\n ) public view returns (uint128) {\n Controller controller = Controller.wrap(msg.sender);\n Balance memory balance = _getBalance(controller, fundId, accountId);\n return balance.available + balance.designated;\n }\n\n /// The amount of tokens that are currently designated in an account\n /// These tokens can no longer be transfered to other accounts.\n function getDesignatedBalance(\n FundId fundId,\n AccountId accountId\n ) public view returns (uint128) {\n Controller controller = Controller.wrap(msg.sender);\n Balance memory balance = _getBalance(controller, fundId, accountId);\n return balance.designated;\n }\n\n /// Returns the status of the fund. Most operations on the vault can only be\n /// done by the controller when the funds are locked. Withdrawals can only be\n /// done in the withdrawing state.\n function getFundStatus(FundId fundId) public view returns (FundStatus) {\n Controller controller = Controller.wrap(msg.sender);\n return _getFundStatus(controller, fundId);\n }\n\n /// Returns the expiry time of the lock on the fund. A locked fund unlocks\n /// automatically at this timestamp.\n function getLockExpiry(FundId fundId) public view returns (Timestamp) {\n Controller controller = Controller.wrap(msg.sender);\n return _getLockExpiry(controller, fundId);\n }\n\n /// Locks the fund until the expiry timestamp. The lock expiry can be extended\n /// later, but no more than the maximum timestamp.\n function lock(\n FundId fundId,\n Timestamp expiry,\n Timestamp maximum\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _lock(controller, fundId, expiry, maximum);\n }\n\n /// Delays unlocking of a locked fund. The new expiry should be later than\n /// the existing expiry, but no later than the maximum timestamp that was\n /// provided when locking the fund.\n /// Only allowed when the lock has not unlocked yet.\n function extendLock(FundId fundId, Timestamp expiry) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _extendLock(controller, fundId, expiry);\n }\n\n /// Deposits an amount of tokens into the vault, and adds them to the balance\n /// of the account. ERC20 tokens are transfered from the caller to the vault\n /// contract.\n /// Only allowed when the fund is locked.\n function deposit(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _deposit(controller, fundId, accountId, amount);\n }\n\n /// Takes an amount of tokens from the account balance and designates them\n /// for the account holder. These tokens are no longer available to be\n /// transfered to other accounts.\n /// Only allowed when the fund is locked.\n function designate(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _designate(controller, fundId, accountId, amount);\n }\n\n /// Transfers an amount of tokens from one account to the other.\n /// Only allowed when the fund is locked.\n function transfer(\n FundId fundId,\n AccountId from,\n AccountId to,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _transfer(controller, fundId, from, to, amount);\n }\n\n /// Transfers tokens from one account the other over time.\n /// Every second a number of tokens are transfered, until the fund is\n /// unlocked. After flowing into an account, these tokens become designated\n /// tokens, so they cannot be transfered again.\n /// Only allowed when the fund is locked.\n /// Only allowed when the balance is sufficient to sustain the flow until the\n /// fund unlocks, even if the lock expiry time is extended to its maximum.\n function flow(\n FundId fundId,\n AccountId from,\n AccountId to,\n TokensPerSecond rate\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _flow(controller, fundId, from, to, rate);\n }\n\n /// Burns an amount of designated tokens from the account.\n /// Only allowed when the fund is locked.\n function burnDesignated(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _burnDesignated(controller, fundId, accountId, amount);\n }\n\n /// Burns all tokens from the account.\n /// Only allowed when the fund is locked.\n /// Only allowed when no funds are flowing into or out of the account.\n function burnAccount(\n FundId fundId,\n AccountId accountId\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _burnAccount(controller, fundId, accountId);\n }\n\n /// Freezes a fund. Stops all tokens flows and disallows any operations on the\n /// fund until it unlocks.\n /// Only allowed when the fund is locked.\n function freezeFund(FundId fundId) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _freezeFund(controller, fundId);\n }\n\n /// Transfers all ERC20 tokens in the account out of the vault to the account\n /// owner.\n /// Only allowed when the fund is unlocked.\n /// ⚠️ The account holder can also withdraw itself, so when designing a smart\n /// contract that controls funds in the vault, don't assume that only this\n /// smart contract can initiate a withdrawal ⚠️\n function withdraw(FundId fund, AccountId accountId) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _withdraw(controller, fund, accountId);\n }\n\n /// Allows an account holder to withdraw its tokens from a fund directly,\n /// bypassing the need to ask the controller of the fund to initiate the\n /// withdrawal.\n /// Only allowed when the fund is unlocked.\n function withdrawByRecipient(\n Controller controller,\n FundId fund,\n AccountId accountId\n ) public {\n (address holder, ) = Accounts.decodeId(accountId);\n require(msg.sender == holder, VaultOnlyAccountHolder());\n _withdraw(controller, fund, accountId);\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n error VaultOnlyAccountHolder();\n}\n" - }, - "contracts/vault/Accounts.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./TokenFlows.sol\";\nimport \"./Timestamps.sol\";\n\n/// Used to identify an account. The first 20 bytes consist of the address of\n/// the account holder, and the last 12 bytes consist of a discriminator value.\ntype AccountId is bytes32;\n\n/// Records the token balance and the incoming and outgoing token flows\nstruct Account {\n Balance balance;\n Flow flow;\n}\n\n/// The account balance. Fits in 32 bytes to minimize storage costs.\n/// A uint128 is used to record the amount of tokens, which should be more than\n/// enough. Given a standard 18 decimal places for the ERC20 token, this still\n/// allows for 10^20 whole coins.\nstruct Balance {\n /// Available tokens can be transfered\n uint128 available;\n /// Designated tokens can no longer be transfered\n uint128 designated;\n}\n\n/// The incoming and outgoing flows of an account. Fits in 32 bytes to minimize\n/// storage costs.\nstruct Flow {\n /// Rate of outgoing tokens\n TokensPerSecond outgoing;\n /// Rate of incoming tokens\n TokensPerSecond incoming;\n /// Last time that the flow was updated\n Timestamp updated;\n}\n\nlibrary Accounts {\n using Accounts for Account;\n using TokenFlows for TokensPerSecond;\n using Timestamps for Timestamp;\n\n /// Creates an account id from the account holder address and a discriminator.\n /// The discriminiator can be used to create different accounts that belong to\n /// the same account holder.\n function encodeId(\n address holder,\n bytes12 discriminator\n ) internal pure returns (AccountId) {\n bytes32 left = bytes32(bytes20(holder));\n bytes32 right = bytes32(uint256(uint96(discriminator)));\n return AccountId.wrap(left | right);\n }\n\n /// Extracts the account holder and the discriminator from the the account id\n function decodeId(AccountId id) internal pure returns (address, bytes12) {\n bytes32 unwrapped = AccountId.unwrap(id);\n address holder = address(bytes20(unwrapped));\n bytes12 discriminator = bytes12(uint96(uint256(unwrapped)));\n return (holder, discriminator);\n }\n\n /// Calculates whether the available balance is sufficient to sustain the\n /// outgoing flow of tokens until the specified timestamp\n function isSolventAt(\n Account memory account,\n Timestamp timestamp\n ) internal pure returns (bool) {\n Duration duration = account.flow.updated.until(timestamp);\n uint128 outgoing = account.flow.outgoing.accumulate(duration);\n return outgoing <= account.balance.available;\n }\n\n /// Updates the available and designated balances by accumulating the\n /// outgoing and incoming flows up until the specified timestamp. Outgoing\n /// tokens are deducted from the available balance. Incoming tokens are added\n /// to the designated tokens.\n function accumulateFlows(\n Account memory account,\n Timestamp timestamp\n ) internal pure {\n Duration duration = account.flow.updated.until(timestamp);\n account.balance.available -= account.flow.outgoing.accumulate(duration);\n account.balance.designated += account.flow.incoming.accumulate(duration);\n account.flow.updated = timestamp;\n }\n\n /// Starts an incoming flow of tokens at the specified rate. If there already\n /// is a flow of incoming tokens, then its rate is increased accordingly.\n function flowIn(Account memory account, TokensPerSecond rate) internal view {\n account.accumulateFlows(Timestamps.currentTime());\n account.flow.incoming = account.flow.incoming + rate;\n }\n\n /// Starts an outgoing flow of tokens at the specified rate. If there is\n /// already a flow of incoming tokens, then these are used to pay for the\n /// outgoing flow. If there are insuffient incoming tokens, then the outgoing\n /// rate is increased.\n function flowOut(Account memory account, TokensPerSecond rate) internal view {\n account.accumulateFlows(Timestamps.currentTime());\n if (rate <= account.flow.incoming) {\n account.flow.incoming = account.flow.incoming - rate;\n } else {\n account.flow.outgoing = account.flow.outgoing + rate;\n account.flow.outgoing = account.flow.outgoing - account.flow.incoming;\n account.flow.incoming = TokensPerSecond.wrap(0);\n }\n }\n}\n" - }, - "contracts/vault/Funds.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Timestamps.sol\";\n\nstruct Fund {\n /// The time-lock unlocks at this time\n Timestamp lockExpiry;\n /// The lock expiry can be extended no further than this\n Timestamp lockMaximum;\n /// Indicates whether fund is frozen, and at what time\n Timestamp frozenAt;\n}\n\n/// A fund can go through the following states:\n///\n/// --> Inactive ---> Locked -----> Withdrawing\n/// \\ ^\n/// \\ /\n/// --> Frozen --\n///\nenum FundStatus {\n /// Indicates that the fund is inactive and contains no tokens. This is the\n /// initial state.\n Inactive,\n /// Indicates that a time-lock is set and withdrawing tokens is not allowed. A\n /// fund needs to be locked for deposits, transfers, flows and burning to be\n /// allowed.\n Locked,\n /// Indicates that a locked fund is frozen. Flows have stopped, nothing is\n /// allowed until the fund unlocks.\n Frozen,\n /// Indicates the fund has unlocked and withdrawing is allowed. Other\n /// operations are no longer allowed.\n Withdrawing\n}\n\nlibrary Funds {\n function status(Fund memory fund) internal view returns (FundStatus) {\n if (Timestamps.currentTime() < fund.lockExpiry) {\n if (fund.frozenAt != Timestamp.wrap(0)) {\n return FundStatus.Frozen;\n }\n return FundStatus.Locked;\n }\n if (fund.lockMaximum == Timestamp.wrap(0)) {\n return FundStatus.Inactive;\n }\n return FundStatus.Withdrawing;\n }\n\n function flowEnd(Fund memory fund) internal pure returns (Timestamp) {\n if (fund.frozenAt != Timestamp.wrap(0)) {\n return fund.frozenAt;\n }\n return fund.lockExpiry;\n }\n}\n" - }, - "contracts/vault/Timestamps.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\n/// Represents a moment in time, represented as unix time (number of seconds\n/// since 1970). Uses a uint40 to facilitate efficient packing in structs. A\n/// uint40 allows times to be represented for the coming 30 000 years.\ntype Timestamp is uint40;\n/// Represents a duration of time in seconds\ntype Duration is uint40;\n\nusing {_timestampEquals as ==} for Timestamp global;\nusing {_timestampNotEqual as !=} for Timestamp global;\nusing {_timestampLessThan as <} for Timestamp global;\nusing {_timestampAtMost as <=} for Timestamp global;\n\nfunction _timestampEquals(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) == Timestamp.unwrap(b);\n}\n\nfunction _timestampNotEqual(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) != Timestamp.unwrap(b);\n}\n\nfunction _timestampLessThan(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) < Timestamp.unwrap(b);\n}\n\nfunction _timestampAtMost(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) <= Timestamp.unwrap(b);\n}\n\nlibrary Timestamps {\n /// Returns the current block timestamp converted to a Timestamp type\n function currentTime() internal view returns (Timestamp) {\n return Timestamp.wrap(uint40(block.timestamp));\n }\n\n /// Calculates the duration from start until end\n function until(\n Timestamp start,\n Timestamp end\n ) internal pure returns (Duration) {\n return Duration.wrap(Timestamp.unwrap(end) - Timestamp.unwrap(start));\n }\n}\n" - }, - "contracts/vault/TokenFlows.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Timestamps.sol\";\n\n/// Represents a flow of tokens. Uses a uint96 to represent the flow rate, which\n/// should be more than enough. Given a standard 18 decimal places for the\n/// ERC20 token, this still allows for a rate of 10^10 whole coins per second.\ntype TokensPerSecond is uint96;\n\nusing {_tokensPerSecondMinus as -} for TokensPerSecond global;\nusing {_tokensPerSecondPlus as +} for TokensPerSecond global;\nusing {_tokensPerSecondEquals as ==} for TokensPerSecond global;\nusing {_tokensPerSecondAtMost as <=} for TokensPerSecond global;\n\nfunction _tokensPerSecondMinus(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (TokensPerSecond) {\n return\n TokensPerSecond.wrap(TokensPerSecond.unwrap(a) - TokensPerSecond.unwrap(b));\n}\n\nfunction _tokensPerSecondPlus(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (TokensPerSecond) {\n return\n TokensPerSecond.wrap(TokensPerSecond.unwrap(a) + TokensPerSecond.unwrap(b));\n}\n\nfunction _tokensPerSecondEquals(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (bool) {\n return TokensPerSecond.unwrap(a) == TokensPerSecond.unwrap(b);\n}\n\nfunction _tokensPerSecondAtMost(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (bool) {\n return TokensPerSecond.unwrap(a) <= TokensPerSecond.unwrap(b);\n}\n\nlibrary TokenFlows {\n /// Calculates how many tokens are accumulated when a token flow is maintained\n /// for a duration of time.\n function accumulate(\n TokensPerSecond rate,\n Duration duration\n ) internal pure returns (uint128) {\n return uint128(TokensPerSecond.unwrap(rate)) * Duration.unwrap(duration);\n }\n}\n" - }, - "contracts/vault/VaultBase.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"./Accounts.sol\";\nimport \"./Funds.sol\";\n\n/// Records account balances and token flows. Accounts are separated into funds.\n/// Funds are kept separate between controllers.\n///\n/// A fund can only be manipulated by a controller when it is locked. Tokens can\n/// only be withdrawn when a fund is unlocked.\n///\n/// The vault maintains a number of invariants to ensure its integrity.\n///\n/// The lock invariant ensures that there is a maximum time that a fund can be\n/// locked:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId:\n/// fund.lockExpiry <= fund.lockMaximum\n/// where fund = _funds[controller][fundId])\n///\n/// The account invariant ensures that the outgoing token flow can be sustained\n/// for the maximum time that a fund can be locked:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId, accountId ∈ AccountId:\n/// flow.outgoing * (fund.lockMaximum - flow.updated) <= balance.available\n/// where fund = _funds[controller][fundId])\n/// and flow = _accounts[controller][fundId][accountId].flow\n/// and balance = _accounts[controller][fundId][accountId].balance\n///\n/// The flow invariant ensures that incoming and outgoing flow rates match:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId:\n/// (∑ accountId ∈ AccountId: accounts[accountId].flow.incoming) =\n/// (∑ accountId ∈ AccountId: accounts[accountId].flow.outgoing)\n/// where accounts = _accounts[controller][fundId])\n///\nabstract contract VaultBase {\n using SafeERC20 for IERC20;\n using Accounts for Account;\n using Funds for Fund;\n\n IERC20 internal immutable _token;\n\n /// Represents a smart contract that can redistribute and burn tokens in funds\n type Controller is address;\n /// Unique identifier for a fund, chosen by the controller\n type FundId is bytes32;\n\n /// Each controller has its own set of funds\n mapping(Controller => mapping(FundId => Fund)) private _funds;\n /// Each account holder has its own set of accounts in a fund\n mapping(Controller => mapping(FundId => mapping(AccountId => Account)))\n private _accounts;\n\n constructor(IERC20 token) {\n _token = token;\n }\n\n function _getFundStatus(\n Controller controller,\n FundId fundId\n ) internal view returns (FundStatus) {\n return _funds[controller][fundId].status();\n }\n\n function _getLockExpiry(\n Controller controller,\n FundId fundId\n ) internal view returns (Timestamp) {\n return _funds[controller][fundId].lockExpiry;\n }\n\n function _getBalance(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal view returns (Balance memory) {\n Fund memory fund = _funds[controller][fundId];\n FundStatus status = fund.status();\n if (status == FundStatus.Locked) {\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(Timestamps.currentTime());\n return account.balance;\n }\n if (status == FundStatus.Withdrawing || status == FundStatus.Frozen) {\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(fund.flowEnd());\n return account.balance;\n }\n return Balance({available: 0, designated: 0});\n }\n\n function _lock(\n Controller controller,\n FundId fundId,\n Timestamp expiry,\n Timestamp maximum\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Inactive, VaultFundAlreadyLocked());\n fund.lockExpiry = expiry;\n fund.lockMaximum = maximum;\n _checkLockInvariant(fund);\n _funds[controller][fundId] = fund;\n }\n\n function _extendLock(\n Controller controller,\n FundId fundId,\n Timestamp expiry\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n require(fund.lockExpiry <= expiry, VaultInvalidExpiry());\n fund.lockExpiry = expiry;\n _checkLockInvariant(fund);\n _funds[controller][fundId] = fund;\n }\n\n function _deposit(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account storage account = _accounts[controller][fundId][accountId];\n\n account.balance.available += amount;\n\n _token.safeTransferFrom(\n Controller.unwrap(controller),\n address(this),\n amount\n );\n }\n\n function _designate(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n require(amount <= account.balance.available, VaultInsufficientBalance());\n\n account.balance.available -= amount;\n account.balance.designated += amount;\n _checkAccountInvariant(account, fund);\n\n _accounts[controller][fundId][accountId] = account;\n }\n\n function _transfer(\n Controller controller,\n FundId fundId,\n AccountId from,\n AccountId to,\n uint128 amount\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory sender = _accounts[controller][fundId][from];\n require(amount <= sender.balance.available, VaultInsufficientBalance());\n\n sender.balance.available -= amount;\n _checkAccountInvariant(sender, fund);\n\n _accounts[controller][fundId][from] = sender;\n\n _accounts[controller][fundId][to].balance.available += amount;\n }\n\n function _flow(\n Controller controller,\n FundId fundId,\n AccountId from,\n AccountId to,\n TokensPerSecond rate\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory sender = _accounts[controller][fundId][from];\n sender.flowOut(rate);\n _checkAccountInvariant(sender, fund);\n _accounts[controller][fundId][from] = sender;\n\n Account memory receiver = _accounts[controller][fundId][to];\n receiver.flowIn(rate);\n _accounts[controller][fundId][to] = receiver;\n }\n\n function _burnDesignated(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account storage account = _accounts[controller][fundId][accountId];\n require(account.balance.designated >= amount, VaultInsufficientBalance());\n\n account.balance.designated -= amount;\n\n _token.safeTransfer(address(0xdead), amount);\n }\n\n function _burnAccount(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n require(account.flow.incoming == account.flow.outgoing, VaultFlowNotZero());\n uint128 amount = account.balance.available + account.balance.designated;\n\n delete _accounts[controller][fundId][accountId];\n\n _token.safeTransfer(address(0xdead), amount);\n }\n\n function _freezeFund(Controller controller, FundId fundId) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n fund.frozenAt = Timestamps.currentTime();\n }\n\n function _withdraw(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Withdrawing, VaultFundNotUnlocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(fund.flowEnd());\n uint128 amount = account.balance.available + account.balance.designated;\n\n delete _accounts[controller][fundId][accountId];\n\n (address owner, ) = Accounts.decodeId(accountId);\n _token.safeTransfer(owner, amount);\n }\n\n function _checkLockInvariant(Fund memory fund) private pure {\n require(fund.lockExpiry <= fund.lockMaximum, VaultInvalidExpiry());\n }\n\n function _checkAccountInvariant(\n Account memory account,\n Fund memory fund\n ) private pure {\n require(account.isSolventAt(fund.lockMaximum), VaultInsufficientBalance());\n }\n\n error VaultInsufficientBalance();\n error VaultInvalidExpiry();\n error VaultFundNotLocked();\n error VaultFundNotUnlocked();\n error VaultFundAlreadyLocked();\n error VaultFlowNotZero();\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/3a588acfa01d533bd1d8c93ca5daf963.json b/deployments/codex_testnet/solcInputs/3a588acfa01d533bd1d8c93ca5daf963.json deleted file mode 100644 index 035170e..0000000 --- a/deployments/codex_testnet/solcInputs/3a588acfa01d533bd1d8c93ca5daf963.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\", 67)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned when Request expires to the Request creator\n /// @dev The sum is deducted every time a host fills a Slot by precalculated amount that he should receive if the Request expires\n uint256 expiryFundsWithdraw;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for partial payouts when Requests expires and Hosts are paid out only the time they host the content.\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host; // address used for collateral interactions and identifying hosts\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n ) Proofs(configuration.proofs, verifier) {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function config() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(request.ask.slots > 0, \"Insufficient slots\");\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _requestContexts[id].expiryFundsWithdraw = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n slot.filledAt = block.timestamp;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n context.expiryFundsWithdraw -= _expiryPayoutAmount(\n requestId,\n block.timestamp\n );\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _requests[requestId].pricePerSlot();\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _expiryPayoutAmount(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be expired, must be in RequestStat e.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public {\n Request storage request = _requests[requestId];\n require(\n block.timestamp > requestExpiry(requestId),\n \"Request not yet timed out\"\n );\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n uint256 amount = context.expiryFundsWithdraw;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(withdrawRecipient, amount));\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host if a request\n * expires based on when the host fills the slot\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _expiryPayoutAmount(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(\n startingTimestamp < requestExpiry(requestId),\n \"Start not before expiry\"\n );\n\n return (requestExpiry(requestId) - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts; // TODO: Should be smaller than uint256\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed; // TODO: Should be smaller than uint256\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @param probability Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled // when request was cancelled then slot is cancelled as well\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/449a9ef8325abda653eb59796f71b45e.json b/deployments/codex_testnet/solcInputs/449a9ef8325abda653eb59796f71b45e.json deleted file mode 100644 index 2047d13..0000000 --- a/deployments/codex_testnet/solcInputs/449a9ef8325abda653eb59796f71b45e.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\", 67),\n SlotReservationsConfig(20)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned when Request expires to the Request creator\n /// @dev The sum is deducted every time a host fills a Slot by precalculated amount that he should receive if the Request expires\n uint256 expiryFundsWithdraw;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for partial payouts when Requests expires and Hosts are paid out only the time they host the content.\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host; // address used for collateral interactions and identifying hosts\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n )\n SlotReservations(configuration.reservations)\n Proofs(configuration.proofs, verifier)\n {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function config() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(request.ask.slots > 0, \"Insufficient slots\");\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _requestContexts[id].expiryFundsWithdraw = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n slot.filledAt = block.timestamp;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n context.expiryFundsWithdraw -= _expiryPayoutAmount(\n requestId,\n block.timestamp\n );\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _requests[requestId].pricePerSlot();\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _expiryPayoutAmount(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be expired, must be in RequestStat e.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public {\n Request storage request = _requests[requestId];\n require(\n block.timestamp > requestExpiry(requestId),\n \"Request not yet timed out\"\n );\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n uint256 amount = context.expiryFundsWithdraw;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(withdrawRecipient, amount));\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host if a request\n * expires based on when the host fills the slot\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _expiryPayoutAmount(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(\n startingTimestamp < requestExpiry(requestId),\n \"Start not before expiry\"\n );\n\n return (requestExpiry(requestId) - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts; // TODO: Should be smaller than uint256\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed; // TODO: Should be smaller than uint256\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @param probability Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled // when request was cancelled then slot is cancelled as well\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\ncontract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function reserveSlot(RequestId requestId, uint256 slotIndex) public {\n require(canReserveSlot(requestId, slotIndex), \"Reservation not allowed\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint256 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint256 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/62478d275926ca2a01e7974e918885d1.json b/deployments/codex_testnet/solcInputs/62478d275926ca2a01e7974e918885d1.json deleted file mode 100644 index 030b8cf..0000000 --- a/deployments/codex_testnet/solcInputs/62478d275926ca2a01e7974e918885d1.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n uint64 requestDurationLimit;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20),\n 60 * 60 * 24 * 30 // 30 days\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n error Marketplace_DurationExceedsLimit();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0)) {\n revert Marketplace_RequestAlreadyExists();\n }\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n if (request.ask.duration > _config.requestDurationLimit) {\n revert Marketplace_DurationExceedsLimit();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n assert(_token.transfer(msg.sender, validatorRewardAmount));\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n delete _reservations[slotId]; // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n uint64 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return uint64(Math.min(end, block.timestamp - 1));\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/6c0b1ecc717fd79335563520a885156c.json b/deployments/codex_testnet/solcInputs/6c0b1ecc717fd79335563520a885156c.json deleted file mode 100644 index 75759a1..0000000 --- a/deployments/codex_testnet/solcInputs/6c0b1ecc717fd79335563520a885156c.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\", 67),\n SlotReservationsConfig(20)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid based on time they actually host the content\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host; // address used for collateral interactions and identifying hosts\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n )\n SlotReservations(configuration.reservations)\n Proofs(configuration.proofs, verifier)\n {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(request.ask.slots > 0, \"Insufficient slots\");\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n require(_reservations[slotId].contains(msg.sender), \"Reservation required\");\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n slot.filledAt = block.timestamp;\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public {\n Request storage request = _requests[requestId];\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n RequestState state = requestState(requestId);\n require(\n state == RequestState.Cancelled ||\n state == RequestState.Failed ||\n state == RequestState.Finished,\n \"Invalid state\"\n );\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n require(context.fundsToReturnToClient != 0, \"Nothing to withdraw\");\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(withdrawRecipient, amount));\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp,\n uint256 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(startingTimestamp < endingTimestamp, \"Start not before expiry\");\n\n return (endingTimestamp - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts; // TODO: Should be smaller than uint256\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed; // TODO: Should be smaller than uint256\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @param probability Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled // when request was cancelled then slot is cancelled as well\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * request.ask.duration * request.ask.reward;\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint256 slotIndex) public {\n require(canReserveSlot(requestId, slotIndex), \"Reservation not allowed\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint256 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint256 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/73497e5b46b1a1eec0c64f9cd6de8fb8.json b/deployments/codex_testnet/solcInputs/73497e5b46b1a1eec0c64f9cd6de8fb8.json deleted file mode 100644 index bbdc9cf..0000000 --- a/deployments/codex_testnet/solcInputs/73497e5b46b1a1eec0c64f9cd6de8fb8.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\", 67),\n SlotReservationsConfig(20)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid based on time they actually host the content\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host; // address used for collateral interactions and identifying hosts\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n )\n SlotReservations(configuration.reservations)\n Proofs(configuration.proofs, verifier)\n {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function config() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(request.ask.slots > 0, \"Insufficient slots\");\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n require(_reservations[slotId].contains(msg.sender), \"Reservation required\");\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n slot.filledAt = block.timestamp;\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public {\n Request storage request = _requests[requestId];\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n RequestState state = requestState(requestId);\n require(\n state == RequestState.Cancelled ||\n state == RequestState.Failed ||\n state == RequestState.Finished,\n \"Invalid state\"\n );\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n require(context.fundsToReturnToClient != 0, \"Nothing to withdraw\");\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(withdrawRecipient, amount));\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp,\n uint256 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(startingTimestamp < endingTimestamp, \"Start not before expiry\");\n\n return (endingTimestamp - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts; // TODO: Should be smaller than uint256\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed; // TODO: Should be smaller than uint256\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @param probability Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled // when request was cancelled then slot is cancelled as well\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * request.ask.duration * request.ask.reward;\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\ncontract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function reserveSlot(RequestId requestId, uint256 slotIndex) public {\n require(canReserveSlot(requestId, slotIndex), \"Reservation not allowed\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint256 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint256 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/a8e27e97db3517f88dac395990ad3d84.json b/deployments/codex_testnet/solcInputs/a8e27e97db3517f88dac395990ad3d84.json deleted file mode 100644 index 7f59f9e..0000000 --- a/deployments/codex_testnet/solcInputs/a8e27e97db3517f88dac395990ad3d84.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n uint64 requestDurationLimit;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20),\n 60 * 60 * 24 * 30 // 30 days\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_ProofNotSubmittedByHost();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n error Marketplace_DurationExceedsLimit();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0)) {\n revert Marketplace_RequestAlreadyExists();\n }\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n if (request.ask.duration > _config.requestDurationLimit) {\n revert Marketplace_DurationExceedsLimit();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n\n if (msg.sender != slot.host) {\n revert Marketplace_ProofNotSubmittedByHost();\n }\n\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n assert(_token.transfer(msg.sender, validatorRewardAmount));\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n delete _reservations[slotId]; // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return _requestContexts[requestId].endsAt;\n }\n if (state == RequestState.Cancelled) {\n return _requestContexts[requestId].expiresAt;\n }\n return\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/c09963445d55f04ec1cd7dd500a29a55.json b/deployments/codex_testnet/solcInputs/c09963445d55f04ec1cd7dd500a29a55.json deleted file mode 100644 index 4e06539..0000000 --- a/deployments/codex_testnet/solcInputs/c09963445d55f04ec1cd7dd500a29a55.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\")\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) private _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned when Request expires to the Request creator\n /// @dev The sum is deducted every time a host fills a Slot by precalculated amount that he should receive if the Request expires\n uint256 expiryFundsWithdraw;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for partial payouts when Requests expires and Hosts are paid out only the time they host the content.\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n ) Proofs(configuration.proofs, verifier) {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function config() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _requestContexts[id].expiryFundsWithdraw = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n slot.filledAt = block.timestamp;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n context.expiryFundsWithdraw -= _expiryPayoutAmount(\n requestId,\n block.timestamp\n );\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(slot.requestId, slotId);\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 amount = _requests[requestId].pricePerSlot() +\n slot.currentCollateral;\n _marketplaceTotals.sent += amount;\n slot.state = SlotState.Paid;\n assert(_token.transfer(slot.host, amount));\n }\n\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 amount = _expiryPayoutAmount(requestId, slot.filledAt) +\n slot.currentCollateral;\n _marketplaceTotals.sent += amount;\n slot.state = SlotState.Paid;\n assert(_token.transfer(slot.host, amount));\n }\n\n /// @notice Withdraws storage request funds back to the client that deposited them.\n /// @dev Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\n /// @param requestId the id of the request\n function withdrawFunds(RequestId requestId) public {\n Request storage request = _requests[requestId];\n require(\n block.timestamp > requestExpiry(requestId),\n \"Request not yet timed out\"\n );\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n uint256 amount = context.expiryFundsWithdraw;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(msg.sender, amount));\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /// @notice Calculates the amount that should be payed out to a host if a request expires based on when the host fills the slot\n function _expiryPayoutAmount(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(\n startingTimestamp < requestExpiry(requestId),\n \"Start not before expiry\"\n );\n\n return (requestExpiry(requestId) - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n context.state == RequestState.Started && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts;\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n // To ensure the pointer does not remain in downtime for many consecutive\n // periods, for each period increase, move the pointer 67 blocks. We've\n // chosen a prime number to ensure that we don't get cycles.\n uint256 periodNumber = (Period.unwrap(period) * 67) % 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled // when request was cancelled then slot is cancelled as well\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/codex_testnet/solcInputs/eae4c6107a8ac2a19ef4d8c910f117dc.json b/deployments/codex_testnet/solcInputs/eae4c6107a8ac2a19ef4d8c910f117dc.json deleted file mode 100644 index 93794e5..0000000 --- a/deployments/codex_testnet/solcInputs/eae4c6107a8ac2a19ef4d8c910f117dc.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * The initial owner is set to the address provided by the deployer. This can\n * later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" - }, - "@openzeppelin/contracts/interfaces/IERC1363.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @title IERC1363\n * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].\n *\n * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract\n * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.\n */\ninterface IERC1363 is IERC20, IERC165 {\n /*\n * Note: the ERC-165 identifier for this interface is 0xb0202a11.\n * 0xb0202a11 ===\n * bytes4(keccak256('transferAndCall(address,uint256)')) ^\n * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^\n * bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256)')) ^\n * bytes4(keccak256('approveAndCall(address,uint256,bytes)'))\n */\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism\n * and then calls {IERC1363Receiver-onTransferReceived} on `to`.\n * @param from The address which you want to send tokens from.\n * @param to The address which you want to transfer to.\n * @param value The amount of tokens to be transferred.\n * @param data Additional data with no specified format, sent in call to `to`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.\n * @param spender The address which will spend the funds.\n * @param value The amount of tokens to be spent.\n * @param data Additional data with no specified format, sent in call to `spender`.\n * @return A boolean value indicating whether the operation succeeded unless throwing.\n */\n function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/interfaces/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" - }, - "@openzeppelin/contracts/interfaces/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n" - }, - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n mapping(address account => uint256) private _balances;\n\n mapping(address account => mapping(address spender => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * Both values are immutable: they can only be set once during construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `value`.\n */\n function transfer(address to, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 value) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, value);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Skips emitting an {Approval} event indicating an allowance update. This is not\n * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `value`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `value`.\n */\n function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, value);\n _transfer(from, to, value);\n return true;\n }\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _transfer(address from, address to, uint256 value) internal {\n if (from == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n if (to == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(from, to, value);\n }\n\n /**\n * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n * this function.\n *\n * Emits a {Transfer} event.\n */\n function _update(address from, address to, uint256 value) internal virtual {\n if (from == address(0)) {\n // Overflow check required: The rest of the code assumes that totalSupply never overflows\n _totalSupply += value;\n } else {\n uint256 fromBalance = _balances[from];\n if (fromBalance < value) {\n revert ERC20InsufficientBalance(from, fromBalance, value);\n }\n unchecked {\n // Overflow not possible: value <= fromBalance <= totalSupply.\n _balances[from] = fromBalance - value;\n }\n }\n\n if (to == address(0)) {\n unchecked {\n // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n _totalSupply -= value;\n }\n } else {\n unchecked {\n // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n _balances[to] += value;\n }\n }\n\n emit Transfer(from, to, value);\n }\n\n /**\n * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n * Relies on the `_update` mechanism\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead.\n */\n function _mint(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidReceiver(address(0));\n }\n _update(address(0), account, value);\n }\n\n /**\n * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n * Relies on the `_update` mechanism.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * NOTE: This function is not virtual, {_update} should be overridden instead\n */\n function _burn(address account, uint256 value) internal {\n if (account == address(0)) {\n revert ERC20InvalidSender(address(0));\n }\n _update(account, address(0), value);\n }\n\n /**\n * @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address owner, address spender, uint256 value) internal {\n _approve(owner, spender, value, true);\n }\n\n /**\n * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n *\n * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n * `Approval` event during `transferFrom` operations.\n *\n * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n * true using the following override:\n *\n * ```solidity\n * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n * super._approve(owner, spender, value, true);\n * }\n * ```\n *\n * Requirements are the same as {_approve}.\n */\n function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n if (owner == address(0)) {\n revert ERC20InvalidApprover(address(0));\n }\n if (spender == address(0)) {\n revert ERC20InvalidSpender(address(0));\n }\n _allowances[owner][spender] = value;\n if (emitEvent) {\n emit Approval(owner, spender, value);\n }\n }\n\n /**\n * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n *\n * Does not update the allowance value in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Does not emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance < type(uint256).max) {\n if (currentAllowance < value) {\n revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n }\n unchecked {\n _approve(owner, spender, currentAllowance - value, false);\n }\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"../IERC20.sol\";\nimport {IERC1363} from \"../../../interfaces/IERC1363.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC-20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n /**\n * @dev An operation with an ERC-20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.\n */\n function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {\n return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.\n */\n function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {\n return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n *\n * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the \"client\"\n * smart contract uses ERC-7674 to set temporary allowances, then the \"client\" smart contract should avoid using\n * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract\n * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance < requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n *\n * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function\n * only sets the \"standard\" allowance. Any temporary allowance will remain active, in addition to the value being\n * set here.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n safeTransfer(token, to, value);\n } else if (!token.transferAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target\n * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * Reverts if the returned value is other than `true`.\n */\n function transferFromAndCallRelaxed(\n IERC1363 token,\n address from,\n address to,\n uint256 value,\n bytes memory data\n ) internal {\n if (to.code.length == 0) {\n safeTransferFrom(token, from, to, value);\n } else if (!token.transferFromAndCall(from, to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no\n * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when\n * targeting contracts.\n *\n * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.\n * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}\n * once without retrying, and relies on the returned value to be true.\n *\n * Reverts if the returned value is other than `true`.\n */\n function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {\n if (to.code.length == 0) {\n forceApprove(token, to, value);\n } else if (!token.approveAndCall(to, value, data)) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n // bubble errors\n if iszero(success) {\n let ptr := mload(0x40)\n returndatacopy(ptr, 0, returndatasize())\n revert(ptr, returndatasize())\n }\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n\n if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n bool success;\n uint256 returnSize;\n uint256 returnValue;\n assembly (\"memory-safe\") {\n success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)\n returnSize := returndatasize()\n returnValue := mload(0)\n }\n return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Arrays.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Arrays.sol)\n// This file was procedurally generated from scripts/generate/templates/Arrays.js.\n\npragma solidity ^0.8.20;\n\nimport {Comparators} from \"./Comparators.sol\";\nimport {SlotDerivation} from \"./SlotDerivation.sol\";\nimport {StorageSlot} from \"./StorageSlot.sol\";\nimport {Math} from \"./math/Math.sol\";\n\n/**\n * @dev Collection of functions related to array types.\n */\nlibrary Arrays {\n using SlotDerivation for bytes32;\n using StorageSlot for bytes32;\n\n /**\n * @dev Sort an array of uint256 (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n uint256[] memory array,\n function(uint256, uint256) pure returns (bool) comp\n ) internal pure returns (uint256[] memory) {\n _quickSort(_begin(array), _end(array), comp);\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of uint256 in increasing order.\n */\n function sort(uint256[] memory array) internal pure returns (uint256[] memory) {\n sort(array, Comparators.lt);\n return array;\n }\n\n /**\n * @dev Sort an array of address (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n address[] memory array,\n function(address, address) pure returns (bool) comp\n ) internal pure returns (address[] memory) {\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of address in increasing order.\n */\n function sort(address[] memory array) internal pure returns (address[] memory) {\n sort(_castToUint256Array(array), Comparators.lt);\n return array;\n }\n\n /**\n * @dev Sort an array of bytes32 (in memory) following the provided comparator function.\n *\n * This function does the sorting \"in place\", meaning that it overrides the input. The object is returned for\n * convenience, but that returned value can be discarded safely if the caller has a memory pointer to the array.\n *\n * NOTE: this function's cost is `O(n · log(n))` in average and `O(n²)` in the worst case, with n the length of the\n * array. Using it in view functions that are executed through `eth_call` is safe, but one should be very careful\n * when executing this as part of a transaction. If the array being sorted is too large, the sort operation may\n * consume more gas than is available in a block, leading to potential DoS.\n *\n * IMPORTANT: Consider memory side-effects when using custom comparator functions that access memory in an unsafe way.\n */\n function sort(\n bytes32[] memory array,\n function(bytes32, bytes32) pure returns (bool) comp\n ) internal pure returns (bytes32[] memory) {\n sort(_castToUint256Array(array), _castToUint256Comp(comp));\n return array;\n }\n\n /**\n * @dev Variant of {sort} that sorts an array of bytes32 in increasing order.\n */\n function sort(bytes32[] memory array) internal pure returns (bytes32[] memory) {\n sort(_castToUint256Array(array), Comparators.lt);\n return array;\n }\n\n /**\n * @dev Performs a quick sort of a segment of memory. The segment sorted starts at `begin` (inclusive), and stops\n * at end (exclusive). Sorting follows the `comp` comparator.\n *\n * Invariant: `begin <= end`. This is the case when initially called by {sort} and is preserved in subcalls.\n *\n * IMPORTANT: Memory locations between `begin` and `end` are not validated/zeroed. This function should\n * be used only if the limits are within a memory array.\n */\n function _quickSort(uint256 begin, uint256 end, function(uint256, uint256) pure returns (bool) comp) private pure {\n unchecked {\n if (end - begin < 0x40) return;\n\n // Use first element as pivot\n uint256 pivot = _mload(begin);\n // Position where the pivot should be at the end of the loop\n uint256 pos = begin;\n\n for (uint256 it = begin + 0x20; it < end; it += 0x20) {\n if (comp(_mload(it), pivot)) {\n // If the value stored at the iterator's position comes before the pivot, we increment the\n // position of the pivot and move the value there.\n pos += 0x20;\n _swap(pos, it);\n }\n }\n\n _swap(begin, pos); // Swap pivot into place\n _quickSort(begin, pos, comp); // Sort the left side of the pivot\n _quickSort(pos + 0x20, end, comp); // Sort the right side of the pivot\n }\n }\n\n /**\n * @dev Pointer to the memory location of the first element of `array`.\n */\n function _begin(uint256[] memory array) private pure returns (uint256 ptr) {\n assembly (\"memory-safe\") {\n ptr := add(array, 0x20)\n }\n }\n\n /**\n * @dev Pointer to the memory location of the first memory word (32bytes) after `array`. This is the memory word\n * that comes just after the last element of the array.\n */\n function _end(uint256[] memory array) private pure returns (uint256 ptr) {\n unchecked {\n return _begin(array) + array.length * 0x20;\n }\n }\n\n /**\n * @dev Load memory word (as a uint256) at location `ptr`.\n */\n function _mload(uint256 ptr) private pure returns (uint256 value) {\n assembly {\n value := mload(ptr)\n }\n }\n\n /**\n * @dev Swaps the elements memory location `ptr1` and `ptr2`.\n */\n function _swap(uint256 ptr1, uint256 ptr2) private pure {\n assembly {\n let value1 := mload(ptr1)\n let value2 := mload(ptr2)\n mstore(ptr1, value2)\n mstore(ptr2, value1)\n }\n }\n\n /// @dev Helper: low level cast address memory array to uint256 memory array\n function _castToUint256Array(address[] memory input) private pure returns (uint256[] memory output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast bytes32 memory array to uint256 memory array\n function _castToUint256Array(bytes32[] memory input) private pure returns (uint256[] memory output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast address comp function to uint256 comp function\n function _castToUint256Comp(\n function(address, address) pure returns (bool) input\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n assembly {\n output := input\n }\n }\n\n /// @dev Helper: low level cast bytes32 comp function to uint256 comp function\n function _castToUint256Comp(\n function(bytes32, bytes32) pure returns (bool) input\n ) private pure returns (function(uint256, uint256) pure returns (bool) output) {\n assembly {\n output := input\n }\n }\n\n /**\n * @dev Searches a sorted `array` and returns the first index that contains\n * a value greater or equal to `element`. If no such index exists (i.e. all\n * values in the array are strictly less than `element`), the array length is\n * returned. Time complexity O(log n).\n *\n * NOTE: The `array` is expected to be sorted in ascending order, and to\n * contain no repeated elements.\n *\n * IMPORTANT: Deprecated. This implementation behaves as {lowerBound} but lacks\n * support for repeated elements in the array. The {lowerBound} function should\n * be used instead.\n */\n function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.\n if (low > 0 && unsafeAccess(array, low - 1).value == element) {\n return low - 1;\n } else {\n return low;\n }\n }\n\n /**\n * @dev Searches an `array` sorted in ascending order and returns the first\n * index that contains a value greater or equal than `element`. If no such index\n * exists (i.e. all values in the array are strictly less than `element`), the array\n * length is returned. Time complexity O(log n).\n *\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/lower_bound[lower_bound].\n */\n function lowerBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value < element) {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n } else {\n high = mid;\n }\n }\n\n return low;\n }\n\n /**\n * @dev Searches an `array` sorted in ascending order and returns the first\n * index that contains a value strictly greater than `element`. If no such index\n * exists (i.e. all values in the array are strictly less than `element`), the array\n * length is returned. Time complexity O(log n).\n *\n * See C++'s https://en.cppreference.com/w/cpp/algorithm/upper_bound[upper_bound].\n */\n function upperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeAccess(array, mid).value > element) {\n high = mid;\n } else {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n }\n }\n\n return low;\n }\n\n /**\n * @dev Same as {lowerBound}, but with an array in memory.\n */\n function lowerBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeMemoryAccess(array, mid) < element) {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n } else {\n high = mid;\n }\n }\n\n return low;\n }\n\n /**\n * @dev Same as {upperBound}, but with an array in memory.\n */\n function upperBoundMemory(uint256[] memory array, uint256 element) internal pure returns (uint256) {\n uint256 low = 0;\n uint256 high = array.length;\n\n if (high == 0) {\n return 0;\n }\n\n while (low < high) {\n uint256 mid = Math.average(low, high);\n\n // Note that mid will always be strictly less than high (i.e. it will be a valid array index)\n // because Math.average rounds towards zero (it does integer division with truncation).\n if (unsafeMemoryAccess(array, mid) > element) {\n high = mid;\n } else {\n // this cannot overflow because mid < high\n unchecked {\n low = mid + 1;\n }\n }\n }\n\n return low;\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getAddressSlot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getBytes32Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {\n bytes32 slot;\n assembly (\"memory-safe\") {\n slot := arr.slot\n }\n return slot.deriveArray().offset(pos).getUint256Slot();\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(bytes32[] memory arr, uint256 pos) internal pure returns (bytes32 res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Access an array in an \"unsafe\" way. Skips solidity \"index-out-of-range\" check.\n *\n * WARNING: Only use if you are certain `pos` is lower than the array length.\n */\n function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {\n assembly {\n res := mload(add(add(arr, 0x20), mul(pos, 0x20)))\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(address[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(bytes32[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n\n /**\n * @dev Helper to set the length of a dynamic array. Directly writing to `.length` is forbidden.\n *\n * WARNING: this does not clear elements if length is reduced, of initialize elements if length is increased.\n */\n function unsafeSetLength(uint256[] storage array, uint256 len) internal {\n assembly (\"memory-safe\") {\n sstore(array.slot, len)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Comparators.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Comparators.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides a set of functions to compare values.\n *\n * _Available since v5.1._\n */\nlibrary Comparators {\n function lt(uint256 a, uint256 b) internal pure returns (bool) {\n return a < b;\n }\n\n function gt(uint256 a, uint256 b) internal pure returns (bool) {\n return a > b;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Return the 512-bit addition of two uint256.\n *\n * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n */\n function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n assembly (\"memory-safe\") {\n low := add(a, b)\n high := lt(low, a)\n }\n }\n\n /**\n * @dev Return the 512-bit multiplication of two uint256.\n *\n * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n */\n function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = high * 2²⁵⁶ + low.\n assembly (\"memory-safe\") {\n let mm := mulmod(a, b, not(0))\n low := mul(a, b)\n high := sub(sub(mm, low), lt(mm, low))\n }\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n success = c >= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a - b;\n success = c <= a;\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a * b;\n assembly (\"memory-safe\") {\n // Only true when the multiplication doesn't overflow\n // (c / a == b) || (a == 0)\n success := or(eq(div(c, a), b), iszero(a))\n }\n // equivalent to: success ? c : 0\n result = c * SafeCast.toUint(success);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `DIV` opcode returns zero when the denominator is 0.\n result := div(a, b)\n }\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n success = b > 0;\n assembly (\"memory-safe\") {\n // The `MOD` opcode returns zero when the denominator is 0.\n result := mod(a, b)\n }\n }\n }\n\n /**\n * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryAdd(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n */\n function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n (, uint256 result) = trySub(a, b);\n return result;\n }\n\n /**\n * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n */\n function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n (bool success, uint256 result) = tryMul(a, b);\n return ternary(success, result, type(uint256).max);\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a > b, a, b);\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return ternary(a < b, a, b);\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n\n // Handle non-overflow cases, 256 by 256 division.\n if (high == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return low / denominator;\n }\n\n // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n if (denominator <= high) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [high low].\n uint256 remainder;\n assembly (\"memory-safe\") {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n high := sub(high, gt(remainder, low))\n low := sub(low, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\n assembly (\"memory-safe\") {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [high low] by twos.\n low := div(low, twos)\n\n // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from high into low.\n low |= high * twos;\n\n // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n // is no longer required.\n result = low * inverse;\n return result;\n }\n }\n\n /**\n * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n */\n function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n unchecked {\n (uint256 high, uint256 low) = mul512(x, y);\n if (high >= 1 << n) {\n Panic.panic(Panic.UNDER_OVERFLOW);\n }\n return (high << (256 - n)) | (low >> n);\n }\n }\n\n /**\n * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n */\n function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // If upper 8 bits of 16-bit half set, add 8 to result\n r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n // If upper 4 bits of 8-bit half set, add 4 to result\n r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n // Shifts value right by the current result and use it as an index into this lookup table:\n //\n // | x (4 bits) | index | table[index] = MSB position |\n // |------------|---------|-----------------------------|\n // | 0000 | 0 | table[0] = 0 |\n // | 0001 | 1 | table[1] = 0 |\n // | 0010 | 2 | table[2] = 1 |\n // | 0011 | 3 | table[3] = 1 |\n // | 0100 | 4 | table[4] = 2 |\n // | 0101 | 5 | table[5] = 2 |\n // | 0110 | 6 | table[6] = 2 |\n // | 0111 | 7 | table[7] = 2 |\n // | 1000 | 8 | table[8] = 3 |\n // | 1001 | 9 | table[9] = 3 |\n // | 1010 | 10 | table[10] = 3 |\n // | 1011 | 11 | table[11] = 3 |\n // | 1100 | 12 | table[12] = 3 |\n // | 1101 | 13 | table[13] = 3 |\n // | 1110 | 14 | table[14] = 3 |\n // | 1111 | 15 | table[15] = 3 |\n //\n // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n assembly (\"memory-safe\") {\n r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n }\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 x) internal pure returns (uint256 r) {\n // If value has upper 128 bits set, log2 result is at least 128\n r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n // If upper 64 bits of 128-bit half set, add 64 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n // If upper 32 bits of 64-bit half set, add 32 to result\n r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n // If upper 16 bits of 32-bit half set, add 16 to result\n r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/SafeCast.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Panic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n bool private _paused;\n\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n /**\n * @dev The operation failed because the contract is paused.\n */\n error EnforcedPause();\n\n /**\n * @dev The operation failed because the contract is not paused.\n */\n error ExpectedPause();\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n if (paused()) {\n revert EnforcedPause();\n }\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n if (!paused()) {\n revert ExpectedPause();\n }\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/utils/SlotDerivation.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/SlotDerivation.sol)\n// This file was procedurally generated from scripts/generate/templates/SlotDerivation.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for computing storage (and transient storage) locations from namespaces and deriving slots\n * corresponding to standard patterns. The derivation method for array and mapping matches the storage layout used by\n * the solidity language / compiler.\n *\n * See https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays[Solidity docs for mappings and dynamic arrays.].\n *\n * Example usage:\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using StorageSlot for bytes32;\n * using SlotDerivation for bytes32;\n *\n * // Declare a namespace\n * string private constant _NAMESPACE = \"\"; // eg. OpenZeppelin.Slot\n *\n * function setValueInNamespace(uint256 key, address newValue) internal {\n * _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value = newValue;\n * }\n *\n * function getValueInNamespace(uint256 key) internal view returns (address) {\n * return _NAMESPACE.erc7201Slot().deriveMapping(key).getAddressSlot().value;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {StorageSlot}.\n *\n * NOTE: This library provides a way to manipulate storage locations in a non-standard way. Tooling for checking\n * upgrade safety will ignore the slots accessed through this library.\n *\n * _Available since v5.1._\n */\nlibrary SlotDerivation {\n /**\n * @dev Derive an ERC-7201 slot from a string (namespace).\n */\n function erc7201Slot(string memory namespace) internal pure returns (bytes32 slot) {\n assembly (\"memory-safe\") {\n mstore(0x00, sub(keccak256(add(namespace, 0x20), mload(namespace)), 1))\n slot := and(keccak256(0x00, 0x20), not(0xff))\n }\n }\n\n /**\n * @dev Add an offset to a slot to get the n-th element of a structure or an array.\n */\n function offset(bytes32 slot, uint256 pos) internal pure returns (bytes32 result) {\n unchecked {\n return bytes32(uint256(slot) + pos);\n }\n }\n\n /**\n * @dev Derive the location of the first element in an array from the slot where the length is stored.\n */\n function deriveArray(bytes32 slot) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, slot)\n result := keccak256(0x00, 0x20)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, address key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, and(key, shr(96, not(0))))\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bool key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, iszero(iszero(key)))\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bytes32 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, uint256 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, int256 key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n mstore(0x00, key)\n mstore(0x20, slot)\n result := keccak256(0x00, 0x40)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, string memory key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n let length := mload(key)\n let begin := add(key, 0x20)\n let end := add(begin, length)\n let cache := mload(end)\n mstore(end, slot)\n result := keccak256(begin, add(length, 0x20))\n mstore(end, cache)\n }\n }\n\n /**\n * @dev Derive the location of a mapping element from the key.\n */\n function deriveMapping(bytes32 slot, bytes memory key) internal pure returns (bytes32 result) {\n assembly (\"memory-safe\") {\n let length := mload(key)\n let begin := add(key, 0x20)\n let end := add(begin, length)\n let cache := mload(end)\n mstore(end, slot)\n result := keccak256(begin, add(length, 0x20))\n mstore(end, cache)\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.20;\n\nimport {Arrays} from \"../Arrays.sol\";\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n * - Set can be cleared (all elements removed) in O(n).\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value => uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function _clear(Set storage set) private {\n uint256 len = _length(set);\n for (uint256 i = 0; i < len; ++i) {\n delete set._positions[set._values[i]];\n }\n Arrays.unsafeSetLength(set._values, 0);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(Bytes32Set storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(AddressSet storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes all the values from a set. O(n).\n *\n * WARNING: Developers should keep in mind that this function has an unbounded cost and using it may render the\n * function uncallable if the set grows to the point where clearing it consumes too much gas to fit in a block.\n */\n function clear(UintSet storage set) internal {\n _clear(set._inner);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n assembly (\"memory-safe\") {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n uint64 requestDurationLimit;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20),\n 60 * 60 * 24 * 30 // 30 days\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_ProofNotSubmittedByHost();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n error Marketplace_DurationExceedsLimit();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0)) {\n revert Marketplace_RequestAlreadyExists();\n }\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n if (request.ask.duration > _config.requestDurationLimit) {\n revert Marketplace_DurationExceedsLimit();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n\n if (msg.sender != slot.host) {\n revert Marketplace_ProofNotSubmittedByHost();\n }\n\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function canMarkProofAsMissing(\n SlotId slotId,\n Period period\n ) public view slotAcceptsProofs(slotId) {\n _canMarkProofAsMissing(slotId, period);\n }\n\n function markProofAsMissing(\n SlotId slotId,\n Period period\n ) public slotAcceptsProofs(slotId) {\n _markProofAsMissing(slotId, period);\n\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n\n if (!_token.transfer(msg.sender, validatorRewardAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n _reservations[slotId].clear(); // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view returns (ActiveSlot memory) {\n // Modifier `slotIsNotFree(slotId)` works here, but using the modifier\n // causes hardhat to return an error \"reverted with an unrecognized custom\n // error (return data: 0x8b41ec7f)\".\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n modifier slotAcceptsProofs(SlotId slotId) {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return _requestContexts[requestId].endsAt;\n }\n if (state == RequestState.Cancelled) {\n return _requestContexts[requestId].expiresAt;\n }\n return\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(\n SlotId slotId\n ) public view override(Proofs, SlotReservations) returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n _canMarkProofAsMissing(id, missedPeriod);\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n function _canMarkProofAsMissing(\n SlotId id,\n Period missedPeriod\n ) internal view {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n SlotState state = slotState(slotId);\n return\n // TODO: add in check for address inside of expanding window\n (state == SlotState.Free || state == SlotState.Repair) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - }, - "contracts/Vault.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/Pausable.sol\";\nimport \"./vault/VaultBase.sol\";\n\n/// A vault provides a means for smart contracts to control allocation of ERC20\n/// tokens without the need to hold the ERC20 tokens themselves, thereby\n/// decreasing their own attack surface.\n///\n/// A vault keeps track of funds for a smart contract. This smart contract is\n/// called the controller of the funds. Each controller has its own independent\n/// set of funds. Each fund has a number of accounts.\n///\n/// Vault -> Controller -> Fund -> Account\n///\n/// Funds are identified by a unique 32 byte identifier, chosen by the\n/// controller.\n///\n/// An account has a balance, of which a part can be designated. Designated\n/// tokens can no longer be transfered to another account, although they can be\n/// burned.\n/// Accounts are identified by the address of the account holder, and an id that\n/// can be used to create different accounts for the same holder.\n///\n/// A typical flow in which a controller uses the vault to handle funds:\n/// 1. the controller chooses a unique id for the fund\n/// 2. the controller locks the fund for an amount of time\n/// 3. the controller deposits ERC20 tokens into the fund\n/// 4. the controller transfers tokens between accounts in the fund\n/// 5. the fund unlocks after a while, freezing the account balances\n/// 6. the controller withdraws ERC20 tokens from the fund for an account holder,\n/// or the account holder initiates the withdrawal itself\n///\n/// The vault makes it harder for an attacker to extract funds, through several\n/// mechanisms:\n/// - tokens in a fund can only be reassigned while the fund is time-locked, and\n/// only be withdrawn after the lock unlocks, delaying an attacker's attempt\n/// at extraction of tokens from the vault\n/// - tokens in a fund can not be reassigned when the lock unlocks, ensuring\n/// that they can no longer be reassigned to an attacker\n/// - when storing collateral, it can be designated for the collateral provider,\n/// ensuring that it cannot be reassigned to an attacker\n/// - malicious upgrades to a fund controller cannot prevent account holders\n/// from withdrawing their tokens\n/// - burning tokens in a fund ensures that these tokens can no longer be\n/// extracted by an attacker\n///\ncontract Vault is VaultBase, Pausable, Ownable {\n constructor(IERC20 token) VaultBase(token) Ownable(msg.sender) {}\n\n /// Creates an account id that encodes the address of the account holder, and\n /// a discriminator. The discriminator can be used to create different\n /// accounts within a fund that all belong to the same account holder.\n function encodeAccountId(\n address holder,\n bytes12 discriminator\n ) public pure returns (AccountId) {\n return Accounts.encodeId(holder, discriminator);\n }\n\n /// Extracts the address of the account holder and the discriminator from the\n /// account id.\n function decodeAccountId(\n AccountId id\n ) public pure returns (address holder, bytes12 discriminator) {\n return Accounts.decodeId(id);\n }\n\n /// The amount of tokens that are currently in an account.\n /// This includes available and designated tokens. Available tokens can be\n /// transfered to other accounts, but designated tokens cannot.\n function getBalance(\n FundId fundId,\n AccountId accountId\n ) public view returns (uint128) {\n Controller controller = Controller.wrap(msg.sender);\n Balance memory balance = _getBalance(controller, fundId, accountId);\n return balance.available + balance.designated;\n }\n\n /// The amount of tokens that are currently designated in an account\n /// These tokens can no longer be transfered to other accounts.\n function getDesignatedBalance(\n FundId fundId,\n AccountId accountId\n ) public view returns (uint128) {\n Controller controller = Controller.wrap(msg.sender);\n Balance memory balance = _getBalance(controller, fundId, accountId);\n return balance.designated;\n }\n\n /// Returns the status of the fund. Most operations on the vault can only be\n /// done by the controller when the funds are locked. Withdrawals can only be\n /// done in the withdrawing state.\n function getFundStatus(FundId fundId) public view returns (FundStatus) {\n Controller controller = Controller.wrap(msg.sender);\n return _getFundStatus(controller, fundId);\n }\n\n /// Returns the expiry time of the lock on the fund. A locked fund unlocks\n /// automatically at this timestamp.\n function getLockExpiry(FundId fundId) public view returns (Timestamp) {\n Controller controller = Controller.wrap(msg.sender);\n return _getLockExpiry(controller, fundId);\n }\n\n /// Locks the fund until the expiry timestamp. The lock expiry can be extended\n /// later, but no more than the maximum timestamp.\n function lock(\n FundId fundId,\n Timestamp expiry,\n Timestamp maximum\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _lock(controller, fundId, expiry, maximum);\n }\n\n /// Delays unlocking of a locked fund. The new expiry should be later than\n /// the existing expiry, but no later than the maximum timestamp that was\n /// provided when locking the fund.\n /// Only allowed when the lock has not unlocked yet.\n function extendLock(FundId fundId, Timestamp expiry) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _extendLock(controller, fundId, expiry);\n }\n\n /// Deposits an amount of tokens into the vault, and adds them to the balance\n /// of the account. ERC20 tokens are transfered from the caller to the vault\n /// contract.\n /// Only allowed when the fund is locked.\n function deposit(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _deposit(controller, fundId, accountId, amount);\n }\n\n /// Takes an amount of tokens from the account balance and designates them\n /// for the account holder. These tokens are no longer available to be\n /// transfered to other accounts.\n /// Only allowed when the fund is locked.\n function designate(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _designate(controller, fundId, accountId, amount);\n }\n\n /// Transfers an amount of tokens from one account to the other.\n /// Only allowed when the fund is locked.\n function transfer(\n FundId fundId,\n AccountId from,\n AccountId to,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _transfer(controller, fundId, from, to, amount);\n }\n\n /// Transfers tokens from one account the other over time.\n /// Every second a number of tokens are transfered, until the fund is\n /// unlocked. After flowing into an account, these tokens become designated\n /// tokens, so they cannot be transfered again.\n /// Only allowed when the fund is locked.\n /// Only allowed when the balance is sufficient to sustain the flow until the\n /// fund unlocks, even if the lock expiry time is extended to its maximum.\n function flow(\n FundId fundId,\n AccountId from,\n AccountId to,\n TokensPerSecond rate\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _flow(controller, fundId, from, to, rate);\n }\n\n /// Burns an amount of designated tokens from the account.\n /// Only allowed when the fund is locked.\n function burnDesignated(\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _burnDesignated(controller, fundId, accountId, amount);\n }\n\n /// Burns all tokens from the account.\n /// Only allowed when the fund is locked.\n /// Only allowed when no funds are flowing into or out of the account.\n function burnAccount(\n FundId fundId,\n AccountId accountId\n ) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _burnAccount(controller, fundId, accountId);\n }\n\n /// Freezes a fund. Stops all tokens flows and disallows any operations on the\n /// fund until it unlocks.\n /// Only allowed when the fund is locked.\n function freezeFund(FundId fundId) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _freezeFund(controller, fundId);\n }\n\n /// Transfers all ERC20 tokens in the account out of the vault to the account\n /// owner.\n /// Only allowed when the fund is unlocked.\n /// ⚠️ The account holder can also withdraw itself, so when designing a smart\n /// contract that controls funds in the vault, don't assume that only this\n /// smart contract can initiate a withdrawal ⚠️\n function withdraw(FundId fund, AccountId accountId) public whenNotPaused {\n Controller controller = Controller.wrap(msg.sender);\n _withdraw(controller, fund, accountId);\n }\n\n /// Allows an account holder to withdraw its tokens from a fund directly,\n /// bypassing the need to ask the controller of the fund to initiate the\n /// withdrawal.\n /// Only allowed when the fund is unlocked.\n function withdrawByRecipient(\n Controller controller,\n FundId fund,\n AccountId accountId\n ) public {\n (address holder, ) = Accounts.decodeId(accountId);\n require(msg.sender == holder, VaultOnlyAccountHolder());\n _withdraw(controller, fund, accountId);\n }\n\n function pause() public onlyOwner {\n _pause();\n }\n\n function unpause() public onlyOwner {\n _unpause();\n }\n\n error VaultOnlyAccountHolder();\n}\n" - }, - "contracts/vault/Accounts.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./TokenFlows.sol\";\nimport \"./Timestamps.sol\";\n\n/// Used to identify an account. The first 20 bytes consist of the address of\n/// the account holder, and the last 12 bytes consist of a discriminator value.\ntype AccountId is bytes32;\n\n/// Records the token balance and the incoming and outgoing token flows\nstruct Account {\n Balance balance;\n Flow flow;\n}\n\n/// The account balance. Fits in 32 bytes to minimize storage costs.\n/// A uint128 is used to record the amount of tokens, which should be more than\n/// enough. Given a standard 18 decimal places for the ERC20 token, this still\n/// allows for 10^20 whole coins.\nstruct Balance {\n /// Available tokens can be transfered\n uint128 available;\n /// Designated tokens can no longer be transfered\n uint128 designated;\n}\n\n/// The incoming and outgoing flows of an account. Fits in 32 bytes to minimize\n/// storage costs.\nstruct Flow {\n /// Rate of outgoing tokens\n TokensPerSecond outgoing;\n /// Rate of incoming tokens\n TokensPerSecond incoming;\n /// Last time that the flow was updated\n Timestamp updated;\n}\n\nlibrary Accounts {\n using Accounts for Account;\n using TokenFlows for TokensPerSecond;\n using Timestamps for Timestamp;\n\n /// Creates an account id from the account holder address and a discriminator.\n /// The discriminiator can be used to create different accounts that belong to\n /// the same account holder.\n function encodeId(\n address holder,\n bytes12 discriminator\n ) internal pure returns (AccountId) {\n bytes32 left = bytes32(bytes20(holder));\n bytes32 right = bytes32(uint256(uint96(discriminator)));\n return AccountId.wrap(left | right);\n }\n\n /// Extracts the account holder and the discriminator from the the account id\n function decodeId(AccountId id) internal pure returns (address, bytes12) {\n bytes32 unwrapped = AccountId.unwrap(id);\n address holder = address(bytes20(unwrapped));\n bytes12 discriminator = bytes12(uint96(uint256(unwrapped)));\n return (holder, discriminator);\n }\n\n /// Calculates whether the available balance is sufficient to sustain the\n /// outgoing flow of tokens until the specified timestamp\n function isSolventAt(\n Account memory account,\n Timestamp timestamp\n ) internal pure returns (bool) {\n Duration duration = account.flow.updated.until(timestamp);\n uint128 outgoing = account.flow.outgoing.accumulate(duration);\n return outgoing <= account.balance.available;\n }\n\n /// Updates the available and designated balances by accumulating the\n /// outgoing and incoming flows up until the specified timestamp. Outgoing\n /// tokens are deducted from the available balance. Incoming tokens are added\n /// to the designated tokens.\n function accumulateFlows(\n Account memory account,\n Timestamp timestamp\n ) internal pure {\n Duration duration = account.flow.updated.until(timestamp);\n account.balance.available -= account.flow.outgoing.accumulate(duration);\n account.balance.designated += account.flow.incoming.accumulate(duration);\n account.flow.updated = timestamp;\n }\n\n /// Starts an incoming flow of tokens at the specified rate. If there already\n /// is a flow of incoming tokens, then its rate is increased accordingly.\n function flowIn(Account memory account, TokensPerSecond rate) internal view {\n account.accumulateFlows(Timestamps.currentTime());\n account.flow.incoming = account.flow.incoming + rate;\n }\n\n /// Starts an outgoing flow of tokens at the specified rate. If there is\n /// already a flow of incoming tokens, then these are used to pay for the\n /// outgoing flow. If there are insuffient incoming tokens, then the outgoing\n /// rate is increased.\n function flowOut(Account memory account, TokensPerSecond rate) internal view {\n account.accumulateFlows(Timestamps.currentTime());\n if (rate <= account.flow.incoming) {\n account.flow.incoming = account.flow.incoming - rate;\n } else {\n account.flow.outgoing = account.flow.outgoing + rate;\n account.flow.outgoing = account.flow.outgoing - account.flow.incoming;\n account.flow.incoming = TokensPerSecond.wrap(0);\n }\n }\n}\n" - }, - "contracts/vault/Funds.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Timestamps.sol\";\n\nstruct Fund {\n /// The time-lock unlocks at this time\n Timestamp lockExpiry;\n /// The lock expiry can be extended no further than this\n Timestamp lockMaximum;\n /// Indicates whether fund is frozen, and at what time\n Timestamp frozenAt;\n}\n\n/// A fund can go through the following states:\n///\n/// --> Inactive ---> Locked -----> Withdrawing\n/// \\ ^\n/// \\ /\n/// --> Frozen --\n///\nenum FundStatus {\n /// Indicates that the fund is inactive and contains no tokens. This is the\n /// initial state.\n Inactive,\n /// Indicates that a time-lock is set and withdrawing tokens is not allowed. A\n /// fund needs to be locked for deposits, transfers, flows and burning to be\n /// allowed.\n Locked,\n /// Indicates that a locked fund is frozen. Flows have stopped, nothing is\n /// allowed until the fund unlocks.\n Frozen,\n /// Indicates the fund has unlocked and withdrawing is allowed. Other\n /// operations are no longer allowed.\n Withdrawing\n}\n\nlibrary Funds {\n function status(Fund memory fund) internal view returns (FundStatus) {\n if (Timestamps.currentTime() < fund.lockExpiry) {\n if (fund.frozenAt != Timestamp.wrap(0)) {\n return FundStatus.Frozen;\n }\n return FundStatus.Locked;\n }\n if (fund.lockMaximum == Timestamp.wrap(0)) {\n return FundStatus.Inactive;\n }\n return FundStatus.Withdrawing;\n }\n\n function flowEnd(Fund memory fund) internal pure returns (Timestamp) {\n if (fund.frozenAt != Timestamp.wrap(0)) {\n return fund.frozenAt;\n }\n return fund.lockExpiry;\n }\n}\n" - }, - "contracts/vault/Timestamps.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\n/// Represents a moment in time, represented as unix time (number of seconds\n/// since 1970). Uses a uint40 to facilitate efficient packing in structs. A\n/// uint40 allows times to be represented for the coming 30 000 years.\ntype Timestamp is uint40;\n/// Represents a duration of time in seconds\ntype Duration is uint40;\n\nusing {_timestampEquals as ==} for Timestamp global;\nusing {_timestampNotEqual as !=} for Timestamp global;\nusing {_timestampLessThan as <} for Timestamp global;\nusing {_timestampAtMost as <=} for Timestamp global;\n\nfunction _timestampEquals(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) == Timestamp.unwrap(b);\n}\n\nfunction _timestampNotEqual(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) != Timestamp.unwrap(b);\n}\n\nfunction _timestampLessThan(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) < Timestamp.unwrap(b);\n}\n\nfunction _timestampAtMost(Timestamp a, Timestamp b) pure returns (bool) {\n return Timestamp.unwrap(a) <= Timestamp.unwrap(b);\n}\n\nlibrary Timestamps {\n /// Returns the current block timestamp converted to a Timestamp type\n function currentTime() internal view returns (Timestamp) {\n return Timestamp.wrap(uint40(block.timestamp));\n }\n\n /// Calculates the duration from start until end\n function until(\n Timestamp start,\n Timestamp end\n ) internal pure returns (Duration) {\n return Duration.wrap(Timestamp.unwrap(end) - Timestamp.unwrap(start));\n }\n}\n" - }, - "contracts/vault/TokenFlows.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Timestamps.sol\";\n\n/// Represents a flow of tokens. Uses a uint96 to represent the flow rate, which\n/// should be more than enough. Given a standard 18 decimal places for the\n/// ERC20 token, this still allows for a rate of 10^10 whole coins per second.\ntype TokensPerSecond is uint96;\n\nusing {_tokensPerSecondMinus as -} for TokensPerSecond global;\nusing {_tokensPerSecondPlus as +} for TokensPerSecond global;\nusing {_tokensPerSecondEquals as ==} for TokensPerSecond global;\nusing {_tokensPerSecondAtMost as <=} for TokensPerSecond global;\n\nfunction _tokensPerSecondMinus(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (TokensPerSecond) {\n return\n TokensPerSecond.wrap(TokensPerSecond.unwrap(a) - TokensPerSecond.unwrap(b));\n}\n\nfunction _tokensPerSecondPlus(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (TokensPerSecond) {\n return\n TokensPerSecond.wrap(TokensPerSecond.unwrap(a) + TokensPerSecond.unwrap(b));\n}\n\nfunction _tokensPerSecondEquals(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (bool) {\n return TokensPerSecond.unwrap(a) == TokensPerSecond.unwrap(b);\n}\n\nfunction _tokensPerSecondAtMost(\n TokensPerSecond a,\n TokensPerSecond b\n) pure returns (bool) {\n return TokensPerSecond.unwrap(a) <= TokensPerSecond.unwrap(b);\n}\n\nlibrary TokenFlows {\n /// Calculates how many tokens are accumulated when a token flow is maintained\n /// for a duration of time.\n function accumulate(\n TokensPerSecond rate,\n Duration duration\n ) internal pure returns (uint128) {\n return uint128(TokensPerSecond.unwrap(rate)) * Duration.unwrap(duration);\n }\n}\n" - }, - "contracts/vault/VaultBase.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"./Accounts.sol\";\nimport \"./Funds.sol\";\n\n/// Records account balances and token flows. Accounts are separated into funds.\n/// Funds are kept separate between controllers.\n///\n/// A fund can only be manipulated by a controller when it is locked. Tokens can\n/// only be withdrawn when a fund is unlocked.\n///\n/// The vault maintains a number of invariants to ensure its integrity.\n///\n/// The lock invariant ensures that there is a maximum time that a fund can be\n/// locked:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId:\n/// fund.lockExpiry <= fund.lockMaximum\n/// where fund = _funds[controller][fundId])\n///\n/// The account invariant ensures that the outgoing token flow can be sustained\n/// for the maximum time that a fund can be locked:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId, accountId ∈ AccountId:\n/// flow.outgoing * (fund.lockMaximum - flow.updated) <= balance.available\n/// where fund = _funds[controller][fundId])\n/// and flow = _accounts[controller][fundId][accountId].flow\n/// and balance = _accounts[controller][fundId][accountId].balance\n///\n/// The flow invariant ensures that incoming and outgoing flow rates match:\n///\n/// (∀ controller ∈ Controller, fundId ∈ FundId:\n/// (∑ accountId ∈ AccountId: accounts[accountId].flow.incoming) =\n/// (∑ accountId ∈ AccountId: accounts[accountId].flow.outgoing)\n/// where accounts = _accounts[controller][fundId])\n///\nabstract contract VaultBase {\n using SafeERC20 for IERC20;\n using Accounts for Account;\n using Funds for Fund;\n\n IERC20 internal immutable _token;\n\n /// Represents a smart contract that can redistribute and burn tokens in funds\n type Controller is address;\n /// Unique identifier for a fund, chosen by the controller\n type FundId is bytes32;\n\n /// Each controller has its own set of funds\n mapping(Controller => mapping(FundId => Fund)) private _funds;\n /// Each account holder has its own set of accounts in a fund\n mapping(Controller => mapping(FundId => mapping(AccountId => Account)))\n private _accounts;\n\n constructor(IERC20 token) {\n _token = token;\n }\n\n function _getFundStatus(\n Controller controller,\n FundId fundId\n ) internal view returns (FundStatus) {\n return _funds[controller][fundId].status();\n }\n\n function _getLockExpiry(\n Controller controller,\n FundId fundId\n ) internal view returns (Timestamp) {\n return _funds[controller][fundId].lockExpiry;\n }\n\n function _getBalance(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal view returns (Balance memory) {\n Fund memory fund = _funds[controller][fundId];\n FundStatus status = fund.status();\n if (status == FundStatus.Locked) {\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(Timestamps.currentTime());\n return account.balance;\n }\n if (status == FundStatus.Withdrawing || status == FundStatus.Frozen) {\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(fund.flowEnd());\n return account.balance;\n }\n return Balance({available: 0, designated: 0});\n }\n\n function _lock(\n Controller controller,\n FundId fundId,\n Timestamp expiry,\n Timestamp maximum\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Inactive, VaultFundAlreadyLocked());\n fund.lockExpiry = expiry;\n fund.lockMaximum = maximum;\n _checkLockInvariant(fund);\n _funds[controller][fundId] = fund;\n }\n\n function _extendLock(\n Controller controller,\n FundId fundId,\n Timestamp expiry\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n require(fund.lockExpiry <= expiry, VaultInvalidExpiry());\n fund.lockExpiry = expiry;\n _checkLockInvariant(fund);\n _funds[controller][fundId] = fund;\n }\n\n function _deposit(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account storage account = _accounts[controller][fundId][accountId];\n\n account.balance.available += amount;\n\n _token.safeTransferFrom(\n Controller.unwrap(controller),\n address(this),\n amount\n );\n }\n\n function _designate(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n require(amount <= account.balance.available, VaultInsufficientBalance());\n\n account.balance.available -= amount;\n account.balance.designated += amount;\n _checkAccountInvariant(account, fund);\n\n _accounts[controller][fundId][accountId] = account;\n }\n\n function _transfer(\n Controller controller,\n FundId fundId,\n AccountId from,\n AccountId to,\n uint128 amount\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory sender = _accounts[controller][fundId][from];\n require(amount <= sender.balance.available, VaultInsufficientBalance());\n\n sender.balance.available -= amount;\n _checkAccountInvariant(sender, fund);\n\n _accounts[controller][fundId][from] = sender;\n\n _accounts[controller][fundId][to].balance.available += amount;\n }\n\n function _flow(\n Controller controller,\n FundId fundId,\n AccountId from,\n AccountId to,\n TokensPerSecond rate\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory sender = _accounts[controller][fundId][from];\n sender.flowOut(rate);\n _checkAccountInvariant(sender, fund);\n _accounts[controller][fundId][from] = sender;\n\n Account memory receiver = _accounts[controller][fundId][to];\n receiver.flowIn(rate);\n _accounts[controller][fundId][to] = receiver;\n }\n\n function _burnDesignated(\n Controller controller,\n FundId fundId,\n AccountId accountId,\n uint128 amount\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account storage account = _accounts[controller][fundId][accountId];\n require(account.balance.designated >= amount, VaultInsufficientBalance());\n\n account.balance.designated -= amount;\n\n _token.safeTransfer(address(0xdead), amount);\n }\n\n function _burnAccount(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n require(account.flow.incoming == account.flow.outgoing, VaultFlowNotZero());\n uint128 amount = account.balance.available + account.balance.designated;\n\n delete _accounts[controller][fundId][accountId];\n\n _token.safeTransfer(address(0xdead), amount);\n }\n\n function _freezeFund(Controller controller, FundId fundId) internal {\n Fund storage fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Locked, VaultFundNotLocked());\n\n fund.frozenAt = Timestamps.currentTime();\n }\n\n function _withdraw(\n Controller controller,\n FundId fundId,\n AccountId accountId\n ) internal {\n Fund memory fund = _funds[controller][fundId];\n require(fund.status() == FundStatus.Withdrawing, VaultFundNotUnlocked());\n\n Account memory account = _accounts[controller][fundId][accountId];\n account.accumulateFlows(fund.flowEnd());\n uint128 amount = account.balance.available + account.balance.designated;\n\n delete _accounts[controller][fundId][accountId];\n\n (address owner, ) = Accounts.decodeId(accountId);\n _token.safeTransfer(owner, amount);\n }\n\n function _checkLockInvariant(Fund memory fund) private pure {\n require(fund.lockExpiry <= fund.lockMaximum, VaultInvalidExpiry());\n }\n\n function _checkAccountInvariant(\n Account memory account,\n Fund memory fund\n ) private pure {\n require(account.isSolventAt(fund.lockMaximum), VaultInsufficientBalance());\n }\n\n error VaultInsufficientBalance();\n error VaultInvalidExpiry();\n error VaultFundNotLocked();\n error VaultFundNotUnlocked();\n error VaultFundAlreadyLocked();\n error VaultFlowNotZero();\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/.chainId b/deployments/linea_testnet/.chainId deleted file mode 100644 index 9f88427..0000000 --- a/deployments/linea_testnet/.chainId +++ /dev/null @@ -1 +0,0 @@ -1660990954 \ No newline at end of file diff --git a/deployments/linea_testnet/Groth16Verifier.json b/deployments/linea_testnet/Groth16Verifier.json deleted file mode 100644 index 2b84935..0000000 --- a/deployments/linea_testnet/Groth16Verifier.json +++ /dev/null @@ -1,504 +0,0 @@ -{ - "address": "0xF119248ffe0a8A07Ff91301F83BFaE7c20456173", - "abi": [ - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "alpha1", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "beta2", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "gamma2", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "delta2", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point[]", - "name": "ic", - "type": "tuple[]" - } - ], - "internalType": "struct Groth16Verifier.VerifyingKey", - "name": "key", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - }, - { - "internalType": "uint256[]", - "name": "input", - "type": "uint256[]" - } - ], - "name": "verify", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xceb4c5b94154688ff063f29d011df4cc62210742a94d028712ae3f6cd66523ff", - "receipt": { - "to": null, - "from": "0xC3B5023e9d6522f9A8B0E187EB324C8341E5C9cf", - "contractAddress": "0xF119248ffe0a8A07Ff91301F83BFaE7c20456173", - "transactionIndex": 1, - "gasUsed": "1053013", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xcf347d18b7ebdbc6c15d5deee66cdce11d23bade5cf4e110e766c944146b910f", - "transactionHash": "0xceb4c5b94154688ff063f29d011df4cc62210742a94d028712ae3f6cd66523ff", - "logs": [], - "blockNumber": 2001328, - "cumulativeGasUsed": "1074013", - "status": 1, - "byzantium": true - }, - "args": [ - { - "alpha1": { - "x": "20491192805390485299153009773594534940189261866228447918068658471970481763042", - "y": "9383485363053290200918347156157836566562967994039712273449902621266178545958" - }, - "beta2": { - "x": { - "real": "6375614351688725206403948262868962793625744043794305715222011528459656738731", - "imag": "4252822878758300859123897981450591353533073413197771768651442665752259397132" - }, - "y": { - "real": "10505242626370262277552901082094356697409835680220590971873171140371331206856", - "imag": "21847035105528745403288232691147584728191162732299865338377159692350059136679" - } - }, - "gamma2": { - "x": { - "real": "10857046999023057135944570762232829481370756359578518086990519993285655852781", - "imag": "11559732032986387107991004021392285783925812861821192530917403151452391805634" - }, - "y": { - "real": "8495653923123431417604973247489272438418190587263600148770280649306958101930", - "imag": "4082367875863433681332203403145435568316851327593401208105741076214120093531" - } - }, - "delta2": { - "x": { - "real": "7791164563743079419589440373723531715660863237515256801832496378744062705692", - "imag": "18140015760956658993401314410013399172580752447722106245827704769275144944365" - }, - "y": { - "real": "17812654733893615050952431189498139904025668992277104449740946322604310593259", - "imag": "17369491537387214087127689025270527340613832203196753088110263926977142197544" - } - }, - "ic": [ - { - "x": "11919420103024546168896650006162652130022732573970705849225139177428442519914", - "y": "17747753383929265689844293401689552935018333420134132157824903795680624926572" - }, - { - "x": "13158415194355348546090070151711085027834066488127676886518524272551654481129", - "y": "18831701962118195025265682681702066674741422770850028135520336928884612556978" - }, - { - "x": "20882269691461568155321689204947751047717828445545223718893788782534717197527", - "y": "11996193054822748526485644723594571195813487505803351159052936325857690315211" - }, - { - "x": "18155166643053044822201627105588517913195535693446564472247126736722594445000", - "y": "13816319482622393060406816684195314200198627617641073470088058848129378231754" - } - ] - } - ], - "numDeployments": 3, - "solcInputHash": "38bc1dfa6eb605585a1d33e30c68e961", - "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"alpha1\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"beta2\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"gamma2\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"delta2\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point[]\",\"name\":\"ic\",\"type\":\"tuple[]\"}],\"internalType\":\"struct Groth16Verifier.VerifyingKey\",\"name\":\"key\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"},{\"internalType\":\"uint256[]\",\"name\":\"input\",\"type\":\"uint256[]\"}],\"name\":\"verify\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Groth16Verifier.sol\":\"Groth16Verifier\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"contracts/Groth16.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nstruct G1Point {\\n uint256 x;\\n uint256 y;\\n}\\n\\n// A field element F_{p^2} encoded as `real + i * imag`.\\n// We chose to not represent this as an array of 2 numbers, because both Circom\\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\\nstruct Fp2Element {\\n uint256 real;\\n uint256 imag;\\n}\\n\\nstruct G2Point {\\n Fp2Element x;\\n Fp2Element y;\\n}\\n\\nstruct Groth16Proof {\\n G1Point a;\\n G2Point b;\\n G1Point c;\\n}\\n\\ninterface IGroth16Verifier {\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] calldata pubSignals\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x3694cd68f518dc4dfeb2f9a9d18f594b5511b110e129018348f21db25de1ed92\",\"license\":\"MIT\"},\"contracts/Groth16Verifier.sol\":{\"content\":\"// Copyright 2017 Christian Reitwiessner\\n// Copyright 2019 OKIMS\\n// Copyright 2024 Codex\\n// Permission is hereby granted, free of charge, to any person obtaining a copy\\n// of this software and associated documentation files (the \\\"Software\\\"), to deal\\n// in the Software without restriction, including without limitation the rights\\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\n// copies of the Software, and to permit persons to whom the Software is\\n// furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in\\n// all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\\n// SOFTWARE.\\n// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\nimport \\\"./Groth16.sol\\\";\\n\\ncontract Groth16Verifier is IGroth16Verifier {\\n uint256 private constant _P =\\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n uint256 private constant _R =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n VerifyingKey private _verifyingKey;\\n\\n struct VerifyingKey {\\n G1Point alpha1;\\n G2Point beta2;\\n G2Point gamma2;\\n G2Point delta2;\\n G1Point[] ic;\\n }\\n\\n constructor(VerifyingKey memory key) {\\n _verifyingKey.alpha1 = key.alpha1;\\n _verifyingKey.beta2 = key.beta2;\\n _verifyingKey.gamma2 = key.gamma2;\\n _verifyingKey.delta2 = key.delta2;\\n for (uint i = 0; i < key.ic.length; i++) {\\n _verifyingKey.ic.push(key.ic[i]);\\n }\\n }\\n\\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\\n return G1Point(point.x, (_P - point.y) % _P);\\n }\\n\\n function _add(\\n G1Point memory point1,\\n G1Point memory point2\\n ) private view returns (bool success, G1Point memory sum) {\\n // Call the precompiled contract for addition on the alt_bn128 curve.\\n // The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\\n\\n uint256[4] memory input;\\n input[0] = point1.x;\\n input[1] = point1.y;\\n input[2] = point2.x;\\n input[3] = point2.y;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 6, input, 128, sum, 64)\\n }\\n }\\n\\n function _multiply(\\n G1Point memory point,\\n uint256 scalar\\n ) private view returns (bool success, G1Point memory product) {\\n // Call the precompiled contract for scalar multiplication on the alt_bn128\\n // curve. The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\\n\\n uint256[3] memory input;\\n input[0] = point.x;\\n input[1] = point.y;\\n input[2] = scalar;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 7, input, 96, product, 64)\\n }\\n }\\n\\n function _checkPairing(\\n G1Point memory a1,\\n G2Point memory a2,\\n G1Point memory b1,\\n G2Point memory b2,\\n G1Point memory c1,\\n G2Point memory c2,\\n G1Point memory d1,\\n G2Point memory d2\\n ) private view returns (bool success, uint256 outcome) {\\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\\n // The call will fail if the points are not valid group elements:\\n // https://eips.ethereum.org/EIPS/eip-197#specification\\n\\n uint256[24] memory input; // 4 pairs of G1 and G2 points\\n uint256[1] memory output;\\n\\n input[0] = a1.x;\\n input[1] = a1.y;\\n input[2] = a2.x.imag;\\n input[3] = a2.x.real;\\n input[4] = a2.y.imag;\\n input[5] = a2.y.real;\\n\\n input[6] = b1.x;\\n input[7] = b1.y;\\n input[8] = b2.x.imag;\\n input[9] = b2.x.real;\\n input[10] = b2.y.imag;\\n input[11] = b2.y.real;\\n\\n input[12] = c1.x;\\n input[13] = c1.y;\\n input[14] = c2.x.imag;\\n input[15] = c2.x.real;\\n input[16] = c2.y.imag;\\n input[17] = c2.y.real;\\n\\n input[18] = d1.x;\\n input[19] = d1.y;\\n input[20] = d2.x.imag;\\n input[21] = d2.x.real;\\n input[22] = d2.y.imag;\\n input[23] = d2.y.real;\\n\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n success := staticcall(gas(), 8, input, 768, output, 32)\\n }\\n return (success, output[0]);\\n }\\n\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] memory input\\n ) public view returns (bool success) {\\n // Check amount of public inputs\\n if (input.length + 1 != _verifyingKey.ic.length) {\\n return false;\\n }\\n // Check that public inputs are field elements\\n for (uint i = 0; i < input.length; i++) {\\n if (input[i] >= _R) {\\n return false;\\n }\\n }\\n // Compute the linear combination\\n G1Point memory combination = _verifyingKey.ic[0];\\n for (uint i = 0; i < input.length; i++) {\\n G1Point memory product;\\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\\n if (!success) {\\n return false;\\n }\\n (success, combination) = _add(combination, product);\\n if (!success) {\\n return false;\\n }\\n }\\n // Check the pairing\\n uint256 outcome;\\n (success, outcome) = _checkPairing(\\n _negate(proof.a),\\n proof.b,\\n _verifyingKey.alpha1,\\n _verifyingKey.beta2,\\n combination,\\n _verifyingKey.gamma2,\\n proof.c,\\n _verifyingKey.delta2\\n );\\n if (!success) {\\n return false;\\n }\\n return outcome == 1;\\n }\\n}\\n\",\"keccak256\":\"0x9e2288fb822e47b5bd24c7d1b4bffb8e8210761bf85759d1845df5b8fc060901\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50604051610bbd380380610bbd83398101604081905261002f91610208565b805180516000908155602091820151600155818301518051805160025583015160035582015180516004558201516005556040830151805180516006558301516007558201518051600855820151600955606083015180518051600a55830151600b558201518051600c5590910151600d555b816080015151811015610100576000600e01826080015182815181106100ca576100ca610343565b602090810291909101810151825460018181018555600094855293839020825160029092020190815591015190820155016100a2565b5050610359565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b038111828210171561013f5761013f610107565b60405290565b60405160a081016001600160401b038111828210171561013f5761013f610107565b604051601f8201601f191681016001600160401b038111828210171561018f5761018f610107565b604052919050565b6000604082840312156101a957600080fd5b6101b161011d565b825181526020928301519281019290925250919050565b6000608082840312156101da57600080fd5b6101e261011d565b90506101ee8383610197565b81526101fd8360408401610197565b602082015292915050565b60006020828403121561021a57600080fd5b81516001600160401b0381111561023057600080fd5b82016101e0818503121561024357600080fd5b61024b610145565b6102558583610197565b815261026485604084016101c8565b60208201526102768560c084016101c8565b60408201526102898561014084016101c8565b60608201526101c08201516001600160401b038111156102a857600080fd5b80830192505084601f8301126102bd57600080fd5b81516001600160401b038111156102d6576102d6610107565b6102e560208260051b01610167565b8082825260208201915060208360061b86010192508783111561030757600080fd5b6020850194505b82851015610333576103208886610197565b825260208201915060408501945061030e565b6080840152509095945050505050565b634e487b7160e01b600052603260045260246000fd5b610855806103686000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806394c8919d14610030575b600080fd5b61004361003e366004610647565b610057565b604051901515815260200160405180910390f35b600e5481516000919061006b90600161072c565b146100785750600061030c565b60005b82518110156100d6577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018382815181106100b7576100b761073f565b6020026020010151106100ce57600091505061030c565b60010161007b565b50600080600e016000815481106100ef576100ef61073f565b600091825260208083206040805180820190915260029093020180548352600101549082015291505b83518110156101e05760408051808201909152600080825260208201526101a1600e61014584600161072c565b815481106101555761015561073f565b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508684815181106101945761019461073f565b6020026020010151610312565b9094509050836101b7576000935050505061030c565b6101c18382610361565b9094509250836101d7576000935050505061030c565b50600101610118565b5060006102f06101fd6101f836889003880188610786565b6103bc565b61020f368890038801604089016107a9565b604080518082018252600054815260015460208083019190915282516080808201855260025482860190815260035460608085019190915290835285518087018752600454815260055481860152838501528551918201865260065482870190815260075491830191909152815284518086019095526008548552600954858401529182019390935290919087906102af368d90038d0160c08e01610786565b60408051608081018252600a54818301908152600b54606083015281528151808301909252600c548252600d54602083810191909152810191909152610448565b9093509050826103055760009250505061030c565b6001149150505b92915050565b6000610331604051806040016040528060008152602001600081525090565b61033961055e565b845181526020808601519082015260408082018590528260608360075afa9250509250929050565b6000610380604051806040016040528060008152602001600081525090565b61038861057c565b845181526020808601518183015284516040808401919091529085015160608301528260808360065afa9250509250929050565b60408051808201909152600080825260208201526040518060400160405280836000015181526020017f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4784602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4761043691906107ea565b61044091906107fd565b905292915050565b60008061045361059a565b61045b6105b9565b8b5182526020808d0151818401528b5181015160408401528b515160608401528b810180518201516080850152515160a08401528a5160c08401528a81015160e08401528951810151610100840152895151610120840152898101805182015161014085015251516101608401528851610180840152888101516101a084015287518101516101c08401528751516101e08401528781018051820151610200850152515161022084015286516102408401528681015161026084015285518101516102808401528551516102a084015285810180518201516102c085015251516102e0840152816103008460085afa9051909c909b509950505050505050505050565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610610576106106105d7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561063f5761063f6105d7565b604052919050565b60008082840361012081121561065c57600080fd5b61010081121561066b57600080fd5b5082915061010083013567ffffffffffffffff81111561068a57600080fd5b8301601f8101851361069b57600080fd5b803567ffffffffffffffff8111156106b5576106b56105d7565b8060051b6106c560208201610616565b918252602081840181019290810190888411156106e157600080fd5b6020850194505b83851015610707578435808352602095860195909350909101906106e8565b80955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c610716565b634e487b7160e01b600052603260045260246000fd5b60006040828403121561076757600080fd5b61076f6105ed565b823581526020928301359281019290925250919050565b60006040828403121561079857600080fd5b6107a28383610755565b9392505050565b600060808284031280156107bc57600080fd5b506107c56105ed565b6107cf8484610755565b81526107de8460408501610755565b60208201529392505050565b8181038181111561030c5761030c610716565b60008261081a57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220e999442315398e0b48870ac7727735b77e41ded2e66e2cdcccc8c4255b3b7dfb64736f6c634300081c0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c806394c8919d14610030575b600080fd5b61004361003e366004610647565b610057565b604051901515815260200160405180910390f35b600e5481516000919061006b90600161072c565b146100785750600061030c565b60005b82518110156100d6577f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018382815181106100b7576100b761073f565b6020026020010151106100ce57600091505061030c565b60010161007b565b50600080600e016000815481106100ef576100ef61073f565b600091825260208083206040805180820190915260029093020180548352600101549082015291505b83518110156101e05760408051808201909152600080825260208201526101a1600e61014584600161072c565b815481106101555761015561073f565b9060005260206000209060020201604051806040016040529081600082015481526020016001820154815250508684815181106101945761019461073f565b6020026020010151610312565b9094509050836101b7576000935050505061030c565b6101c18382610361565b9094509250836101d7576000935050505061030c565b50600101610118565b5060006102f06101fd6101f836889003880188610786565b6103bc565b61020f368890038801604089016107a9565b604080518082018252600054815260015460208083019190915282516080808201855260025482860190815260035460608085019190915290835285518087018752600454815260055481860152838501528551918201865260065482870190815260075491830191909152815284518086019095526008548552600954858401529182019390935290919087906102af368d90038d0160c08e01610786565b60408051608081018252600a54818301908152600b54606083015281528151808301909252600c548252600d54602083810191909152810191909152610448565b9093509050826103055760009250505061030c565b6001149150505b92915050565b6000610331604051806040016040528060008152602001600081525090565b61033961055e565b845181526020808601519082015260408082018590528260608360075afa9250509250929050565b6000610380604051806040016040528060008152602001600081525090565b61038861057c565b845181526020808601518183015284516040808401919091529085015160608301528260808360065afa9250509250929050565b60408051808201909152600080825260208201526040518060400160405280836000015181526020017f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4784602001517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4761043691906107ea565b61044091906107fd565b905292915050565b60008061045361059a565b61045b6105b9565b8b5182526020808d0151818401528b5181015160408401528b515160608401528b810180518201516080850152515160a08401528a5160c08401528a81015160e08401528951810151610100840152895151610120840152898101805182015161014085015251516101608401528851610180840152888101516101a084015287518101516101c08401528751516101e08401528781018051820151610200850152515161022084015286516102408401528681015161026084015285518101516102808401528551516102a084015285810180518201516102c085015251516102e0840152816103008460085afa9051909c909b509950505050505050505050565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518061030001604052806018906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715610610576106106105d7565b60405290565b604051601f8201601f1916810167ffffffffffffffff8111828210171561063f5761063f6105d7565b604052919050565b60008082840361012081121561065c57600080fd5b61010081121561066b57600080fd5b5082915061010083013567ffffffffffffffff81111561068a57600080fd5b8301601f8101851361069b57600080fd5b803567ffffffffffffffff8111156106b5576106b56105d7565b8060051b6106c560208201610616565b918252602081840181019290810190888411156106e157600080fd5b6020850194505b83851015610707578435808352602095860195909350909101906106e8565b80955050505050509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561030c5761030c610716565b634e487b7160e01b600052603260045260246000fd5b60006040828403121561076757600080fd5b61076f6105ed565b823581526020928301359281019290925250919050565b60006040828403121561079857600080fd5b6107a28383610755565b9392505050565b600060808284031280156107bc57600080fd5b506107c56105ed565b6107cf8484610755565b81526107de8460408501610755565b60208201529392505050565b8181038181111561030c5761030c610716565b60008261081a57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220e999442315398e0b48870ac7727735b77e41ded2e66e2cdcccc8c4255b3b7dfb64736f6c634300081c0033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 2435, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "_verifyingKey", - "offset": 0, - "slot": "0", - "type": "t_struct(VerifyingKey)2452_storage" - } - ], - "types": { - "t_array(t_struct(G1Point)2387_storage)dyn_storage": { - "base": "t_struct(G1Point)2387_storage", - "encoding": "dynamic_array", - "label": "struct G1Point[]", - "numberOfBytes": "32" - }, - "t_struct(Fp2Element)2392_storage": { - "encoding": "inplace", - "label": "struct Fp2Element", - "members": [ - { - "astId": 2389, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "real", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 2391, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "imag", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(G1Point)2387_storage": { - "encoding": "inplace", - "label": "struct G1Point", - "members": [ - { - "astId": 2384, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 2386, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "y", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(G2Point)2399_storage": { - "encoding": "inplace", - "label": "struct G2Point", - "members": [ - { - "astId": 2395, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "x", - "offset": 0, - "slot": "0", - "type": "t_struct(Fp2Element)2392_storage" - }, - { - "astId": 2398, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "y", - "offset": 0, - "slot": "2", - "type": "t_struct(Fp2Element)2392_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(VerifyingKey)2452_storage": { - "encoding": "inplace", - "label": "struct Groth16Verifier.VerifyingKey", - "members": [ - { - "astId": 2438, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "alpha1", - "offset": 0, - "slot": "0", - "type": "t_struct(G1Point)2387_storage" - }, - { - "astId": 2441, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "beta2", - "offset": 0, - "slot": "2", - "type": "t_struct(G2Point)2399_storage" - }, - { - "astId": 2444, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "gamma2", - "offset": 0, - "slot": "6", - "type": "t_struct(G2Point)2399_storage" - }, - { - "astId": 2447, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "delta2", - "offset": 0, - "slot": "10", - "type": "t_struct(G2Point)2399_storage" - }, - { - "astId": 2451, - "contract": "contracts/Groth16Verifier.sol:Groth16Verifier", - "label": "ic", - "offset": 0, - "slot": "14", - "type": "t_array(t_struct(G1Point)2387_storage)dyn_storage" - } - ], - "numberOfBytes": "480" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/Marketplace.json b/deployments/linea_testnet/Marketplace.json deleted file mode 100644 index 379b65d..0000000 --- a/deployments/linea_testnet/Marketplace.json +++ /dev/null @@ -1,2296 +0,0 @@ -{ - "address": "0x34F606C65869277f236ce07aBe9af0B8c88F486B", - "abi": [ - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "validatorRewardPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "period", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "timeout", - "type": "uint64" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "downtimeProduct", - "type": "uint8" - }, - { - "internalType": "string", - "name": "zkeyHash", - "type": "string" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "maxReservations", - "type": "uint8" - } - ], - "internalType": "struct SlotReservationsConfig", - "name": "reservations", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "requestDurationLimit", - "type": "uint64" - } - ], - "internalType": "struct MarketplaceConfig", - "name": "config", - "type": "tuple" - }, - { - "internalType": "contract IERC20", - "name": "token_", - "type": "address" - }, - { - "internalType": "contract IGroth16Verifier", - "name": "verifier", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "Marketplace_AlreadyPaid", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_DurationExceedsLimit", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientCollateral", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientDuration", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientProofProbability", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientReward", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InsufficientSlots", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidCid", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidClientAddress", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidExpiry", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidMaxSlotLoss", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidSlot", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidSlotHost", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_InvalidState", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_MaximumSlashingTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_NothingToWithdraw", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_RepairRewardPercentageTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_RequestAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_ReservationRequired", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlashPercentageTooHigh", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotIsFree", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotNotAcceptingProofs", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_SlotNotFree", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_StartNotBeforeExpiry", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_TransferFailed", - "type": "error" - }, - { - "inputs": [], - "name": "Marketplace_UnknownRequest", - "type": "error" - }, - { - "inputs": [], - "name": "Periods_InvalidSecondsPerPeriod", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_InsufficientBlockHeight", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_InvalidProof", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_PeriodNotEnded", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofAlreadyMarkedMissing", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofAlreadySubmitted", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofNotMissing", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ProofNotRequired", - "type": "error" - }, - { - "inputs": [], - "name": "Proofs_ValidationTimedOut", - "type": "error" - }, - { - "inputs": [], - "name": "SlotReservations_ReservationNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "ProofSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFulfilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotFilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotFreed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "SlotReservationsFull", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "indexed": false, - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - } - ], - "name": "StorageRequested", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "canReserveSlot", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "configuration", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "validatorRewardPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "period", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "timeout", - "type": "uint64" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "downtimeProduct", - "type": "uint8" - }, - { - "internalType": "string", - "name": "zkeyHash", - "type": "string" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint8", - "name": "maxReservations", - "type": "uint8" - } - ], - "internalType": "struct SlotReservationsConfig", - "name": "reservations", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "requestDurationLimit", - "type": "uint64" - } - ], - "internalType": "struct MarketplaceConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "currentCollateral", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "fillSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "rewardRecipient", - "type": "address" - }, - { - "internalType": "address", - "name": "collateralRecipient", - "type": "address" - } - ], - "name": "freeSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "freeSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getActiveSlot", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "internalType": "struct Marketplace.ActiveSlot", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getHost", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getPointer", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "getRequest", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "isProofRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "Periods.Period", - "name": "period", - "type": "uint64" - } - ], - "name": "markProofAsMissing", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "missingProofs", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "myRequests", - "outputs": [ - { - "internalType": "RequestId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mySlots", - "outputs": [ - { - "internalType": "SlotId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestEnd", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestExpiry", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestState", - "outputs": [ - { - "internalType": "enum RequestState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pricePerBytePerSecond", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateralPerByte", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "slotSize", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "cid", - "type": "bytes" - }, - { - "internalType": "bytes32", - "name": "merkleRoot", - "type": "bytes32" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint64", - "name": "expiry", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - } - ], - "name": "requestStorage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "slotIndex", - "type": "uint64" - } - ], - "name": "reserveSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "slotProbability", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "slotState", - "outputs": [ - { - "internalType": "enum SlotState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "a", - "type": "tuple" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "x", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "real", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "imag", - "type": "uint256" - } - ], - "internalType": "struct Fp2Element", - "name": "y", - "type": "tuple" - } - ], - "internalType": "struct G2Point", - "name": "b", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "x", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "y", - "type": "uint256" - } - ], - "internalType": "struct G1Point", - "name": "c", - "type": "tuple" - } - ], - "internalType": "struct Groth16Proof", - "name": "proof", - "type": "tuple" - } - ], - "name": "submitProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "willProofBeRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "withdrawRecipient", - "type": "address" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x7fb9a6221316c917217d63a1ef44c3d0726a43b869f1743818e57dfaa7255005", - "receipt": { - "to": null, - "from": "0xC3B5023e9d6522f9A8B0E187EB324C8341E5C9cf", - "contractAddress": "0x34F606C65869277f236ce07aBe9af0B8c88F486B", - "transactionIndex": 1, - "gasUsed": "4267896", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x31baee527a534a9a93dcfd9a62855e7402b589979fa00fc0bd02b1b7f5271ae9", - "transactionHash": "0x7fb9a6221316c917217d63a1ef44c3d0726a43b869f1743818e57dfaa7255005", - "logs": [], - "blockNumber": 2001331, - "cumulativeGasUsed": "4288896", - "status": 1, - "byzantium": true - }, - "args": [ - { - "collateral": { - "repairRewardPercentage": 10, - "maxNumberOfSlashes": 2, - "slashPercentage": 20, - "validatorRewardPercentage": 20 - }, - "proofs": { - "period": 120, - "timeout": 30, - "downtime": 64, - "downtimeProduct": 67, - "zkeyHash": "754e3339afbb9260109b6dd3ab33a8136046cc45f525c790fbd385dcd8ad35de" - }, - "reservations": { - "maxReservations": 3 - }, - "requestDurationLimit": 2592000 - }, - "0xe5C3daA5eeD91976d0997122f1B8688bFE4f3Af5", - "0xF119248ffe0a8A07Ff91301F83BFaE7c20456173" - ], - "numDeployments": 3, - "solcInputHash": "38bc1dfa6eb605585a1d33e30c68e961", - "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"validatorRewardPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"period\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timeout\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"downtimeProduct\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"zkeyHash\",\"type\":\"string\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"maxReservations\",\"type\":\"uint8\"}],\"internalType\":\"struct SlotReservationsConfig\",\"name\":\"reservations\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"requestDurationLimit\",\"type\":\"uint64\"}],\"internalType\":\"struct MarketplaceConfig\",\"name\":\"config\",\"type\":\"tuple\"},{\"internalType\":\"contract IERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"internalType\":\"contract IGroth16Verifier\",\"name\":\"verifier\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"Marketplace_AlreadyPaid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_DurationExceedsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientCollateral\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientDuration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientProofProbability\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientReward\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InsufficientSlots\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidCid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidClientAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidExpiry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidMaxSlotLoss\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidSlot\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidSlotHost\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_InvalidState\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_MaximumSlashingTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_NothingToWithdraw\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_RepairRewardPercentageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_RequestAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_ReservationRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlashPercentageTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotIsFree\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotNotAcceptingProofs\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_SlotNotFree\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_StartNotBeforeExpiry\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_TransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Marketplace_UnknownRequest\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Periods_InvalidSecondsPerPeriod\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_InsufficientBlockHeight\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_InvalidProof\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_PeriodNotEnded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofAlreadyMarkedMissing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofAlreadySubmitted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofNotMissing\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ProofNotRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Proofs_ValidationTimedOut\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SlotReservations_ReservationNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"ProofSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotFreed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"SlotReservationsFull\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"}],\"name\":\"StorageRequested\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"canReserveSlot\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"configuration\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"validatorRewardPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"period\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timeout\",\"type\":\"uint64\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"downtimeProduct\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"zkeyHash\",\"type\":\"string\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"maxReservations\",\"type\":\"uint8\"}],\"internalType\":\"struct SlotReservationsConfig\",\"name\":\"reservations\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"requestDurationLimit\",\"type\":\"uint64\"}],\"internalType\":\"struct MarketplaceConfig\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"currentCollateral\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"fillSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"rewardRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"collateralRecipient\",\"type\":\"address\"}],\"name\":\"freeSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"freeSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getActiveSlot\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"internalType\":\"struct Marketplace.ActiveSlot\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getChallenge\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getHost\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getPointer\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"isProofRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"Periods.Period\",\"name\":\"period\",\"type\":\"uint64\"}],\"name\":\"markProofAsMissing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"missingProofs\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"myRequests\",\"outputs\":[{\"internalType\":\"RequestId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mySlots\",\"outputs\":[{\"internalType\":\"SlotId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestEnd\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestExpiry\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestState\",\"outputs\":[{\"internalType\":\"enum RequestState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"pricePerBytePerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateralPerByte\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"slotSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"duration\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"cid\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint64\",\"name\":\"expiry\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"}],\"name\":\"requestStorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"slotIndex\",\"type\":\"uint64\"}],\"name\":\"reserveSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"slotProbability\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"slotState\",\"outputs\":[{\"internalType\":\"enum SlotState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"a\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"x\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"real\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"imag\",\"type\":\"uint256\"}],\"internalType\":\"struct Fp2Element\",\"name\":\"y\",\"type\":\"tuple\"}],\"internalType\":\"struct G2Point\",\"name\":\"b\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"x\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"y\",\"type\":\"uint256\"}],\"internalType\":\"struct G1Point\",\"name\":\"c\",\"type\":\"tuple\"}],\"internalType\":\"struct Groth16Proof\",\"name\":\"proof\",\"type\":\"tuple\"}],\"name\":\"submitProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"willProofBeRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"withdrawRecipient\",\"type\":\"address\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))\":{\"params\":{\"proof\":\"Groth16 proof procing possession of the slot data.\",\"requestId\":\"RequestId identifying the request containing the slot to fill.\",\"slotIndex\":\"Index of the slot in the request.\"}},\"freeSlot(bytes32)\":{\"details\":\"The host that filled the slot must have initiated the transaction (msg.sender). This overload allows `rewardRecipient` and `collateralRecipient` to be optional.\",\"params\":{\"slotId\":\"id of the slot to free\"}},\"freeSlot(bytes32,address,address)\":{\"params\":{\"collateralRecipient\":\"address to refund collateral to\",\"rewardRecipient\":\"address to send rewards to\",\"slotId\":\"id of the slot to free\"}},\"getChallenge(bytes32)\":{\"params\":{\"id\":\"Slot's ID for which the challenge should be calculated\"},\"returns\":{\"_0\":\"Challenge for current Period that should be used for generation of proofs\"}},\"getPointer(bytes32)\":{\"details\":\"For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\",\"params\":{\"id\":\"Slot's ID for which the pointer should be calculated\"},\"returns\":{\"_0\":\"Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\"}},\"isProofRequired(bytes32)\":{\"params\":{\"id\":\"Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\"},\"returns\":{\"_0\":\"bool indicating if proof is required for current period\"}},\"missingProofs(bytes32)\":{\"returns\":{\"_0\":\"Number of missed proofs since Slot was Filled\"}},\"willProofBeRequired(bytes32)\":{\"details\":\"for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\",\"params\":{\"id\":\"SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\"},\"returns\":{\"_0\":\"bool\"}},\"withdrawFunds(bytes32)\":{\"details\":\"Request must be cancelled, failed or finished, and the transaction must originate from the depositor address.\",\"params\":{\"requestId\":\"the id of the request\"}},\"withdrawFunds(bytes32,address)\":{\"details\":\"Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\",\"params\":{\"requestId\":\"the id of the request\",\"withdrawRecipient\":\"address to return the remaining funds to\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))\":{\"notice\":\"Fills a slot. Reverts if an invalid proof of the slot data is provided.\"},\"freeSlot(bytes32)\":{\"notice\":\"Frees a slot, paying out rewards and returning collateral for finished or cancelled requests to the host that has filled the slot.\"},\"freeSlot(bytes32,address,address)\":{\"notice\":\"Frees a slot, paying out rewards and returning collateral for finished or cancelled requests.\"},\"willProofBeRequired(bytes32)\":{\"notice\":\"Proof Downtime specifies part of the Period when the proof is not required even if the proof should be required. This function returns true if the pointer is in downtime (hence no proof required now) and at the same time the proof will be required later on in the Period.\"},\"withdrawFunds(bytes32)\":{\"notice\":\"Withdraws remaining storage request funds back to the client that deposited them.\"},\"withdrawFunds(bytes32,address)\":{\"notice\":\"Withdraws storage request funds to the provided address.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Marketplace.sol\":\"Marketplace\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xc3ff3f5c4584e1d9a483ad7ced51ab64523201f4e3d3c65293e4ca8aeb77a961\",\"license\":\"MIT\"},\"contracts/Configuration.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nstruct MarketplaceConfig {\\n CollateralConfig collateral;\\n ProofConfig proofs;\\n SlotReservationsConfig reservations;\\n uint64 requestDurationLimit;\\n}\\n\\nstruct CollateralConfig {\\n /// @dev percentage of collateral that is used as repair reward\\n uint8 repairRewardPercentage;\\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\\n uint8 slashPercentage; // percentage of the collateral that is slashed\\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\\n}\\n\\nstruct ProofConfig {\\n uint64 period; // proofs requirements are calculated per period (in seconds)\\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\\n uint8 downtime; // ignore this much recent blocks for proof requirements\\n // Ensures the pointer does not remain in downtime for many consecutive\\n // periods. For each period increase, move the pointer `pointerProduct`\\n // blocks. Should be a prime number to ensure there are no cycles.\\n uint8 downtimeProduct;\\n string zkeyHash; // hash of the zkey file which is linked to the verifier\\n}\\n\\nstruct SlotReservationsConfig {\\n // Number of allowed reservations per slot\\n uint8 maxReservations;\\n}\\n\",\"keccak256\":\"0x1d6cbbf7fff2b6807f29d46c8550a71b95c076b1136a30999c9578145174b36c\",\"license\":\"MIT\"},\"contracts/Endian.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ncontract Endian {\\n /// reverses byte order to allow conversion between little endian and big\\n /// endian integers\\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\\n output = output | bytes1(input);\\n for (uint i = 1; i < 32; i++) {\\n output = output >> 8;\\n output = output | bytes1(input << (i * 8));\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa721187e8bda9245ce16ad989fda5812874f2bf70ae4009bbeb0951c65ba6a2b\",\"license\":\"MIT\"},\"contracts/Groth16.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nstruct G1Point {\\n uint256 x;\\n uint256 y;\\n}\\n\\n// A field element F_{p^2} encoded as `real + i * imag`.\\n// We chose to not represent this as an array of 2 numbers, because both Circom\\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\\nstruct Fp2Element {\\n uint256 real;\\n uint256 imag;\\n}\\n\\nstruct G2Point {\\n Fp2Element x;\\n Fp2Element y;\\n}\\n\\nstruct Groth16Proof {\\n G1Point a;\\n G2Point b;\\n G1Point c;\\n}\\n\\ninterface IGroth16Verifier {\\n function verify(\\n Groth16Proof calldata proof,\\n uint256[] calldata pubSignals\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x3694cd68f518dc4dfeb2f9a9d18f594b5511b110e129018348f21db25de1ed92\",\"license\":\"MIT\"},\"contracts/Marketplace.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Proofs.sol\\\";\\nimport \\\"./SlotReservations.sol\\\";\\nimport \\\"./StateRetrieval.sol\\\";\\nimport \\\"./Endian.sol\\\";\\nimport \\\"./Groth16.sol\\\";\\n\\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\\n error Marketplace_RepairRewardPercentageTooHigh();\\n error Marketplace_SlashPercentageTooHigh();\\n error Marketplace_MaximumSlashingTooHigh();\\n error Marketplace_InvalidExpiry();\\n error Marketplace_InvalidMaxSlotLoss();\\n error Marketplace_InsufficientSlots();\\n error Marketplace_InsufficientDuration();\\n error Marketplace_InsufficientProofProbability();\\n error Marketplace_InsufficientCollateral();\\n error Marketplace_InsufficientReward();\\n error Marketplace_InvalidClientAddress();\\n error Marketplace_RequestAlreadyExists();\\n error Marketplace_InvalidSlot();\\n error Marketplace_InvalidCid();\\n error Marketplace_SlotNotFree();\\n error Marketplace_InvalidSlotHost();\\n error Marketplace_AlreadyPaid();\\n error Marketplace_TransferFailed();\\n error Marketplace_UnknownRequest();\\n error Marketplace_InvalidState();\\n error Marketplace_StartNotBeforeExpiry();\\n error Marketplace_SlotNotAcceptingProofs();\\n error Marketplace_SlotIsFree();\\n error Marketplace_ReservationRequired();\\n error Marketplace_NothingToWithdraw();\\n error Marketplace_DurationExceedsLimit();\\n\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n using Requests for Request;\\n using AskHelpers for Ask;\\n\\n IERC20 private immutable _token;\\n MarketplaceConfig private _config;\\n\\n mapping(RequestId => Request) private _requests;\\n mapping(RequestId => RequestContext) internal _requestContexts;\\n mapping(SlotId => Slot) internal _slots;\\n\\n MarketplaceTotals internal _marketplaceTotals;\\n\\n struct RequestContext {\\n RequestState state;\\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\\n /// This is the amount that will be paid out to the host when the request successfully finishes.\\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\\n /// This is possible, because technically it is not possible for this variable to reach 0 in \\\"natural\\\" way as\\n /// that would require all the slots to be filled at the same block as the request was created.\\n uint256 fundsToReturnToClient;\\n uint64 slotsFilled;\\n uint64 startedAt;\\n uint64 endsAt;\\n uint64 expiresAt;\\n }\\n\\n struct Slot {\\n SlotState state;\\n RequestId requestId;\\n /// @notice Timestamp that signals when slot was filled\\n /// @dev Used for calculating payouts as hosts are paid\\n /// based on time they actually host the content\\n uint64 filledAt;\\n uint64 slotIndex;\\n /// @notice Tracks the current amount of host's collateral that is\\n /// to be payed out at the end of Slot's lifespan.\\n /// @dev When Slot is filled, the collateral is collected in amount\\n /// of request.ask.collateralPerByte * request.ask.slotSize\\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\\n /// @dev When Host is slashed for missing a proof the slashed amount is\\n /// reflected in this variable\\n uint256 currentCollateral;\\n /// @notice address used for collateral interactions and identifying hosts\\n address host;\\n }\\n\\n struct ActiveSlot {\\n Request request;\\n uint64 slotIndex;\\n }\\n\\n constructor(\\n MarketplaceConfig memory config,\\n IERC20 token_,\\n IGroth16Verifier verifier\\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\\n _token = token_;\\n\\n if (config.collateral.repairRewardPercentage > 100)\\n revert Marketplace_RepairRewardPercentageTooHigh();\\n if (config.collateral.slashPercentage > 100)\\n revert Marketplace_SlashPercentageTooHigh();\\n\\n if (\\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\\n 100\\n ) {\\n revert Marketplace_MaximumSlashingTooHigh();\\n }\\n _config = config;\\n }\\n\\n function configuration() public view returns (MarketplaceConfig memory) {\\n return _config;\\n }\\n\\n function token() public view returns (IERC20) {\\n return _token;\\n }\\n\\n function currentCollateral(SlotId slotId) public view returns (uint256) {\\n return _slots[slotId].currentCollateral;\\n }\\n\\n function requestStorage(Request calldata request) public {\\n RequestId id = request.id();\\n\\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\\n if (_requests[id].client != address(0)) {\\n revert Marketplace_RequestAlreadyExists();\\n }\\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\\n revert Marketplace_InvalidExpiry();\\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\\n if (request.ask.maxSlotLoss > request.ask.slots)\\n revert Marketplace_InvalidMaxSlotLoss();\\n if (request.ask.duration == 0) {\\n revert Marketplace_InsufficientDuration();\\n }\\n if (request.ask.proofProbability == 0) {\\n revert Marketplace_InsufficientProofProbability();\\n }\\n if (request.ask.collateralPerByte == 0) {\\n revert Marketplace_InsufficientCollateral();\\n }\\n if (request.ask.pricePerBytePerSecond == 0) {\\n revert Marketplace_InsufficientReward();\\n }\\n if (bytes(request.content.cid).length == 0) {\\n revert Marketplace_InvalidCid();\\n }\\n if (request.ask.duration > _config.requestDurationLimit) {\\n revert Marketplace_DurationExceedsLimit();\\n }\\n\\n _requests[id] = request;\\n _requestContexts[id].endsAt =\\n uint64(block.timestamp) +\\n request.ask.duration;\\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\\n\\n _addToMyRequests(request.client, id);\\n\\n uint256 amount = request.maxPrice();\\n _requestContexts[id].fundsToReturnToClient = amount;\\n _marketplaceTotals.received += amount;\\n _transferFrom(msg.sender, amount);\\n\\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\\n }\\n\\n /**\\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\\n provided.\\n * @param requestId RequestId identifying the request containing the slot to\\n fill.\\n * @param slotIndex Index of the slot in the request.\\n * @param proof Groth16 proof procing possession of the slot data.\\n */\\n function fillSlot(\\n RequestId requestId,\\n uint64 slotIndex,\\n Groth16Proof calldata proof\\n ) public requestIsKnown(requestId) {\\n Request storage request = _requests[requestId];\\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\\n\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n\\n if (!_reservations[slotId].contains(msg.sender))\\n revert Marketplace_ReservationRequired();\\n\\n Slot storage slot = _slots[slotId];\\n slot.requestId = requestId;\\n slot.slotIndex = slotIndex;\\n RequestContext storage context = _requestContexts[requestId];\\n\\n if (\\n slotState(slotId) != SlotState.Free &&\\n slotState(slotId) != SlotState.Repair\\n ) {\\n revert Marketplace_SlotNotFree();\\n }\\n\\n _startRequiringProofs(slotId);\\n submitProof(slotId, proof);\\n\\n slot.host = msg.sender;\\n slot.filledAt = uint64(block.timestamp);\\n\\n context.slotsFilled += 1;\\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\\n\\n // Collect collateral\\n uint256 collateralAmount;\\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\\n if (slotState(slotId) == SlotState.Repair) {\\n // Host is repairing a slot and is entitled for repair reward, so he gets \\\"discounted collateral\\\"\\n // in this way he gets \\\"physically\\\" the reward at the end of the request when the full amount of collateral\\n // is returned to him.\\n collateralAmount =\\n collateralPerSlot -\\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\\n } else {\\n collateralAmount = collateralPerSlot;\\n }\\n _transferFrom(msg.sender, collateralAmount);\\n _marketplaceTotals.received += collateralAmount;\\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\\n\\n _addToMySlots(slot.host, slotId);\\n\\n slot.state = SlotState.Filled;\\n emit SlotFilled(requestId, slotIndex);\\n\\n if (\\n context.slotsFilled == request.ask.slots &&\\n context.state == RequestState.New // Only New requests can \\\"start\\\" the requests\\n ) {\\n context.state = RequestState.Started;\\n context.startedAt = uint64(block.timestamp);\\n emit RequestFulfilled(requestId);\\n }\\n }\\n\\n /**\\n * @notice Frees a slot, paying out rewards and returning collateral for\\n finished or cancelled requests to the host that has filled the slot.\\n * @param slotId id of the slot to free\\n * @dev The host that filled the slot must have initiated the transaction\\n (msg.sender). This overload allows `rewardRecipient` and\\n `collateralRecipient` to be optional.\\n */\\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\\n return freeSlot(slotId, msg.sender, msg.sender);\\n }\\n\\n /**\\n * @notice Frees a slot, paying out rewards and returning collateral for\\n finished or cancelled requests.\\n * @param slotId id of the slot to free\\n * @param rewardRecipient address to send rewards to\\n * @param collateralRecipient address to refund collateral to\\n */\\n function freeSlot(\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) public slotIsNotFree(slotId) {\\n Slot storage slot = _slots[slotId];\\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\\n\\n SlotState state = slotState(slotId);\\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\\n\\n if (state == SlotState.Finished) {\\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\\n } else if (state == SlotState.Cancelled) {\\n _payoutCancelledSlot(\\n slot.requestId,\\n slotId,\\n rewardRecipient,\\n collateralRecipient\\n );\\n } else if (state == SlotState.Failed) {\\n _removeFromMySlots(msg.sender, slotId);\\n } else if (state == SlotState.Filled) {\\n // free slot without returning collateral, effectively a 100% slash\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n\\n function _challengeToFieldElement(\\n bytes32 challenge\\n ) internal pure returns (uint256) {\\n // use only 31 bytes of the challenge to ensure that it fits into the field\\n bytes32 truncated = bytes32(bytes31(challenge));\\n // convert from little endian to big endian\\n bytes32 bigEndian = _byteSwap(truncated);\\n // convert bytes to integer\\n return uint256(bigEndian);\\n }\\n\\n function _merkleRootToFieldElement(\\n bytes32 merkleRoot\\n ) internal pure returns (uint256) {\\n // convert from little endian to big endian\\n bytes32 bigEndian = _byteSwap(merkleRoot);\\n // convert bytes to integer\\n return uint256(bigEndian);\\n }\\n\\n function submitProof(\\n SlotId id,\\n Groth16Proof calldata proof\\n ) public requestIsKnown(_slots[id].requestId) {\\n Slot storage slot = _slots[id];\\n Request storage request = _requests[slot.requestId];\\n uint256[] memory pubSignals = new uint256[](3);\\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\\n pubSignals[2] = slot.slotIndex;\\n _proofReceived(id, proof, pubSignals);\\n }\\n\\n function markProofAsMissing(SlotId slotId, Period period) public {\\n if (slotState(slotId) != SlotState.Filled)\\n revert Marketplace_SlotNotAcceptingProofs();\\n\\n _markProofAsMissing(slotId, period);\\n Slot storage slot = _slots[slotId];\\n Request storage request = _requests[slot.requestId];\\n\\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\\n _config.collateral.slashPercentage) / 100;\\n\\n uint256 validatorRewardAmount = (slashedAmount *\\n _config.collateral.validatorRewardPercentage) / 100;\\n _marketplaceTotals.sent += validatorRewardAmount;\\n assert(_token.transfer(msg.sender, validatorRewardAmount));\\n\\n slot.currentCollateral -= slashedAmount;\\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\\n // When the number of slashings is at or above the allowed amount,\\n // free the slot.\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n\\n /**\\n * @notice Abandons the slot without returning collateral, effectively slashing the\\n entire collateral.\\n * @param slotId SlotId of the slot to free.\\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\\n to 0.\\n */\\n function _forciblyFreeSlot(SlotId slotId) internal {\\n Slot storage slot = _slots[slotId];\\n RequestId requestId = slot.requestId;\\n RequestContext storage context = _requestContexts[requestId];\\n\\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\\n // we keep correctly the track of the funds that needs to be returned at the end.\\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\\n\\n _removeFromMySlots(slot.host, slotId);\\n delete _reservations[slotId]; // We purge all the reservations for the slot\\n slot.state = SlotState.Repair;\\n slot.filledAt = 0;\\n slot.currentCollateral = 0;\\n slot.host = address(0);\\n context.slotsFilled -= 1;\\n emit SlotFreed(requestId, slot.slotIndex);\\n _resetMissingProofs(slotId);\\n\\n Request storage request = _requests[requestId];\\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\\n if (\\n slotsLost > request.ask.maxSlotLoss &&\\n context.state == RequestState.Started\\n ) {\\n context.state = RequestState.Failed;\\n context.endsAt = uint64(block.timestamp) - 1;\\n emit RequestFailed(requestId);\\n }\\n }\\n\\n function _payoutSlot(\\n RequestId requestId,\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) private requestIsKnown(requestId) {\\n RequestContext storage context = _requestContexts[requestId];\\n Request storage request = _requests[requestId];\\n context.state = RequestState.Finished;\\n Slot storage slot = _slots[slotId];\\n\\n _removeFromMyRequests(request.client, requestId);\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\\n uint256 collateralAmount = slot.currentCollateral;\\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\\n slot.state = SlotState.Paid;\\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n }\\n\\n /**\\n * @notice Pays out a host for duration of time that the slot was filled, and\\n returns the collateral.\\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\\n to the host address.\\n * @param requestId RequestId of the request that contains the slot to be paid\\n out.\\n * @param slotId SlotId of the slot to be paid out.\\n */\\n function _payoutCancelledSlot(\\n RequestId requestId,\\n SlotId slotId,\\n address rewardRecipient,\\n address collateralRecipient\\n ) private requestIsKnown(requestId) {\\n Slot storage slot = _slots[slotId];\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 payoutAmount = _slotPayout(\\n requestId,\\n slot.filledAt,\\n requestExpiry(requestId)\\n );\\n uint256 collateralAmount = slot.currentCollateral;\\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\\n slot.state = SlotState.Paid;\\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\\n revert Marketplace_TransferFailed();\\n }\\n }\\n\\n /**\\n * @notice Withdraws remaining storage request funds back to the client that\\n deposited them.\\n * @dev Request must be cancelled, failed or finished, and the\\n transaction must originate from the depositor address.\\n * @param requestId the id of the request\\n */\\n function withdrawFunds(RequestId requestId) public {\\n withdrawFunds(requestId, msg.sender);\\n }\\n\\n /**\\n * @notice Withdraws storage request funds to the provided address.\\n * @dev Request must be expired, must be in RequestState.New, and the\\n transaction must originate from the depositer address.\\n * @param requestId the id of the request\\n * @param withdrawRecipient address to return the remaining funds to\\n */\\n function withdrawFunds(\\n RequestId requestId,\\n address withdrawRecipient\\n ) public requestIsKnown(requestId) {\\n Request storage request = _requests[requestId];\\n RequestContext storage context = _requestContexts[requestId];\\n\\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\\n\\n RequestState state = requestState(requestId);\\n if (\\n state != RequestState.Cancelled &&\\n state != RequestState.Failed &&\\n state != RequestState.Finished\\n ) {\\n revert Marketplace_InvalidState();\\n }\\n\\n // fundsToReturnToClient == 0 is used for \\\"double-spend\\\" protection, once the funds are withdrawn\\n // then this variable is set to 0.\\n if (context.fundsToReturnToClient == 0)\\n revert Marketplace_NothingToWithdraw();\\n\\n if (state == RequestState.Cancelled) {\\n context.state = RequestState.Cancelled;\\n emit RequestCancelled(requestId);\\n\\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\\n // When requests are cancelled, funds earmarked for payment for the duration\\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\\n // Update `fundsToReturnToClient` to reflect this.\\n context.fundsToReturnToClient +=\\n context.slotsFilled *\\n _slotPayout(requestId, requestExpiry(requestId));\\n } else if (state == RequestState.Failed) {\\n // For Failed requests the client is refunded whole amount.\\n context.fundsToReturnToClient = request.maxPrice();\\n } else {\\n context.state = RequestState.Finished;\\n }\\n\\n _removeFromMyRequests(request.client, requestId);\\n\\n uint256 amount = context.fundsToReturnToClient;\\n _marketplaceTotals.sent += amount;\\n\\n if (!_token.transfer(withdrawRecipient, amount)) {\\n revert Marketplace_TransferFailed();\\n }\\n\\n // We zero out the funds tracking in order to prevent double-spends\\n context.fundsToReturnToClient = 0;\\n }\\n\\n function getActiveSlot(\\n SlotId slotId\\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\\n Slot storage slot = _slots[slotId];\\n ActiveSlot memory activeSlot;\\n activeSlot.request = _requests[slot.requestId];\\n activeSlot.slotIndex = slot.slotIndex;\\n return activeSlot;\\n }\\n\\n modifier requestIsKnown(RequestId requestId) {\\n if (_requests[requestId].client == address(0))\\n revert Marketplace_UnknownRequest();\\n\\n _;\\n }\\n\\n function getRequest(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (Request memory) {\\n return _requests[requestId];\\n }\\n\\n modifier slotIsNotFree(SlotId slotId) {\\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\\n _;\\n }\\n\\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\\n return _slots[slotId].state == SlotState.Free;\\n }\\n\\n function requestEnd(RequestId requestId) public view returns (uint64) {\\n RequestState state = requestState(requestId);\\n if (state == RequestState.New || state == RequestState.Started) {\\n return _requestContexts[requestId].endsAt;\\n }\\n if (state == RequestState.Cancelled) {\\n return _requestContexts[requestId].expiresAt;\\n }\\n return\\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\\n }\\n\\n function requestExpiry(RequestId requestId) public view returns (uint64) {\\n return _requestContexts[requestId].expiresAt;\\n }\\n\\n /**\\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\\n * @param requestId RequestId of the request used to calculate the payout\\n * amount.\\n * @param startingTimestamp timestamp indicating when a host filled a slot and\\n * started providing proofs.\\n */\\n function _slotPayout(\\n RequestId requestId,\\n uint64 startingTimestamp\\n ) private view returns (uint256) {\\n return\\n _slotPayout(\\n requestId,\\n startingTimestamp,\\n _requestContexts[requestId].endsAt\\n );\\n }\\n\\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\\n function _slotPayout(\\n RequestId requestId,\\n uint64 startingTimestamp,\\n uint64 endingTimestamp\\n ) private view returns (uint256) {\\n Request storage request = _requests[requestId];\\n if (startingTimestamp >= endingTimestamp)\\n revert Marketplace_StartNotBeforeExpiry();\\n return\\n (endingTimestamp - startingTimestamp) *\\n request.ask.pricePerSlotPerSecond();\\n }\\n\\n function getHost(SlotId slotId) public view returns (address) {\\n return _slots[slotId].host;\\n }\\n\\n function requestState(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (RequestState) {\\n RequestContext storage context = _requestContexts[requestId];\\n if (\\n context.state == RequestState.New &&\\n uint64(block.timestamp) > requestExpiry(requestId)\\n ) {\\n return RequestState.Cancelled;\\n } else if (\\n (context.state == RequestState.Started ||\\n context.state == RequestState.New) &&\\n uint64(block.timestamp) > context.endsAt\\n ) {\\n return RequestState.Finished;\\n } else {\\n return context.state;\\n }\\n }\\n\\n function slotState(SlotId slotId) public view override returns (SlotState) {\\n Slot storage slot = _slots[slotId];\\n if (RequestId.unwrap(slot.requestId) == 0) {\\n return SlotState.Free;\\n }\\n RequestState reqState = requestState(slot.requestId);\\n if (slot.state == SlotState.Paid) {\\n return SlotState.Paid;\\n }\\n if (reqState == RequestState.Cancelled) {\\n return SlotState.Cancelled;\\n }\\n if (reqState == RequestState.Finished) {\\n return SlotState.Finished;\\n }\\n if (reqState == RequestState.Failed) {\\n return SlotState.Failed;\\n }\\n return slot.state;\\n }\\n\\n function slotProbability(\\n SlotId slotId\\n ) public view override returns (uint256) {\\n Slot storage slot = _slots[slotId];\\n Request storage request = _requests[slot.requestId];\\n return\\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\\n }\\n\\n function _transferFrom(address sender, uint256 amount) internal {\\n address receiver = address(this);\\n if (!_token.transferFrom(sender, receiver, amount))\\n revert Marketplace_TransferFailed();\\n }\\n\\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\\n event RequestFulfilled(RequestId indexed requestId);\\n event RequestFailed(RequestId indexed requestId);\\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\\n event RequestCancelled(RequestId indexed requestId);\\n\\n struct MarketplaceTotals {\\n uint256 received;\\n uint256 sent;\\n }\\n}\\n\",\"keccak256\":\"0x183c27e6316d854781a5b8319c833f7af087e57982fa26d724cad68759bb3c6e\",\"license\":\"MIT\"},\"contracts/Periods.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ncontract Periods {\\n error Periods_InvalidSecondsPerPeriod();\\n\\n type Period is uint64;\\n\\n uint64 internal immutable _secondsPerPeriod;\\n\\n constructor(uint64 secondsPerPeriod) {\\n if (secondsPerPeriod == 0) {\\n revert Periods_InvalidSecondsPerPeriod();\\n }\\n _secondsPerPeriod = secondsPerPeriod;\\n }\\n\\n function _periodOf(uint64 timestamp) internal view returns (Period) {\\n return Period.wrap(timestamp / _secondsPerPeriod);\\n }\\n\\n function _blockPeriod() internal view returns (Period) {\\n return _periodOf(uint64(block.timestamp));\\n }\\n\\n function _nextPeriod(Period period) internal pure returns (Period) {\\n return Period.wrap(Period.unwrap(period) + 1);\\n }\\n\\n function _periodStart(Period period) internal view returns (uint64) {\\n return Period.unwrap(period) * _secondsPerPeriod;\\n }\\n\\n function _periodEnd(Period period) internal view returns (uint64) {\\n return _periodStart(_nextPeriod(period));\\n }\\n\\n function _isBefore(Period a, Period b) internal pure returns (bool) {\\n return Period.unwrap(a) < Period.unwrap(b);\\n }\\n\\n function _isAfter(Period a, Period b) internal pure returns (bool) {\\n return _isBefore(b, a);\\n }\\n}\\n\",\"keccak256\":\"0xd8b259c4b2b8f94f1a5530c7028ec5ecebccd7c97de5cb3283d4e51c24ac4b05\",\"license\":\"MIT\"},\"contracts/Proofs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Periods.sol\\\";\\nimport \\\"./Groth16.sol\\\";\\n\\n/**\\n * @title Proofs\\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\\n */\\nabstract contract Proofs is Periods {\\n error Proofs_InsufficientBlockHeight();\\n error Proofs_InvalidProof();\\n error Proofs_ProofAlreadySubmitted();\\n error Proofs_PeriodNotEnded();\\n error Proofs_ValidationTimedOut();\\n error Proofs_ProofNotMissing();\\n error Proofs_ProofNotRequired();\\n error Proofs_ProofAlreadyMarkedMissing();\\n\\n ProofConfig private _config;\\n IGroth16Verifier private _verifier;\\n\\n /**\\n * Creation of the contract requires at least 256 mined blocks!\\n * @param config Proving configuration\\n */\\n constructor(\\n ProofConfig memory config,\\n IGroth16Verifier verifier\\n ) Periods(config.period) {\\n if (block.number <= 256) {\\n revert Proofs_InsufficientBlockHeight();\\n }\\n\\n _config = config;\\n _verifier = verifier;\\n }\\n\\n mapping(SlotId => uint64) private _slotStarts;\\n mapping(SlotId => uint64) private _missed;\\n mapping(SlotId => mapping(Period => bool)) private _received;\\n mapping(SlotId => mapping(Period => bool)) private _missing;\\n\\n function slotState(SlotId id) public view virtual returns (SlotState);\\n\\n /**\\n * @param id Slot's ID\\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\\n */\\n function slotProbability(SlotId id) public view virtual returns (uint256);\\n\\n /**\\n * @return Number of missed proofs since Slot was Filled\\n */\\n function missingProofs(SlotId slotId) public view returns (uint64) {\\n return _missed[slotId];\\n }\\n\\n /**\\n * @param slotId Slot's ID for which the proofs should be reset\\n * @notice Resets the missing proofs counter to zero\\n */\\n function _resetMissingProofs(SlotId slotId) internal {\\n _missed[slotId] = 0;\\n }\\n\\n /**\\n * @param id Slot's ID for which the proofs should be started to require\\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\\n * and saves the required probability.\\n */\\n function _startRequiringProofs(SlotId id) internal {\\n _slotStarts[id] = uint64(block.timestamp);\\n }\\n\\n /**\\n * @param id Slot's ID for which the pointer should be calculated\\n * @param period Period for which the pointer should be calculated\\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\\n */\\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\\n uint256 blockNumber = block.number % 256;\\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\\n 256;\\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\\n return uint8(pointer);\\n }\\n\\n /**\\n * @param id Slot's ID for which the pointer should be calculated\\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\\n */\\n function getPointer(SlotId id) public view returns (uint8) {\\n return _getPointer(id, _blockPeriod());\\n }\\n\\n /**\\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\\n * @return Challenge that should be used for generation of proofs\\n */\\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\\n bytes32 hash = blockhash(block.number - 1 - pointer);\\n assert(uint256(hash) != 0);\\n return keccak256(abi.encode(hash));\\n }\\n\\n /**\\n * @param id Slot's ID for which the challenge should be calculated\\n * @param period Period for which the challenge should be calculated\\n * @return Challenge that should be used for generation of proofs\\n */\\n function _getChallenge(\\n SlotId id,\\n Period period\\n ) internal view returns (bytes32) {\\n return _getChallenge(_getPointer(id, period));\\n }\\n\\n /**\\n * @param id Slot's ID for which the challenge should be calculated\\n * @return Challenge for current Period that should be used for generation of proofs\\n */\\n function getChallenge(SlotId id) public view returns (bytes32) {\\n return _getChallenge(id, _blockPeriod());\\n }\\n\\n /**\\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\\n * @param period Period for which the requirements are gathered.\\n */\\n function _getProofRequirement(\\n SlotId id,\\n Period period\\n ) internal view returns (bool isRequired, uint8 pointer) {\\n SlotState state = slotState(id);\\n Period start = _periodOf(_slotStarts[id]);\\n if (state != SlotState.Filled || !_isAfter(period, start)) {\\n return (false, 0);\\n }\\n pointer = _getPointer(id, period);\\n bytes32 challenge = _getChallenge(pointer);\\n\\n /// Scaling of the probability according the downtime configuration\\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\\n uint256 probability = slotProbability(id);\\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\\n }\\n\\n /**\\n * See isProofRequired\\n */\\n function _isProofRequired(\\n SlotId id,\\n Period period\\n ) internal view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, period);\\n return isRequired && pointer >= _config.downtime;\\n }\\n\\n /**\\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\\n * @return bool indicating if proof is required for current period\\n */\\n function isProofRequired(SlotId id) public view returns (bool) {\\n return _isProofRequired(id, _blockPeriod());\\n }\\n\\n /**\\n * Proof Downtime specifies part of the Period when the proof is not required even\\n * if the proof should be required. This function returns true if the pointer is\\n * in downtime (hence no proof required now) and at the same time the proof\\n * will be required later on in the Period.\\n *\\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\\n * @return bool\\n */\\n function willProofBeRequired(SlotId id) public view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\\n return isRequired && pointer < _config.downtime;\\n }\\n\\n /**\\n * Function used for submitting and verification of the proofs.\\n *\\n * @dev Reverts when proof is invalid or had been already submitted.\\n * @dev Emits ProofSubmitted event.\\n * @param id Slot's ID for which the proof requirements should be checked\\n * @param proof Groth16 proof\\n * @param pubSignals Proofs public input\\n */\\n function _proofReceived(\\n SlotId id,\\n Groth16Proof calldata proof,\\n uint[] memory pubSignals\\n ) internal {\\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\\n\\n _received[id][_blockPeriod()] = true;\\n emit ProofSubmitted(id);\\n }\\n\\n /**\\n * Function used to mark proof as missing.\\n *\\n * @param id Slot's ID for which the proof is missing\\n * @param missedPeriod Period for which the proof was missed\\n * @dev Reverts when:\\n * - missedPeriod has not ended yet ended\\n * - missing proof was time-barred\\n * - proof was submitted\\n * - proof was not required for missedPeriod period\\n * - proof was already marked as missing\\n */\\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\\n uint256 end = _periodEnd(missedPeriod);\\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\\n if (block.timestamp >= end + _config.timeout)\\n revert Proofs_ValidationTimedOut();\\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\\n\\n _missing[id][missedPeriod] = true;\\n _missed[id] += 1;\\n }\\n\\n event ProofSubmitted(SlotId id);\\n}\\n\",\"keccak256\":\"0xc0ea30ef10d9a450dd869da7af85dc328c33e912e385e9f413bf32b21e3d8b3e\",\"license\":\"MIT\"},\"contracts/Requests.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\ntype RequestId is bytes32;\\ntype SlotId is bytes32;\\n\\nstruct Request {\\n address client;\\n Ask ask;\\n Content content;\\n uint64 expiry; // amount of seconds since start of the request at which this request expires\\n bytes32 nonce; // random nonce to differentiate between similar requests\\n}\\n\\nstruct Ask {\\n uint256 proofProbability; // how often storage proofs are required\\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\\n uint64 slots; // the number of requested slots\\n uint64 slotSize; // amount of storage per slot (in number of bytes)\\n uint64 duration; // how long content should be stored (in seconds)\\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\\n}\\n\\nstruct Content {\\n bytes cid; // content id, used to download the dataset\\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\\n}\\n\\nenum RequestState {\\n New, // [default] waiting to fill slots\\n Started, // all slots filled, accepting regular proofs\\n Cancelled, // not enough slots filled before expiry\\n Finished, // successfully completed\\n Failed // too many nodes have failed to provide proofs, data lost\\n}\\n\\nenum SlotState {\\n Free, // [default] not filled yet\\n Filled, // host has filled slot\\n Finished, // successfully completed\\n Failed, // the request has failed\\n Paid, // host has been paid\\n Cancelled, // when request was cancelled then slot is cancelled as well\\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\\n}\\n\\nlibrary AskHelpers {\\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\\n return ask.collateralPerByte * ask.slotSize;\\n }\\n\\n function pricePerSlotPerSecond(\\n Ask memory ask\\n ) internal pure returns (uint256) {\\n return ask.pricePerBytePerSecond * ask.slotSize;\\n }\\n}\\n\\nlibrary Requests {\\n using AskHelpers for Ask;\\n\\n function id(Request memory request) internal pure returns (RequestId) {\\n return RequestId.wrap(keccak256(abi.encode(request)));\\n }\\n\\n function slotId(\\n RequestId requestId,\\n uint64 slotIndex\\n ) internal pure returns (SlotId) {\\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\\n }\\n\\n function toRequestIds(\\n bytes32[] memory ids\\n ) internal pure returns (RequestId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function toSlotIds(\\n bytes32[] memory ids\\n ) internal pure returns (SlotId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function maxPrice(Request memory request) internal pure returns (uint256) {\\n return\\n request.ask.slots *\\n request.ask.duration *\\n request.ask.pricePerSlotPerSecond();\\n }\\n}\\n\",\"keccak256\":\"0x48ae7387078d0c3175d0b7fb8c0b7a2fc82a7e98ac28953904d0cca67e47e352\",\"license\":\"MIT\"},\"contracts/SlotReservations.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Configuration.sol\\\";\\n\\nabstract contract SlotReservations {\\n using EnumerableSet for EnumerableSet.AddressSet;\\n error SlotReservations_ReservationNotAllowed();\\n\\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\\n SlotReservationsConfig private _config;\\n\\n constructor(SlotReservationsConfig memory config) {\\n _config = config;\\n }\\n\\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\\n\\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\\n if (!canReserveSlot(requestId, slotIndex))\\n revert SlotReservations_ReservationNotAllowed();\\n\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n _reservations[slotId].add(msg.sender);\\n\\n if (_reservations[slotId].length() == _config.maxReservations) {\\n emit SlotReservationsFull(requestId, slotIndex);\\n }\\n }\\n\\n function canReserveSlot(\\n RequestId requestId,\\n uint64 slotIndex\\n ) public view returns (bool) {\\n address host = msg.sender;\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n return\\n // TODO: add in check for address inside of expanding window\\n _slotIsFree(slotId) &&\\n (_reservations[slotId].length() < _config.maxReservations) &&\\n (!_reservations[slotId].contains(host));\\n }\\n\\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\\n}\\n\",\"keccak256\":\"0x4c1ad6a6b4c702835f42800d5e51824882f375861ed7c0d959a5aec37483648d\",\"license\":\"MIT\"},\"contracts/StateRetrieval.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Requests.sol\\\";\\n\\ncontract StateRetrieval {\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using Requests for bytes32[];\\n\\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\\n\\n function myRequests() public view returns (RequestId[] memory) {\\n return _requestsPerClient[msg.sender].values().toRequestIds();\\n }\\n\\n function mySlots() public view returns (SlotId[] memory) {\\n return _slotsPerHost[msg.sender].values().toSlotIds();\\n }\\n\\n function _hasSlots(address host) internal view returns (bool) {\\n return _slotsPerHost[host].length() > 0;\\n }\\n\\n function _addToMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\\n }\\n\\n function _addToMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\\n }\\n\\n function _removeFromMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\\n }\\n\\n function _removeFromMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\\n }\\n}\\n\",\"keccak256\":\"0xedc2d20f718aa5bd75e250ab5e2c11eae7849057391eb06996245899922ee6cf\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c060405234801561001057600080fd5b50604051614eb5380380614eb583398101604081905261002f9161053b565b602083015180516040850151516001805460ff191660ff90921691909117905582906001600160401b03811660000361007b5760405163015536c760e51b815260040160405180910390fd5b6001600160401b031660805261010043116100a9576040516338f5f66160e11b815260040160405180910390fd5b8151600280546020850151604086015160608701516001600160401b039586166001600160801b0319909416939093176801000000000000000095909216949094021761ffff60801b1916600160801b60ff9485160260ff60881b191617600160881b9390911692909202919091178155608083015183919060039061012f90826106d9565b5050600480546001600160a01b0319166001600160a01b0393841617905550831660a05250825151606460ff909116111561017d576040516302bd816360e41b815260040160405180910390fd5b606483600001516040015160ff1611156101aa576040516354e5e0ab60e11b815260040160405180910390fd5b825160408101516020909101516064916101c391610797565b60ff1611156101e5576040516317ff9d0f60e21b815260040160405180910390fd5b82518051600b805460208085015160408087015160609788015160ff90811663010000000263ff0000001992821662010000029290921663ffff0000199482166101000261ffff1990971698821698909817959095179290921695909517178355808801518051600c80549383015196830151978301518516600160881b0260ff60881b1998909516600160801b029790971661ffff60801b196001600160401b0397881668010000000000000000026001600160801b031990951697909216969096179290921791909116939093171783556080820151869391929190600d906102d090826106d9565b50505060408201515160038201805460ff191660ff909216919091179055606090910151600490910180546001600160401b0319166001600160401b03909216919091179055506107c8915050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b03811182821017156103575761035761031f565b60405290565b604051608081016001600160401b03811182821017156103575761035761031f565b604051601f8201601f191681016001600160401b03811182821017156103a7576103a761031f565b604052919050565b805160ff811681146103c057600080fd5b919050565b80516001600160401b03811681146103c057600080fd5b600060a082840312156103ee57600080fd5b6103f6610335565b9050610401826103c5565b815261040f602083016103c5565b6020820152610420604083016103af565b6040820152610431606083016103af565b606082015260808201516001600160401b0381111561044f57600080fd5b8201601f8101841361046057600080fd5b80516001600160401b038111156104795761047961031f565b61048c601f8201601f191660200161037f565b8181528560208385010111156104a157600080fd5b60005b828110156104c0576020818501810151838301820152016104a4565b5060006020838301015280608085015250505092915050565b6000602082840312156104eb57600080fd5b604051602081016001600160401b038111828210171561050d5761050d61031f565b60405290508061051c836103af565b905292915050565b80516001600160a01b03811681146103c057600080fd5b60008060006060848603121561055057600080fd5b83516001600160401b0381111561056657600080fd5b840180860360e081121561057957600080fd5b61058161035d565b608082121561058f57600080fd5b61059761035d565b91506105a2836103af565b82526105b0602084016103af565b60208301526105c1604084016103af565b60408301526105d2606084016103af565b60608301529081526080820151906001600160401b038211156105f457600080fd5b610600888385016103dc565b60208201526106128860a085016104d9565b604082015261062360c084016103c5565b6060820152945061063991505060208501610524565b915061064760408501610524565b90509250925092565b600181811c9082168061066457607f821691505b60208210810361068457634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156106d457806000526020600020601f840160051c810160208510156106b15750805b601f840160051c820191505b818110156106d157600081556001016106bd565b50505b505050565b81516001600160401b038111156106f2576106f261031f565b610706816107008454610650565b8461068a565b6020601f82116001811461073a57600083156107225750848201515b600019600385901b1c1916600184901b1784556106d1565b600084815260208120601f198516915b8281101561076a578785015182556020948501946001909201910161074a565b50848210156107885786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b60ff81811683821602908116908181146107c157634e487b7160e01b600052601160045260246000fd5b5092915050565b60805160a051614690610825600039600081816104bf01528181610f640152818161200d0152818161257e0152818161262e015281816127bd0152818161286d0152612c97015260008181613501015261379101526146906000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80636e2b54ee116100f9578063c0cc4add11610097578063e8aa0a0711610071578063e8aa0a0714610461578063f752196b14610474578063fb1e61ca1461049d578063fc0c546a146104bd57600080fd5b8063c0cc4add14610428578063c5d433511461043b578063d02bbe331461044e57600080fd5b8063a29c29a4116100d3578063a29c29a4146103b2578063a3a0807e146103c5578063b396dc79146103e8578063be5cdc481461040857600080fd5b80636e2b54ee146103845780639777b72c1461039757806399b6da0c1461039f57600080fd5b8063329b5a0b1161016657806351a766421161014057806351a76642146103035780635da73835146103165780636b00c8cf1461032b5780636c70bee91461036f57600080fd5b8063329b5a0b14610298578063458d2bf1146102cb5780634641dce6146102de57600080fd5b806312827602116101a2578063128276021461022e5780631d873c1b14610241578063237d84821461025457806326d6f8341461026757600080fd5b806302fa8e65146101c957806305b90773146101f95780630aefaabe14610219575b600080fd5b6101dc6101d736600461385e565b6104e3565b6040516001600160401b0390911681526020015b60405180910390f35b61020c61020736600461385e565b6105c1565b6040516101f0919061388d565b61022c6102273660046138bc565b6106e4565b005b61022c61023c366004613923565b610877565b61022c61024f366004613966565b610948565b61022c610262366004613923565b610dee565b61028a61027536600461385e565b60009081526012602052604090206003015490565b6040519081526020016101f0565b6101dc6102a636600461385e565b600090815260116020526040902060020154600160c01b90046001600160401b031690565b61028a6102d936600461385e565b61103a565b6102f16102ec36600461385e565b611053565b60405160ff90911681526020016101f0565b61028a61031136600461385e565b611066565b61031e6110c5565b6040516101f091906139a6565b61035761033936600461385e565b6000908152601260205260409020600401546001600160a01b031690565b6040516001600160a01b0390911681526020016101f0565b6103776110ec565b6040516101f09190613a84565b61022c61039236600461385e565b611263565b61031e611270565b61022c6103ad366004613b0c565b61128f565b61022c6103c036600461385e565b6117d5565b6103d86103d336600461385e565b611827565b60405190151581526020016101f0565b6103fb6103f636600461385e565b611863565b6040516101f09190613c3b565b61041b61041636600461385e565b611b45565b6040516101f09190613c76565b6103d861043636600461385e565b611c13565b61022c610449366004613c8a565b611c26565b6103d861045c366004613923565b6120a7565b61022c61046f366004613caf565b612113565b6101dc61048236600461385e565b6000908152600660205260409020546001600160401b031690565b6104b06104ab36600461385e565b612243565b6040516101f09190613cdd565b7f0000000000000000000000000000000000000000000000000000000000000000610357565b6000806104ef836105c1565b9050600081600481111561050557610505613877565b14806105225750600181600481111561052057610520613877565b145b1561054e575050600090815260116020526040902060020154600160801b90046001600160401b031690565b600281600481111561056257610562613877565b0361058e575050600090815260116020526040902060020154600160c01b90046001600160401b031690565b6000838152601160205260409020600201546105ba90600160801b90046001600160401b031642612459565b9392505050565b60008181526010602052604081205482906001600160a01b03166105f857604051635eeb253d60e11b815260040160405180910390fd5b600083815260116020526040812090815460ff16600481111561061d5761061d613877565b14801561065c5750600084815260116020526040902060020154600160c01b90046001600160401b03166001600160401b0316426001600160401b0316115b1561066b5760029250506106de565b6001815460ff16600481111561068357610683613877565b14806106a457506000815460ff1660048111156106a2576106a2613877565b145b80156106c8575060028101546001600160401b03600160801b909104811642909116115b156106d75760039250506106de565b5460ff1691505b50919050565b826000808281526012602052604090205460ff16600681111561070957610709613877565b0361072757604051638b41ec7f60e01b815260040160405180910390fd5b600084815260126020526040902060048101546001600160a01b0316331461077b576040517f57a6f4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061078686611b45565b9050600481600681111561079c5761079c613877565b036107d3576040517fc2cbf77700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160068111156107e7576107e7613877565b03610801576107fc826001015487878761246f565b61086f565b600581600681111561081557610815613877565b0361082a576107fc82600101548787876126b8565b600381600681111561083e5761083e613877565b0361084d576107fc3387612901565b600181600681111561086157610861613877565b0361086f5761086f86612923565b505050505050565b61088182826120a7565b6108b7576040517f424a04ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108c38383612b7b565b60008181526020819052604090209091506108de9033612bc0565b50600154600082815260208190526040902060ff909116906108ff90612bd5565b03610943576040516001600160401b038316815283907fc8e6c955744189a19222ec226b72ac1435d88d5745252dac56e6f679f64c037a9060200160405180910390a25b505050565b60008381526010602052604090205483906001600160a01b031661097f57604051635eeb253d60e11b815260040160405180910390fd5b600084815260106020526040902060048101546001600160401b03908116908516106109d7576040517f3b920b8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006109e38686612b7b565b60008181526020819052604090209091506109fe9033612bdf565b610a34576040517fd651ce1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601260209081526040808320600181018a90556002810180546fffffffffffffffff00000000000000001916600160401b6001600160401b038c1602179055898452601190925282209091610a8d84611b45565b6006811115610a9e57610a9e613877565b14158015610ac657506006610ab284611b45565b6006811115610ac357610ac3613877565b14155b15610afd576040517fff556acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600560205260409020805467ffffffffffffffff1916426001600160401b0316179055610b2f8387612113565b60048201805473ffffffffffffffffffffffffffffffffffffffff191633179055600280830180546001600160401b0342811667ffffffffffffffff19909216919091179091559082018054600192600091610b8d91859116613d06565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610bd2888360020160009054906101000a90046001600160401b0316612c01565b816001016000828254610be59190613d25565b90915550506040805160e081018252600186015481526002860154602082015260038601549181019190915260048501546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526000908190610c5e90612c30565b90506006610c6b86611b45565b6006811115610c7c57610c7c613877565b03610caf57600b54606490610c949060ff1683613d38565b610c9e9190613d65565b610ca89082613d25565b9150610cb3565b8091505b610cbd3383612c4f565b8160136000016000828254610cd29190613d79565b9091555050600384018190556004840154610cf6906001600160a01b031686612d23565b835460ff191660011784556040516001600160401b038a1681528a907f8f301470a994578b52323d625dfbf827ca5208c81747d3459be7b8867baec3ec9060200160405180910390a2600486015460028401546001600160401b039081169116148015610d7857506000835460ff166004811115610d7657610d76613877565b145b15610de257825460ff191660011783556002830180546001600160401b034216600160401b026fffffffffffffffff0000000000000000199091161790556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b6001610df983611b45565b6006811115610e0a57610e0a613877565b14610e41576040517fae9dcffd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e4b8282612d45565b6000828152601260209081526040808320600180820154855260108452828520600b54845160e08101865292820154835260028201549583019590955260038101549382019390935260048301546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152909391926064916201000090910460ff1690610eee90612c30565b610ef89190613d38565b610f029190613d65565b600b54909150600090606490610f22906301000000900460ff1684613d38565b610f2c9190613d65565b90508060136001016000828254610f439190613d79565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd99190613d8c565b610fe557610fe5613dae565b81846003016000828254610ff99190613d25565b9091555050600b5460008781526006602052604090205461010090910460ff16906001600160401b03166001600160401b03161061086f5761086f86612923565b600061104d82611048612f5c565b612f67565b92915050565b600061104d82611061612f5c565b612f7b565b60008181526012602090815260408083206001810154845260109092528220600c54610100906110a090600160801b900460ff1682613dc4565b60018301546110b39161ffff1690613d38565b6110bd9190613d65565b949350505050565b336000908152600a602052604090206060906110e7906110e49061300d565b90565b905090565b6110f46137b6565b604080516101008082018352600b805460ff8082166080808701918252948304821660a080880191909152620100008404831660c08801526301000000909304821660e0870152855285519182018652600c80546001600160401b038082168552600160401b820416602085810191909152600160801b82048416988501989098527101000000000000000000000000000000000090049091166060830152600d80549596939593870194929391928401916111af90613dde565b80601f01602080910402602001604051908101604052809291908181526020018280546111db90613dde565b80156112285780601f106111fd57610100808354040283529160200191611228565b820191906000526020600020905b81548152906001019060200180831161120b57829003601f168201915b5050509190925250505081526040805160208181018352600385015460ff1682528301526004909201546001600160401b0316910152919050565b61126d8133611c26565b50565b3360009081526009602052604090206060906110e7906110e49061300d565b60006112a261129d83613f6f565b61301a565b9050336112b26020840184614078565b6001600160a01b0316146112d9576040516334c69e3160e11b815260040160405180910390fd5b6000818152601060205260409020546001600160a01b031615611328576040517ffc7d069000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61133a61014083016101208401614095565b6001600160401b03161580611381575061135a60e0830160c08401614095565b6001600160401b031661137561014084016101208501614095565b6001600160401b031610155b156113b8576040517fdf63f61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113c860a0830160808401614095565b6001600160401b031660000361140a576040517f535ed2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61141a60a0830160808401614095565b6001600160401b0316611434610100840160e08501614095565b6001600160401b03161115611475576040517fb9551ab100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61148560e0830160c08401614095565b6001600160401b03166000036114c7576040517f090a5ecd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020820135600003611505576040517f6aba7aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060820135600003611543576040517ffb7df0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040820135600003611581576040517f47ba51c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61158f6101008301836140b2565b61159990806140d2565b90506000036115d4576040517f86f8cf9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160401b03166115f060e0840160c08501614095565b6001600160401b03161115611631576040517f1267b3f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601060205260409020829061164b8282614272565b5061165e905060e0830160c08401614095565b6116689042613d06565b600082815260116020526040902060020180546001600160401b0392909216600160801b0267ffffffffffffffff60801b199092169190911790556116b561014083016101208401614095565b6116bf9042613d06565b600082815260116020908152604090912060020180546001600160401b0393909316600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff909316929092179091556117209061171a90840184614078565b8261304a565b600061173361172e84613f6f565b61306c565b600083815260116020526040812060010182905560138054929350839290919061175e908490613d79565b9091555061176e90503382612c4f565b6000828152601160209081526040918290206002015491517f1bf9c457accf8703dbf7cdf1b58c2f74ddf2e525f98155c70b3d318d74609bd8926117c892869290880191600160c01b90046001600160401b031690614426565b60405180910390a1505050565b806000808281526012602052604090205460ff1660068111156117fa576117fa613877565b0361181857604051638b41ec7f60e01b815260040160405180910390fd5b6118238233336106e4565b5050565b600080600061183d84611838612f5c565b6130a8565b90925090508180156110bd5750600254600160801b900460ff9081169116109392505050565b6118e6604051806040016040528061381f6040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b816000808281526012602052604090205460ff16600681111561190b5761190b613877565b0361192957604051638b41ec7f60e01b815260040160405180910390fd5b60008381526012602052604090206119ba604051806040016040528061381f6040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b600180830154600090815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e08101865295830154865260028301548685015260038301548686015260048301546001600160401b038082166060890152600160401b820481166080890152600160801b8204811692880192909252600160c01b90041660c0860152918201939093528151808301835260058401805492949385019282908290611a6f90613dde565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9b90613dde565b8015611ae85780601f10611abd57610100808354040283529160200191611ae8565b820191906000526020600020905b815481529060010190602001808311611acb57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0390811683830152600890930154604090920191909152918352600290930154600160401b900490921691810191909152915050919050565b600081815260126020526040812060018101548203611b675750600092915050565b6000611b7682600101546105c1565b90506004825460ff166006811115611b9057611b90613877565b03611b9f575060049392505050565b6002816004811115611bb357611bb3613877565b03611bc2575060059392505050565b6003816004811115611bd657611bd6613877565b03611be5575060029392505050565b6004816004811115611bf957611bf9613877565b03611c08575060039392505050565b505460ff1692915050565b600061104d82611c21612f5c565b613160565b60008281526010602052604090205482906001600160a01b0316611c5d57604051635eeb253d60e11b815260040160405180910390fd5b6000838152601060209081526040808320601190925290912081546001600160a01b03163314611ca0576040516334c69e3160e11b815260040160405180910390fd5b6000611cab866105c1565b90506002816004811115611cc157611cc1613877565b14158015611ce157506004816004811115611cde57611cde613877565b14155b8015611cff57506003816004811115611cfc57611cfc613877565b14155b15611d36576040517fc00b5b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010154600003611d74576040517fbd8bdd9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816004811115611d8857611d88613877565b03611e2657815460ff1916600217825560405186907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a2600086815260116020526040902060020154611df0908790600160c01b90046001600160401b0316612c01565b6002830154611e0891906001600160401b0316613d38565b826001016000828254611e1b9190613d79565b90915550611fb39050565b6004816004811115611e3a57611e3a613877565b03611fa7576040805160a0808201835285546001600160a01b03168252825160e08101845260018701548152600287015460208281019190915260038801548286015260048801546001600160401b038082166060850152600160401b820481166080850152600160801b8204811694840194909452600160c01b900490921660c08201529082015281518083018352600586018054611f9d94889390850192909182908290611ee990613dde565b80601f0160208091040260200160405190810160405280929190818152602001828054611f1590613dde565b8015611f625780601f10611f3757610100808354040283529160200191611f62565b820191906000526020600020905b815481529060010190602001808311611f4557829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b03169082015260089091015460409091015261306c565b6001830155611fb3565b815460ff191660031782555b8254611fc8906001600160a01b031687613197565b600182015460148054829190600090611fe2908490613d79565b909155505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612056573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207a9190613d8c565b61209757604051637c2ccffd60e11b815260040160405180910390fd5b5050600060019091015550505050565b600033816120b58585612b7b565b90506120c0816131b9565b80156120e95750600154600082815260208190526040902060ff909116906120e790612bd5565b105b801561210a575060008181526020819052604090206121089083612bdf565b155b95945050505050565b6000828152601260209081526040808320600101548084526010909252909120546001600160a01b031661215a57604051635eeb253d60e11b815260040160405180910390fd5b6000838152601260209081526040808320600181015484526010835281842082516003808252608082019094529194909390929082016060803683370190505090506121ad6121a88761103a565b6131e6565b816000815181106121c0576121c06144d3565b602090810291909101015260068201546121d9906131f7565b816001815181106121ec576121ec6144d3565b6020026020010181815250508260020160089054906101000a90046001600160401b03166001600160401b03168160028151811061222c5761222c6144d3565b60200260200101818152505061086f868683613203565b6122b86040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526010602052604090205482906001600160a01b03166122ef57604051635eeb253d60e11b815260040160405180910390fd5b600083815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186526001840154815260028401548186015260038401548187015260048401546001600160401b038082166060840152600160401b820481166080840152600160801b8204811693830193909352600160c01b900490911660c082015292810192909252825180840184526005820180549394929392850192829082906123a390613dde565b80601f01602080910402602001604051908101604052809291908181526020018280546123cf90613dde565b801561241c5780601f106123f15761010080835404028352916020019161241c565b820191906000526020600020905b8154815290600101906020018083116123ff57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0316908201526008909101546040909101529392505050565b600081831061246857816105ba565b5090919050565b60008481526010602052604090205484906001600160a01b03166124a657604051635eeb253d60e11b815260040160405180910390fd5b600085815260116020908152604080832060108352818420815460ff191660031782558885526012909352922081546124e8906001600160a01b031689613197565b6004810154612500906001600160a01b031688612901565b600281015460009061251c908a906001600160401b0316612c01565b600383015490915061252e8183613d79565b60148054600090612540908490613d79565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156125c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125eb9190613d8c565b61260857604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038881166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269b9190613d8c565b610de257604051637c2ccffd60e11b815260040160405180910390fd5b60008481526010602052604090205484906001600160a01b03166126ef57604051635eeb253d60e11b815260040160405180910390fd5b60008481526012602052604090206004810154612715906001600160a01b031686612901565b600281015460009061275b9088906001600160401b0316612756826000908152601160205260409020600201546001600160401b03600160c01b9091041690565b6133a1565b600383015490915061276d8183613d79565b6014805460009061277f908490613d79565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282a9190613d8c565b61284757604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156128b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128da9190613d8c565b6128f757604051637c2ccffd60e11b815260040160405180910390fd5b5050505050505050565b6001600160a01b0382166000908152600a602052604090206109439082613480565b6000818152601260209081526040808320600181015480855260119093529220600283015461295c9083906001600160401b0316612c01565b81600101600082825461296f9190613d79565b9091555050600483015461298c906001600160a01b031685612901565b60008481526020819052604081209081816129a7828261382c565b5050845460ff1916600617855550506002808401805467ffffffffffffffff1916905560006003850181905560048501805473ffffffffffffffffffffffffffffffffffffffff19169055908201805460019290612a0f9084906001600160401b03166144e9565b82546101009290920a6001600160401b038181021990931691831602179091556002850154604051600160401b90910490911681528391507f33ba8f7627565d89f7ada2a6b81ea532b7aa9b11e91a78312d6e1fca0bfcd1dc9060200160405180910390a26000848152600660205260409020805467ffffffffffffffff19169055600082815260106020526040812060028301546004820154919291612ac2916001600160401b0390811691166144e9565b60048301546001600160401b039182169250600160c01b90041681118015612aff57506001835460ff166004811115612afd57612afd613877565b145b1561086f57825460ff19166004178355612b1a6001426144e9565b6002840180546001600160401b0392909216600160801b0267ffffffffffffffff60801b1990921691909117905560405184907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a2505050505050565b60008282604051602001612ba29291909182526001600160401b0316602082015260400190565b60405160208183030381529060405280519060200120905092915050565b60006105ba836001600160a01b03841661348c565b600061104d825490565b6001600160a01b038116600090815260018301602052604081205415156105ba565b6000828152601160205260408120600201546105ba9084908490600160801b90046001600160401b03166133a1565b600081608001516001600160401b0316826040015161104d9190613d38565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015612ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d069190613d8c565b61094357604051637c2ccffd60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600a6020526040902061094390826134db565b6000612d50826134e7565b6001600160401b03169050428110612d94576040517f6b4b1a4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600254612db190600160401b90046001600160401b031682613d79565b4210612de9576040517fde55698e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602090815260408083206001600160401b038616845290915290205460ff1615612e45576040517efab7d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612e4f8383613160565b612e85576040517fd3ffa66b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038616845290915290205460ff1615612ee2576040517f98e7e55100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038087168552908352818420805460ff1916600190811790915587855260069093529083208054929390929091612f3391859116613d06565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550505050565b60006110e7426134fa565b60006105ba612f768484612f7b565b613526565b600080612f8a61010043614508565b60025490915060009061010090612fb99071010000000000000000000000000000000000900460ff168661451c565b612fc3919061453e565b6001600160401b031690506000612fdc61010087614508565b9050600061010082612fee8587613d79565b612ff89190613d79565b6130029190614508565b979650505050505050565b606060006105ba83613580565b60008160405160200161302d9190613cdd565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216600090815260096020526040902061094390826134db565b600061307b82602001516135dc565b602083015160a0810151606090910151613095919061451c565b6001600160401b031661104d9190613d38565b60008060006130b685611b45565b600086815260056020526040812054919250906130db906001600160401b03166134fa565b905060018260068111156130f1576130f1613877565b141580613105575061310385826135fb565b155b1561311857600080935093505050613159565b6131228686612f7b565b9250600061312f84613526565b9050600061313c88611066565b905080158061315257506131508183614508565b155b9550505050505b9250929050565b600080600061316f85856130a8565b909250905081801561210a5750600254600160801b900460ff90811691161015949350505050565b6001600160a01b03821660009081526009602052604090206109439082613480565b60008060008381526012602052604090205460ff1660068111156131df576131df613877565b1492915050565b600060ff198216816110bd82613611565b6000806105ba83613611565b60008381526007602052604081209061321a612f5c565b6001600160401b0316815260208101919091526040016000205460ff161561326e576040517f3edef7db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116916394c8919d916132b891869186910161456c565b602060405180830381865afa1580156132d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132f99190613d8c565b61332f576040517ffcd03a4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600760205260408120600191613348612f5c565b6001600160401b031681526020808201929092526040908101600020805460ff19169315159390931790925590518481527f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d91016117c8565b60008381526010602052604081206001600160401b03808416908516106133f4576040517f56607cb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081018252600183015481526002830154602082015260038301549181019190915260048201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152613463906135dc565b61346d85856144e9565b6001600160401b031661210a9190613d38565b60006105ba8383613683565b60008181526001830160205260408120546134d35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561104d565b50600061104d565b60006105ba838361348c565b600061104d6134f58361377d565b61378a565b600061104d7f000000000000000000000000000000000000000000000000000000000000000083614616565b60008060ff8316613538600143613d25565b6135429190613d25565b409050600081900361355657613556613dae565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156135d057602002820191906000526020600020905b8154815260200190600101908083116135bc575b50505050509050919050565b600081608001516001600160401b0316826020015161104d9190613d38565b60006001600160401b03808416908316106105ba565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b60208110156106de57600891821c91613651908290613d38565b83901b7fff00000000000000000000000000000000000000000000000000000000000000169190911790600101613637565b6000818152600183016020526040812054801561376c5760006136a7600183613d25565b85549091506000906136bb90600190613d25565b90508181146137205760008660000182815481106136db576136db6144d3565b90600052602060002001549050808760000184815481106136fe576136fe6144d3565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061373157613731614644565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061104d565b600091505061104d565b5092915050565b600061104d826001613d06565b600061104d7f00000000000000000000000000000000000000000000000000000000000000008361451c565b60408051610100810182526000608080830182815260a080850184905260c0850184905260e08501849052908452845190810185528281526020808201849052818601849052606080830185905292820192909252818401528351908101845290815290918201905b8152600060209091015290565b508054600082559060005260206000209081019061126d91905b8082111561385a5760008155600101613846565b5090565b60006020828403121561387057600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106138a1576138a1613877565b91905290565b6001600160a01b038116811461126d57600080fd5b6000806000606084860312156138d157600080fd5b8335925060208401356138e3816138a7565b915060408401356138f3816138a7565b809150509250925092565b6001600160401b038116811461126d57600080fd5b803561391e816138fe565b919050565b6000806040838503121561393657600080fd5b823591506020830135613948816138fe565b809150509250929050565b600061010082840312156106de57600080fd5b6000806000610140848603121561397c57600080fd5b83359250602084013561398e816138fe565b915061399d8560408601613953565b90509250925092565b602080825282518282018190526000918401906040840190835b818110156139de5783518352602093840193909201916001016139c0565b509095945050505050565b6000815180845260005b81811015613a0f576020818501810151868301820152016139f3565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160401b0381511682526001600160401b03602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160a060808501526110bd60a08501826139e9565b602081526000825160ff815116602084015260ff602082015116604084015260ff604082015116606084015260ff606082015116608084015250602083015160e060a0840152613ad8610100840182613a2f565b90506040840151613aef60c08501825160ff169052565b5060608401516001600160401b03811660e0850152509392505050565b600060208284031215613b1e57600080fd5b81356001600160401b03811115613b3457600080fd5b820161016081850312156105ba57600080fd5b6000815160408452613b5c60408501826139e9565b602093840151949093019390935250919050565b6001600160a01b038151168252600060208201518051602085015260208101516040850152604081015160608501526001600160401b0360608201511660808501526001600160401b0360808201511660a08501526001600160401b0360a08201511660c08501526001600160401b0360c08201511660e0850152506040820151610160610100850152613c08610160850182613b47565b90506060830151613c256101208601826001600160401b03169052565b5060808301516101408501528091505092915050565b602081526000825160406020840152613c576060840182613b70565b90506001600160401b0360208501511660408401528091505092915050565b60208101600783106138a1576138a1613877565b60008060408385031215613c9d57600080fd5b823591506020830135613948816138a7565b6000806101208385031215613cc357600080fd5b82359150613cd48460208501613953565b90509250929050565b6020815260006105ba6020830184613b70565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019081111561104d5761104d613cf0565b8181038181111561104d5761104d613cf0565b808202811582820484141761104d5761104d613cf0565b634e487b7160e01b600052601260045260246000fd5b600082613d7457613d74613d4f565b500490565b8082018082111561104d5761104d613cf0565b600060208284031215613d9e57600080fd5b815180151581146105ba57600080fd5b634e487b7160e01b600052600160045260246000fd5b61ffff828116828216039081111561104d5761104d613cf0565b600181811c90821680613df257607f821691505b6020821081036106de57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613e4a57613e4a613e12565b60405290565b60405160a081016001600160401b0381118282101715613e4a57613e4a613e12565b60405160e081016001600160401b0381118282101715613e4a57613e4a613e12565b604051601f8201601f191681016001600160401b0381118282101715613ebc57613ebc613e12565b604052919050565b600060408284031215613ed657600080fd5b613ede613e28565b905081356001600160401b03811115613ef657600080fd5b8201601f81018413613f0757600080fd5b80356001600160401b03811115613f2057613f20613e12565b613f33601f8201601f1916602001613e94565b818152856020838501011115613f4857600080fd5b81602084016020830137600060209282018301528352928301359282019290925292915050565b6000813603610160811215613f8357600080fd5b613f8b613e50565b8335613f96816138a7565b815260e0601f1983011215613faa57600080fd5b613fb2613e72565b60208581013582526040808701359183019190915260608601359082015291506080840135613fe0816138fe565b606083015260a0840135613ff3816138fe565b608083015260c0840135614006816138fe565b60a083015260e0840135614019816138fe565b60c08301526020810191909152610100830135906001600160401b0382111561404157600080fd5b61404d36838601613ec4565b604082015261405f6101208501613913565b6060820152610140939093013560808401525090919050565b60006020828403121561408a57600080fd5b81356105ba816138a7565b6000602082840312156140a757600080fd5b81356105ba816138fe565b60008235603e198336030181126140c857600080fd5b9190910192915050565b6000808335601e198436030181126140e957600080fd5b8301803591506001600160401b0382111561410357600080fd5b60200191503681900382131561315957600080fd5b6000813561104d816138fe565b601f82111561094357806000526020600020601f840160051c8101602085101561414c5750805b601f840160051c820191505b8181101561416c5760008155600101614158565b5050505050565b8135601e1983360301811261418757600080fd5b820180356001600160401b03811180156141a057600080fd5b8136036020840113156141b257600080fd5b600090506141ca826141c48654613dde565b86614125565b80601f8311600181146141ff578284156141e75750848201602001355b600019600386901b1c1916600185901b17865561425e565b600086815260209020601f19851690845b8281101561423257602085890181013583559485019460019092019101614210565b50858210156142525760001960f88760031b161c19602085890101351681555b505060018460011b0186555b505050505060209190910135600190910155565b813561427d816138a7565b815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03919091161781556020820135600182015560408201356002820155606082013560038201556004810160808301356142d5816138fe565b815467ffffffffffffffff19166001600160401b0382161782555060a08301356142fe816138fe565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617815561437261433d60c08501614118565b825467ffffffffffffffff60801b191660809190911b77ffffffffffffffff0000000000000000000000000000000016178255565b6143ca61438160e08501614118565b825477ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b7fffffffffffffffff00000000000000000000000000000000000000000000000016178255565b506143e56143dc6101008401846140b2565b60058301614173565b6144166143f56101208401614118565b600783016001600160401b0382166001600160401b03198254161781555050565b6101409190910135600890910155565b838152823560208083019190915283013560408083019190915283013560608083019190915261012082019084013561445e816138fe565b6001600160401b038116608084015250608084013561447c816138fe565b6001600160401b03811660a08401525060a084013561449a816138fe565b6001600160401b03811660c0840152506144b660c08501613913565b6001600160401b0390811660e084015283166101008301526110bd565b634e487b7160e01b600052603260045260246000fd5b6001600160401b03828116828216039081111561104d5761104d613cf0565b60008261451757614517613d4f565b500690565b6001600160401b03818116838216029081169081811461377657613776613cf0565b60006001600160401b0383168061455757614557613d4f565b806001600160401b0384160691505092915050565b82358152602080840135908201526000610120820161459b604084016040870180358252602090810135910152565b6145b5608084016080870180358252602090810135910152565b6145cf60c0840160c0870180358252602090810135910152565b610120610100840152835190819052602084019061014084019060005b8181101561460a5783518352602093840193909201916001016145ec565b50909695505050505050565b60006001600160401b0383168061462f5761462f613d4f565b806001600160401b0384160491505092915050565b634e487b7160e01b600052603160045260246000fdfea264697066735822122022d1585d4a2549e539759684fb5042b4c2cc27b217dc5dff9d79f66b7f62b36964736f6c634300081c0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80636e2b54ee116100f9578063c0cc4add11610097578063e8aa0a0711610071578063e8aa0a0714610461578063f752196b14610474578063fb1e61ca1461049d578063fc0c546a146104bd57600080fd5b8063c0cc4add14610428578063c5d433511461043b578063d02bbe331461044e57600080fd5b8063a29c29a4116100d3578063a29c29a4146103b2578063a3a0807e146103c5578063b396dc79146103e8578063be5cdc481461040857600080fd5b80636e2b54ee146103845780639777b72c1461039757806399b6da0c1461039f57600080fd5b8063329b5a0b1161016657806351a766421161014057806351a76642146103035780635da73835146103165780636b00c8cf1461032b5780636c70bee91461036f57600080fd5b8063329b5a0b14610298578063458d2bf1146102cb5780634641dce6146102de57600080fd5b806312827602116101a2578063128276021461022e5780631d873c1b14610241578063237d84821461025457806326d6f8341461026757600080fd5b806302fa8e65146101c957806305b90773146101f95780630aefaabe14610219575b600080fd5b6101dc6101d736600461385e565b6104e3565b6040516001600160401b0390911681526020015b60405180910390f35b61020c61020736600461385e565b6105c1565b6040516101f0919061388d565b61022c6102273660046138bc565b6106e4565b005b61022c61023c366004613923565b610877565b61022c61024f366004613966565b610948565b61022c610262366004613923565b610dee565b61028a61027536600461385e565b60009081526012602052604090206003015490565b6040519081526020016101f0565b6101dc6102a636600461385e565b600090815260116020526040902060020154600160c01b90046001600160401b031690565b61028a6102d936600461385e565b61103a565b6102f16102ec36600461385e565b611053565b60405160ff90911681526020016101f0565b61028a61031136600461385e565b611066565b61031e6110c5565b6040516101f091906139a6565b61035761033936600461385e565b6000908152601260205260409020600401546001600160a01b031690565b6040516001600160a01b0390911681526020016101f0565b6103776110ec565b6040516101f09190613a84565b61022c61039236600461385e565b611263565b61031e611270565b61022c6103ad366004613b0c565b61128f565b61022c6103c036600461385e565b6117d5565b6103d86103d336600461385e565b611827565b60405190151581526020016101f0565b6103fb6103f636600461385e565b611863565b6040516101f09190613c3b565b61041b61041636600461385e565b611b45565b6040516101f09190613c76565b6103d861043636600461385e565b611c13565b61022c610449366004613c8a565b611c26565b6103d861045c366004613923565b6120a7565b61022c61046f366004613caf565b612113565b6101dc61048236600461385e565b6000908152600660205260409020546001600160401b031690565b6104b06104ab36600461385e565b612243565b6040516101f09190613cdd565b7f0000000000000000000000000000000000000000000000000000000000000000610357565b6000806104ef836105c1565b9050600081600481111561050557610505613877565b14806105225750600181600481111561052057610520613877565b145b1561054e575050600090815260116020526040902060020154600160801b90046001600160401b031690565b600281600481111561056257610562613877565b0361058e575050600090815260116020526040902060020154600160c01b90046001600160401b031690565b6000838152601160205260409020600201546105ba90600160801b90046001600160401b031642612459565b9392505050565b60008181526010602052604081205482906001600160a01b03166105f857604051635eeb253d60e11b815260040160405180910390fd5b600083815260116020526040812090815460ff16600481111561061d5761061d613877565b14801561065c5750600084815260116020526040902060020154600160c01b90046001600160401b03166001600160401b0316426001600160401b0316115b1561066b5760029250506106de565b6001815460ff16600481111561068357610683613877565b14806106a457506000815460ff1660048111156106a2576106a2613877565b145b80156106c8575060028101546001600160401b03600160801b909104811642909116115b156106d75760039250506106de565b5460ff1691505b50919050565b826000808281526012602052604090205460ff16600681111561070957610709613877565b0361072757604051638b41ec7f60e01b815260040160405180910390fd5b600084815260126020526040902060048101546001600160a01b0316331461077b576040517f57a6f4e900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061078686611b45565b9050600481600681111561079c5761079c613877565b036107d3576040517fc2cbf77700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028160068111156107e7576107e7613877565b03610801576107fc826001015487878761246f565b61086f565b600581600681111561081557610815613877565b0361082a576107fc82600101548787876126b8565b600381600681111561083e5761083e613877565b0361084d576107fc3387612901565b600181600681111561086157610861613877565b0361086f5761086f86612923565b505050505050565b61088182826120a7565b6108b7576040517f424a04ab00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006108c38383612b7b565b60008181526020819052604090209091506108de9033612bc0565b50600154600082815260208190526040902060ff909116906108ff90612bd5565b03610943576040516001600160401b038316815283907fc8e6c955744189a19222ec226b72ac1435d88d5745252dac56e6f679f64c037a9060200160405180910390a25b505050565b60008381526010602052604090205483906001600160a01b031661097f57604051635eeb253d60e11b815260040160405180910390fd5b600084815260106020526040902060048101546001600160401b03908116908516106109d7576040517f3b920b8800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006109e38686612b7b565b60008181526020819052604090209091506109fe9033612bdf565b610a34576040517fd651ce1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601260209081526040808320600181018a90556002810180546fffffffffffffffff00000000000000001916600160401b6001600160401b038c1602179055898452601190925282209091610a8d84611b45565b6006811115610a9e57610a9e613877565b14158015610ac657506006610ab284611b45565b6006811115610ac357610ac3613877565b14155b15610afd576040517fff556acf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600560205260409020805467ffffffffffffffff1916426001600160401b0316179055610b2f8387612113565b60048201805473ffffffffffffffffffffffffffffffffffffffff191633179055600280830180546001600160401b0342811667ffffffffffffffff19909216919091179091559082018054600192600091610b8d91859116613d06565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550610bd2888360020160009054906101000a90046001600160401b0316612c01565b816001016000828254610be59190613d25565b90915550506040805160e081018252600186015481526002860154602082015260038601549181019190915260048501546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c08201526000908190610c5e90612c30565b90506006610c6b86611b45565b6006811115610c7c57610c7c613877565b03610caf57600b54606490610c949060ff1683613d38565b610c9e9190613d65565b610ca89082613d25565b9150610cb3565b8091505b610cbd3383612c4f565b8160136000016000828254610cd29190613d79565b9091555050600384018190556004840154610cf6906001600160a01b031686612d23565b835460ff191660011784556040516001600160401b038a1681528a907f8f301470a994578b52323d625dfbf827ca5208c81747d3459be7b8867baec3ec9060200160405180910390a2600486015460028401546001600160401b039081169116148015610d7857506000835460ff166004811115610d7657610d76613877565b145b15610de257825460ff191660011783556002830180546001600160401b034216600160401b026fffffffffffffffff0000000000000000199091161790556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b6001610df983611b45565b6006811115610e0a57610e0a613877565b14610e41576040517fae9dcffd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e4b8282612d45565b6000828152601260209081526040808320600180820154855260108452828520600b54845160e08101865292820154835260028201549583019590955260038101549382019390935260048301546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152909391926064916201000090910460ff1690610eee90612c30565b610ef89190613d38565b610f029190613d65565b600b54909150600090606490610f22906301000000900460ff1684613d38565b610f2c9190613d65565b90508060136001016000828254610f439190613d79565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610fb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd99190613d8c565b610fe557610fe5613dae565b81846003016000828254610ff99190613d25565b9091555050600b5460008781526006602052604090205461010090910460ff16906001600160401b03166001600160401b03161061086f5761086f86612923565b600061104d82611048612f5c565b612f67565b92915050565b600061104d82611061612f5c565b612f7b565b60008181526012602090815260408083206001810154845260109092528220600c54610100906110a090600160801b900460ff1682613dc4565b60018301546110b39161ffff1690613d38565b6110bd9190613d65565b949350505050565b336000908152600a602052604090206060906110e7906110e49061300d565b90565b905090565b6110f46137b6565b604080516101008082018352600b805460ff8082166080808701918252948304821660a080880191909152620100008404831660c08801526301000000909304821660e0870152855285519182018652600c80546001600160401b038082168552600160401b820416602085810191909152600160801b82048416988501989098527101000000000000000000000000000000000090049091166060830152600d80549596939593870194929391928401916111af90613dde565b80601f01602080910402602001604051908101604052809291908181526020018280546111db90613dde565b80156112285780601f106111fd57610100808354040283529160200191611228565b820191906000526020600020905b81548152906001019060200180831161120b57829003601f168201915b5050509190925250505081526040805160208181018352600385015460ff1682528301526004909201546001600160401b0316910152919050565b61126d8133611c26565b50565b3360009081526009602052604090206060906110e7906110e49061300d565b60006112a261129d83613f6f565b61301a565b9050336112b26020840184614078565b6001600160a01b0316146112d9576040516334c69e3160e11b815260040160405180910390fd5b6000818152601060205260409020546001600160a01b031615611328576040517ffc7d069000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61133a61014083016101208401614095565b6001600160401b03161580611381575061135a60e0830160c08401614095565b6001600160401b031661137561014084016101208501614095565b6001600160401b031610155b156113b8576040517fdf63f61a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113c860a0830160808401614095565b6001600160401b031660000361140a576040517f535ed2be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61141a60a0830160808401614095565b6001600160401b0316611434610100840160e08501614095565b6001600160401b03161115611475576040517fb9551ab100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61148560e0830160c08401614095565b6001600160401b03166000036114c7576040517f090a5ecd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020820135600003611505576040517f6aba7aae00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6060820135600003611543576040517ffb7df0c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040820135600003611581576040517f47ba51c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61158f6101008301836140b2565b61159990806140d2565b90506000036115d4576040517f86f8cf9b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600f546001600160401b03166115f060e0840160c08501614095565b6001600160401b03161115611631576040517f1267b3f200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000818152601060205260409020829061164b8282614272565b5061165e905060e0830160c08401614095565b6116689042613d06565b600082815260116020526040902060020180546001600160401b0392909216600160801b0267ffffffffffffffff60801b199092169190911790556116b561014083016101208401614095565b6116bf9042613d06565b600082815260116020908152604090912060020180546001600160401b0393909316600160c01b0277ffffffffffffffffffffffffffffffffffffffffffffffff909316929092179091556117209061171a90840184614078565b8261304a565b600061173361172e84613f6f565b61306c565b600083815260116020526040812060010182905560138054929350839290919061175e908490613d79565b9091555061176e90503382612c4f565b6000828152601160209081526040918290206002015491517f1bf9c457accf8703dbf7cdf1b58c2f74ddf2e525f98155c70b3d318d74609bd8926117c892869290880191600160c01b90046001600160401b031690614426565b60405180910390a1505050565b806000808281526012602052604090205460ff1660068111156117fa576117fa613877565b0361181857604051638b41ec7f60e01b815260040160405180910390fd5b6118238233336106e4565b5050565b600080600061183d84611838612f5c565b6130a8565b90925090508180156110bd5750600254600160801b900460ff9081169116109392505050565b6118e6604051806040016040528061381f6040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b816000808281526012602052604090205460ff16600681111561190b5761190b613877565b0361192957604051638b41ec7f60e01b815260040160405180910390fd5b60008381526012602052604090206119ba604051806040016040528061381f6040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b600180830154600090815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e08101865295830154865260028301548685015260038301548686015260048301546001600160401b038082166060890152600160401b820481166080890152600160801b8204811692880192909252600160c01b90041660c0860152918201939093528151808301835260058401805492949385019282908290611a6f90613dde565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9b90613dde565b8015611ae85780601f10611abd57610100808354040283529160200191611ae8565b820191906000526020600020905b815481529060010190602001808311611acb57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0390811683830152600890930154604090920191909152918352600290930154600160401b900490921691810191909152915050919050565b600081815260126020526040812060018101548203611b675750600092915050565b6000611b7682600101546105c1565b90506004825460ff166006811115611b9057611b90613877565b03611b9f575060049392505050565b6002816004811115611bb357611bb3613877565b03611bc2575060059392505050565b6003816004811115611bd657611bd6613877565b03611be5575060029392505050565b6004816004811115611bf957611bf9613877565b03611c08575060039392505050565b505460ff1692915050565b600061104d82611c21612f5c565b613160565b60008281526010602052604090205482906001600160a01b0316611c5d57604051635eeb253d60e11b815260040160405180910390fd5b6000838152601060209081526040808320601190925290912081546001600160a01b03163314611ca0576040516334c69e3160e11b815260040160405180910390fd5b6000611cab866105c1565b90506002816004811115611cc157611cc1613877565b14158015611ce157506004816004811115611cde57611cde613877565b14155b8015611cff57506003816004811115611cfc57611cfc613877565b14155b15611d36576040517fc00b5b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160010154600003611d74576040517fbd8bdd9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002816004811115611d8857611d88613877565b03611e2657815460ff1916600217825560405186907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a2600086815260116020526040902060020154611df0908790600160c01b90046001600160401b0316612c01565b6002830154611e0891906001600160401b0316613d38565b826001016000828254611e1b9190613d79565b90915550611fb39050565b6004816004811115611e3a57611e3a613877565b03611fa7576040805160a0808201835285546001600160a01b03168252825160e08101845260018701548152600287015460208281019190915260038801548286015260048801546001600160401b038082166060850152600160401b820481166080850152600160801b8204811694840194909452600160c01b900490921660c08201529082015281518083018352600586018054611f9d94889390850192909182908290611ee990613dde565b80601f0160208091040260200160405190810160405280929190818152602001828054611f1590613dde565b8015611f625780601f10611f3757610100808354040283529160200191611f62565b820191906000526020600020905b815481529060010190602001808311611f4557829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b03169082015260089091015460409091015261306c565b6001830155611fb3565b815460ff191660031782555b8254611fc8906001600160a01b031687613197565b600182015460148054829190600090611fe2908490613d79565b909155505060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612056573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207a9190613d8c565b61209757604051637c2ccffd60e11b815260040160405180910390fd5b5050600060019091015550505050565b600033816120b58585612b7b565b90506120c0816131b9565b80156120e95750600154600082815260208190526040902060ff909116906120e790612bd5565b105b801561210a575060008181526020819052604090206121089083612bdf565b155b95945050505050565b6000828152601260209081526040808320600101548084526010909252909120546001600160a01b031661215a57604051635eeb253d60e11b815260040160405180910390fd5b6000838152601260209081526040808320600181015484526010835281842082516003808252608082019094529194909390929082016060803683370190505090506121ad6121a88761103a565b6131e6565b816000815181106121c0576121c06144d3565b602090810291909101015260068201546121d9906131f7565b816001815181106121ec576121ec6144d3565b6020026020010181815250508260020160089054906101000a90046001600160401b03166001600160401b03168160028151811061222c5761222c6144d3565b60200260200101818152505061086f868683613203565b6122b86040805160a080820183526000808352835160e081018552818152602080820183905281860183905260608083018490526080830184905293820183905260c0820183905280850191909152845180860186529283528201529091820190815260006020820181905260409091015290565b60008281526010602052604090205482906001600160a01b03166122ef57604051635eeb253d60e11b815260040160405180910390fd5b600083815260106020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186526001840154815260028401548186015260038401548187015260048401546001600160401b038082166060840152600160401b820481166080840152600160801b8204811693830193909352600160c01b900490911660c082015292810192909252825180840184526005820180549394929392850192829082906123a390613dde565b80601f01602080910402602001604051908101604052809291908181526020018280546123cf90613dde565b801561241c5780601f106123f15761010080835404028352916020019161241c565b820191906000526020600020905b8154815290600101906020018083116123ff57829003601f168201915b50505091835250506001919091015460209182015290825260078301546001600160401b0316908201526008909101546040909101529392505050565b600081831061246857816105ba565b5090919050565b60008481526010602052604090205484906001600160a01b03166124a657604051635eeb253d60e11b815260040160405180910390fd5b600085815260116020908152604080832060108352818420815460ff191660031782558885526012909352922081546124e8906001600160a01b031689613197565b6004810154612500906001600160a01b031688612901565b600281015460009061251c908a906001600160401b0316612c01565b600383015490915061252e8183613d79565b60148054600090612540908490613d79565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156125c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125eb9190613d8c565b61260857604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038881166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612677573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269b9190613d8c565b610de257604051637c2ccffd60e11b815260040160405180910390fd5b60008481526010602052604090205484906001600160a01b03166126ef57604051635eeb253d60e11b815260040160405180910390fd5b60008481526012602052604090206004810154612715906001600160a01b031686612901565b600281015460009061275b9088906001600160401b0316612756826000908152601160205260409020600201546001600160401b03600160c01b9091041690565b6133a1565b600383015490915061276d8183613d79565b6014805460009061277f908490613d79565b90915550508254600490849060ff1916600183021790555060405163a9059cbb60e01b81526001600160a01b038781166004830152602482018490527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015612806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061282a9190613d8c565b61284757604051637c2ccffd60e11b815260040160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156128b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128da9190613d8c565b6128f757604051637c2ccffd60e11b815260040160405180910390fd5b5050505050505050565b6001600160a01b0382166000908152600a602052604090206109439082613480565b6000818152601260209081526040808320600181015480855260119093529220600283015461295c9083906001600160401b0316612c01565b81600101600082825461296f9190613d79565b9091555050600483015461298c906001600160a01b031685612901565b60008481526020819052604081209081816129a7828261382c565b5050845460ff1916600617855550506002808401805467ffffffffffffffff1916905560006003850181905560048501805473ffffffffffffffffffffffffffffffffffffffff19169055908201805460019290612a0f9084906001600160401b03166144e9565b82546101009290920a6001600160401b038181021990931691831602179091556002850154604051600160401b90910490911681528391507f33ba8f7627565d89f7ada2a6b81ea532b7aa9b11e91a78312d6e1fca0bfcd1dc9060200160405180910390a26000848152600660205260409020805467ffffffffffffffff19169055600082815260106020526040812060028301546004820154919291612ac2916001600160401b0390811691166144e9565b60048301546001600160401b039182169250600160c01b90041681118015612aff57506001835460ff166004811115612afd57612afd613877565b145b1561086f57825460ff19166004178355612b1a6001426144e9565b6002840180546001600160401b0392909216600160801b0267ffffffffffffffff60801b1990921691909117905560405184907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a2505050505050565b60008282604051602001612ba29291909182526001600160401b0316602082015260400190565b60405160208183030381529060405280519060200120905092915050565b60006105ba836001600160a01b03841661348c565b600061104d825490565b6001600160a01b038116600090815260018301602052604081205415156105ba565b6000828152601160205260408120600201546105ba9084908490600160801b90046001600160401b03166133a1565b600081608001516001600160401b0316826040015161104d9190613d38565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd906064016020604051808303816000875af1158015612ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d069190613d8c565b61094357604051637c2ccffd60e11b815260040160405180910390fd5b6001600160a01b0382166000908152600a6020526040902061094390826134db565b6000612d50826134e7565b6001600160401b03169050428110612d94576040517f6b4b1a4e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600254612db190600160401b90046001600160401b031682613d79565b4210612de9576040517fde55698e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602090815260408083206001600160401b038616845290915290205460ff1615612e45576040517efab7d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612e4f8383613160565b612e85576040517fd3ffa66b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038616845290915290205460ff1615612ee2576040517f98e7e55100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526008602090815260408083206001600160401b038087168552908352818420805460ff1916600190811790915587855260069093529083208054929390929091612f3391859116613d06565b92506101000a8154816001600160401b0302191690836001600160401b03160217905550505050565b60006110e7426134fa565b60006105ba612f768484612f7b565b613526565b600080612f8a61010043614508565b60025490915060009061010090612fb99071010000000000000000000000000000000000900460ff168661451c565b612fc3919061453e565b6001600160401b031690506000612fdc61010087614508565b9050600061010082612fee8587613d79565b612ff89190613d79565b6130029190614508565b979650505050505050565b606060006105ba83613580565b60008160405160200161302d9190613cdd565b604051602081830303815290604052805190602001209050919050565b6001600160a01b038216600090815260096020526040902061094390826134db565b600061307b82602001516135dc565b602083015160a0810151606090910151613095919061451c565b6001600160401b031661104d9190613d38565b60008060006130b685611b45565b600086815260056020526040812054919250906130db906001600160401b03166134fa565b905060018260068111156130f1576130f1613877565b141580613105575061310385826135fb565b155b1561311857600080935093505050613159565b6131228686612f7b565b9250600061312f84613526565b9050600061313c88611066565b905080158061315257506131508183614508565b155b9550505050505b9250929050565b600080600061316f85856130a8565b909250905081801561210a5750600254600160801b900460ff90811691161015949350505050565b6001600160a01b03821660009081526009602052604090206109439082613480565b60008060008381526012602052604090205460ff1660068111156131df576131df613877565b1492915050565b600060ff198216816110bd82613611565b6000806105ba83613611565b60008381526007602052604081209061321a612f5c565b6001600160401b0316815260208101919091526040016000205460ff161561326e576040517f3edef7db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546040517f94c8919d0000000000000000000000000000000000000000000000000000000081526001600160a01b03909116916394c8919d916132b891869186910161456c565b602060405180830381865afa1580156132d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132f99190613d8c565b61332f576040517ffcd03a4700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600760205260408120600191613348612f5c565b6001600160401b031681526020808201929092526040908101600020805460ff19169315159390931790925590518481527f3b989d183b84b02259d7c14b34a9c9eb0fccb4c355a920d25e581e25aef4993d91016117c8565b60008381526010602052604081206001600160401b03808416908516106133f4576040517f56607cb000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160e081018252600183015481526002830154602082015260038301549181019190915260048201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0820152613463906135dc565b61346d85856144e9565b6001600160401b031661210a9190613d38565b60006105ba8383613683565b60008181526001830160205260408120546134d35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561104d565b50600061104d565b60006105ba838361348c565b600061104d6134f58361377d565b61378a565b600061104d7f000000000000000000000000000000000000000000000000000000000000000083614616565b60008060ff8316613538600143613d25565b6135429190613d25565b409050600081900361355657613556613dae565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156135d057602002820191906000526020600020905b8154815260200190600101908083116135bc575b50505050509050919050565b600081608001516001600160401b0316826020015161104d9190613d38565b60006001600160401b03808416908316106105ba565b7fff00000000000000000000000000000000000000000000000000000000000000811660015b60208110156106de57600891821c91613651908290613d38565b83901b7fff00000000000000000000000000000000000000000000000000000000000000169190911790600101613637565b6000818152600183016020526040812054801561376c5760006136a7600183613d25565b85549091506000906136bb90600190613d25565b90508181146137205760008660000182815481106136db576136db6144d3565b90600052602060002001549050808760000184815481106136fe576136fe6144d3565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061373157613731614644565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061104d565b600091505061104d565b5092915050565b600061104d826001613d06565b600061104d7f00000000000000000000000000000000000000000000000000000000000000008361451c565b60408051610100810182526000608080830182815260a080850184905260c0850184905260e08501849052908452845190810185528281526020808201849052818601849052606080830185905292820192909252818401528351908101845290815290918201905b8152600060209091015290565b508054600082559060005260206000209081019061126d91905b8082111561385a5760008155600101613846565b5090565b60006020828403121561387057600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60208101600583106138a1576138a1613877565b91905290565b6001600160a01b038116811461126d57600080fd5b6000806000606084860312156138d157600080fd5b8335925060208401356138e3816138a7565b915060408401356138f3816138a7565b809150509250925092565b6001600160401b038116811461126d57600080fd5b803561391e816138fe565b919050565b6000806040838503121561393657600080fd5b823591506020830135613948816138fe565b809150509250929050565b600061010082840312156106de57600080fd5b6000806000610140848603121561397c57600080fd5b83359250602084013561398e816138fe565b915061399d8560408601613953565b90509250925092565b602080825282518282018190526000918401906040840190835b818110156139de5783518352602093840193909201916001016139c0565b509095945050505050565b6000815180845260005b81811015613a0f576020818501810151868301820152016139f3565b506000602082860101526020601f19601f83011685010191505092915050565b6001600160401b0381511682526001600160401b03602082015116602083015260ff604082015116604083015260ff60608201511660608301526000608082015160a060808501526110bd60a08501826139e9565b602081526000825160ff815116602084015260ff602082015116604084015260ff604082015116606084015260ff606082015116608084015250602083015160e060a0840152613ad8610100840182613a2f565b90506040840151613aef60c08501825160ff169052565b5060608401516001600160401b03811660e0850152509392505050565b600060208284031215613b1e57600080fd5b81356001600160401b03811115613b3457600080fd5b820161016081850312156105ba57600080fd5b6000815160408452613b5c60408501826139e9565b602093840151949093019390935250919050565b6001600160a01b038151168252600060208201518051602085015260208101516040850152604081015160608501526001600160401b0360608201511660808501526001600160401b0360808201511660a08501526001600160401b0360a08201511660c08501526001600160401b0360c08201511660e0850152506040820151610160610100850152613c08610160850182613b47565b90506060830151613c256101208601826001600160401b03169052565b5060808301516101408501528091505092915050565b602081526000825160406020840152613c576060840182613b70565b90506001600160401b0360208501511660408401528091505092915050565b60208101600783106138a1576138a1613877565b60008060408385031215613c9d57600080fd5b823591506020830135613948816138a7565b6000806101208385031215613cc357600080fd5b82359150613cd48460208501613953565b90509250929050565b6020815260006105ba6020830184613b70565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019081111561104d5761104d613cf0565b8181038181111561104d5761104d613cf0565b808202811582820484141761104d5761104d613cf0565b634e487b7160e01b600052601260045260246000fd5b600082613d7457613d74613d4f565b500490565b8082018082111561104d5761104d613cf0565b600060208284031215613d9e57600080fd5b815180151581146105ba57600080fd5b634e487b7160e01b600052600160045260246000fd5b61ffff828116828216039081111561104d5761104d613cf0565b600181811c90821680613df257607f821691505b6020821081036106de57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b0381118282101715613e4a57613e4a613e12565b60405290565b60405160a081016001600160401b0381118282101715613e4a57613e4a613e12565b60405160e081016001600160401b0381118282101715613e4a57613e4a613e12565b604051601f8201601f191681016001600160401b0381118282101715613ebc57613ebc613e12565b604052919050565b600060408284031215613ed657600080fd5b613ede613e28565b905081356001600160401b03811115613ef657600080fd5b8201601f81018413613f0757600080fd5b80356001600160401b03811115613f2057613f20613e12565b613f33601f8201601f1916602001613e94565b818152856020838501011115613f4857600080fd5b81602084016020830137600060209282018301528352928301359282019290925292915050565b6000813603610160811215613f8357600080fd5b613f8b613e50565b8335613f96816138a7565b815260e0601f1983011215613faa57600080fd5b613fb2613e72565b60208581013582526040808701359183019190915260608601359082015291506080840135613fe0816138fe565b606083015260a0840135613ff3816138fe565b608083015260c0840135614006816138fe565b60a083015260e0840135614019816138fe565b60c08301526020810191909152610100830135906001600160401b0382111561404157600080fd5b61404d36838601613ec4565b604082015261405f6101208501613913565b6060820152610140939093013560808401525090919050565b60006020828403121561408a57600080fd5b81356105ba816138a7565b6000602082840312156140a757600080fd5b81356105ba816138fe565b60008235603e198336030181126140c857600080fd5b9190910192915050565b6000808335601e198436030181126140e957600080fd5b8301803591506001600160401b0382111561410357600080fd5b60200191503681900382131561315957600080fd5b6000813561104d816138fe565b601f82111561094357806000526020600020601f840160051c8101602085101561414c5750805b601f840160051c820191505b8181101561416c5760008155600101614158565b5050505050565b8135601e1983360301811261418757600080fd5b820180356001600160401b03811180156141a057600080fd5b8136036020840113156141b257600080fd5b600090506141ca826141c48654613dde565b86614125565b80601f8311600181146141ff578284156141e75750848201602001355b600019600386901b1c1916600185901b17865561425e565b600086815260209020601f19851690845b8281101561423257602085890181013583559485019460019092019101614210565b50858210156142525760001960f88760031b161c19602085890101351681555b505060018460011b0186555b505050505060209190910135600190910155565b813561427d816138a7565b815473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03919091161781556020820135600182015560408201356002820155606082013560038201556004810160808301356142d5816138fe565b815467ffffffffffffffff19166001600160401b0382161782555060a08301356142fe816138fe565b81546fffffffffffffffff0000000000000000191660409190911b6fffffffffffffffff00000000000000001617815561437261433d60c08501614118565b825467ffffffffffffffff60801b191660809190911b77ffffffffffffffff0000000000000000000000000000000016178255565b6143ca61438160e08501614118565b825477ffffffffffffffffffffffffffffffffffffffffffffffff1660c09190911b7fffffffffffffffff00000000000000000000000000000000000000000000000016178255565b506143e56143dc6101008401846140b2565b60058301614173565b6144166143f56101208401614118565b600783016001600160401b0382166001600160401b03198254161781555050565b6101409190910135600890910155565b838152823560208083019190915283013560408083019190915283013560608083019190915261012082019084013561445e816138fe565b6001600160401b038116608084015250608084013561447c816138fe565b6001600160401b03811660a08401525060a084013561449a816138fe565b6001600160401b03811660c0840152506144b660c08501613913565b6001600160401b0390811660e084015283166101008301526110bd565b634e487b7160e01b600052603260045260246000fd5b6001600160401b03828116828216039081111561104d5761104d613cf0565b60008261451757614517613d4f565b500690565b6001600160401b03818116838216029081169081811461377657613776613cf0565b60006001600160401b0383168061455757614557613d4f565b806001600160401b0384160691505092915050565b82358152602080840135908201526000610120820161459b604084016040870180358252602090810135910152565b6145b5608084016080870180358252602090810135910152565b6145cf60c0840160c0870180358252602090810135910152565b610120610100840152835190819052602084019061014084019060005b8181101561460a5783518352602093840193909201916001016145ec565b50909695505050505050565b60006001600160401b0383168061462f5761462f613d4f565b806001600160401b0384160491505092915050565b634e487b7160e01b600052603160045260246000fdfea264697066735822122022d1585d4a2549e539759684fb5042b4c2cc27b217dc5dff9d79f66b7f62b36964736f6c634300081c0033", - "devdoc": { - "kind": "dev", - "methods": { - "fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))": { - "params": { - "proof": "Groth16 proof procing possession of the slot data.", - "requestId": "RequestId identifying the request containing the slot to fill.", - "slotIndex": "Index of the slot in the request." - } - }, - "freeSlot(bytes32)": { - "details": "The host that filled the slot must have initiated the transaction (msg.sender). This overload allows `rewardRecipient` and `collateralRecipient` to be optional.", - "params": { - "slotId": "id of the slot to free" - } - }, - "freeSlot(bytes32,address,address)": { - "params": { - "collateralRecipient": "address to refund collateral to", - "rewardRecipient": "address to send rewards to", - "slotId": "id of the slot to free" - } - }, - "getChallenge(bytes32)": { - "params": { - "id": "Slot's ID for which the challenge should be calculated" - }, - "returns": { - "_0": "Challenge for current Period that should be used for generation of proofs" - } - }, - "getPointer(bytes32)": { - "details": "For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)", - "params": { - "id": "Slot's ID for which the pointer should be calculated" - }, - "returns": { - "_0": "Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration." - } - }, - "isProofRequired(bytes32)": { - "params": { - "id": "Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned." - }, - "returns": { - "_0": "bool indicating if proof is required for current period" - } - }, - "missingProofs(bytes32)": { - "returns": { - "_0": "Number of missed proofs since Slot was Filled" - } - }, - "willProofBeRequired(bytes32)": { - "details": "for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)", - "params": { - "id": "SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned." - }, - "returns": { - "_0": "bool" - } - }, - "withdrawFunds(bytes32)": { - "details": "Request must be cancelled, failed or finished, and the transaction must originate from the depositor address.", - "params": { - "requestId": "the id of the request" - } - }, - "withdrawFunds(bytes32,address)": { - "details": "Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.", - "params": { - "requestId": "the id of the request", - "withdrawRecipient": "address to return the remaining funds to" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "fillSlot(bytes32,uint64,((uint256,uint256),((uint256,uint256),(uint256,uint256)),(uint256,uint256)))": { - "notice": "Fills a slot. Reverts if an invalid proof of the slot data is provided." - }, - "freeSlot(bytes32)": { - "notice": "Frees a slot, paying out rewards and returning collateral for finished or cancelled requests to the host that has filled the slot." - }, - "freeSlot(bytes32,address,address)": { - "notice": "Frees a slot, paying out rewards and returning collateral for finished or cancelled requests." - }, - "willProofBeRequired(bytes32)": { - "notice": "Proof Downtime specifies part of the Period when the proof is not required even if the proof should be required. This function returns true if the pointer is in downtime (hence no proof required now) and at the same time the proof will be required later on in the Period." - }, - "withdrawFunds(bytes32)": { - "notice": "Withdraws remaining storage request funds back to the client that deposited them." - }, - "withdrawFunds(bytes32,address)": { - "notice": "Withdraws storage request funds to the provided address." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 6021, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_reservations", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_struct(AddressSet)1902_storage)" - }, - { - "astId": 6024, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "1", - "type": "t_struct(SlotReservationsConfig)2228_storage" - }, - { - "astId": 5256, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "2", - "type": "t_struct(ProofConfig)2225_storage" - }, - { - "astId": 5259, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_verifier", - "offset": 0, - "slot": "4", - "type": "t_contract(IGroth16Verifier)2421" - }, - { - "astId": 5296, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotStarts", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_uint64)" - }, - { - "astId": 5301, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missed", - "offset": 0, - "slot": "6", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_uint64)" - }, - { - "astId": 5309, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_received", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_mapping(t_userDefinedValueType(Period)5086,t_bool))" - }, - { - "astId": 5317, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missing", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_mapping(t_userDefinedValueType(Period)5086,t_bool))" - }, - { - "astId": 6166, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestsPerClient", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)" - }, - { - "astId": 6171, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotsPerHost", - "offset": 0, - "slot": "10", - "type": "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)" - }, - { - "astId": 3104, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "11", - "type": "t_struct(MarketplaceConfig)2204_storage" - }, - { - "astId": 3110, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requests", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_userDefinedValueType(RequestId)5830,t_struct(Request)5845_storage)" - }, - { - "astId": 3116, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestContexts", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_userDefinedValueType(RequestId)5830,t_struct(RequestContext)3140_storage)" - }, - { - "astId": 3122, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slots", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_userDefinedValueType(SlotId)5832,t_struct(Slot)3158_storage)" - }, - { - "astId": 3125, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_marketplaceTotals", - "offset": 0, - "slot": "19", - "type": "t_struct(MarketplaceTotals)5079_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_bytes32)dyn_storage": { - "base": "t_bytes32", - "encoding": "dynamic_array", - "label": "bytes32[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_contract(IGroth16Verifier)2421": { - "encoding": "inplace", - "label": "contract IGroth16Verifier", - "numberOfBytes": "20" - }, - "t_enum(RequestState)5871": { - "encoding": "inplace", - "label": "enum RequestState", - "numberOfBytes": "1" - }, - "t_enum(SlotState)5879": { - "encoding": "inplace", - "label": "enum SlotState", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.Bytes32Set)", - "numberOfBytes": "32", - "value": "t_struct(Bytes32Set)1781_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_userDefinedValueType(Period)5086,t_bool)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(Period)5086", - "label": "mapping(Periods.Period => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_userDefinedValueType(RequestId)5830,t_struct(Request)5845_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)5830", - "label": "mapping(RequestId => struct Request)", - "numberOfBytes": "32", - "value": "t_struct(Request)5845_storage" - }, - "t_mapping(t_userDefinedValueType(RequestId)5830,t_struct(RequestContext)3140_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)5830", - "label": "mapping(RequestId => struct Marketplace.RequestContext)", - "numberOfBytes": "32", - "value": "t_struct(RequestContext)3140_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)5832,t_mapping(t_userDefinedValueType(Period)5086,t_bool))": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)5832", - "label": "mapping(SlotId => mapping(Periods.Period => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_userDefinedValueType(Period)5086,t_bool)" - }, - "t_mapping(t_userDefinedValueType(SlotId)5832,t_struct(AddressSet)1902_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)5832", - "label": "mapping(SlotId => struct EnumerableSet.AddressSet)", - "numberOfBytes": "32", - "value": "t_struct(AddressSet)1902_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)5832,t_struct(Slot)3158_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)5832", - "label": "mapping(SlotId => struct Marketplace.Slot)", - "numberOfBytes": "32", - "value": "t_struct(Slot)3158_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)5832,t_uint64)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)5832", - "label": "mapping(SlotId => uint64)", - "numberOfBytes": "32", - "value": "t_uint64" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(AddressSet)1902_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.AddressSet", - "members": [ - { - "astId": 1901, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1587_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Ask)5860_storage": { - "encoding": "inplace", - "label": "struct Ask", - "members": [ - { - "astId": 5847, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofProbability", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 5849, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "pricePerBytePerSecond", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 5851, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateralPerByte", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 5853, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slots", - "offset": 0, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 5855, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotSize", - "offset": 8, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 5857, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "duration", - "offset": 16, - "slot": "3", - "type": "t_uint64" - }, - { - "astId": 5859, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxSlotLoss", - "offset": 24, - "slot": "3", - "type": "t_uint64" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Bytes32Set)1781_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Bytes32Set", - "members": [ - { - "astId": 1780, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1587_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(CollateralConfig)2214_storage": { - "encoding": "inplace", - "label": "struct CollateralConfig", - "members": [ - { - "astId": 2207, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "repairRewardPercentage", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2209, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxNumberOfSlashes", - "offset": 1, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2211, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slashPercentage", - "offset": 2, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2213, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "validatorRewardPercentage", - "offset": 3, - "slot": "0", - "type": "t_uint8" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Content)5865_storage": { - "encoding": "inplace", - "label": "struct Content", - "members": [ - { - "astId": 5862, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "cid", - "offset": 0, - "slot": "0", - "type": "t_bytes_storage" - }, - { - "astId": 5864, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "merkleRoot", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_struct(MarketplaceConfig)2204_storage": { - "encoding": "inplace", - "label": "struct MarketplaceConfig", - "members": [ - { - "astId": 2195, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateral", - "offset": 0, - "slot": "0", - "type": "t_struct(CollateralConfig)2214_storage" - }, - { - "astId": 2198, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofs", - "offset": 0, - "slot": "1", - "type": "t_struct(ProofConfig)2225_storage" - }, - { - "astId": 2201, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "reservations", - "offset": 0, - "slot": "3", - "type": "t_struct(SlotReservationsConfig)2228_storage" - }, - { - "astId": 2203, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "requestDurationLimit", - "offset": 0, - "slot": "4", - "type": "t_uint64" - } - ], - "numberOfBytes": "160" - }, - "t_struct(MarketplaceTotals)5079_storage": { - "encoding": "inplace", - "label": "struct Marketplace.MarketplaceTotals", - "members": [ - { - "astId": 5076, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "received", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 5078, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "sent", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(ProofConfig)2225_storage": { - "encoding": "inplace", - "label": "struct ProofConfig", - "members": [ - { - "astId": 2216, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "period", - "offset": 0, - "slot": "0", - "type": "t_uint64" - }, - { - "astId": 2218, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "timeout", - "offset": 8, - "slot": "0", - "type": "t_uint64" - }, - { - "astId": 2220, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "downtime", - "offset": 16, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2222, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "downtimeProduct", - "offset": 17, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2224, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "zkeyHash", - "offset": 0, - "slot": "1", - "type": "t_string_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Request)5845_storage": { - "encoding": "inplace", - "label": "struct Request", - "members": [ - { - "astId": 5834, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "client", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 5837, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "ask", - "offset": 0, - "slot": "1", - "type": "t_struct(Ask)5860_storage" - }, - { - "astId": 5840, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "content", - "offset": 0, - "slot": "5", - "type": "t_struct(Content)5865_storage" - }, - { - "astId": 5842, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "expiry", - "offset": 0, - "slot": "7", - "type": "t_uint64" - }, - { - "astId": 5844, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "nonce", - "offset": 0, - "slot": "8", - "type": "t_bytes32" - } - ], - "numberOfBytes": "288" - }, - "t_struct(RequestContext)3140_storage": { - "encoding": "inplace", - "label": "struct Marketplace.RequestContext", - "members": [ - { - "astId": 3128, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(RequestState)5871" - }, - { - "astId": 3131, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "fundsToReturnToClient", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 3133, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotsFilled", - "offset": 0, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 3135, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "startedAt", - "offset": 8, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 3137, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "endsAt", - "offset": 16, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 3139, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "expiresAt", - "offset": 24, - "slot": "2", - "type": "t_uint64" - } - ], - "numberOfBytes": "96" - }, - "t_struct(Set)1587_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1582, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1586, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Slot)3158_storage": { - "encoding": "inplace", - "label": "struct Marketplace.Slot", - "members": [ - { - "astId": 3143, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(SlotState)5879" - }, - { - "astId": 3146, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "requestId", - "offset": 0, - "slot": "1", - "type": "t_userDefinedValueType(RequestId)5830" - }, - { - "astId": 3149, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "filledAt", - "offset": 0, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 3151, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotIndex", - "offset": 8, - "slot": "2", - "type": "t_uint64" - }, - { - "astId": 3154, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "currentCollateral", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 3157, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "host", - "offset": 0, - "slot": "4", - "type": "t_address" - } - ], - "numberOfBytes": "160" - }, - "t_struct(SlotReservationsConfig)2228_storage": { - "encoding": "inplace", - "label": "struct SlotReservationsConfig", - "members": [ - { - "astId": 2227, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxReservations", - "offset": 0, - "slot": "0", - "type": "t_uint8" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint64": { - "encoding": "inplace", - "label": "uint64", - "numberOfBytes": "8" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - }, - "t_userDefinedValueType(Period)5086": { - "encoding": "inplace", - "label": "Periods.Period", - "numberOfBytes": "8" - }, - "t_userDefinedValueType(RequestId)5830": { - "encoding": "inplace", - "label": "RequestId", - "numberOfBytes": "32" - }, - "t_userDefinedValueType(SlotId)5832": { - "encoding": "inplace", - "label": "SlotId", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/TestToken.json b/deployments/linea_testnet/TestToken.json deleted file mode 100644 index c8c7571..0000000 --- a/deployments/linea_testnet/TestToken.json +++ /dev/null @@ -1,447 +0,0 @@ -{ - "address": "0xe5C3daA5eeD91976d0997122f1B8688bFE4f3Af5", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd49d5dc4d039ef4e10cef0bee6343228750fcaeb9b34d09e08ead877fbacc783", - "receipt": { - "to": null, - "from": "0xC3B5023e9d6522f9A8B0E187EB324C8341E5C9cf", - "contractAddress": "0xe5C3daA5eeD91976d0997122f1B8688bFE4f3Af5", - "transactionIndex": 1, - "gasUsed": "669261", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1334e6c251ea1215f8577ea7ad6ce3f178f6b9993fef3abf137d846b574c730c", - "transactionHash": "0xd49d5dc4d039ef4e10cef0bee6343228750fcaeb9b34d09e08ead877fbacc783", - "logs": [], - "blockNumber": 2001325, - "cumulativeGasUsed": "690261", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 2, - "solcInputHash": "38bc1dfa6eb605585a1d33e30c68e961", - "metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TestToken.sol\":\"TestToken\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/TestToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.28;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestToken is ERC20 {\\n // solhint-disable-next-line no-empty-blocks\\n constructor() ERC20(\\\"TestToken\\\", \\\"TST\\\") {}\\n\\n function mint(address holder, uint256 amount) public {\\n _mint(holder, amount);\\n }\\n}\\n\",\"keccak256\":\"0x08b5a383080b1b8c11baa61f3c849501be0f54ad5181be3dd80bd8f08fb10f53\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50604051806040016040528060098152602001682a32b9ba2a37b5b2b760b91b815250604051806040016040528060038152602001621514d560ea1b815250816003908161005e9190610112565b50600461006b8282610112565b5050506101d0565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061009d57607f821691505b6020821081036100bd57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561010d57806000526020600020601f840160051c810160208510156100ea5750805b601f840160051c820191505b8181101561010a57600081556001016100f6565b50505b505050565b81516001600160401b0381111561012b5761012b610073565b61013f816101398454610089565b846100c3565b6020601f821160018114610173576000831561015b5750848201515b600019600385901b1c1916600184901b17845561010a565b600084815260208120601f198516915b828110156101a35787850151825560209485019460019092019101610183565b50848210156101c15786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b610a3c806101df6000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610885565b60405180910390f35b61010a6101053660046108ef565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a366004610919565b6102b2565b604051601281526020016100ee565b61010a61015c3660046108ef565b6102d6565b61017461016f3660046108ef565b610315565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610323565b61010a6101b53660046108ef565b610332565b61010a6101c83660046108ef565b6103e1565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ef565b60019150505b92915050565b6000336102c0858285610547565b6102cb8585856105d9565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a690829086906103109087906109e5565b6103ef565b61031f82826107c6565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102cb82868684036103ef565b6000336102a68185856105d9565b6001600160a01b03831661046a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166104e65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d357818110156105c65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103cb565b6105d384848484036103ef565b50505050565b6001600160a01b0383166106555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166106d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b038316600090815260208190526040902054818110156107605760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d3565b6001600160a01b03821661081c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103cb565b806002600082825461082e91906109e5565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b602081526000825180602084015260005b818110156108b35760208186018101516040868401015201610896565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146108ea57600080fd5b919050565b6000806040838503121561090257600080fd5b61090b836108d3565b946020939093013593505050565b60008060006060848603121561092e57600080fd5b610937846108d3565b9250610945602085016108d3565b929592945050506040919091013590565b60006020828403121561096857600080fd5b610971826108d3565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d3565b91506109a2602084016108d3565b90509250929050565b600181811c908216806109bf57607f821691505b6020821081036109df57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156102ac57634e487b7160e01b600052601160045260246000fdfea2646970667358221220eb8de41a50210892ac15e4a17b69e5267bfa3b85e7db473712b6c4967d7df59564736f6c634300081c0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610885565b60405180910390f35b61010a6101053660046108ef565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a366004610919565b6102b2565b604051601281526020016100ee565b61010a61015c3660046108ef565b6102d6565b61017461016f3660046108ef565b610315565b005b61011e610184366004610956565b6001600160a01b031660009081526020819052604090205490565b6100e1610323565b61010a6101b53660046108ef565b610332565b61010a6101c83660046108ef565b6103e1565b61011e6101db366004610978565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109ab565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ef565b60019150505b92915050565b6000336102c0858285610547565b6102cb8585856105d9565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a690829086906103109087906109e5565b6103ef565b61031f82826107c6565b5050565b606060048054610215906109ab565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d45760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102cb82868684036103ef565b6000336102a68185856105d9565b6001600160a01b03831661046a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166104e65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d357818110156105c65760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103cb565b6105d384848484036103ef565b50505050565b6001600160a01b0383166106555760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b0382166106d15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b038316600090815260208190526040902054818110156107605760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103cb565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d3565b6001600160a01b03821661081c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103cb565b806002600082825461082e91906109e5565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b602081526000825180602084015260005b818110156108b35760208186018101516040868401015201610896565b506000604082850101526040601f19601f83011684010191505092915050565b80356001600160a01b03811681146108ea57600080fd5b919050565b6000806040838503121561090257600080fd5b61090b836108d3565b946020939093013593505050565b60008060006060848603121561092e57600080fd5b610937846108d3565b9250610945602085016108d3565b929592945050506040919091013590565b60006020828403121561096857600080fd5b610971826108d3565b9392505050565b6000806040838503121561098b57600080fd5b610994836108d3565b91506109a2602084016108d3565b90509250929050565b600181811c908216806109bf57607f821691505b6020821081036109df57634e487b7160e01b600052602260045260246000fd5b50919050565b808201808211156102ac57634e487b7160e01b600052601160045260246000fdfea2646970667358221220eb8de41a50210892ac15e4a17b69e5267bfa3b85e7db473712b6c4967d7df59564736f6c634300081c0033", - "devdoc": { - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." - } - }, - "kind": "dev", - "methods": { - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/solcInputs/38bc1dfa6eb605585a1d33e30c68e961.json b/deployments/linea_testnet/solcInputs/38bc1dfa6eb605585a1d33e30c68e961.json deleted file mode 100644 index b073a12..0000000 --- a/deployments/linea_testnet/solcInputs/38bc1dfa6eb605585a1d33e30c68e961.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n uint64 requestDurationLimit;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20),\n 60 * 60 * 24 * 30 // 30 days\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n error Marketplace_DurationExceedsLimit();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0)) {\n revert Marketplace_RequestAlreadyExists();\n }\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n if (request.ask.duration > _config.requestDurationLimit) {\n revert Marketplace_DurationExceedsLimit();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n assert(_token.transfer(msg.sender, validatorRewardAmount));\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n delete _reservations[slotId]; // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return _requestContexts[requestId].endsAt;\n }\n if (state == RequestState.Cancelled) {\n return _requestContexts[requestId].expiresAt;\n }\n return\n uint64(Math.min(_requestContexts[requestId].endsAt, block.timestamp));\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.28;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.28;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/solcInputs/a7589242551c14dbdceb002d4a7986f1.json b/deployments/linea_testnet/solcInputs/a7589242551c14dbdceb002d4a7986f1.json deleted file mode 100644 index 02e8614..0000000 --- a/deployments/linea_testnet/solcInputs/a7589242551c14dbdceb002d4a7986f1.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint8 slashPercentage; // percentage of the collateral that is slashed\n uint8 validatorRewardPercentage; // percentage of the slashed amount going to the validators\n}\n\nstruct ProofConfig {\n uint64 period; // proofs requirements are calculated per period (in seconds)\n uint64 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 10, 20),\n ProofConfig(10, 5, 64, 67, \"\"),\n SlotReservationsConfig(20)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n error Marketplace_RepairRewardPercentageTooHigh();\n error Marketplace_SlashPercentageTooHigh();\n error Marketplace_MaximumSlashingTooHigh();\n error Marketplace_InvalidExpiry();\n error Marketplace_InvalidMaxSlotLoss();\n error Marketplace_InsufficientSlots();\n error Marketplace_InsufficientDuration();\n error Marketplace_InsufficientProofProbability();\n error Marketplace_InsufficientCollateral();\n error Marketplace_InsufficientReward();\n error Marketplace_InvalidClientAddress();\n error Marketplace_RequestAlreadyExists();\n error Marketplace_InvalidSlot();\n error Marketplace_InvalidCid();\n error Marketplace_SlotNotFree();\n error Marketplace_InvalidSlotHost();\n error Marketplace_AlreadyPaid();\n error Marketplace_TransferFailed();\n error Marketplace_UnknownRequest();\n error Marketplace_InvalidState();\n error Marketplace_StartNotBeforeExpiry();\n error Marketplace_SlotNotAcceptingProofs();\n error Marketplace_SlotIsFree();\n error Marketplace_ReservationRequired();\n error Marketplace_NothingToWithdraw();\n\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n using AskHelpers for Ask;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint64 slotsFilled;\n uint64 startedAt;\n uint64 endsAt;\n uint64 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid\n /// based on time they actually host the content\n uint64 filledAt;\n uint64 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is\n /// to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount\n /// of request.ask.collateralPerByte * request.ask.slotSize\n /// (== request.ask.collateralPerSlot() when using the AskHelpers library)\n /// @dev When Host is slashed for missing a proof the slashed amount is\n /// reflected in this variable\n uint256 currentCollateral;\n /// @notice address used for collateral interactions and identifying hosts\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint64 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory config,\n IERC20 token_,\n IGroth16Verifier verifier\n ) SlotReservations(config.reservations) Proofs(config.proofs, verifier) {\n _token = token_;\n\n if (config.collateral.repairRewardPercentage > 100)\n revert Marketplace_RepairRewardPercentageTooHigh();\n if (config.collateral.slashPercentage > 100)\n revert Marketplace_SlashPercentageTooHigh();\n\n if (\n config.collateral.maxNumberOfSlashes * config.collateral.slashPercentage >\n 100\n ) {\n revert Marketplace_MaximumSlashingTooHigh();\n }\n _config = config;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function currentCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function requestStorage(Request calldata request) public {\n RequestId id = request.id();\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n if (_requests[id].client != address(0))\n revert Marketplace_RequestAlreadyExists();\n if (request.expiry == 0 || request.expiry >= request.ask.duration)\n revert Marketplace_InvalidExpiry();\n if (request.ask.slots == 0) revert Marketplace_InsufficientSlots();\n if (request.ask.maxSlotLoss > request.ask.slots)\n revert Marketplace_InvalidMaxSlotLoss();\n if (request.ask.duration == 0) {\n revert Marketplace_InsufficientDuration();\n }\n if (request.ask.proofProbability == 0) {\n revert Marketplace_InsufficientProofProbability();\n }\n if (request.ask.collateralPerByte == 0) {\n revert Marketplace_InsufficientCollateral();\n }\n if (request.ask.pricePerBytePerSecond == 0) {\n revert Marketplace_InsufficientReward();\n }\n if (bytes(request.content.cid).length == 0) {\n revert Marketplace_InvalidCid();\n }\n\n _requests[id] = request;\n _requestContexts[id].endsAt =\n uint64(block.timestamp) +\n request.ask.duration;\n _requestContexts[id].expiresAt = uint64(block.timestamp) + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint64 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n if (slotIndex >= request.ask.slots) revert Marketplace_InvalidSlot();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n\n if (!_reservations[slotId].contains(msg.sender))\n revert Marketplace_ReservationRequired();\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n if (\n slotState(slotId) != SlotState.Free &&\n slotState(slotId) != SlotState.Repair\n ) {\n revert Marketplace_SlotNotFree();\n }\n\n _startRequiringProofs(slotId);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.filledAt = uint64(block.timestamp);\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n uint256 collateralPerSlot = request.ask.collateralPerSlot();\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n collateralPerSlot -\n ((collateralPerSlot * _config.collateral.repairRewardPercentage) / 100);\n } else {\n collateralAmount = collateralPerSlot;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralPerSlot; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = uint64(block.timestamp);\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n if (slot.host != msg.sender) revert Marketplace_InvalidSlotHost();\n\n SlotState state = slotState(slotId);\n if (state == SlotState.Paid) revert Marketplace_AlreadyPaid();\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n if (slotState(slotId) != SlotState.Filled)\n revert Marketplace_SlotNotAcceptingProofs();\n\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n uint256 slashedAmount = (request.ask.collateralPerSlot() *\n _config.collateral.slashPercentage) / 100;\n\n uint256 validatorRewardAmount = (slashedAmount *\n _config.collateral.validatorRewardPercentage) / 100;\n _marketplaceTotals.sent += validatorRewardAmount;\n assert(_token.transfer(msg.sender, validatorRewardAmount));\n\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) >= _config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n delete _reservations[slotId]; // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = uint64(block.timestamp) - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n if (!_token.transfer(rewardRecipient, payoutAmount)) {\n revert Marketplace_TransferFailed();\n }\n\n if (!_token.transfer(collateralRecipient, collateralAmount)) {\n revert Marketplace_TransferFailed();\n }\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n RequestContext storage context = _requestContexts[requestId];\n\n if (request.client != msg.sender) revert Marketplace_InvalidClientAddress();\n\n RequestState state = requestState(requestId);\n if (\n state != RequestState.Cancelled &&\n state != RequestState.Failed &&\n state != RequestState.Finished\n ) {\n revert Marketplace_InvalidState();\n }\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n if (context.fundsToReturnToClient == 0)\n revert Marketplace_NothingToWithdraw();\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n\n if (!_token.transfer(withdrawRecipient, amount)) {\n revert Marketplace_TransferFailed();\n }\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n if (_requests[requestId].client == address(0))\n revert Marketplace_UnknownRequest();\n\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n if (_slots[slotId].state == SlotState.Free) revert Marketplace_SlotIsFree();\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint64) {\n uint64 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return uint64(Math.min(end, block.timestamp - 1));\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint64) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint64 startingTimestamp,\n uint64 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n if (startingTimestamp >= endingTimestamp)\n revert Marketplace_StartNotBeforeExpiry();\n return\n (endingTimestamp - startingTimestamp) *\n request.ask.pricePerSlotPerSecond();\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n uint64(block.timestamp) > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) &&\n uint64(block.timestamp) > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function slotProbability(\n SlotId slotId\n ) public view override returns (uint256) {\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n return\n (request.ask.proofProbability * (256 - _config.proofs.downtime)) / 256;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n if (!_token.transferFrom(sender, receiver, amount))\n revert Marketplace_TransferFailed();\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint64 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint64 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint64 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n error Periods_InvalidSecondsPerPeriod();\n\n type Period is uint64;\n\n uint64 internal immutable _secondsPerPeriod;\n\n constructor(uint64 secondsPerPeriod) {\n if (secondsPerPeriod == 0) {\n revert Periods_InvalidSecondsPerPeriod();\n }\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint64 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(uint64(block.timestamp));\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint64) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint64) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n error Proofs_InsufficientBlockHeight();\n error Proofs_InvalidProof();\n error Proofs_ProofAlreadySubmitted();\n error Proofs_PeriodNotEnded();\n error Proofs_ValidationTimedOut();\n error Proofs_ProofNotMissing();\n error Proofs_ProofNotRequired();\n error Proofs_ProofAlreadyMarkedMissing();\n\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n if (block.number <= 256) {\n revert Proofs_InsufficientBlockHeight();\n }\n\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint64) private _slotStarts;\n mapping(SlotId => uint64) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @param id Slot's ID\n * @return Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n */\n function slotProbability(SlotId id) public view virtual returns (uint256);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint64) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id) internal {\n _slotStarts[id] = uint64(block.timestamp);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = slotProbability(id);\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n if (_received[id][_blockPeriod()]) revert Proofs_ProofAlreadySubmitted();\n if (!_verifier.verify(proof, pubSignals)) revert Proofs_InvalidProof();\n\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n if (end >= block.timestamp) revert Proofs_PeriodNotEnded();\n if (block.timestamp >= end + _config.timeout)\n revert Proofs_ValidationTimedOut();\n if (_received[id][missedPeriod]) revert Proofs_ProofNotMissing();\n if (!_isProofRequired(id, missedPeriod)) revert Proofs_ProofNotRequired();\n if (_missing[id][missedPeriod]) revert Proofs_ProofAlreadyMarkedMissing();\n\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint64 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint256 proofProbability; // how often storage proofs are required\n uint256 pricePerBytePerSecond; // amount of tokens paid per second per byte to hosts\n uint256 collateralPerByte; // amount of tokens per byte required to be deposited by the hosts in order to fill the slot\n uint64 slots; // the number of requested slots\n uint64 slotSize; // amount of storage per slot (in number of bytes)\n uint64 duration; // how long content should be stored (in seconds)\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n bytes cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary AskHelpers {\n function collateralPerSlot(Ask memory ask) internal pure returns (uint256) {\n return ask.collateralPerByte * ask.slotSize;\n }\n\n function pricePerSlotPerSecond(\n Ask memory ask\n ) internal pure returns (uint256) {\n return ask.pricePerBytePerSecond * ask.slotSize;\n }\n}\n\nlibrary Requests {\n using AskHelpers for Ask;\n\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint64 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return\n request.ask.slots *\n request.ask.duration *\n request.ask.pricePerSlotPerSecond();\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n error SlotReservations_ReservationNotAllowed();\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint64 slotIndex) public {\n if (!canReserveSlot(requestId, slotIndex))\n revert SlotReservations_ReservationNotAllowed();\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint64 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint64 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n mapping(SlotId => uint256) private _probabilities;\n // A _config object exist in Proofs but it is private.\n // Better to duplicate this config in the test implementation\n // rather than modifiying the existing implementation and change\n // private to internal, which may cause problems in the Marketplace contract.\n ProofConfig private _proofConfig;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {\n _proofConfig = config;\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot) public {\n _startRequiringProofs(slot);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n\n function slotProbability(\n SlotId id\n ) public view virtual override returns (uint256) {\n return (_probabilities[id] * (256 - _proofConfig.downtime)) / 256;\n }\n\n function setSlotProbability(SlotId id, uint256 probability) public {\n _probabilities[id] = probability;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/linea_testnet/solcInputs/a8d4d99447cf1f5155fc4a8a0d59e374.json b/deployments/linea_testnet/solcInputs/a8d4d99447cf1f5155fc4a8a0d59e374.json deleted file mode 100644 index da218e2..0000000 --- a/deployments/linea_testnet/solcInputs/a8d4d99447cf1f5155fc4a8a0d59e374.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n SlotReservationsConfig reservations;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of collateral that is used as repair reward\n uint8 repairRewardPercentage;\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n string zkeyHash; // hash of the zkey file which is linked to the verifier\n // Ensures the pointer does not remain in downtime for many consecutive\n // periods. For each period increase, move the pointer `pointerProduct`\n // blocks. Should be a prime number to ensure there are no cycles.\n uint8 downtimeProduct;\n}\n\nstruct SlotReservationsConfig {\n // Number of allowed reservations per slot\n uint8 maxReservations;\n}\n" - }, - "contracts/Endian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Endian {\n /// reverses byte order to allow conversion between little endian and big\n /// endian integers\n function _byteSwap(bytes32 input) internal pure returns (bytes32 output) {\n output = output | bytes1(input);\n for (uint i = 1; i < 32; i++) {\n output = output >> 8;\n output = output | bytes1(input << (i * 8));\n }\n }\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\nimport \"./TestVerifier.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n MarketplaceConfig(\n CollateralConfig(10, 5, 3, 10),\n ProofConfig(10, 5, 64, \"\", 67),\n SlotReservationsConfig(20)\n ),\n new TestToken(),\n new TestVerifier()\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token().balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Groth16.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nstruct G1Point {\n uint256 x;\n uint256 y;\n}\n\n// A field element F_{p^2} encoded as `real + i * imag`.\n// We chose to not represent this as an array of 2 numbers, because both Circom\n// and Ethereum EIP-197 encode to an array, but with conflicting encodings.\nstruct Fp2Element {\n uint256 real;\n uint256 imag;\n}\n\nstruct G2Point {\n Fp2Element x;\n Fp2Element y;\n}\n\nstruct Groth16Proof {\n G1Point a;\n G2Point b;\n G1Point c;\n}\n\ninterface IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint256[] calldata pubSignals\n ) external view returns (bool);\n}\n" - }, - "contracts/Groth16Verifier.sol": { - "content": "// Copyright 2017 Christian Reitwiessner\n// Copyright 2019 OKIMS\n// Copyright 2024 Codex\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"./Groth16.sol\";\n\ncontract Groth16Verifier is IGroth16Verifier {\n uint256 private constant _P =\n 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n uint256 private constant _R =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n VerifyingKey private _verifyingKey;\n\n struct VerifyingKey {\n G1Point alpha1;\n G2Point beta2;\n G2Point gamma2;\n G2Point delta2;\n G1Point[] ic;\n }\n\n constructor(VerifyingKey memory key) {\n _verifyingKey.alpha1 = key.alpha1;\n _verifyingKey.beta2 = key.beta2;\n _verifyingKey.gamma2 = key.gamma2;\n _verifyingKey.delta2 = key.delta2;\n for (uint i = 0; i < key.ic.length; i++) {\n _verifyingKey.ic.push(key.ic[i]);\n }\n }\n\n function _negate(G1Point memory point) private pure returns (G1Point memory) {\n return G1Point(point.x, (_P - point.y) % _P);\n }\n\n function _add(\n G1Point memory point1,\n G1Point memory point2\n ) private view returns (bool success, G1Point memory sum) {\n // Call the precompiled contract for addition on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[4] memory input;\n input[0] = point1.x;\n input[1] = point1.y;\n input[2] = point2.x;\n input[3] = point2.y;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 6, input, 128, sum, 64)\n }\n }\n\n function _multiply(\n G1Point memory point,\n uint256 scalar\n ) private view returns (bool success, G1Point memory product) {\n // Call the precompiled contract for scalar multiplication on the alt_bn128\n // curve. The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-196#exact-semantics\n\n uint256[3] memory input;\n input[0] = point.x;\n input[1] = point.y;\n input[2] = scalar;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 7, input, 96, product, 64)\n }\n }\n\n function _checkPairing(\n G1Point memory a1,\n G2Point memory a2,\n G1Point memory b1,\n G2Point memory b2,\n G1Point memory c1,\n G2Point memory c2,\n G1Point memory d1,\n G2Point memory d2\n ) private view returns (bool success, uint256 outcome) {\n // Call the precompiled contract for pairing check on the alt_bn128 curve.\n // The call will fail if the points are not valid group elements:\n // https://eips.ethereum.org/EIPS/eip-197#specification\n\n uint256[24] memory input; // 4 pairs of G1 and G2 points\n uint256[1] memory output;\n\n input[0] = a1.x;\n input[1] = a1.y;\n input[2] = a2.x.imag;\n input[3] = a2.x.real;\n input[4] = a2.y.imag;\n input[5] = a2.y.real;\n\n input[6] = b1.x;\n input[7] = b1.y;\n input[8] = b2.x.imag;\n input[9] = b2.x.real;\n input[10] = b2.y.imag;\n input[11] = b2.y.real;\n\n input[12] = c1.x;\n input[13] = c1.y;\n input[14] = c2.x.imag;\n input[15] = c2.x.real;\n input[16] = c2.y.imag;\n input[17] = c2.y.real;\n\n input[18] = d1.x;\n input[19] = d1.y;\n input[20] = d2.x.imag;\n input[21] = d2.x.real;\n input[22] = d2.y.imag;\n input[23] = d2.y.real;\n\n // solhint-disable-next-line no-inline-assembly\n assembly {\n success := staticcall(gas(), 8, input, 768, output, 32)\n }\n return (success, output[0]);\n }\n\n function verify(\n Groth16Proof calldata proof,\n uint256[] memory input\n ) public view returns (bool success) {\n // Check amount of public inputs\n if (input.length + 1 != _verifyingKey.ic.length) {\n return false;\n }\n // Check that public inputs are field elements\n for (uint i = 0; i < input.length; i++) {\n if (input[i] >= _R) {\n return false;\n }\n }\n // Compute the linear combination\n G1Point memory combination = _verifyingKey.ic[0];\n for (uint i = 0; i < input.length; i++) {\n G1Point memory product;\n (success, product) = _multiply(_verifyingKey.ic[i + 1], input[i]);\n if (!success) {\n return false;\n }\n (success, combination) = _add(combination, product);\n if (!success) {\n return false;\n }\n }\n // Check the pairing\n uint256 outcome;\n (success, outcome) = _checkPairing(\n _negate(proof.a),\n proof.b,\n _verifyingKey.alpha1,\n _verifyingKey.beta2,\n combination,\n _verifyingKey.gamma2,\n proof.c,\n _verifyingKey.delta2\n );\n if (!success) {\n return false;\n }\n return outcome == 1;\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./SlotReservations.sol\";\nimport \"./StateRetrieval.sol\";\nimport \"./Endian.sol\";\nimport \"./Groth16.sol\";\n\ncontract Marketplace is SlotReservations, Proofs, StateRetrieval, Endian {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using EnumerableSet for EnumerableSet.AddressSet;\n using Requests for Request;\n\n IERC20 private immutable _token;\n MarketplaceConfig private _config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) internal _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n /// @notice Tracks how much funds should be returned to the client as not all funds might be used for hosting the request\n /// @dev The sum starts with the full reward amount for the request and is reduced every time a host fills a slot.\n /// The reduction is calculated from the duration of time between the slot being filled and the request's end.\n /// This is the amount that will be paid out to the host when the request successfully finishes.\n /// @dev fundsToReturnToClient == 0 is used to signal that after request is terminated all the remaining funds were withdrawn.\n /// This is possible, because technically it is not possible for this variable to reach 0 in \"natural\" way as\n /// that would require all the slots to be filled at the same block as the request was created.\n uint256 fundsToReturnToClient;\n uint256 startedAt;\n uint256 endsAt;\n uint256 expiresAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n /// @notice Timestamp that signals when slot was filled\n /// @dev Used for calculating payouts as hosts are paid based on time they actually host the content\n uint256 filledAt;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host; // address used for collateral interactions and identifying hosts\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n MarketplaceConfig memory configuration,\n IERC20 token_,\n IGroth16Verifier verifier\n )\n SlotReservations(configuration.reservations)\n Proofs(configuration.proofs, verifier)\n {\n _token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n _config = configuration;\n }\n\n function configuration() public view returns (MarketplaceConfig memory) {\n return _config;\n }\n\n function token() public view returns (IERC20) {\n return _token;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n require(\n request.expiry > 0 && request.expiry < request.ask.duration,\n \"Expiry not in range\"\n );\n require(request.ask.slots > 0, \"Insufficient slots\");\n require(\n request.ask.maxSlotLoss <= request.ask.slots,\n \"maxSlotLoss exceeds slots\"\n );\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n _requestContexts[id].expiresAt = block.timestamp + request.expiry;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.maxPrice();\n _requestContexts[id].fundsToReturnToClient = amount;\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, _requestContexts[id].expiresAt);\n }\n\n /**\n * @notice Fills a slot. Reverts if an invalid proof of the slot data is\n provided.\n * @param requestId RequestId identifying the request containing the slot to\n fill.\n * @param slotIndex Index of the slot in the request.\n * @param proof Groth16 proof procing possession of the slot data.\n */\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n Groth16Proof calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n require(_reservations[slotId].contains(msg.sender), \"Reservation required\");\n\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n RequestContext storage context = _requestContexts[requestId];\n\n require(\n slotState(slotId) == SlotState.Free ||\n slotState(slotId) == SlotState.Repair,\n \"Slot is not free\"\n );\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.filledAt = block.timestamp;\n\n context.slotsFilled += 1;\n context.fundsToReturnToClient -= _slotPayout(requestId, slot.filledAt);\n\n // Collect collateral\n uint256 collateralAmount;\n if (slotState(slotId) == SlotState.Repair) {\n // Host is repairing a slot and is entitled for repair reward, so he gets \"discounted collateral\"\n // in this way he gets \"physically\" the reward at the end of the request when the full amount of collateral\n // is returned to him.\n collateralAmount =\n request.ask.collateral -\n ((request.ask.collateral * _config.collateral.repairRewardPercentage) /\n 100);\n } else {\n collateralAmount = request.ask.collateral;\n }\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = request.ask.collateral; // Even if he has collateral discounted, he is operating with full collateral\n\n _addToMySlots(slot.host, slotId);\n\n slot.state = SlotState.Filled;\n emit SlotFilled(requestId, slotIndex);\n\n if (\n context.slotsFilled == request.ask.slots &&\n context.state == RequestState.New // Only New requests can \"start\" the requests\n ) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests to the host that has filled the slot.\n * @param slotId id of the slot to free\n * @dev The host that filled the slot must have initiated the transaction\n (msg.sender). This overload allows `rewardRecipient` and\n `collateralRecipient` to be optional.\n */\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n return freeSlot(slotId, msg.sender, msg.sender);\n }\n\n /**\n * @notice Frees a slot, paying out rewards and returning collateral for\n finished or cancelled requests.\n * @param slotId id of the slot to free\n * @param rewardRecipient address to send rewards to\n * @param collateralRecipient address to refund collateral to\n */\n function freeSlot(\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId, rewardRecipient, collateralRecipient);\n } else if (state == SlotState.Cancelled) {\n _payoutCancelledSlot(\n slot.requestId,\n slotId,\n rewardRecipient,\n collateralRecipient\n );\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n // free slot without returning collateral, effectively a 100% slash\n _forciblyFreeSlot(slotId);\n }\n }\n\n function _challengeToFieldElement(\n bytes32 challenge\n ) internal pure returns (uint256) {\n // use only 31 bytes of the challenge to ensure that it fits into the field\n bytes32 truncated = bytes32(bytes31(challenge));\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(truncated);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function _merkleRootToFieldElement(\n bytes32 merkleRoot\n ) internal pure returns (uint256) {\n // convert from little endian to big endian\n bytes32 bigEndian = _byteSwap(merkleRoot);\n // convert bytes to integer\n return uint256(bigEndian);\n }\n\n function submitProof(\n SlotId id,\n Groth16Proof calldata proof\n ) public requestIsKnown(_slots[id].requestId) {\n Slot storage slot = _slots[id];\n Request storage request = _requests[slot.requestId];\n uint256[] memory pubSignals = new uint256[](3);\n pubSignals[0] = _challengeToFieldElement(getChallenge(id));\n pubSignals[1] = _merkleRootToFieldElement(request.content.merkleRoot);\n pubSignals[2] = slot.slotIndex;\n _proofReceived(id, proof, pubSignals);\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n // TODO: Reward for validator that calls this function\n\n if (missingProofs(slotId) % _config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n _config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / _config.collateral.slashCriterion >=\n _config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n /**\n * @notice Abandons the slot without returning collateral, effectively slashing the\n entire collateral.\n * @param slotId SlotId of the slot to free.\n * @dev _slots[slotId] is deleted, resetting _slots[slotId].currentCollateral\n to 0.\n */\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n // We need to refund the amount of payout of the current node to the `fundsToReturnToClient` so\n // we keep correctly the track of the funds that needs to be returned at the end.\n context.fundsToReturnToClient += _slotPayout(requestId, slot.filledAt);\n\n _removeFromMySlots(slot.host, slotId);\n delete _reservations[slotId]; // We purge all the reservations for the slot\n slot.state = SlotState.Repair;\n slot.filledAt = 0;\n slot.currentCollateral = 0;\n slot.host = address(0);\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slot.slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n Slot storage slot = _slots[slotId];\n\n _removeFromMyRequests(request.client, requestId);\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(requestId, slot.filledAt);\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Pays out a host for duration of time that the slot was filled, and\n returns the collateral.\n * @dev The payouts are sent to the rewardRecipient, and collateral is returned\n to the host address.\n * @param requestId RequestId of the request that contains the slot to be paid\n out.\n * @param slotId SlotId of the slot to be paid out.\n */\n function _payoutCancelledSlot(\n RequestId requestId,\n SlotId slotId,\n address rewardRecipient,\n address collateralRecipient\n ) private requestIsKnown(requestId) {\n Slot storage slot = _slots[slotId];\n _removeFromMySlots(slot.host, slotId);\n\n uint256 payoutAmount = _slotPayout(\n requestId,\n slot.filledAt,\n requestExpiry(requestId)\n );\n uint256 collateralAmount = slot.currentCollateral;\n _marketplaceTotals.sent += (payoutAmount + collateralAmount);\n slot.state = SlotState.Paid;\n assert(_token.transfer(rewardRecipient, payoutAmount));\n assert(_token.transfer(collateralRecipient, collateralAmount));\n }\n\n /**\n * @notice Withdraws remaining storage request funds back to the client that\n deposited them.\n * @dev Request must be cancelled, failed or finished, and the\n transaction must originate from the depositor address.\n * @param requestId the id of the request\n */\n function withdrawFunds(RequestId requestId) public {\n withdrawFunds(requestId, msg.sender);\n }\n\n /**\n * @notice Withdraws storage request funds to the provided address.\n * @dev Request must be expired, must be in RequestState.New, and the\n transaction must originate from the depositer address.\n * @param requestId the id of the request\n * @param withdrawRecipient address to return the remaining funds to\n */\n function withdrawFunds(\n RequestId requestId,\n address withdrawRecipient\n ) public {\n Request storage request = _requests[requestId];\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n RequestState state = requestState(requestId);\n require(\n state == RequestState.Cancelled ||\n state == RequestState.Failed ||\n state == RequestState.Finished,\n \"Invalid state\"\n );\n\n // fundsToReturnToClient == 0 is used for \"double-spend\" protection, once the funds are withdrawn\n // then this variable is set to 0.\n require(context.fundsToReturnToClient != 0, \"Nothing to withdraw\");\n\n if (state == RequestState.Cancelled) {\n context.state = RequestState.Cancelled;\n emit RequestCancelled(requestId);\n\n // `fundsToReturnToClient` currently tracks funds to be returned for requests that successfully finish.\n // When requests are cancelled, funds earmarked for payment for the duration\n // between request expiry and request end (for every slot that was filled), should be returned to the client.\n // Update `fundsToReturnToClient` to reflect this.\n context.fundsToReturnToClient +=\n context.slotsFilled *\n _slotPayout(requestId, requestExpiry(requestId));\n } else if (state == RequestState.Failed) {\n // For Failed requests the client is refunded whole amount.\n context.fundsToReturnToClient = request.maxPrice();\n } else {\n context.state = RequestState.Finished;\n }\n\n _removeFromMyRequests(request.client, requestId);\n\n uint256 amount = context.fundsToReturnToClient;\n _marketplaceTotals.sent += amount;\n assert(_token.transfer(withdrawRecipient, amount));\n\n // We zero out the funds tracking in order to prevent double-spends\n context.fundsToReturnToClient = 0;\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _slots[slotId].state == SlotState.Free;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function requestExpiry(RequestId requestId) public view returns (uint256) {\n return _requestContexts[requestId].expiresAt;\n }\n\n /**\n * @notice Calculates the amount that should be paid out to a host that successfully finished the request\n * @param requestId RequestId of the request used to calculate the payout\n * amount.\n * @param startingTimestamp timestamp indicating when a host filled a slot and\n * started providing proofs.\n */\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp\n ) private view returns (uint256) {\n return\n _slotPayout(\n requestId,\n startingTimestamp,\n _requestContexts[requestId].endsAt\n );\n }\n\n /// @notice Calculates the amount that should be paid out to a host based on the specified time frame.\n function _slotPayout(\n RequestId requestId,\n uint256 startingTimestamp,\n uint256 endingTimestamp\n ) private view returns (uint256) {\n Request storage request = _requests[requestId];\n require(startingTimestamp < endingTimestamp, \"Start not before expiry\");\n\n return (endingTimestamp - startingTimestamp) * request.ask.reward;\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > requestExpiry(requestId)\n ) {\n return RequestState.Cancelled;\n } else if (\n (context.state == RequestState.Started ||\n context.state == RequestState.New) && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Cancelled;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(_token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(RequestId indexed requestId, uint256 slotIndex);\n event SlotFreed(RequestId indexed requestId, uint256 slotIndex);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\nimport \"./Groth16.sol\";\n\n/**\n * @title Proofs\n * @notice Abstract contract that handles proofs tracking, validation and reporting functionality\n */\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n IGroth16Verifier private _verifier;\n\n /**\n * Creation of the contract requires at least 256 mined blocks!\n * @param config Proving configuration\n */\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n _verifier = verifier;\n }\n\n mapping(SlotId => uint256) private _slotStarts; // TODO: Should be smaller than uint256\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed; // TODO: Should be smaller than uint256\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n /**\n * @return Number of missed proofs since Slot was Filled\n */\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n /**\n * @param slotId Slot's ID for which the proofs should be reset\n * @notice Resets the missing proofs counter to zero\n */\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n /**\n * @param id Slot's ID for which the proofs should be started to require\n * @param probability Integer which specifies the probability of how often the proofs will be required. Lower number means higher probability.\n * @notice Notes down the block's timestamp as Slot's starting time for requiring proofs\n * and saves the required probability.\n */\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @param period Period for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = (Period.unwrap(period) * _config.downtimeProduct) %\n 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n /**\n * @param id Slot's ID for which the pointer should be calculated\n * @return Uint8 pointer that is stable over current Period, ie an integer offset [0-255] of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @dev For more information see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md)\n */\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n /**\n * @param pointer Integer [0-255] that indicates an offset of the last 256 blocks, pointing to a block that remains constant for the entire Period's duration.\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @param period Period for which the challenge should be calculated\n * @return Challenge that should be used for generation of proofs\n */\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n /**\n * @param id Slot's ID for which the challenge should be calculated\n * @return Challenge for current Period that should be used for generation of proofs\n */\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n /**\n * @param id Slot's ID for which the requirements are gathered. If the Slot's state is other than Filled, `false` is always returned.\n * @param period Period for which the requirements are gathered.\n */\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n\n /// Scaling of the probability according the downtime configuration\n /// See: https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n /**\n * See isProofRequired\n */\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n /**\n * @param id Slot's ID for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool indicating if proof is required for current period\n */\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n /**\n * Proof Downtime specifies part of the Period when the proof is not required even\n * if the proof should be required. This function returns true if the pointer is\n * in downtime (hence no proof required now) and at the same time the proof\n * will be required later on in the Period.\n *\n * @dev for more info about downtime see [timing of storage proofs](https://github.com/codex-storage/codex-research/blob/41c4b4409d2092d0a5475aca0f28995034e58d14/design/storage-proof-timing.md#pointer-downtime)\n * @param id SlotId for which the proof requirements should be checked. If the Slot's state is other than Filled, `false` is always returned.\n * @return bool\n */\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n /**\n * Function used for submitting and verification of the proofs.\n *\n * @dev Reverts when proof is invalid or had been already submitted.\n * @dev Emits ProofSubmitted event.\n * @param id Slot's ID for which the proof requirements should be checked\n * @param proof Groth16 proof\n * @param pubSignals Proofs public input\n */\n function _proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) internal {\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n require(_verifier.verify(proof, pubSignals), \"Invalid proof\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id);\n }\n\n /**\n * Function used to mark proof as missing.\n *\n * @param id Slot's ID for which the proof is missing\n * @param missedPeriod Period for which the proof was missed\n * @dev Reverts when:\n * - missedPeriod has not ended yet ended\n * - missing proof was time-barred\n * - proof was submitted\n * - proof was not required for missedPeriod period\n * - proof was already marked as missing\n */\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // amount of seconds since start of the request at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id, used to download the dataset\n bytes32 merkleRoot; // merkle root of the dataset, used to verify storage proofs\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid, // host has been paid\n Cancelled, // when request was cancelled then slot is cancelled as well\n Repair // when slot slot was forcible freed (host was kicked out from hosting the slot because of too many missed proofs) and needs to be repaired\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function maxPrice(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * request.ask.duration * request.ask.reward;\n }\n}\n" - }, - "contracts/SlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\nimport \"./Configuration.sol\";\n\nabstract contract SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => EnumerableSet.AddressSet) internal _reservations;\n SlotReservationsConfig private _config;\n\n constructor(SlotReservationsConfig memory config) {\n _config = config;\n }\n\n function _slotIsFree(SlotId slotId) internal view virtual returns (bool);\n\n function reserveSlot(RequestId requestId, uint256 slotIndex) public {\n require(canReserveSlot(requestId, slotIndex), \"Reservation not allowed\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n _reservations[slotId].add(msg.sender);\n\n if (_reservations[slotId].length() == _config.maxReservations) {\n emit SlotReservationsFull(requestId, slotIndex);\n }\n }\n\n function canReserveSlot(\n RequestId requestId,\n uint256 slotIndex\n ) public view returns (bool) {\n address host = msg.sender;\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n return\n // TODO: add in check for address inside of expanding window\n _slotIsFree(slotId) &&\n (_reservations[slotId].length() < _config.maxReservations) &&\n (!_reservations[slotId].contains(host));\n }\n\n event SlotReservationsFull(RequestId indexed requestId, uint256 slotIndex);\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestEndian.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Endian.sol\";\n\ncontract TestEndian is Endian {\n function byteSwap(bytes32 input) public pure returns (bytes32) {\n return _byteSwap(input);\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n MarketplaceConfig memory config,\n IERC20 token,\n IGroth16Verifier verifier\n )\n Marketplace(config, token, verifier) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n\n function challengeToFieldElement(\n bytes32 challenge\n ) public pure returns (uint256) {\n return _challengeToFieldElement(challenge);\n }\n\n function merkleRootToFieldElement(\n bytes32 merkleRoot\n ) public pure returns (uint256) {\n return _merkleRootToFieldElement(merkleRoot);\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n constructor(\n ProofConfig memory config,\n IGroth16Verifier verifier\n ) Proofs(config, verifier) {} // solhint-disable-line no-empty-blocks\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function proofReceived(\n SlotId id,\n Groth16Proof calldata proof,\n uint[] memory pubSignals\n ) public {\n _proofReceived(id, proof, pubSignals);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestSlotReservations.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"./SlotReservations.sol\";\n\ncontract TestSlotReservations is SlotReservations {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(SlotReservationsConfig memory config) SlotReservations(config) {}\n\n function contains(SlotId slotId, address host) public view returns (bool) {\n return _reservations[slotId].contains(host);\n }\n\n function length(SlotId slotId) public view returns (uint256) {\n return _reservations[slotId].length();\n }\n\n function _slotIsFree(SlotId slotId) internal view override returns (bool) {\n return _states[slotId] == SlotState.Free;\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.23;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - }, - "contracts/TestVerifier.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\n\nimport \"./Groth16.sol\";\n\ncontract TestVerifier is IGroth16Verifier {\n function verify(\n Groth16Proof calldata proof,\n uint[] calldata\n ) external pure returns (bool) {\n // accepts any proof, except the proof with all zero values\n return\n !(proof.a.x == 0 &&\n proof.a.y == 0 &&\n proof.b.x.real == 0 &&\n proof.b.x.imag == 0 &&\n proof.b.y.real == 0 &&\n proof.b.y.imag == 0 &&\n proof.c.x == 0 &&\n proof.c.y == 0);\n }\n}\n" - } - }, - "settings": { - "evmVersion": "paris", - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/taiko_test/.chainId b/deployments/taiko_test/.chainId deleted file mode 100644 index d455637..0000000 --- a/deployments/taiko_test/.chainId +++ /dev/null @@ -1 +0,0 @@ -167005 \ No newline at end of file diff --git a/deployments/taiko_test/Marketplace.json b/deployments/taiko_test/Marketplace.json deleted file mode 100644 index 8ab8699..0000000 --- a/deployments/taiko_test/Marketplace.json +++ /dev/null @@ -1,1687 +0,0 @@ -{ - "address": "0x948CF9291b77Bd7ad84781b9047129Addf1b894F", - "abi": [ - { - "inputs": [ - { - "internalType": "contract IERC20", - "name": "token_", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "slashCriterion", - "type": "uint16" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "period", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeout", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - } - ], - "internalType": "struct MarketplaceConfig", - "name": "configuration", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "name": "ProofSubmitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFailed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "RequestFulfilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slotIndex", - "type": "uint256" - } - ], - "name": "SlotFilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "slotIndex", - "type": "uint256" - } - ], - "name": "SlotFreed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "slotSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "indexed": false, - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "name": "StorageRequested", - "type": "event" - }, - { - "inputs": [], - "name": "config", - "outputs": [ - { - "components": [ - { - "internalType": "uint8", - "name": "repairRewardPercentage", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "maxNumberOfSlashes", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "slashCriterion", - "type": "uint16" - }, - { - "internalType": "uint8", - "name": "slashPercentage", - "type": "uint8" - } - ], - "internalType": "struct CollateralConfig", - "name": "collateral", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "period", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "timeout", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "downtime", - "type": "uint8" - } - ], - "internalType": "struct ProofConfig", - "name": "proofs", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "slotIndex", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "name": "fillSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "freeSlot", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getActiveSlot", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "slotSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "cid", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "totalChunks", - "type": "uint64" - } - ], - "internalType": "struct Erasure", - "name": "erasure", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "u", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "publicKey", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "name", - "type": "bytes" - } - ], - "internalType": "struct PoR", - "name": "por", - "type": "tuple" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "slotIndex", - "type": "uint256" - } - ], - "internalType": "struct Marketplace.ActiveSlot", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getChallenge", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "getHost", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "getPointer", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "getRequest", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "slotSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "cid", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "totalChunks", - "type": "uint64" - } - ], - "internalType": "struct Erasure", - "name": "erasure", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "u", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "publicKey", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "name", - "type": "bytes" - } - ], - "internalType": "struct PoR", - "name": "por", - "type": "tuple" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "isProofRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - }, - { - "internalType": "Periods.Period", - "name": "period", - "type": "uint256" - } - ], - "name": "markProofAsMissing", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "missingProofs", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "myRequests", - "outputs": [ - { - "internalType": "RequestId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "mySlots", - "outputs": [ - { - "internalType": "SlotId[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestEnd", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "requestState", - "outputs": [ - { - "internalType": "enum RequestState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "client", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "slots", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "slotSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "duration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofProbability", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collateral", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "maxSlotLoss", - "type": "uint64" - } - ], - "internalType": "struct Ask", - "name": "ask", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "string", - "name": "cid", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "totalChunks", - "type": "uint64" - } - ], - "internalType": "struct Erasure", - "name": "erasure", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "u", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "publicKey", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "name", - "type": "bytes" - } - ], - "internalType": "struct PoR", - "name": "por", - "type": "tuple" - } - ], - "internalType": "struct Content", - "name": "content", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "nonce", - "type": "bytes32" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - } - ], - "name": "requestStorage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "slotId", - "type": "bytes32" - } - ], - "name": "slotState", - "outputs": [ - { - "internalType": "enum SlotState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "name": "submitProof", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "SlotId", - "name": "id", - "type": "bytes32" - } - ], - "name": "willProofBeRequired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "RequestId", - "name": "requestId", - "type": "bytes32" - } - ], - "name": "withdrawFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x20ae209f295c34cb2a1379c63c5d9a82b29a1730fb76f7d904a37aa3bb2cdbbb", - "receipt": { - "to": null, - "from": "0xD40C3aED27Cb03CC671b66Fd52d81AE9d8702BE4", - "contractAddress": "0x948CF9291b77Bd7ad84781b9047129Addf1b894F", - "transactionIndex": 1, - "gasUsed": "3504339", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x5e123f5a919bef312d06824a618e0f06446a57f1777e6cd462da37fa7c246dcb", - "transactionHash": "0x20ae209f295c34cb2a1379c63c5d9a82b29a1730fb76f7d904a37aa3bb2cdbbb", - "logs": [], - "blockNumber": 1857256, - "cumulativeGasUsed": "3632196", - "status": 1, - "byzantium": true - }, - "args": [ - "0x95658FdA29e3b547107c95c11dD5e4a1A034C4AB", - { - "collateral": { - "repairRewardPercentage": 10, - "maxNumberOfSlashes": 5, - "slashCriterion": 3, - "slashPercentage": 10 - }, - "proofs": { - "period": 10, - "timeout": 5, - "downtime": 64 - } - } - ], - "numDeployments": 2, - "solcInputHash": "1f43413075cc2b565de996acf5469041", - "metadata": "{\"compiler\":{\"version\":\"0.8.8+commit.dddeac2f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token_\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"slashCriterion\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"}],\"internalType\":\"struct MarketplaceConfig\",\"name\":\"configuration\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"ProofSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"RequestFulfilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotIndex\",\"type\":\"uint256\"}],\"name\":\"SlotFilled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"slotIndex\",\"type\":\"uint256\"}],\"name\":\"SlotFreed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"slotSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"StorageRequested\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint8\",\"name\":\"repairRewardPercentage\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"maxNumberOfSlashes\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"slashCriterion\",\"type\":\"uint16\"},{\"internalType\":\"uint8\",\"name\":\"slashPercentage\",\"type\":\"uint8\"}],\"internalType\":\"struct CollateralConfig\",\"name\":\"collateral\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"period\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"downtime\",\"type\":\"uint8\"}],\"internalType\":\"struct ProofConfig\",\"name\":\"proofs\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"slotIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"fillSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"freeSlot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getActiveSlot\",\"outputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"slotSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"cid\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"totalChunks\",\"type\":\"uint64\"}],\"internalType\":\"struct Erasure\",\"name\":\"erasure\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"u\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"}],\"internalType\":\"struct PoR\",\"name\":\"por\",\"type\":\"tuple\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"slotIndex\",\"type\":\"uint256\"}],\"internalType\":\"struct Marketplace.ActiveSlot\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getChallenge\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"getHost\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"getPointer\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"getRequest\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"slotSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"cid\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"totalChunks\",\"type\":\"uint64\"}],\"internalType\":\"struct Erasure\",\"name\":\"erasure\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"u\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"}],\"internalType\":\"struct PoR\",\"name\":\"por\",\"type\":\"tuple\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"isProofRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"},{\"internalType\":\"Periods.Period\",\"name\":\"period\",\"type\":\"uint256\"}],\"name\":\"markProofAsMissing\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"missingProofs\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"myRequests\",\"outputs\":[{\"internalType\":\"RequestId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mySlots\",\"outputs\":[{\"internalType\":\"SlotId[]\",\"name\":\"\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestEnd\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"requestState\",\"outputs\":[{\"internalType\":\"enum RequestState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"client\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"slots\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"slotSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofProbability\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collateral\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"maxSlotLoss\",\"type\":\"uint64\"}],\"internalType\":\"struct Ask\",\"name\":\"ask\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"string\",\"name\":\"cid\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"totalChunks\",\"type\":\"uint64\"}],\"internalType\":\"struct Erasure\",\"name\":\"erasure\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"u\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"publicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"name\",\"type\":\"bytes\"}],\"internalType\":\"struct PoR\",\"name\":\"por\",\"type\":\"tuple\"}],\"internalType\":\"struct Content\",\"name\":\"content\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"nonce\",\"type\":\"bytes32\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"}],\"name\":\"requestStorage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"slotId\",\"type\":\"bytes32\"}],\"name\":\"slotState\",\"outputs\":[{\"internalType\":\"enum SlotState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"submitProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"SlotId\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"willProofBeRequired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"RequestId\",\"name\":\"requestId\",\"type\":\"bytes32\"}],\"name\":\"withdrawFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"withdrawFunds(bytes32)\":{\"details\":\"Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\",\"params\":{\"requestId\":\"the id of the request\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"withdrawFunds(bytes32)\":{\"notice\":\"Withdraws storage request funds back to the client that deposited them.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/Marketplace.sol\":\"Marketplace\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0xc3ff3f5c4584e1d9a483ad7ced51ab64523201f4e3d3c65293e4ca8aeb77a961\",\"license\":\"MIT\"},\"contracts/Configuration.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\nstruct MarketplaceConfig {\\n CollateralConfig collateral;\\n ProofConfig proofs;\\n}\\n\\nstruct CollateralConfig {\\n /// @dev percentage of remaining collateral slot after it has been freed\\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\\n uint8 repairRewardPercentage;\\n\\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\\n uint8 slashPercentage; // percentage of the collateral that is slashed\\n}\\n\\nstruct ProofConfig {\\n uint256 period; // proofs requirements are calculated per period (in seconds)\\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\\n uint8 downtime; // ignore this much recent blocks for proof requirements\\n}\\n\",\"keccak256\":\"0x355b9cd03f5ffadd52cb07c64934bb823bfebced18f4cec9e714326dfee152fc\",\"license\":\"MIT\"},\"contracts/Marketplace.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Proofs.sol\\\";\\nimport \\\"./StateRetrieval.sol\\\";\\n\\ncontract Marketplace is Proofs, StateRetrieval {\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using Requests for Request;\\n\\n IERC20 public immutable token;\\n MarketplaceConfig public config;\\n\\n mapping(RequestId => Request) private _requests;\\n mapping(RequestId => RequestContext) private _requestContexts;\\n mapping(SlotId => Slot) internal _slots;\\n\\n MarketplaceTotals internal _marketplaceTotals;\\n\\n struct RequestContext {\\n RequestState state;\\n uint256 slotsFilled;\\n uint256 startedAt;\\n uint256 endsAt;\\n }\\n\\n struct Slot {\\n SlotState state;\\n RequestId requestId;\\n uint256 slotIndex;\\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\\n uint256 currentCollateral;\\n address host;\\n }\\n\\n struct ActiveSlot {\\n Request request;\\n uint256 slotIndex;\\n }\\n\\n constructor(\\n IERC20 token_,\\n MarketplaceConfig memory configuration\\n ) Proofs(configuration.proofs) {\\n token = token_;\\n\\n require(\\n configuration.collateral.repairRewardPercentage <= 100,\\n \\\"Must be less than 100\\\"\\n );\\n require(\\n configuration.collateral.slashPercentage <= 100,\\n \\\"Must be less than 100\\\"\\n );\\n require(\\n configuration.collateral.maxNumberOfSlashes *\\n configuration.collateral.slashPercentage <=\\n 100,\\n \\\"Maximum slashing exceeds 100%\\\"\\n );\\n config = configuration;\\n }\\n\\n function requestStorage(Request calldata request) public {\\n require(request.client == msg.sender, \\\"Invalid client address\\\");\\n\\n RequestId id = request.id();\\n require(_requests[id].client == address(0), \\\"Request already exists\\\");\\n\\n _requests[id] = request;\\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\\n\\n _addToMyRequests(request.client, id);\\n\\n uint256 amount = request.price();\\n _marketplaceTotals.received += amount;\\n _transferFrom(msg.sender, amount);\\n\\n emit StorageRequested(id, request.ask, request.expiry);\\n }\\n\\n function fillSlot(\\n RequestId requestId,\\n uint256 slotIndex,\\n bytes calldata proof\\n ) public requestIsKnown(requestId) {\\n Request storage request = _requests[requestId];\\n require(slotIndex < request.ask.slots, \\\"Invalid slot\\\");\\n\\n SlotId slotId = Requests.slotId(requestId, slotIndex);\\n Slot storage slot = _slots[slotId];\\n slot.requestId = requestId;\\n slot.slotIndex = slotIndex;\\n\\n require(slotState(slotId) == SlotState.Free, \\\"Slot is not free\\\");\\n\\n _startRequiringProofs(slotId, request.ask.proofProbability);\\n submitProof(slotId, proof);\\n\\n slot.host = msg.sender;\\n slot.state = SlotState.Filled;\\n RequestContext storage context = _requestContexts[requestId];\\n context.slotsFilled += 1;\\n\\n // Collect collateral\\n uint256 collateralAmount = request.ask.collateral;\\n _transferFrom(msg.sender, collateralAmount);\\n _marketplaceTotals.received += collateralAmount;\\n slot.currentCollateral = collateralAmount;\\n\\n _addToMySlots(slot.host, slotId);\\n\\n emit SlotFilled(requestId, slotIndex);\\n if (context.slotsFilled == request.ask.slots) {\\n context.state = RequestState.Started;\\n context.startedAt = block.timestamp;\\n emit RequestFulfilled(requestId);\\n }\\n }\\n\\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\\n Slot storage slot = _slots[slotId];\\n require(slot.host == msg.sender, \\\"Slot filled by other host\\\");\\n SlotState state = slotState(slotId);\\n require(state != SlotState.Paid, \\\"Already paid\\\");\\n\\n if (state == SlotState.Finished) {\\n _payoutSlot(slot.requestId, slotId);\\n } else if (state == SlotState.Failed) {\\n _removeFromMySlots(msg.sender, slotId);\\n } else if (state == SlotState.Filled) {\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n\\n function markProofAsMissing(SlotId slotId, Period period) public {\\n require(slotState(slotId) == SlotState.Filled, \\\"Slot not accepting proofs\\\");\\n _markProofAsMissing(slotId, period);\\n Slot storage slot = _slots[slotId];\\n Request storage request = _requests[slot.requestId];\\n\\n if (missingProofs(slotId) % config.collateral.slashCriterion == 0) {\\n uint256 slashedAmount = (request.ask.collateral *\\n config.collateral.slashPercentage) / 100;\\n slot.currentCollateral -= slashedAmount;\\n if (\\n missingProofs(slotId) / config.collateral.slashCriterion >=\\n config.collateral.maxNumberOfSlashes\\n ) {\\n // When the number of slashings is at or above the allowed amount,\\n // free the slot.\\n _forciblyFreeSlot(slotId);\\n }\\n }\\n }\\n\\n function _forciblyFreeSlot(SlotId slotId) internal {\\n Slot storage slot = _slots[slotId];\\n RequestId requestId = slot.requestId;\\n RequestContext storage context = _requestContexts[requestId];\\n\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 slotIndex = slot.slotIndex;\\n delete _slots[slotId];\\n context.slotsFilled -= 1;\\n emit SlotFreed(requestId, slotIndex);\\n _resetMissingProofs(slotId);\\n\\n Request storage request = _requests[requestId];\\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\\n if (\\n slotsLost > request.ask.maxSlotLoss &&\\n context.state == RequestState.Started\\n ) {\\n context.state = RequestState.Failed;\\n context.endsAt = block.timestamp - 1;\\n emit RequestFailed(requestId);\\n\\n // TODO: send client remaining funds\\n }\\n }\\n\\n function _payoutSlot(\\n RequestId requestId,\\n SlotId slotId\\n ) private requestIsKnown(requestId) {\\n RequestContext storage context = _requestContexts[requestId];\\n Request storage request = _requests[requestId];\\n context.state = RequestState.Finished;\\n _removeFromMyRequests(request.client, requestId);\\n Slot storage slot = _slots[slotId];\\n\\n _removeFromMySlots(slot.host, slotId);\\n\\n uint256 amount = _requests[requestId].pricePerSlot() +\\n slot.currentCollateral;\\n _marketplaceTotals.sent += amount;\\n slot.state = SlotState.Paid;\\n assert(token.transfer(slot.host, amount));\\n }\\n\\n /// @notice Withdraws storage request funds back to the client that deposited them.\\n /// @dev Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\\n /// @param requestId the id of the request\\n function withdrawFunds(RequestId requestId) public {\\n Request storage request = _requests[requestId];\\n require(block.timestamp > request.expiry, \\\"Request not yet timed out\\\");\\n require(request.client == msg.sender, \\\"Invalid client address\\\");\\n RequestContext storage context = _requestContexts[requestId];\\n require(context.state == RequestState.New, \\\"Invalid state\\\");\\n\\n // Update request state to Cancelled. Handle in the withdraw transaction\\n // as there needs to be someone to pay for the gas to update the state\\n context.state = RequestState.Cancelled;\\n _removeFromMyRequests(request.client, requestId);\\n\\n emit RequestCancelled(requestId);\\n\\n // TODO: To be changed once we start paying out hosts for the time they\\n // fill a slot. The amount that we paid to hosts will then have to be\\n // deducted from the price.\\n uint256 amount = request.price();\\n _marketplaceTotals.sent += amount;\\n assert(token.transfer(msg.sender, amount));\\n }\\n\\n function getActiveSlot(\\n SlotId slotId\\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\\n Slot storage slot = _slots[slotId];\\n ActiveSlot memory activeSlot;\\n activeSlot.request = _requests[slot.requestId];\\n activeSlot.slotIndex = slot.slotIndex;\\n return activeSlot;\\n }\\n\\n modifier requestIsKnown(RequestId requestId) {\\n require(_requests[requestId].client != address(0), \\\"Unknown request\\\");\\n _;\\n }\\n\\n function getRequest(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (Request memory) {\\n return _requests[requestId];\\n }\\n\\n modifier slotIsNotFree(SlotId slotId) {\\n require(_slots[slotId].state != SlotState.Free, \\\"Slot is free\\\");\\n _;\\n }\\n\\n function requestEnd(RequestId requestId) public view returns (uint256) {\\n uint256 end = _requestContexts[requestId].endsAt;\\n RequestState state = requestState(requestId);\\n if (state == RequestState.New || state == RequestState.Started) {\\n return end;\\n } else {\\n return Math.min(end, block.timestamp - 1);\\n }\\n }\\n\\n function getHost(SlotId slotId) public view returns (address) {\\n return _slots[slotId].host;\\n }\\n\\n function requestState(\\n RequestId requestId\\n ) public view requestIsKnown(requestId) returns (RequestState) {\\n RequestContext storage context = _requestContexts[requestId];\\n if (\\n context.state == RequestState.New &&\\n block.timestamp > _requests[requestId].expiry\\n ) {\\n return RequestState.Cancelled;\\n } else if (\\n context.state == RequestState.Started && block.timestamp > context.endsAt\\n ) {\\n return RequestState.Finished;\\n } else {\\n return context.state;\\n }\\n }\\n\\n function slotState(SlotId slotId) public view override returns (SlotState) {\\n Slot storage slot = _slots[slotId];\\n if (RequestId.unwrap(slot.requestId) == 0) {\\n return SlotState.Free;\\n }\\n RequestState reqState = requestState(slot.requestId);\\n if (slot.state == SlotState.Paid) {\\n return SlotState.Paid;\\n }\\n if (reqState == RequestState.Cancelled) {\\n return SlotState.Finished;\\n }\\n if (reqState == RequestState.Finished) {\\n return SlotState.Finished;\\n }\\n if (reqState == RequestState.Failed) {\\n return SlotState.Failed;\\n }\\n return slot.state;\\n }\\n\\n function _transferFrom(address sender, uint256 amount) internal {\\n address receiver = address(this);\\n require(token.transferFrom(sender, receiver, amount), \\\"Transfer failed\\\");\\n }\\n\\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\\n event RequestFulfilled(RequestId indexed requestId);\\n event RequestFailed(RequestId indexed requestId);\\n event SlotFilled(\\n RequestId indexed requestId,\\n uint256 slotIndex\\n );\\n event SlotFreed(\\n RequestId indexed requestId,\\n uint256 slotIndex\\n );\\n event RequestCancelled(RequestId indexed requestId);\\n\\n struct MarketplaceTotals {\\n uint256 received;\\n uint256 sent;\\n }\\n}\\n\",\"keccak256\":\"0xaf91b6c170f1801ca161831001b81bd68e9a6357c4709bc286868145bb64f636\",\"license\":\"MIT\"},\"contracts/Periods.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\ncontract Periods {\\n type Period is uint256;\\n\\n uint256 internal immutable _secondsPerPeriod;\\n\\n constructor(uint256 secondsPerPeriod) {\\n _secondsPerPeriod = secondsPerPeriod;\\n }\\n\\n function _periodOf(uint256 timestamp) internal view returns (Period) {\\n return Period.wrap(timestamp / _secondsPerPeriod);\\n }\\n\\n function _blockPeriod() internal view returns (Period) {\\n return _periodOf(block.timestamp);\\n }\\n\\n function _nextPeriod(Period period) internal pure returns (Period) {\\n return Period.wrap(Period.unwrap(period) + 1);\\n }\\n\\n function _periodStart(Period period) internal view returns (uint256) {\\n return Period.unwrap(period) * _secondsPerPeriod;\\n }\\n\\n function _periodEnd(Period period) internal view returns (uint256) {\\n return _periodStart(_nextPeriod(period));\\n }\\n\\n function _isBefore(Period a, Period b) internal pure returns (bool) {\\n return Period.unwrap(a) < Period.unwrap(b);\\n }\\n\\n function _isAfter(Period a, Period b) internal pure returns (bool) {\\n return _isBefore(b, a);\\n }\\n}\\n\",\"keccak256\":\"0xf5c816a69a705fd84bd3e43490ea32e8cc5bec05363b7c2deb32665519d0bfe2\",\"license\":\"MIT\"},\"contracts/Proofs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\nimport \\\"./Configuration.sol\\\";\\nimport \\\"./Requests.sol\\\";\\nimport \\\"./Periods.sol\\\";\\n\\nabstract contract Proofs is Periods {\\n ProofConfig private _config;\\n\\n constructor(ProofConfig memory config) Periods(config.period) {\\n require(block.number > 256, \\\"Insufficient block height\\\");\\n _config = config;\\n }\\n\\n mapping(SlotId => uint256) private _slotStarts;\\n mapping(SlotId => uint256) private _probabilities;\\n mapping(SlotId => uint256) private _missed;\\n mapping(SlotId => mapping(Period => bool)) private _received;\\n mapping(SlotId => mapping(Period => bool)) private _missing;\\n\\n function slotState(SlotId id) public view virtual returns (SlotState);\\n\\n function missingProofs(SlotId slotId) public view returns (uint256) {\\n return _missed[slotId];\\n }\\n\\n function _resetMissingProofs(SlotId slotId) internal {\\n _missed[slotId] = 0;\\n }\\n\\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\\n _slotStarts[id] = block.timestamp;\\n _probabilities[id] = probability;\\n }\\n\\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\\n uint256 blockNumber = block.number % 256;\\n uint256 periodNumber = Period.unwrap(period) % 256;\\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\\n return uint8(pointer);\\n }\\n\\n function getPointer(SlotId id) public view returns (uint8) {\\n return _getPointer(id, _blockPeriod());\\n }\\n\\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\\n bytes32 hash = blockhash(block.number - 1 - pointer);\\n assert(uint256(hash) != 0);\\n return keccak256(abi.encode(hash));\\n }\\n\\n function _getChallenge(\\n SlotId id,\\n Period period\\n ) internal view returns (bytes32) {\\n return _getChallenge(_getPointer(id, period));\\n }\\n\\n function getChallenge(SlotId id) public view returns (bytes32) {\\n return _getChallenge(id, _blockPeriod());\\n }\\n\\n function _getProofRequirement(\\n SlotId id,\\n Period period\\n ) internal view returns (bool isRequired, uint8 pointer) {\\n SlotState state = slotState(id);\\n Period start = _periodOf(_slotStarts[id]);\\n if (state != SlotState.Filled || !_isAfter(period, start)) {\\n return (false, 0);\\n }\\n pointer = _getPointer(id, period);\\n bytes32 challenge = _getChallenge(pointer);\\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\\n }\\n\\n function _isProofRequired(\\n SlotId id,\\n Period period\\n ) internal view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, period);\\n return isRequired && pointer >= _config.downtime;\\n }\\n\\n function isProofRequired(SlotId id) public view returns (bool) {\\n return _isProofRequired(id, _blockPeriod());\\n }\\n\\n function willProofBeRequired(SlotId id) public view returns (bool) {\\n bool isRequired;\\n uint8 pointer;\\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\\n return isRequired && pointer < _config.downtime;\\n }\\n\\n function submitProof(SlotId id, bytes calldata proof) public {\\n require(proof.length > 0, \\\"Invalid proof\\\"); // TODO: replace by actual check\\n require(!_received[id][_blockPeriod()], \\\"Proof already submitted\\\");\\n _received[id][_blockPeriod()] = true;\\n emit ProofSubmitted(id, proof);\\n }\\n\\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\\n uint256 end = _periodEnd(missedPeriod);\\n require(end < block.timestamp, \\\"Period has not ended yet\\\");\\n require(block.timestamp < end + _config.timeout, \\\"Validation timed out\\\");\\n require(!_received[id][missedPeriod], \\\"Proof was submitted, not missing\\\");\\n require(_isProofRequired(id, missedPeriod), \\\"Proof was not required\\\");\\n require(!_missing[id][missedPeriod], \\\"Proof already marked as missing\\\");\\n _missing[id][missedPeriod] = true;\\n _missed[id] += 1;\\n }\\n\\n event ProofSubmitted(SlotId id, bytes proof);\\n}\\n\",\"keccak256\":\"0x3ffba023dfb5aff8f3367768586fbad12e7385fb3855c9f06871e0b5a2fc1ec4\",\"license\":\"MIT\"},\"contracts/Requests.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\ntype RequestId is bytes32;\\ntype SlotId is bytes32;\\n\\nstruct Request {\\n address client;\\n Ask ask;\\n Content content;\\n uint256 expiry; // timestamp as seconds since unix epoch at which this request expires\\n bytes32 nonce; // random nonce to differentiate between similar requests\\n}\\n\\nstruct Ask {\\n uint64 slots; // the number of requested slots\\n uint256 slotSize; // amount of storage per slot (in number of bytes)\\n uint256 duration; // how long content should be stored (in seconds)\\n uint256 proofProbability; // how often storage proofs are required\\n uint256 reward; // amount of tokens paid per second per slot to hosts\\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\\n}\\n\\nstruct Content {\\n string cid; // content id (if part of a larger set, the chunk cid)\\n Erasure erasure; // Erasure coding attributes\\n PoR por; // Proof of Retrievability parameters\\n}\\n\\nstruct Erasure {\\n uint64 totalChunks; // the total number of chunks in the larger data set\\n}\\n\\nstruct PoR {\\n bytes u; // parameters u_1..u_s\\n bytes publicKey; // public key\\n bytes name; // random name\\n}\\n\\nenum RequestState {\\n New, // [default] waiting to fill slots\\n Started, // all slots filled, accepting regular proofs\\n Cancelled, // not enough slots filled before expiry\\n Finished, // successfully completed\\n Failed // too many nodes have failed to provide proofs, data lost\\n}\\n\\nenum SlotState {\\n Free, // [default] not filled yet, or host has vacated the slot\\n Filled, // host has filled slot\\n Finished, // successfully completed\\n Failed, // the request has failed\\n Paid // host has been paid\\n}\\n\\nlibrary Requests {\\n function id(Request memory request) internal pure returns (RequestId) {\\n return RequestId.wrap(keccak256(abi.encode(request)));\\n }\\n\\n function slotId(\\n RequestId requestId,\\n uint256 slotIndex\\n ) internal pure returns (SlotId) {\\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\\n }\\n\\n function toRequestIds(\\n bytes32[] memory ids\\n ) internal pure returns (RequestId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function toSlotIds(\\n bytes32[] memory ids\\n ) internal pure returns (SlotId[] memory result) {\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n result := ids\\n }\\n }\\n\\n function pricePerSlot(\\n Request memory request\\n ) internal pure returns (uint256) {\\n return request.ask.duration * request.ask.reward;\\n }\\n\\n function price(Request memory request) internal pure returns (uint256) {\\n return request.ask.slots * pricePerSlot(request);\\n }\\n}\\n\",\"keccak256\":\"0x84d4ed812857885c70457625e815abf47e53b41ef4d06d5decc9fa13d82ed45c\",\"license\":\"MIT\"},\"contracts/StateRetrieval.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.8;\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport \\\"./Requests.sol\\\";\\n\\ncontract StateRetrieval {\\n using EnumerableSet for EnumerableSet.Bytes32Set;\\n using Requests for bytes32[];\\n\\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\\n\\n function myRequests() public view returns (RequestId[] memory) {\\n return _requestsPerClient[msg.sender].values().toRequestIds();\\n }\\n\\n function mySlots() public view returns (SlotId[] memory) {\\n return _slotsPerHost[msg.sender].values().toSlotIds();\\n }\\n\\n function _hasSlots(address host) internal view returns (bool) {\\n return _slotsPerHost[host].length() > 0;\\n }\\n\\n function _addToMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\\n }\\n\\n function _addToMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\\n }\\n\\n function _removeFromMyRequests(address client, RequestId requestId) internal {\\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\\n }\\n\\n function _removeFromMySlots(address host, SlotId slotId) internal {\\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\\n }\\n}\\n\",\"keccak256\":\"0xe29275c3ff31874cac3b8ecf67c59502e9fdefb956142278c58ee3aa956801fd\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c06040523480156200001157600080fd5b506040516200401d3803806200401d833981016040819052620000349162000373565b602081015180516080526101004311620000955760405162461bcd60e51b815260206004820152601960248201527f496e73756666696369656e7420626c6f636b206865696768740000000000000060448201526064015b60405180910390fd5b80516000556020810151600155604001516002805460ff191660ff928316179055606083901b6001600160601b03191660a0528151516064911611156200011f5760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008c565b606481600001516060015160ff1611156200017d5760405162461bcd60e51b815260206004820152601560248201527f4d757374206265206c657373207468616e20313030000000000000000000000060448201526064016200008c565b8051606081015160209091015160649162000198916200044f565b60ff161115620001eb5760405162461bcd60e51b815260206004820152601d60248201527f4d6178696d756d20736c617368696e672065786365656473203130302500000060448201526064016200008c565b80518051600a805460208085015160408087015160609097015160ff9081166401000000000260ff60201b1961ffff90991662010000029890981664ffffff0000199382166101000261ffff199096169782169790971794909417919091169490941794909417909155928201518051600b5591820151600c550151600d80549190921660ff19919091161790555062000487565b604080519081016001600160401b0381118282101715620002b157634e487b7160e01b600052604160045260246000fd5b60405290565b604051608081016001600160401b0381118282101715620002b157634e487b7160e01b600052604160045260246000fd5b805160ff81168114620002fa57600080fd5b919050565b6000606082840312156200031257600080fd5b604051606081016001600160401b03811182821017156200034357634e487b7160e01b600052604160045260246000fd5b806040525080915082518152602083015160208201526200036760408401620002e8565b60408201525092915050565b6000808284036101008112156200038957600080fd5b83516001600160a01b0381168114620003a157600080fd5b9250601f190160e0811215620003b657600080fd5b620003c062000280565b6080821215620003cf57600080fd5b620003d9620002b7565b9150620003e960208601620002e8565b8252620003f960408601620002e8565b6020830152606085015161ffff811681146200041457600080fd5b60408301526200042760808601620002e8565b60608301528181526200043e8660a08701620002ff565b602082015280925050509250929050565b600060ff821660ff84168160ff04811182151516156200047f57634e487b7160e01b600052601160045260246000fd5b029392505050565b60805160a05160601c613b51620004cc6000396000818161044201528181611222015281816121a9015261279c01526000818161299e0152612a9f0152613b516000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c80636e2b54ee116100d8578063b396dc791161008c578063f752196b11610066578063f752196b146103fd578063fb1e61ca1461041d578063fc0c546a1461043d57600080fd5b8063b396dc79146103b7578063be5cdc48146103d7578063c0cc4add146103ea57600080fd5b80639777b72c116100bd5780639777b72c14610379578063a29c29a414610381578063a3a0807e1461039457600080fd5b80636e2b54ee146102a157806379502c55146102b457600080fd5b80634641dce61161012f5780636368a471116101145780636368a47114610237578063645116d81461024a5780636b00c8cf1461025d57600080fd5b80634641dce6146101fd5780635da738351461022257600080fd5b806308695fcd1161016057806308695fcd146101c25780630eb6c86f146101d7578063458d2bf1146101ea57600080fd5b806302fa8e651461017c57806305b90773146101a2575b600080fd5b61018f61018a366004612d16565b610464565b6040519081526020015b60405180910390f35b6101b56101b0366004612d16565b6104db565b6040516101999190612d66565b6101d56101d0366004612d79565b6105cd565b005b6101d56101e5366004612d9b565b610720565b61018f6101f8366004612d16565b6108da565b61021061020b366004612d16565b6108f3565b60405160ff9091168152602001610199565b61022a610906565b6040516101999190612dd7565b6101d5610245366004612e5d565b61092d565b6101d5610258366004612eb0565b610c0b565b61028961026b366004612d16565b6000908152601060205260409020600401546001600160a01b031690565b6040516001600160a01b039091168152602001610199565b6101d56102af366004612d16565b610d41565b60408051608081018252600a5460ff80821683526101008204811660208085019190915261ffff6201000084041684860152640100000000909204811660608085019190915284519081018552600b548152600c5492810192909252600d5416928101929092526103229182565b60408051835160ff90811682526020808601518216818401528584015161ffff1683850152606095860151821695830195909552835160808301529383015160a082015291015190911660c082015260e001610199565b61022a6112b2565b6101d561038f366004612d16565b6112d1565b6103a76103a2366004612d16565b611480565b6040519015158152602001610199565b6103ca6103c5366004612d16565b6114b5565b6040516101999190613078565b6101b56103e5366004612d16565b611885565b6103a76103f8366004612d16565b611955565b61018f61040b366004612d16565b60009081526005602052604090205490565b61043061042b366004612d16565b611968565b60405161019991906130aa565b6102897f000000000000000000000000000000000000000000000000000000000000000081565b6000818152600f602052604081206003015481610480846104db565b9050600081600481111561049657610496612d2f565b14806104b3575060018160048111156104b1576104b1612d2f565b145b156104bf575092915050565b6104d3826104ce6001426130d3565b611d01565b949350505050565b6000818152600e602052604081205482906001600160a01b03166105385760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064015b60405180910390fd5b6000838152600f6020526040812090815460ff16600481111561055d5761055d612d2f565b14801561057a57506000848152600e60205260409020600d015442115b156105895760029250506105c7565b6001815460ff1660048111156105a1576105a1612d2f565b1480156105b15750806003015442115b156105c05760039250506105c7565b5460ff1691505b50919050565b60016105d883611885565b60048111156105e9576105e9612d2f565b146106365760405162461bcd60e51b815260206004820152601960248201527f536c6f74206e6f7420616363657074696e672070726f6f667300000000000000604482015260640161052f565b6106408282611d19565b600082815260106020908152604080832060018101548452600e909252909120600a5461ffff62010000909104166106848560009081526005602052604090205490565b61068e9190613100565b61071a57600a5460068201546000916064916106b591640100000000900460ff1690613114565b6106bf9190613133565b9050808360030160008282546106d591906130d3565b9091555050600a54600086815260056020526040902054610100820460ff169162010000900461ffff169061070a9190613133565b106107185761071885611f46565b505b50505050565b3361072e602083018361315c565b6001600160a01b0316146107845760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e74206164647265737300000000000000000000604482015260640161052f565b600061079761079283613412565b6120e5565b6000818152600e60205260409020549091506001600160a01b0316156107ff5760405162461bcd60e51b815260206004820152601660248201527f5265717565737420616c72656164792065786973747300000000000000000000604482015260640161052f565b6000818152600e60205260409020829061081982826138d2565b5061082a90506060830135426139ca565b6000828152600f6020908152604090912060030191909155610858906108529084018461315c565b82612115565b600061086b61086684613412565b61213c565b9050806011600001600082825461088291906139ca565b9091555061089290503382612161565b7f5fdb86c365a247a4d97dcbcc5c3abde9d6e3e2de26273f3fda8eef5073b9a96c82846020018561012001356040516108cd939291906139e2565b60405180910390a1505050565b60006108ed826108e8612273565b61227e565b92915050565b60006108ed82610901612273565b612292565b33600090815260096020526040902060609061092890610925906122f2565b90565b905090565b6000848152600e602052604090205484906001600160a01b03166109855760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000858152600e60205260409020600181015467ffffffffffffffff1685106109f05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420736c6f740000000000000000000000000000000000000000604482015260640161052f565b604080516020808201899052818301889052825180830384018152606090920190925280519101206000906000818152601060205260408120600181018a905560028101899055919250610a4383611885565b6004811115610a5457610a54612d2f565b14610aa15760405162461bcd60e51b815260206004820152601060248201527f536c6f74206973206e6f74206672656500000000000000000000000000000000604482015260640161052f565b60048084015460008481526003602090815260408083204290559390529190912055610ace828787610c0b565b60048101805473ffffffffffffffffffffffffffffffffffffffff191633179055805460ff1916600190811782556000898152600f6020526040812080830180549193929091610b1f9084906139ca565b90915550506006840154610b333382612161565b8060116000016000828254610b4891906139ca565b9091555050600383018190556004830154610b6c906001600160a01b0316856122ff565b897ff530852268993f91008f1a1e0b09b5c813acd4188481f1fa83c33c7182e814b48a604051610b9e91815260200190565b60405180910390a26001808601549083015467ffffffffffffffff9091161415610bff57815460ff191660011782554260028301556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b80610c585760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161052f565b600083815260066020526040812090610c6f612273565b815260208101919091526040016000205460ff1615610cd05760405162461bcd60e51b815260206004820152601760248201527f50726f6f6620616c7265616479207375626d6974746564000000000000000000604482015260640161052f565b6000838152600660205260408120600191610ce9612273565b815260200190815260200160002060006101000a81548160ff0219169083151502179055507f17d5257c85fa8a4b5a4d1f3520e38773826559199467bdce51698fce3d8cae9c8383836040516108cd93929190613a5e565b6000818152600e60205260409020600d8101544211610da25760405162461bcd60e51b815260206004820152601960248201527f52657175657374206e6f74207965742074696d6564206f757400000000000000604482015260640161052f565b80546001600160a01b03163314610dfb5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e74206164647265737300000000000000000000604482015260640161052f565b6000828152600f6020526040812090815460ff166004811115610e2057610e20612d2f565b14610e6d5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c696420737461746500000000000000000000000000000000000000604482015260640161052f565b805460ff191660021781558154610e8d906001600160a01b031684612321565b60405183907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a26040805160a0808201835284546001600160a01b03168252825160e081018452600186015467ffffffffffffffff90811682526002870154602083810191909152600388015483870152600488015460608085019190915260058901546080850152600689015494840194909452600788015490911660c0830152830152825190810183526008850180546000946111ea949388939185019290919082908290610f6190613575565b80601f0160208091040260200160405190810160405280929190818152602001828054610f8d90613575565b8015610fda5780601f10610faf57610100808354040283529160200191610fda565b820191906000526020600020905b815481529060010190602001808311610fbd57829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff1682528301528051606081018252600284018054929093019290918290829061102390613575565b80601f016020809104026020016040519081016040528092919081815260200182805461104f90613575565b801561109c5780601f106110715761010080835404028352916020019161109c565b820191906000526020600020905b81548152906001019060200180831161107f57829003601f168201915b505050505081526020016001820180546110b590613575565b80601f01602080910402602001604051908101604052809291908181526020018280546110e190613575565b801561112e5780601f106111035761010080835404028352916020019161112e565b820191906000526020600020905b81548152906001019060200180831161111157829003601f168201915b5050505050815260200160028201805461114790613575565b80601f016020809104026020016040519081016040528092919081815260200182805461117390613575565b80156111c05780601f10611195576101008083540402835291602001916111c0565b820191906000526020600020905b8154815290600101906020018083116111a357829003601f168201915b505050505081525050815250508152602001600d8201548152602001600e8201548152505061213c565b9050806011600101600082825461120191906139ca565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561126e57600080fd5b505af1158015611282573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a69190613a94565b61071a5761071a613ab6565b33600090815260086020526040902060609061092890610925906122f2565b806000808281526010602052604090205460ff1660048111156112f6576112f6612d2f565b14156113335760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b604482015260640161052f565b600082815260106020526040902060048101546001600160a01b0316331461139d5760405162461bcd60e51b815260206004820152601960248201527f536c6f742066696c6c6564206279206f7468657220686f737400000000000000604482015260640161052f565b60006113a884611885565b905060048160048111156113be576113be612d2f565b141561140c5760405162461bcd60e51b815260206004820152600c60248201527f416c726561647920706169640000000000000000000000000000000000000000604482015260640161052f565b600281600481111561142057611420612d2f565b141561143957611434826001015485612343565b61071a565b600381600481111561144d5761144d612d2f565b141561145d576114343385612824565b600181600481111561147157611471612d2f565b141561071a5761071a84611f46565b600080600061149684611491612273565b612846565b90925090508180156104d3575060025460ff9081169116109392505050565b6114bd612c06565b816000808281526010602052604090205460ff1660048111156114e2576114e2612d2f565b141561151f5760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b604482015260640161052f565b6000838152601060205260409020611535612c06565b6001808301546000908152600e6020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186529583015467ffffffffffffffff908116875260028401548786015260038401548787015260048401546060808901919091526005850154608089015260068501549288019290925260078401541660c08701529281019490945282519182018352600881018054919385019291829082906115e590613575565b80601f016020809104026020016040519081016040528092919081815260200182805461161190613575565b801561165e5780601f106116335761010080835404028352916020019161165e565b820191906000526020600020905b81548152906001019060200180831161164157829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff168252830152805160608101825260028401805492909301929091829082906116a790613575565b80601f01602080910402602001604051908101604052809291908181526020018280546116d390613575565b80156117205780601f106116f557610100808354040283529160200191611720565b820191906000526020600020905b81548152906001019060200180831161170357829003601f168201915b5050505050815260200160018201805461173990613575565b80601f016020809104026020016040519081016040528092919081815260200182805461176590613575565b80156117b25780601f10611787576101008083540402835291602001916117b2565b820191906000526020600020905b81548152906001019060200180831161179557829003601f168201915b505050505081526020016002820180546117cb90613575565b80601f01602080910402602001604051908101604052809291908181526020018280546117f790613575565b80156118445780601f1061181957610100808354040283529160200191611844565b820191906000526020600020905b81548152906001019060200180831161182757829003601f168201915b505050919092525050509052508152600d820154602080830191909152600e9092015460409091015290825260029092015491810191909152915050919050565b600081815260106020526040812060018101546118a55750600092915050565b60006118b482600101546104db565b90506004825460ff1660048111156118ce576118ce612d2f565b14156118de575060049392505050565b60028160048111156118f2576118f2612d2f565b1415611902575060029392505050565b600381600481111561191657611916612d2f565b1415611926575060029392505050565b600481600481111561193a5761193a612d2f565b141561194a575060039392505050565b505460ff1692915050565b60006108ed82611963612273565b612929565b611970612c26565b6000828152600e602052604090205482906001600160a01b03166119c85760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000838152600e6020908152604091829020825160a0808201855282546001600160a01b03168252845160e081018652600184015467ffffffffffffffff908116825260028501548287015260038501548288015260048501546060808401919091526005860154608084015260068601549383019390935260078501541660c0820152938201939093528351928301845260088201805491949293928501929182908290611a7690613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa290613575565b8015611aef5780601f10611ac457610100808354040283529160200191611aef565b820191906000526020600020905b815481529060010190602001808311611ad257829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff16825283015280516060810182526002840180549290930192909182908290611b3890613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6490613575565b8015611bb15780601f10611b8657610100808354040283529160200191611bb1565b820191906000526020600020905b815481529060010190602001808311611b9457829003601f168201915b50505050508152602001600182018054611bca90613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611bf690613575565b8015611c435780601f10611c1857610100808354040283529160200191611c43565b820191906000526020600020905b815481529060010190602001808311611c2657829003601f168201915b50505050508152602001600282018054611c5c90613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8890613575565b8015611cd55780601f10611caa57610100808354040283529160200191611cd5565b820191906000526020600020905b815481529060010190602001808311611cb857829003601f168201915b505050919092525050509052508152600d8201546020820152600e909101546040909101529392505050565b6000818310611d105781611d12565b825b9392505050565b6000611d248261295c565b9050428110611d755760405162461bcd60e51b815260206004820152601860248201527f506572696f6420686173206e6f7420656e646564207965740000000000000000604482015260640161052f565b600154611d8290826139ca565b4210611dd05760405162461bcd60e51b815260206004820152601460248201527f56616c69646174696f6e2074696d6564206f7574000000000000000000000000604482015260640161052f565b600083815260066020908152604080832085845290915290205460ff1615611e3a5760405162461bcd60e51b815260206004820181905260248201527f50726f6f6620776173207375626d69747465642c206e6f74206d697373696e67604482015260640161052f565b611e448383612929565b611e905760405162461bcd60e51b815260206004820152601660248201527f50726f6f6620776173206e6f7420726571756972656400000000000000000000604482015260640161052f565b600083815260076020908152604080832085845290915290205460ff1615611efa5760405162461bcd60e51b815260206004820152601f60248201527f50726f6f6620616c7265616479206d61726b6564206173206d697373696e6700604482015260640161052f565b60008381526007602090815260408083208584528252808320805460ff1916600190811790915586845260059092528220805491929091611f3c9084906139ca565b9091555050505050565b60008181526010602090815260408083206001810154808552600f90935292206004830154611f7e906001600160a01b031685612824565b6002808401546000868152601060205260408120805460ff19168155600180820183905593810182905560038101829055600401805473ffffffffffffffffffffffffffffffffffffffff191690558383018054929392909190611fe39084906130d3565b909155505060405181815283907f1d31c9f8dea6e179f6a050db117595feea8937029ea51f5168a4780be7e8f5529060200160405180910390a26000858152600560205260408120556000838152600e602052604081206001808501549082015491929161205b919067ffffffffffffffff166130d3565b600783015490915067ffffffffffffffff168111801561209057506001845460ff16600481111561208e5761208e612d2f565b145b156120dc57835460ff191660041784556120ab6001426130d3565b600385015560405185907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a25b50505050505050565b6000816040516020016120f891906130aa565b604051602081830303815290604052805190602001209050919050565b6001600160a01b0382166000908152600860205260409020612137908261296f565b505050565b60006121478261297b565b6020830151516108ed919067ffffffffffffffff16613114565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401602060405180830381600087803b1580156121ef57600080fd5b505af1158015612203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122279190613a94565b6121375760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015260640161052f565b600061092842612997565b6000611d1261228d8484612292565b6129c3565b6000806122a161010043613100565b905060006122b161010085613100565b905060006122c161010087613100565b90506000610100826122d385876139ca565b6122dd91906139ca565b6122e79190613100565b979650505050505050565b60606000611d1283612a19565b6001600160a01b0382166000908152600960205260409020612137908261296f565b6001600160a01b03821660009081526008602052604090206121379082612a75565b6000828152600e602052604090205482906001600160a01b031661239b5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000838152600f60209081526040808320600e909252909120815460ff1916600317825580546123d4906001600160a01b031686612321565b600084815260106020526040902060048101546123fa906001600160a01b031686612824565b6003808201546000888152600e60209081526040808320815160a0808201845282546001600160a01b03168252835160e081018552600184015467ffffffffffffffff90811682526002850154828801529884015481860152600484015460608083019190915260058501546080830152600685015492820192909252600784015490981660c08901529381019690965281519283018252600881018054949661273d95909492938501929190829082906124b490613575565b80601f01602080910402602001604051908101604052809291908181526020018280546124e090613575565b801561252d5780601f106125025761010080835404028352916020019161252d565b820191906000526020600020905b81548152906001019060200180831161251057829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff1682528301528051606081018252600284018054929093019290918290829061257690613575565b80601f01602080910402602001604051908101604052809291908181526020018280546125a290613575565b80156125ef5780601f106125c4576101008083540402835291602001916125ef565b820191906000526020600020905b8154815290600101906020018083116125d257829003601f168201915b5050505050815260200160018201805461260890613575565b80601f016020809104026020016040519081016040528092919081815260200182805461263490613575565b80156126815780601f1061265657610100808354040283529160200191612681565b820191906000526020600020905b81548152906001019060200180831161266457829003601f168201915b5050505050815260200160028201805461269a90613575565b80601f01602080910402602001604051908101604052809291908181526020018280546126c690613575565b80156127135780601f106126e857610100808354040283529160200191612713565b820191906000526020600020905b8154815290600101906020018083116126f657829003601f168201915b505050505081525050815250508152602001600d8201548152602001600e8201548152505061297b565b61274791906139ca565b9050806011600101600082825461275e91906139ca565b9091555050815460ff1916600490811783558083015460405163a9059cbb60e01b81526001600160a01b0391821692810192909252602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156127e057600080fd5b505af11580156127f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128189190613a94565b6120dc576120dc613ab6565b6001600160a01b03821660009081526009602052604090206121379082612a75565b600080600061285485611885565b6000868152600360205260408120549192509061287090612997565b9050600182600481111561288657612886612d2f565b14158061289a57506128988582612a81565b155b156128ad57600080935093505050612922565b6128b78686612292565b925060006128c4846129c3565b600254909150600090610100906128de9060ff1682613acc565b60008a8152600460205260409020546128fb9161ffff1690613114565b6129059190613133565b905080158061291b57506129198183613100565b155b9550505050505b9250929050565b60008060006129388585612846565b9092509050818015612953575060025460ff90811690821610155b95945050505050565b60006108ed61296a83612a8b565b612a98565b6000611d128383612ac4565b602081015160808101516040909101516000916108ed91613114565b60006108ed7f000000000000000000000000000000000000000000000000000000000000000083613133565b60008060ff83166129d56001436130d3565b6129df91906130d3565b409050806129ef576129ef613ab6565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612a6957602002820191906000526020600020905b815481526020019060010190808311612a55575b50505050509050919050565b6000611d128383612b13565b6000818311611d12565b60006108ed8260016139ca565b60006108ed7f000000000000000000000000000000000000000000000000000000000000000083613114565b6000818152600183016020526040812054612b0b575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108ed565b5060006108ed565b60008181526001830160205260408120548015612bfc576000612b376001836130d3565b8554909150600090612b4b906001906130d3565b9050818114612bb0576000866000018281548110612b6b57612b6b613aef565b9060005260206000200154905080876000018481548110612b8e57612b8e613aef565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612bc157612bc1613b05565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108ed565b60009150506108ed565b6040518060400160405280612c19612c26565b8152602001600081525090565b6040518060a0016040528060006001600160a01b03168152602001612c956040518060e00160405280600067ffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600067ffffffffffffffff1681525090565b8152602001612ca2612cb6565b815260006020820181905260409091015290565b604051806060016040528060608152602001612ce86040518060200160405280600067ffffffffffffffff1681525090565b8152602001612d1160405180606001604052806060815260200160608152602001606081525090565b905290565b600060208284031215612d2857600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60058110612d6357634e487b7160e01b600052602160045260246000fd5b50565b60208101612d7383612d45565b91905290565b60008060408385031215612d8c57600080fd5b50508035926020909101359150565b600060208284031215612dad57600080fd5b813567ffffffffffffffff811115612dc457600080fd5b82016101608185031215611d1257600080fd5b6020808252825182820181905260009190848201906040850190845b81811015612e0f57835183529284019291840191600101612df3565b50909695505050505050565b60008083601f840112612e2d57600080fd5b50813567ffffffffffffffff811115612e4557600080fd5b60208301915083602082850101111561292257600080fd5b60008060008060608587031215612e7357600080fd5b8435935060208501359250604085013567ffffffffffffffff811115612e9857600080fd5b612ea487828801612e1b565b95989497509550505050565b600080600060408486031215612ec557600080fd5b83359250602084013567ffffffffffffffff811115612ee357600080fd5b612eef86828701612e1b565b9497909650939450505050565b6000815180845260005b81811015612f2257602081850181015186830182015201612f06565b81811115612f34576000602083870101525b50601f01601f19169290920160200192915050565b6000815160608452612f5e6060850182612efc565b905067ffffffffffffffff60208401515116602085015260408301518482036040860152805160608352612f956060840182612efc565b905060208201518382036020850152612fae8282612efc565b915050604082015191508281036040840152612fca8183612efc565b9695505050505050565b60006101606001600160a01b038351168452602083015167ffffffffffffffff808251166020870152602082015160408701526040820151606087015260608201516080870152608082015160a087015260a082015160c08701528060c08301511660e0870152505060408301518161010086015261305582860182612f49565b915050606083015161012085015260808301516101408501528091505092915050565b6020815260008251604060208401526130946060840182612fd4565b9050602084015160408401528091505092915050565b602081526000611d126020830184612fd4565b634e487b7160e01b600052601160045260246000fd5b6000828210156130e5576130e56130bd565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261310f5761310f6130ea565b500690565b600081600019048311821515161561312e5761312e6130bd565b500290565b600082613142576131426130ea565b500490565b6001600160a01b0381168114612d6357600080fd5b60006020828403121561316e57600080fd5b8135611d1281613147565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156131b2576131b2613179565b60405290565b6040516020810167ffffffffffffffff811182821017156131b2576131b2613179565b60405160a0810167ffffffffffffffff811182821017156131b2576131b2613179565b60405160e0810167ffffffffffffffff811182821017156131b2576131b2613179565b67ffffffffffffffff81168114612d6357600080fd5b600067ffffffffffffffff8084111561325257613252613179565b604051601f8501601f19908116603f0116810190828211818310171561327a5761327a613179565b8160405280935085815286868601111561329357600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126132be57600080fd5b611d1283833560208501613237565b6000606082840312156132df57600080fd5b6132e761318f565b9050813567ffffffffffffffff8082111561330157600080fd5b61330d858386016132ad565b8352602084013591508082111561332357600080fd5b61332f858386016132ad565b6020840152604084013591508082111561334857600080fd5b50613355848285016132ad565b60408301525092915050565b6000818303606081121561337457600080fd5b61337c61318f565b9150823567ffffffffffffffff8082111561339657600080fd5b818501915085601f8301126133aa57600080fd5b6133b986833560208501613237565b84526020601f19840112156133cd57600080fd5b6133d56131b8565b9250602085013591506133e782613221565b818352826020850152604085013592508083111561340457600080fd5b5050613355848285016132cd565b600081360361016081121561342657600080fd5b61342e6131db565b833561343981613147565b815260e0601f198301121561344d57600080fd5b6134556131fe565b9150602084013561346581613221565b8083525060408401356020830152606084013560408301526080840135606083015260a0840135608083015260c084013560a083015260e08401356134a981613221565b60c083015260208101919091526101008301359067ffffffffffffffff8211156134d257600080fd5b6134de36838601613361565b604082015261012084013560608201526101409093013560808401525090919050565b600081356108ed81613221565b60008235605e1983360301811261352457600080fd5b9190910192915050565b6000808335601e1984360301811261354557600080fd5b83018035915067ffffffffffffffff82111561356057600080fd5b60200191503681900382131561292257600080fd5b600181811c9082168061358957607f821691505b602082108114156105c757634e487b7160e01b600052602260045260246000fd5b601f82111561213757600081815260208120601f850160051c810160208610156135d15750805b601f850160051c820191505b818110156135f0578281556001016135dd565b505050505050565b813561360381613221565b815467ffffffffffffffff191667ffffffffffffffff8216178255505050565b67ffffffffffffffff83111561363b5761363b613179565b61364f836136498354613575565b836135aa565b6000601f841160018114613683576000851561366b5750838201355b600019600387901b1c1916600186901b178355610718565b600083815260209020601f19861690835b828110156136b45786850135825560209485019460019092019101613694565b50868210156136d15760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6136ed828361352e565b67ffffffffffffffff81111561370557613705613179565b613719816137138554613575565b856135aa565b6000601f82116001811461374d57600083156137355750838201355b600019600385901b1c1916600184901b1785556137a7565b600085815260209020601f19841690835b8281101561377e578685013582556020948501946001909201910161375e565b508482101561379b5760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506137b8602083018361352e565b6137c6818360018601613623565b50506137d5604083018361352e565b61071a818360028601613623565b6137ed828361352e565b67ffffffffffffffff81111561380557613805613179565b613813816137138554613575565b6000601f821160018114613847576000831561382f5750838201355b600019600385901b1c1916600184901b1785556138a1565b600085815260209020601f19841690835b828110156138785786850135825560209485019460019092019101613858565b50848210156138955760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506138b560208301600183016135f8565b6138ce6138c5604084018461350e565b600283016136e3565b5050565b81356138dd81613147565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550602082013561391281613221565b60018201805467ffffffffffffffff191667ffffffffffffffff83161790555060408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015561399661397360e08401613501565b6007830167ffffffffffffffff821667ffffffffffffffff198254161781555050565b6139b06139a761010084018461350e565b600883016137e3565b610120820135600d820155610140820135600e8201555050565b600082198211156139dd576139dd6130bd565b500190565b838152610120810183356139f581613221565b67ffffffffffffffff8082166020850152602086013560408501526040860135606085015260608601356080850152608086013560a085015260a086013560c085015260c08601359150613a4882613221565b1660e08301526101009091019190915292915050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613aa657600080fd5b81518015158114611d1257600080fd5b634e487b7160e01b600052600160045260246000fd5b600061ffff83811690831681811015613ae757613ae76130bd565b039392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220c7052b64f85cd2f0e60a31f5a231ddafb1d3c1bccb20e5810f9de4d54c42547664736f6c63430008080033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101775760003560e01c80636e2b54ee116100d8578063b396dc791161008c578063f752196b11610066578063f752196b146103fd578063fb1e61ca1461041d578063fc0c546a1461043d57600080fd5b8063b396dc79146103b7578063be5cdc48146103d7578063c0cc4add146103ea57600080fd5b80639777b72c116100bd5780639777b72c14610379578063a29c29a414610381578063a3a0807e1461039457600080fd5b80636e2b54ee146102a157806379502c55146102b457600080fd5b80634641dce61161012f5780636368a471116101145780636368a47114610237578063645116d81461024a5780636b00c8cf1461025d57600080fd5b80634641dce6146101fd5780635da738351461022257600080fd5b806308695fcd1161016057806308695fcd146101c25780630eb6c86f146101d7578063458d2bf1146101ea57600080fd5b806302fa8e651461017c57806305b90773146101a2575b600080fd5b61018f61018a366004612d16565b610464565b6040519081526020015b60405180910390f35b6101b56101b0366004612d16565b6104db565b6040516101999190612d66565b6101d56101d0366004612d79565b6105cd565b005b6101d56101e5366004612d9b565b610720565b61018f6101f8366004612d16565b6108da565b61021061020b366004612d16565b6108f3565b60405160ff9091168152602001610199565b61022a610906565b6040516101999190612dd7565b6101d5610245366004612e5d565b61092d565b6101d5610258366004612eb0565b610c0b565b61028961026b366004612d16565b6000908152601060205260409020600401546001600160a01b031690565b6040516001600160a01b039091168152602001610199565b6101d56102af366004612d16565b610d41565b60408051608081018252600a5460ff80821683526101008204811660208085019190915261ffff6201000084041684860152640100000000909204811660608085019190915284519081018552600b548152600c5492810192909252600d5416928101929092526103229182565b60408051835160ff90811682526020808601518216818401528584015161ffff1683850152606095860151821695830195909552835160808301529383015160a082015291015190911660c082015260e001610199565b61022a6112b2565b6101d561038f366004612d16565b6112d1565b6103a76103a2366004612d16565b611480565b6040519015158152602001610199565b6103ca6103c5366004612d16565b6114b5565b6040516101999190613078565b6101b56103e5366004612d16565b611885565b6103a76103f8366004612d16565b611955565b61018f61040b366004612d16565b60009081526005602052604090205490565b61043061042b366004612d16565b611968565b60405161019991906130aa565b6102897f000000000000000000000000000000000000000000000000000000000000000081565b6000818152600f602052604081206003015481610480846104db565b9050600081600481111561049657610496612d2f565b14806104b3575060018160048111156104b1576104b1612d2f565b145b156104bf575092915050565b6104d3826104ce6001426130d3565b611d01565b949350505050565b6000818152600e602052604081205482906001600160a01b03166105385760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b60448201526064015b60405180910390fd5b6000838152600f6020526040812090815460ff16600481111561055d5761055d612d2f565b14801561057a57506000848152600e60205260409020600d015442115b156105895760029250506105c7565b6001815460ff1660048111156105a1576105a1612d2f565b1480156105b15750806003015442115b156105c05760039250506105c7565b5460ff1691505b50919050565b60016105d883611885565b60048111156105e9576105e9612d2f565b146106365760405162461bcd60e51b815260206004820152601960248201527f536c6f74206e6f7420616363657074696e672070726f6f667300000000000000604482015260640161052f565b6106408282611d19565b600082815260106020908152604080832060018101548452600e909252909120600a5461ffff62010000909104166106848560009081526005602052604090205490565b61068e9190613100565b61071a57600a5460068201546000916064916106b591640100000000900460ff1690613114565b6106bf9190613133565b9050808360030160008282546106d591906130d3565b9091555050600a54600086815260056020526040902054610100820460ff169162010000900461ffff169061070a9190613133565b106107185761071885611f46565b505b50505050565b3361072e602083018361315c565b6001600160a01b0316146107845760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e74206164647265737300000000000000000000604482015260640161052f565b600061079761079283613412565b6120e5565b6000818152600e60205260409020549091506001600160a01b0316156107ff5760405162461bcd60e51b815260206004820152601660248201527f5265717565737420616c72656164792065786973747300000000000000000000604482015260640161052f565b6000818152600e60205260409020829061081982826138d2565b5061082a90506060830135426139ca565b6000828152600f6020908152604090912060030191909155610858906108529084018461315c565b82612115565b600061086b61086684613412565b61213c565b9050806011600001600082825461088291906139ca565b9091555061089290503382612161565b7f5fdb86c365a247a4d97dcbcc5c3abde9d6e3e2de26273f3fda8eef5073b9a96c82846020018561012001356040516108cd939291906139e2565b60405180910390a1505050565b60006108ed826108e8612273565b61227e565b92915050565b60006108ed82610901612273565b612292565b33600090815260096020526040902060609061092890610925906122f2565b90565b905090565b6000848152600e602052604090205484906001600160a01b03166109855760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000858152600e60205260409020600181015467ffffffffffffffff1685106109f05760405162461bcd60e51b815260206004820152600c60248201527f496e76616c696420736c6f740000000000000000000000000000000000000000604482015260640161052f565b604080516020808201899052818301889052825180830384018152606090920190925280519101206000906000818152601060205260408120600181018a905560028101899055919250610a4383611885565b6004811115610a5457610a54612d2f565b14610aa15760405162461bcd60e51b815260206004820152601060248201527f536c6f74206973206e6f74206672656500000000000000000000000000000000604482015260640161052f565b60048084015460008481526003602090815260408083204290559390529190912055610ace828787610c0b565b60048101805473ffffffffffffffffffffffffffffffffffffffff191633179055805460ff1916600190811782556000898152600f6020526040812080830180549193929091610b1f9084906139ca565b90915550506006840154610b333382612161565b8060116000016000828254610b4891906139ca565b9091555050600383018190556004830154610b6c906001600160a01b0316856122ff565b897ff530852268993f91008f1a1e0b09b5c813acd4188481f1fa83c33c7182e814b48a604051610b9e91815260200190565b60405180910390a26001808601549083015467ffffffffffffffff9091161415610bff57815460ff191660011782554260028301556040518a907f85e1543bf2f84fe80c6badbce3648c8539ad1df4d2b3d822938ca0538be727e690600090a25b50505050505050505050565b80610c585760405162461bcd60e51b815260206004820152600d60248201527f496e76616c69642070726f6f6600000000000000000000000000000000000000604482015260640161052f565b600083815260066020526040812090610c6f612273565b815260208101919091526040016000205460ff1615610cd05760405162461bcd60e51b815260206004820152601760248201527f50726f6f6620616c7265616479207375626d6974746564000000000000000000604482015260640161052f565b6000838152600660205260408120600191610ce9612273565b815260200190815260200160002060006101000a81548160ff0219169083151502179055507f17d5257c85fa8a4b5a4d1f3520e38773826559199467bdce51698fce3d8cae9c8383836040516108cd93929190613a5e565b6000818152600e60205260409020600d8101544211610da25760405162461bcd60e51b815260206004820152601960248201527f52657175657374206e6f74207965742074696d6564206f757400000000000000604482015260640161052f565b80546001600160a01b03163314610dfb5760405162461bcd60e51b815260206004820152601660248201527f496e76616c696420636c69656e74206164647265737300000000000000000000604482015260640161052f565b6000828152600f6020526040812090815460ff166004811115610e2057610e20612d2f565b14610e6d5760405162461bcd60e51b815260206004820152600d60248201527f496e76616c696420737461746500000000000000000000000000000000000000604482015260640161052f565b805460ff191660021781558154610e8d906001600160a01b031684612321565b60405183907ff903f4774c7bd27355f9d7fcbc382b079b164a697a44ac5d95267a4c3cb3bb2290600090a26040805160a0808201835284546001600160a01b03168252825160e081018452600186015467ffffffffffffffff90811682526002870154602083810191909152600388015483870152600488015460608085019190915260058901546080850152600689015494840194909452600788015490911660c0830152830152825190810183526008850180546000946111ea949388939185019290919082908290610f6190613575565b80601f0160208091040260200160405190810160405280929190818152602001828054610f8d90613575565b8015610fda5780601f10610faf57610100808354040283529160200191610fda565b820191906000526020600020905b815481529060010190602001808311610fbd57829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff1682528301528051606081018252600284018054929093019290918290829061102390613575565b80601f016020809104026020016040519081016040528092919081815260200182805461104f90613575565b801561109c5780601f106110715761010080835404028352916020019161109c565b820191906000526020600020905b81548152906001019060200180831161107f57829003601f168201915b505050505081526020016001820180546110b590613575565b80601f01602080910402602001604051908101604052809291908181526020018280546110e190613575565b801561112e5780601f106111035761010080835404028352916020019161112e565b820191906000526020600020905b81548152906001019060200180831161111157829003601f168201915b5050505050815260200160028201805461114790613575565b80601f016020809104026020016040519081016040528092919081815260200182805461117390613575565b80156111c05780601f10611195576101008083540402835291602001916111c0565b820191906000526020600020905b8154815290600101906020018083116111a357829003601f168201915b505050505081525050815250508152602001600d8201548152602001600e8201548152505061213c565b9050806011600101600082825461120191906139ca565b909155505060405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561126e57600080fd5b505af1158015611282573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a69190613a94565b61071a5761071a613ab6565b33600090815260086020526040902060609061092890610925906122f2565b806000808281526010602052604090205460ff1660048111156112f6576112f6612d2f565b14156113335760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b604482015260640161052f565b600082815260106020526040902060048101546001600160a01b0316331461139d5760405162461bcd60e51b815260206004820152601960248201527f536c6f742066696c6c6564206279206f7468657220686f737400000000000000604482015260640161052f565b60006113a884611885565b905060048160048111156113be576113be612d2f565b141561140c5760405162461bcd60e51b815260206004820152600c60248201527f416c726561647920706169640000000000000000000000000000000000000000604482015260640161052f565b600281600481111561142057611420612d2f565b141561143957611434826001015485612343565b61071a565b600381600481111561144d5761144d612d2f565b141561145d576114343385612824565b600181600481111561147157611471612d2f565b141561071a5761071a84611f46565b600080600061149684611491612273565b612846565b90925090508180156104d3575060025460ff9081169116109392505050565b6114bd612c06565b816000808281526010602052604090205460ff1660048111156114e2576114e2612d2f565b141561151f5760405162461bcd60e51b815260206004820152600c60248201526b536c6f74206973206672656560a01b604482015260640161052f565b6000838152601060205260409020611535612c06565b6001808301546000908152600e6020908152604091829020825160a0808201855282546001600160a01b03168252845160e0810186529583015467ffffffffffffffff908116875260028401548786015260038401548787015260048401546060808901919091526005850154608089015260068501549288019290925260078401541660c08701529281019490945282519182018352600881018054919385019291829082906115e590613575565b80601f016020809104026020016040519081016040528092919081815260200182805461161190613575565b801561165e5780601f106116335761010080835404028352916020019161165e565b820191906000526020600020905b81548152906001019060200180831161164157829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff168252830152805160608101825260028401805492909301929091829082906116a790613575565b80601f01602080910402602001604051908101604052809291908181526020018280546116d390613575565b80156117205780601f106116f557610100808354040283529160200191611720565b820191906000526020600020905b81548152906001019060200180831161170357829003601f168201915b5050505050815260200160018201805461173990613575565b80601f016020809104026020016040519081016040528092919081815260200182805461176590613575565b80156117b25780601f10611787576101008083540402835291602001916117b2565b820191906000526020600020905b81548152906001019060200180831161179557829003601f168201915b505050505081526020016002820180546117cb90613575565b80601f01602080910402602001604051908101604052809291908181526020018280546117f790613575565b80156118445780601f1061181957610100808354040283529160200191611844565b820191906000526020600020905b81548152906001019060200180831161182757829003601f168201915b505050919092525050509052508152600d820154602080830191909152600e9092015460409091015290825260029092015491810191909152915050919050565b600081815260106020526040812060018101546118a55750600092915050565b60006118b482600101546104db565b90506004825460ff1660048111156118ce576118ce612d2f565b14156118de575060049392505050565b60028160048111156118f2576118f2612d2f565b1415611902575060029392505050565b600381600481111561191657611916612d2f565b1415611926575060029392505050565b600481600481111561193a5761193a612d2f565b141561194a575060039392505050565b505460ff1692915050565b60006108ed82611963612273565b612929565b611970612c26565b6000828152600e602052604090205482906001600160a01b03166119c85760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000838152600e6020908152604091829020825160a0808201855282546001600160a01b03168252845160e081018652600184015467ffffffffffffffff908116825260028501548287015260038501548288015260048501546060808401919091526005860154608084015260068601549383019390935260078501541660c0820152938201939093528351928301845260088201805491949293928501929182908290611a7690613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa290613575565b8015611aef5780601f10611ac457610100808354040283529160200191611aef565b820191906000526020600020905b815481529060010190602001808311611ad257829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff16825283015280516060810182526002840180549290930192909182908290611b3890613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6490613575565b8015611bb15780601f10611b8657610100808354040283529160200191611bb1565b820191906000526020600020905b815481529060010190602001808311611b9457829003601f168201915b50505050508152602001600182018054611bca90613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611bf690613575565b8015611c435780601f10611c1857610100808354040283529160200191611c43565b820191906000526020600020905b815481529060010190602001808311611c2657829003601f168201915b50505050508152602001600282018054611c5c90613575565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8890613575565b8015611cd55780601f10611caa57610100808354040283529160200191611cd5565b820191906000526020600020905b815481529060010190602001808311611cb857829003601f168201915b505050919092525050509052508152600d8201546020820152600e909101546040909101529392505050565b6000818310611d105781611d12565b825b9392505050565b6000611d248261295c565b9050428110611d755760405162461bcd60e51b815260206004820152601860248201527f506572696f6420686173206e6f7420656e646564207965740000000000000000604482015260640161052f565b600154611d8290826139ca565b4210611dd05760405162461bcd60e51b815260206004820152601460248201527f56616c69646174696f6e2074696d6564206f7574000000000000000000000000604482015260640161052f565b600083815260066020908152604080832085845290915290205460ff1615611e3a5760405162461bcd60e51b815260206004820181905260248201527f50726f6f6620776173207375626d69747465642c206e6f74206d697373696e67604482015260640161052f565b611e448383612929565b611e905760405162461bcd60e51b815260206004820152601660248201527f50726f6f6620776173206e6f7420726571756972656400000000000000000000604482015260640161052f565b600083815260076020908152604080832085845290915290205460ff1615611efa5760405162461bcd60e51b815260206004820152601f60248201527f50726f6f6620616c7265616479206d61726b6564206173206d697373696e6700604482015260640161052f565b60008381526007602090815260408083208584528252808320805460ff1916600190811790915586845260059092528220805491929091611f3c9084906139ca565b9091555050505050565b60008181526010602090815260408083206001810154808552600f90935292206004830154611f7e906001600160a01b031685612824565b6002808401546000868152601060205260408120805460ff19168155600180820183905593810182905560038101829055600401805473ffffffffffffffffffffffffffffffffffffffff191690558383018054929392909190611fe39084906130d3565b909155505060405181815283907f1d31c9f8dea6e179f6a050db117595feea8937029ea51f5168a4780be7e8f5529060200160405180910390a26000858152600560205260408120556000838152600e602052604081206001808501549082015491929161205b919067ffffffffffffffff166130d3565b600783015490915067ffffffffffffffff168111801561209057506001845460ff16600481111561208e5761208e612d2f565b145b156120dc57835460ff191660041784556120ab6001426130d3565b600385015560405185907f4769361a442504ecaf038f35e119bcccdd5e42096b24c09e3c17fd17c6684c0290600090a25b50505050505050565b6000816040516020016120f891906130aa565b604051602081830303815290604052805190602001209050919050565b6001600160a01b0382166000908152600860205260409020612137908261296f565b505050565b60006121478261297b565b6020830151516108ed919067ffffffffffffffff16613114565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152306024830181905260448301849052917f0000000000000000000000000000000000000000000000000000000000000000909116906323b872dd90606401602060405180830381600087803b1580156121ef57600080fd5b505af1158015612203573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122279190613a94565b6121375760405162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015260640161052f565b600061092842612997565b6000611d1261228d8484612292565b6129c3565b6000806122a161010043613100565b905060006122b161010085613100565b905060006122c161010087613100565b90506000610100826122d385876139ca565b6122dd91906139ca565b6122e79190613100565b979650505050505050565b60606000611d1283612a19565b6001600160a01b0382166000908152600960205260409020612137908261296f565b6001600160a01b03821660009081526008602052604090206121379082612a75565b6000828152600e602052604090205482906001600160a01b031661239b5760405162461bcd60e51b815260206004820152600f60248201526e155b9adb9bdddb881c995c5d595cdd608a1b604482015260640161052f565b6000838152600f60209081526040808320600e909252909120815460ff1916600317825580546123d4906001600160a01b031686612321565b600084815260106020526040902060048101546123fa906001600160a01b031686612824565b6003808201546000888152600e60209081526040808320815160a0808201845282546001600160a01b03168252835160e081018552600184015467ffffffffffffffff90811682526002850154828801529884015481860152600484015460608083019190915260058501546080830152600685015492820192909252600784015490981660c08901529381019690965281519283018252600881018054949661273d95909492938501929190829082906124b490613575565b80601f01602080910402602001604051908101604052809291908181526020018280546124e090613575565b801561252d5780601f106125025761010080835404028352916020019161252d565b820191906000526020600020905b81548152906001019060200180831161251057829003601f168201915b50505091835250506040805160208181018352600185015467ffffffffffffffff1682528301528051606081018252600284018054929093019290918290829061257690613575565b80601f01602080910402602001604051908101604052809291908181526020018280546125a290613575565b80156125ef5780601f106125c4576101008083540402835291602001916125ef565b820191906000526020600020905b8154815290600101906020018083116125d257829003601f168201915b5050505050815260200160018201805461260890613575565b80601f016020809104026020016040519081016040528092919081815260200182805461263490613575565b80156126815780601f1061265657610100808354040283529160200191612681565b820191906000526020600020905b81548152906001019060200180831161266457829003601f168201915b5050505050815260200160028201805461269a90613575565b80601f01602080910402602001604051908101604052809291908181526020018280546126c690613575565b80156127135780601f106126e857610100808354040283529160200191612713565b820191906000526020600020905b8154815290600101906020018083116126f657829003601f168201915b505050505081525050815250508152602001600d8201548152602001600e8201548152505061297b565b61274791906139ca565b9050806011600101600082825461275e91906139ca565b9091555050815460ff1916600490811783558083015460405163a9059cbb60e01b81526001600160a01b0391821692810192909252602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156127e057600080fd5b505af11580156127f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128189190613a94565b6120dc576120dc613ab6565b6001600160a01b03821660009081526009602052604090206121379082612a75565b600080600061285485611885565b6000868152600360205260408120549192509061287090612997565b9050600182600481111561288657612886612d2f565b14158061289a57506128988582612a81565b155b156128ad57600080935093505050612922565b6128b78686612292565b925060006128c4846129c3565b600254909150600090610100906128de9060ff1682613acc565b60008a8152600460205260409020546128fb9161ffff1690613114565b6129059190613133565b905080158061291b57506129198183613100565b155b9550505050505b9250929050565b60008060006129388585612846565b9092509050818015612953575060025460ff90811690821610155b95945050505050565b60006108ed61296a83612a8b565b612a98565b6000611d128383612ac4565b602081015160808101516040909101516000916108ed91613114565b60006108ed7f000000000000000000000000000000000000000000000000000000000000000083613133565b60008060ff83166129d56001436130d3565b6129df91906130d3565b409050806129ef576129ef613ab6565b60408051602081018390520160405160208183030381529060405280519060200120915050919050565b606081600001805480602002602001604051908101604052809291908181526020018280548015612a6957602002820191906000526020600020905b815481526020019060010190808311612a55575b50505050509050919050565b6000611d128383612b13565b6000818311611d12565b60006108ed8260016139ca565b60006108ed7f000000000000000000000000000000000000000000000000000000000000000083613114565b6000818152600183016020526040812054612b0b575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556108ed565b5060006108ed565b60008181526001830160205260408120548015612bfc576000612b376001836130d3565b8554909150600090612b4b906001906130d3565b9050818114612bb0576000866000018281548110612b6b57612b6b613aef565b9060005260206000200154905080876000018481548110612b8e57612b8e613aef565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612bc157612bc1613b05565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506108ed565b60009150506108ed565b6040518060400160405280612c19612c26565b8152602001600081525090565b6040518060a0016040528060006001600160a01b03168152602001612c956040518060e00160405280600067ffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600067ffffffffffffffff1681525090565b8152602001612ca2612cb6565b815260006020820181905260409091015290565b604051806060016040528060608152602001612ce86040518060200160405280600067ffffffffffffffff1681525090565b8152602001612d1160405180606001604052806060815260200160608152602001606081525090565b905290565b600060208284031215612d2857600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b60058110612d6357634e487b7160e01b600052602160045260246000fd5b50565b60208101612d7383612d45565b91905290565b60008060408385031215612d8c57600080fd5b50508035926020909101359150565b600060208284031215612dad57600080fd5b813567ffffffffffffffff811115612dc457600080fd5b82016101608185031215611d1257600080fd5b6020808252825182820181905260009190848201906040850190845b81811015612e0f57835183529284019291840191600101612df3565b50909695505050505050565b60008083601f840112612e2d57600080fd5b50813567ffffffffffffffff811115612e4557600080fd5b60208301915083602082850101111561292257600080fd5b60008060008060608587031215612e7357600080fd5b8435935060208501359250604085013567ffffffffffffffff811115612e9857600080fd5b612ea487828801612e1b565b95989497509550505050565b600080600060408486031215612ec557600080fd5b83359250602084013567ffffffffffffffff811115612ee357600080fd5b612eef86828701612e1b565b9497909650939450505050565b6000815180845260005b81811015612f2257602081850181015186830182015201612f06565b81811115612f34576000602083870101525b50601f01601f19169290920160200192915050565b6000815160608452612f5e6060850182612efc565b905067ffffffffffffffff60208401515116602085015260408301518482036040860152805160608352612f956060840182612efc565b905060208201518382036020850152612fae8282612efc565b915050604082015191508281036040840152612fca8183612efc565b9695505050505050565b60006101606001600160a01b038351168452602083015167ffffffffffffffff808251166020870152602082015160408701526040820151606087015260608201516080870152608082015160a087015260a082015160c08701528060c08301511660e0870152505060408301518161010086015261305582860182612f49565b915050606083015161012085015260808301516101408501528091505092915050565b6020815260008251604060208401526130946060840182612fd4565b9050602084015160408401528091505092915050565b602081526000611d126020830184612fd4565b634e487b7160e01b600052601160045260246000fd5b6000828210156130e5576130e56130bd565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261310f5761310f6130ea565b500690565b600081600019048311821515161561312e5761312e6130bd565b500290565b600082613142576131426130ea565b500490565b6001600160a01b0381168114612d6357600080fd5b60006020828403121561316e57600080fd5b8135611d1281613147565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156131b2576131b2613179565b60405290565b6040516020810167ffffffffffffffff811182821017156131b2576131b2613179565b60405160a0810167ffffffffffffffff811182821017156131b2576131b2613179565b60405160e0810167ffffffffffffffff811182821017156131b2576131b2613179565b67ffffffffffffffff81168114612d6357600080fd5b600067ffffffffffffffff8084111561325257613252613179565b604051601f8501601f19908116603f0116810190828211818310171561327a5761327a613179565b8160405280935085815286868601111561329357600080fd5b858560208301376000602087830101525050509392505050565b600082601f8301126132be57600080fd5b611d1283833560208501613237565b6000606082840312156132df57600080fd5b6132e761318f565b9050813567ffffffffffffffff8082111561330157600080fd5b61330d858386016132ad565b8352602084013591508082111561332357600080fd5b61332f858386016132ad565b6020840152604084013591508082111561334857600080fd5b50613355848285016132ad565b60408301525092915050565b6000818303606081121561337457600080fd5b61337c61318f565b9150823567ffffffffffffffff8082111561339657600080fd5b818501915085601f8301126133aa57600080fd5b6133b986833560208501613237565b84526020601f19840112156133cd57600080fd5b6133d56131b8565b9250602085013591506133e782613221565b818352826020850152604085013592508083111561340457600080fd5b5050613355848285016132cd565b600081360361016081121561342657600080fd5b61342e6131db565b833561343981613147565b815260e0601f198301121561344d57600080fd5b6134556131fe565b9150602084013561346581613221565b8083525060408401356020830152606084013560408301526080840135606083015260a0840135608083015260c084013560a083015260e08401356134a981613221565b60c083015260208101919091526101008301359067ffffffffffffffff8211156134d257600080fd5b6134de36838601613361565b604082015261012084013560608201526101409093013560808401525090919050565b600081356108ed81613221565b60008235605e1983360301811261352457600080fd5b9190910192915050565b6000808335601e1984360301811261354557600080fd5b83018035915067ffffffffffffffff82111561356057600080fd5b60200191503681900382131561292257600080fd5b600181811c9082168061358957607f821691505b602082108114156105c757634e487b7160e01b600052602260045260246000fd5b601f82111561213757600081815260208120601f850160051c810160208610156135d15750805b601f850160051c820191505b818110156135f0578281556001016135dd565b505050505050565b813561360381613221565b815467ffffffffffffffff191667ffffffffffffffff8216178255505050565b67ffffffffffffffff83111561363b5761363b613179565b61364f836136498354613575565b836135aa565b6000601f841160018114613683576000851561366b5750838201355b600019600387901b1c1916600186901b178355610718565b600083815260209020601f19861690835b828110156136b45786850135825560209485019460019092019101613694565b50868210156136d15760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6136ed828361352e565b67ffffffffffffffff81111561370557613705613179565b613719816137138554613575565b856135aa565b6000601f82116001811461374d57600083156137355750838201355b600019600385901b1c1916600184901b1785556137a7565b600085815260209020601f19841690835b8281101561377e578685013582556020948501946001909201910161375e565b508482101561379b5760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506137b8602083018361352e565b6137c6818360018601613623565b50506137d5604083018361352e565b61071a818360028601613623565b6137ed828361352e565b67ffffffffffffffff81111561380557613805613179565b613813816137138554613575565b6000601f821160018114613847576000831561382f5750838201355b600019600385901b1c1916600184901b1785556138a1565b600085815260209020601f19841690835b828110156138785786850135825560209485019460019092019101613858565b50848210156138955760001960f88660031b161c19848701351681555b505060018360011b0185555b505050506138b560208301600183016135f8565b6138ce6138c5604084018461350e565b600283016136e3565b5050565b81356138dd81613147565b6001600160a01b03811673ffffffffffffffffffffffffffffffffffffffff1983541617825550602082013561391281613221565b60018201805467ffffffffffffffff191667ffffffffffffffff83161790555060408201356002820155606082013560038201556080820135600482015560a0820135600582015560c0820135600682015561399661397360e08401613501565b6007830167ffffffffffffffff821667ffffffffffffffff198254161781555050565b6139b06139a761010084018461350e565b600883016137e3565b610120820135600d820155610140820135600e8201555050565b600082198211156139dd576139dd6130bd565b500190565b838152610120810183356139f581613221565b67ffffffffffffffff8082166020850152602086013560408501526040860135606085015260608601356080850152608086013560a085015260a086013560c085015260c08601359150613a4882613221565b1660e08301526101009091019190915292915050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b600060208284031215613aa657600080fd5b81518015158114611d1257600080fd5b634e487b7160e01b600052600160045260246000fd5b600061ffff83811690831681811015613ae757613ae76130bd565b039392505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220c7052b64f85cd2f0e60a31f5a231ddafb1d3c1bccb20e5810f9de4d54c42547664736f6c63430008080033", - "devdoc": { - "kind": "dev", - "methods": { - "withdrawFunds(bytes32)": { - "details": "Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.", - "params": { - "requestId": "the id of the request" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "withdrawFunds(bytes32)": { - "notice": "Withdraws storage request funds back to the client that deposited them." - } - }, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 3632, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_config", - "offset": 0, - "slot": "0", - "type": "t_struct(ProofConfig)2216_storage" - }, - { - "astId": 3660, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotStarts", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_uint256)" - }, - { - "astId": 3665, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_probabilities", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_uint256)" - }, - { - "astId": 3670, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missed", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_uint256)" - }, - { - "astId": 3678, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_received", - "offset": 0, - "slot": "6", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_mapping(t_userDefinedValueType(Period)3491,t_bool))" - }, - { - "astId": 3686, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_missing", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_mapping(t_userDefinedValueType(Period)3491,t_bool))" - }, - { - "astId": 4364, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestsPerClient", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)" - }, - { - "astId": 4369, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slotsPerHost", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)" - }, - { - "astId": 2324, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "config", - "offset": 0, - "slot": "10", - "type": "t_struct(MarketplaceConfig)2199_storage" - }, - { - "astId": 2330, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requests", - "offset": 0, - "slot": "14", - "type": "t_mapping(t_userDefinedValueType(RequestId)4184,t_struct(Request)4199_storage)" - }, - { - "astId": 2336, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_requestContexts", - "offset": 0, - "slot": "15", - "type": "t_mapping(t_userDefinedValueType(RequestId)4184,t_struct(RequestContext)2355_storage)" - }, - { - "astId": 2342, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_slots", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_userDefinedValueType(SlotId)4186,t_struct(Slot)2369_storage)" - }, - { - "astId": 2345, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_marketplaceTotals", - "offset": 0, - "slot": "17", - "type": "t_struct(MarketplaceTotals)3486_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_bytes32)dyn_storage": { - "base": "t_bytes32", - "encoding": "dynamic_array", - "label": "bytes32[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_enum(RequestState)4239": { - "encoding": "inplace", - "label": "enum RequestState", - "numberOfBytes": "1" - }, - "t_enum(SlotState)4245": { - "encoding": "inplace", - "label": "enum SlotState", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_struct(Bytes32Set)1781_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct EnumerableSet.Bytes32Set)", - "numberOfBytes": "32", - "value": "t_struct(Bytes32Set)1781_storage" - }, - "t_mapping(t_bytes32,t_uint256)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_userDefinedValueType(Period)3491,t_bool)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(Period)3491", - "label": "mapping(Periods.Period => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_userDefinedValueType(RequestId)4184,t_struct(Request)4199_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)4184", - "label": "mapping(RequestId => struct Request)", - "numberOfBytes": "32", - "value": "t_struct(Request)4199_storage" - }, - "t_mapping(t_userDefinedValueType(RequestId)4184,t_struct(RequestContext)2355_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(RequestId)4184", - "label": "mapping(RequestId => struct Marketplace.RequestContext)", - "numberOfBytes": "32", - "value": "t_struct(RequestContext)2355_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)4186,t_mapping(t_userDefinedValueType(Period)3491,t_bool))": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)4186", - "label": "mapping(SlotId => mapping(Periods.Period => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_userDefinedValueType(Period)3491,t_bool)" - }, - "t_mapping(t_userDefinedValueType(SlotId)4186,t_struct(Slot)2369_storage)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)4186", - "label": "mapping(SlotId => struct Marketplace.Slot)", - "numberOfBytes": "32", - "value": "t_struct(Slot)2369_storage" - }, - "t_mapping(t_userDefinedValueType(SlotId)4186,t_uint256)": { - "encoding": "mapping", - "key": "t_userDefinedValueType(SlotId)4186", - "label": "mapping(SlotId => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Ask)4214_storage": { - "encoding": "inplace", - "label": "struct Ask", - "members": [ - { - "astId": 4201, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slots", - "offset": 0, - "slot": "0", - "type": "t_uint64" - }, - { - "astId": 4203, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotSize", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 4205, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "duration", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 4207, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofProbability", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 4209, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "reward", - "offset": 0, - "slot": "4", - "type": "t_uint256" - }, - { - "astId": 4211, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateral", - "offset": 0, - "slot": "5", - "type": "t_uint256" - }, - { - "astId": 4213, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxSlotLoss", - "offset": 0, - "slot": "6", - "type": "t_uint64" - } - ], - "numberOfBytes": "224" - }, - "t_struct(Bytes32Set)1781_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Bytes32Set", - "members": [ - { - "astId": 1780, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_inner", - "offset": 0, - "slot": "0", - "type": "t_struct(Set)1587_storage" - } - ], - "numberOfBytes": "64" - }, - "t_struct(CollateralConfig)2209_storage": { - "encoding": "inplace", - "label": "struct CollateralConfig", - "members": [ - { - "astId": 2202, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "repairRewardPercentage", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2204, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "maxNumberOfSlashes", - "offset": 1, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 2206, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slashCriterion", - "offset": 2, - "slot": "0", - "type": "t_uint16" - }, - { - "astId": 2208, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slashPercentage", - "offset": 4, - "slot": "0", - "type": "t_uint8" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Content)4223_storage": { - "encoding": "inplace", - "label": "struct Content", - "members": [ - { - "astId": 4216, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "cid", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4219, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "erasure", - "offset": 0, - "slot": "1", - "type": "t_struct(Erasure)4226_storage" - }, - { - "astId": 4222, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "por", - "offset": 0, - "slot": "2", - "type": "t_struct(PoR)4233_storage" - } - ], - "numberOfBytes": "160" - }, - "t_struct(Erasure)4226_storage": { - "encoding": "inplace", - "label": "struct Erasure", - "members": [ - { - "astId": 4225, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "totalChunks", - "offset": 0, - "slot": "0", - "type": "t_uint64" - } - ], - "numberOfBytes": "32" - }, - "t_struct(MarketplaceConfig)2199_storage": { - "encoding": "inplace", - "label": "struct MarketplaceConfig", - "members": [ - { - "astId": 2195, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "collateral", - "offset": 0, - "slot": "0", - "type": "t_struct(CollateralConfig)2209_storage" - }, - { - "astId": 2198, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "proofs", - "offset": 0, - "slot": "1", - "type": "t_struct(ProofConfig)2216_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(MarketplaceTotals)3486_storage": { - "encoding": "inplace", - "label": "struct Marketplace.MarketplaceTotals", - "members": [ - { - "astId": 3483, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "received", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 3485, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "sent", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_struct(PoR)4233_storage": { - "encoding": "inplace", - "label": "struct PoR", - "members": [ - { - "astId": 4228, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "u", - "offset": 0, - "slot": "0", - "type": "t_bytes_storage" - }, - { - "astId": 4230, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "publicKey", - "offset": 0, - "slot": "1", - "type": "t_bytes_storage" - }, - { - "astId": 4232, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "name", - "offset": 0, - "slot": "2", - "type": "t_bytes_storage" - } - ], - "numberOfBytes": "96" - }, - "t_struct(ProofConfig)2216_storage": { - "encoding": "inplace", - "label": "struct ProofConfig", - "members": [ - { - "astId": 2211, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "period", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 2213, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "timeout", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 2215, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "downtime", - "offset": 0, - "slot": "2", - "type": "t_uint8" - } - ], - "numberOfBytes": "96" - }, - "t_struct(Request)4199_storage": { - "encoding": "inplace", - "label": "struct Request", - "members": [ - { - "astId": 4188, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "client", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 4191, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "ask", - "offset": 0, - "slot": "1", - "type": "t_struct(Ask)4214_storage" - }, - { - "astId": 4194, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "content", - "offset": 0, - "slot": "8", - "type": "t_struct(Content)4223_storage" - }, - { - "astId": 4196, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "expiry", - "offset": 0, - "slot": "13", - "type": "t_uint256" - }, - { - "astId": 4198, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "nonce", - "offset": 0, - "slot": "14", - "type": "t_bytes32" - } - ], - "numberOfBytes": "480" - }, - "t_struct(RequestContext)2355_storage": { - "encoding": "inplace", - "label": "struct Marketplace.RequestContext", - "members": [ - { - "astId": 2348, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(RequestState)4239" - }, - { - "astId": 2350, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotsFilled", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 2352, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "startedAt", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 2354, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "endsAt", - "offset": 0, - "slot": "3", - "type": "t_uint256" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Set)1587_storage": { - "encoding": "inplace", - "label": "struct EnumerableSet.Set", - "members": [ - { - "astId": 1582, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_values", - "offset": 0, - "slot": "0", - "type": "t_array(t_bytes32)dyn_storage" - }, - { - "astId": 1586, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "_indexes", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Slot)2369_storage": { - "encoding": "inplace", - "label": "struct Marketplace.Slot", - "members": [ - { - "astId": 2358, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "state", - "offset": 0, - "slot": "0", - "type": "t_enum(SlotState)4245" - }, - { - "astId": 2361, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "requestId", - "offset": 0, - "slot": "1", - "type": "t_userDefinedValueType(RequestId)4184" - }, - { - "astId": 2363, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "slotIndex", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 2366, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "currentCollateral", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 2368, - "contract": "contracts/Marketplace.sol:Marketplace", - "label": "host", - "offset": 0, - "slot": "4", - "type": "t_address" - } - ], - "numberOfBytes": "160" - }, - "t_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint64": { - "encoding": "inplace", - "label": "uint64", - "numberOfBytes": "8" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - }, - "t_userDefinedValueType(Period)3491": { - "encoding": "inplace", - "label": "Periods.Period", - "numberOfBytes": "32" - }, - "t_userDefinedValueType(RequestId)4184": { - "encoding": "inplace", - "label": "RequestId", - "numberOfBytes": "32" - }, - "t_userDefinedValueType(SlotId)4186": { - "encoding": "inplace", - "label": "SlotId", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/taiko_test/TestToken.json b/deployments/taiko_test/TestToken.json deleted file mode 100644 index 1b85a54..0000000 --- a/deployments/taiko_test/TestToken.json +++ /dev/null @@ -1,439 +0,0 @@ -{ - "address": "0x95658FdA29e3b547107c95c11dD5e4a1A034C4AB", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "holder", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x727bfd3b536568b1cf787ce73f8d3273bde11f847762a77633ae46ecf83e5877", - "receipt": { - "to": null, - "from": "0xD40C3aED27Cb03CC671b66Fd52d81AE9d8702BE4", - "contractAddress": "0x95658FdA29e3b547107c95c11dD5e4a1A034C4AB", - "transactionIndex": 4, - "gasUsed": "669687", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xb7b706e67bbb83fa9973f7eb773f89fc22c9a4ea56a4aad6ca5a782a035d6bb8", - "transactionHash": "0x727bfd3b536568b1cf787ce73f8d3273bde11f847762a77633ae46ecf83e5877", - "logs": [], - "blockNumber": 187454, - "cumulativeGasUsed": "1936262", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "e700509efb579c8cd23fdb7d2aca156d", - "metadata": "{\"compiler\":{\"version\":\"0.8.8+commit.dddeac2f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"See {IERC20-allowance}.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address.\"},\"balanceOf(address)\":{\"details\":\"See {IERC20-balanceOf}.\"},\"decimals()\":{\"details\":\"Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.\"},\"decreaseAllowance(address,uint256)\":{\"details\":\"Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`.\"},\"increaseAllowance(address,uint256)\":{\"details\":\"Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token, usually a shorter version of the name.\"},\"totalSupply()\":{\"details\":\"See {IERC20-totalSupply}.\"},\"transfer(address,uint256)\":{\"details\":\"See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TestToken.sol\":\"TestToken\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20.sol\\\";\\nimport \\\"./extensions/IERC20Metadata.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20 is Context, IERC20, IERC20Metadata {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x4ffc0547c02ad22925310c585c0f166f8759e2648a09e9b489100c42f15dd98d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/TestToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/ERC20.sol\\\";\\n\\ncontract TestToken is ERC20 {\\n // solhint-disable-next-line no-empty-blocks\\n constructor() ERC20(\\\"TestToken\\\", \\\"TST\\\") {}\\n\\n function mint(address holder, uint256 amount) public {\\n _mint(holder, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5d96973c72b760b4d49d2f2211829827839ef6593a1a4924196c84a999dcc6c1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50604051806040016040528060098152602001682a32b9ba2a37b5b2b760b91b815250604051806040016040528060038152602001621514d560ea1b8152508160039080519060200190610065929190610081565b508051610079906004906020840190610081565b505050610155565b82805461008d9061011a565b90600052602060002090601f0160209004810192826100af57600085556100f5565b82601f106100c857805160ff19168380011785556100f5565b828001600101855582156100f5579182015b828111156100f55782518255916020019190600101906100da565b50610101929150610105565b5090565b5b808211156101015760008155600101610106565b600181811c9082168061012e57607f821691505b6020821081141561014f57634e487b7160e01b600052602260045260246000fd5b50919050565b610a46806101646000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610883565b60405180910390f35b61010a6101053660046108f4565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091e565b6102b0565b604051601281526020016100ee565b61010a61015c3660046108f4565b6102d4565b61017461016f3660046108f4565b610313565b005b61011e61018436600461095a565b6001600160a01b031660009081526020819052604090205490565b6100e1610321565b61010a6101b53660046108f4565b610330565b61010a6101c83660046108f4565b6103df565b61011e6101db36600461097c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109af565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109af565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ed565b5060019392505050565b6000336102be858285610545565b6102c98585856105d7565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a6908290869061030e9087906109ea565b6103ed565b61031d82826107c4565b5050565b606060048054610215906109af565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102c982868684036103ed565b6000336102a68185856105d7565b6001600160a01b0383166104685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166104e45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d157818110156105c45760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103c9565b6105d184848484036103ed565b50505050565b6001600160a01b0383166106535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166106cf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0383166000908152602081905260409020548181101561075e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d1565b6001600160a01b03821661081a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103c9565b806002600082825461082c91906109ea565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b818110156108b057858101830151858201604001528201610894565b818111156108c2576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108ef57600080fd5b919050565b6000806040838503121561090757600080fd5b610910836108d8565b946020939093013593505050565b60008060006060848603121561093357600080fd5b61093c846108d8565b925061094a602085016108d8565b9150604084013590509250925092565b60006020828403121561096c57600080fd5b610975826108d8565b9392505050565b6000806040838503121561098f57600080fd5b610998836108d8565b91506109a6602084016108d8565b90509250929050565b600181811c908216806109c357607f821691505b602082108114156109e457634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610a0b57634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220c6619aa6dbd9bec1296ef2ec84d724840a2e5985a94f66906481ff3695f3ca9764736f6c63430008080033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100d45760003560e01c806340c10f1911610081578063a457c2d71161005b578063a457c2d7146101a7578063a9059cbb146101ba578063dd62ed3e146101cd57600080fd5b806340c10f191461016157806370a082311461017657806395d89b411461019f57600080fd5b806323b872dd116100b257806323b872dd1461012c578063313ce5671461013f578063395093511461014e57600080fd5b806306fdde03146100d9578063095ea7b3146100f757806318160ddd1461011a575b600080fd5b6100e1610206565b6040516100ee9190610883565b60405180910390f35b61010a6101053660046108f4565b610298565b60405190151581526020016100ee565b6002545b6040519081526020016100ee565b61010a61013a36600461091e565b6102b0565b604051601281526020016100ee565b61010a61015c3660046108f4565b6102d4565b61017461016f3660046108f4565b610313565b005b61011e61018436600461095a565b6001600160a01b031660009081526020819052604090205490565b6100e1610321565b61010a6101b53660046108f4565b610330565b61010a6101c83660046108f4565b6103df565b61011e6101db36600461097c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b606060038054610215906109af565b80601f0160208091040260200160405190810160405280929190818152602001828054610241906109af565b801561028e5780601f106102635761010080835404028352916020019161028e565b820191906000526020600020905b81548152906001019060200180831161027157829003601f168201915b5050505050905090565b6000336102a68185856103ed565b5060019392505050565b6000336102be858285610545565b6102c98585856105d7565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102a6908290869061030e9087906109ea565b6103ed565b61031d82826107c4565b5050565b606060048054610215906109af565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102c982868684036103ed565b6000336102a68185856105d7565b6001600160a01b0383166104685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166104e45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146105d157818110156105c45760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103c9565b6105d184848484036103ed565b50505050565b6001600160a01b0383166106535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0382166106cf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b0383166000908152602081905260409020548181101561075e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103c9565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36105d1565b6001600160a01b03821661081a5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103c9565b806002600082825461082c91906109ea565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060208083528351808285015260005b818110156108b057858101830151858201604001528201610894565b818111156108c2576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108ef57600080fd5b919050565b6000806040838503121561090757600080fd5b610910836108d8565b946020939093013593505050565b60008060006060848603121561093357600080fd5b61093c846108d8565b925061094a602085016108d8565b9150604084013590509250925092565b60006020828403121561096c57600080fd5b610975826108d8565b9392505050565b6000806040838503121561098f57600080fd5b610998836108d8565b91506109a6602084016108d8565b90509250929050565b600181811c908216806109c357607f821691505b602082108114156109e457634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115610a0b57634e487b7160e01b600052601160045260246000fd5b50019056fea2646970667358221220c6619aa6dbd9bec1296ef2ec84d724840a2e5985a94f66906481ff3695f3ca9764736f6c63430008080033", - "devdoc": { - "kind": "dev", - "methods": { - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value {ERC20} uses, unless this function is overridden; NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 15, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 21, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 23, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 25, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 27, - "contract": "contracts/TestToken.sol:TestToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/taiko_test/solcInputs/1f43413075cc2b565de996acf5469041.json b/deployments/taiko_test/solcInputs/1f43413075cc2b565de996acf5469041.json deleted file mode 100644 index 22f5fde..0000000 --- a/deployments/taiko_test/solcInputs/1f43413075cc2b565de996acf5469041.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n new TestToken(),\n MarketplaceConfig(CollateralConfig(10, 5, 3, 10), ProofConfig(10, 5, 64))\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token.balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./StateRetrieval.sol\";\n\ncontract Marketplace is Proofs, StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 public immutable token;\n MarketplaceConfig public config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) private _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n uint256 startedAt;\n uint256 endsAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n uint256 slotIndex;\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n IERC20 token_,\n MarketplaceConfig memory configuration\n ) Proofs(configuration.proofs) {\n token = token_;\n\n require(\n configuration.collateral.repairRewardPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.slashPercentage <= 100,\n \"Must be less than 100\"\n );\n require(\n configuration.collateral.maxNumberOfSlashes *\n configuration.collateral.slashPercentage <=\n 100,\n \"Maximum slashing exceeds 100%\"\n );\n config = configuration;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask, request.expiry);\n }\n\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n bytes calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId);\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n _forciblyFreeSlot(slotId);\n }\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n if (missingProofs(slotId) % config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral *\n config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (\n missingProofs(slotId) / config.collateral.slashCriterion >=\n config.collateral.maxNumberOfSlashes\n ) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 slotIndex = slot.slotIndex;\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotIndex);\n _resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 amount = _requests[requestId].pricePerSlot() +\n slot.currentCollateral;\n _marketplaceTotals.sent += amount;\n slot.state = SlotState.Paid;\n assert(token.transfer(slot.host, amount));\n }\n\n /// @notice Withdraws storage request funds back to the client that deposited them.\n /// @dev Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\n /// @param requestId the id of the request\n function withdrawFunds(RequestId requestId) public {\n Request storage request = _requests[requestId];\n require(block.timestamp > request.expiry, \"Request not yet timed out\");\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n // TODO: To be changed once we start paying out hosts for the time they\n // fill a slot. The amount that we paid to hosts will then have to be\n // deducted from the price.\n uint256 amount = request.price();\n _marketplaceTotals.sent += amount;\n assert(token.transfer(msg.sender, amount));\n }\n\n function getActiveSlot(\n SlotId slotId\n ) public view slotIsNotFree(slotId) returns (ActiveSlot memory) {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > _requests[requestId].expiry\n ) {\n return RequestState.Cancelled;\n } else if (\n context.state == RequestState.Started && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask, uint256 expiry);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(\n RequestId indexed requestId,\n uint256 slotIndex\n );\n event SlotFreed(\n RequestId indexed requestId,\n uint256 slotIndex\n );\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\n\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n\n constructor(ProofConfig memory config) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n }\n\n mapping(SlotId => uint256) private _slotStarts;\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n function _resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = Period.unwrap(period) % 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n function submitProof(SlotId id, bytes calldata proof) public {\n require(proof.length > 0, \"Invalid proof\"); // TODO: replace by actual check\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id, proof);\n }\n\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id, bytes proof);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // timestamp as seconds since unix epoch at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id (if part of a larger set, the chunk cid)\n Erasure erasure; // Erasure coding attributes\n PoR por; // Proof of Retrievability parameters\n}\n\nstruct Erasure {\n uint64 totalChunks; // the total number of chunks in the larger data set\n}\n\nstruct PoR {\n bytes u; // parameters u_1..u_s\n bytes publicKey; // public key\n bytes name; // random name\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid // host has been paid\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n IERC20 token,\n MarketplaceConfig memory config\n )\n Marketplace(token, config) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(ProofConfig memory config) Proofs(config) {}\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/taiko_test/solcInputs/9671d4e1820229dcd69b349a99feb65b.json b/deployments/taiko_test/solcInputs/9671d4e1820229dcd69b349a99feb65b.json deleted file mode 100644 index 0912a52..0000000 --- a/deployments/taiko_test/solcInputs/9671d4e1820229dcd69b349a99feb65b.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./StateRetrieval.sol\";\n\ncontract Marketplace is Proofs, StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 public immutable token;\n MarketplaceConfig public config;\n\n MarketplaceFunds private _funds;\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) private _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n uint256 startedAt;\n uint256 endsAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n uint256 slotIndex;\n\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n IERC20 token_,\n MarketplaceConfig memory configuration\n ) Proofs(configuration.proofs) marketplaceInvariant {\n token = token_;\n\n require(configuration.collateral.repairRewardPercentage <= 100, \"Must be less than 100\");\n require(configuration.collateral.slashPercentage <= 100, \"Must be less than 100\");\n require(configuration.collateral.maxNumberOfSlashes * configuration.collateral.slashPercentage <= 100, \"Total slash percentage must be less then 100\");\n config = configuration;\n }\n\n function requestStorage(\n Request calldata request\n ) public marketplaceInvariant {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _funds.received += amount;\n _funds.balance += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask);\n }\n\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n bytes calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _funds.received += collateralAmount;\n _funds.balance += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex, slotId);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId);\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n _forciblyFreeSlot(slotId);\n }\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n if (missingProofs(slotId) % config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral * config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n _funds.slashed += slashedAmount;\n _funds.balance -= slashedAmount;\n\n if (missingProofs(slotId) / config.collateral.slashCriterion >= config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n function _forciblyFreeSlot(SlotId slotId) internal marketplaceInvariant {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotId);\n resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId\n ) private requestIsKnown(requestId) marketplaceInvariant {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 amount = _requests[requestId].pricePerSlot() + slot.currentCollateral;\n _funds.sent += amount;\n _funds.balance -= amount;\n slot.state = SlotState.Paid;\n require(token.transfer(slot.host, amount), \"Payment failed\");\n }\n\n /// @notice Withdraws storage request funds back to the client that deposited them.\n /// @dev Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\n /// @param requestId the id of the request\n function withdrawFunds(RequestId requestId) public marketplaceInvariant {\n Request storage request = _requests[requestId];\n require(block.timestamp > request.expiry, \"Request not yet timed out\");\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n // TODO: To be changed once we start paying out hosts for the time they\n // fill a slot. The amount that we paid to hosts will then have to be\n // deducted from the price.\n uint256 amount = request.price();\n _funds.sent += amount;\n _funds.balance -= amount;\n require(token.transfer(msg.sender, amount), \"Withdraw failed\");\n }\n\n function getActiveSlot(SlotId slotId)\n public\n view\n slotIsNotFree(slotId)\n returns (ActiveSlot memory)\n {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > _requests[requestId].expiry\n ) {\n return RequestState.Cancelled;\n } else if (\n context.state == RequestState.Started && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(\n RequestId indexed requestId,\n uint256 indexed slotIndex,\n SlotId slotId\n );\n event SlotFreed(RequestId indexed requestId, SlotId slotId);\n event RequestCancelled(RequestId indexed requestId);\n\n modifier marketplaceInvariant() {\n MarketplaceFunds memory oldFunds = _funds;\n _;\n assert(_funds.received >= oldFunds.received);\n assert(_funds.sent >= oldFunds.sent);\n assert(_funds.slashed >= oldFunds.slashed);\n assert(_funds.received == _funds.balance + _funds.sent + _funds.slashed);\n }\n\n struct MarketplaceFunds {\n uint256 balance;\n uint256 received;\n uint256 sent;\n uint256 slashed;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\n\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n\n constructor(ProofConfig memory config) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n }\n\n mapping(SlotId => uint256) private _slotStarts;\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n function resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = Period.unwrap(period) % 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n function submitProof(SlotId id, bytes calldata proof) public {\n require(proof.length > 0, \"Invalid proof\"); // TODO: replace by actual check\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id, proof);\n }\n\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id, bytes proof);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // timestamp as seconds since unix epoch at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id (if part of a larger set, the chunk cid)\n Erasure erasure; // Erasure coding attributes\n PoR por; // Proof of Retrievability parameters\n}\n\nstruct Erasure {\n uint64 totalChunks; // the total number of chunks in the larger data set\n}\n\nstruct PoR {\n bytes u; // parameters u_1..u_s\n bytes publicKey; // public key\n bytes name; // random name\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid // host has been paid\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n IERC20 token,\n MarketplaceConfig memory config\n )\n Marketplace(token, config) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(ProofConfig memory config) Proofs(config) {}\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/taiko_test/solcInputs/e700509efb579c8cd23fdb7d2aca156d.json b/deployments/taiko_test/solcInputs/e700509efb579c8cd23fdb7d2aca156d.json deleted file mode 100644 index 2c760e3..0000000 --- a/deployments/taiko_test/solcInputs/e700509efb579c8cd23fdb7d2aca156d.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/token/ERC20/ERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * The default value of {decimals} is 18. To select a different value for\n * {decimals} you should overload it.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\n * overridden;\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(\n address owner,\n address spender,\n uint256 amount\n ) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 amount\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 amount\n ) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" - }, - "contracts/Configuration.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\nstruct MarketplaceConfig {\n CollateralConfig collateral;\n ProofConfig proofs;\n}\n\nstruct CollateralConfig {\n /// @dev percentage of remaining collateral slot after it has been freed\n /// (equivalent to `collateral - (collateral*maxNumberOfSlashes*slashPercentage)/100`)\n /// TODO: to be aligned more closely with actual cost of repair once bandwidth incentives are known,\n /// see https://github.com/codex-storage/codex-contracts-eth/pull/47#issuecomment-1465511949.\n uint8 repairRewardPercentage;\n\n uint8 maxNumberOfSlashes; // frees slot when the number of slashing reaches this value\n uint16 slashCriterion; // amount of proofs missed that lead to slashing\n uint8 slashPercentage; // percentage of the collateral that is slashed\n}\n\nstruct ProofConfig {\n uint256 period; // proofs requirements are calculated per period (in seconds)\n uint256 timeout; // mark proofs as missing before the timeout (in seconds)\n uint8 downtime; // ignore this much recent blocks for proof requirements\n}\n" - }, - "contracts/FuzzMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./TestToken.sol\";\nimport \"./Marketplace.sol\";\n\ncontract FuzzMarketplace is Marketplace {\n constructor()\n Marketplace(\n new TestToken(),\n MarketplaceConfig(CollateralConfig(10, 5, 3, 10), ProofConfig(10, 5, 64))\n )\n // solhint-disable-next-line no-empty-blocks\n {\n\n }\n\n // Properties to be tested through fuzzing\n\n MarketplaceTotals private _lastSeenTotals;\n\n function neverDecreaseTotals() public {\n assert(_marketplaceTotals.received >= _lastSeenTotals.received);\n assert(_marketplaceTotals.sent >= _lastSeenTotals.sent);\n _lastSeenTotals = _marketplaceTotals;\n }\n\n function neverLoseFunds() public view {\n uint256 total = _marketplaceTotals.received - _marketplaceTotals.sent;\n assert(token.balanceOf(address(this)) >= total);\n }\n}\n" - }, - "contracts/Marketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Proofs.sol\";\nimport \"./StateRetrieval.sol\";\n\ncontract Marketplace is Proofs, StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for Request;\n\n IERC20 public immutable token;\n MarketplaceConfig public config;\n\n mapping(RequestId => Request) private _requests;\n mapping(RequestId => RequestContext) private _requestContexts;\n mapping(SlotId => Slot) internal _slots;\n\n MarketplaceTotals internal _marketplaceTotals;\n\n struct RequestContext {\n RequestState state;\n uint256 slotsFilled;\n uint256 startedAt;\n uint256 endsAt;\n }\n\n struct Slot {\n SlotState state;\n RequestId requestId;\n uint256 slotIndex;\n\n /// @notice Tracks the current amount of host's collateral that is to be payed out at the end of Slot's lifespan.\n /// @dev When Slot is filled, the collateral is collected in amount of request.ask.collateral\n /// @dev When Host is slashed for missing a proof the slashed amount is reflected in this variable\n uint256 currentCollateral;\n address host;\n }\n\n struct ActiveSlot {\n Request request;\n uint256 slotIndex;\n }\n\n constructor(\n IERC20 token_,\n MarketplaceConfig memory configuration\n ) Proofs(configuration.proofs) {\n token = token_;\n\n require(configuration.collateral.repairRewardPercentage <= 100, \"Must be less than 100\");\n require(configuration.collateral.slashPercentage <= 100, \"Must be less than 100\");\n require(configuration.collateral.maxNumberOfSlashes * configuration.collateral.slashPercentage <= 100, \"Total slash percentage must be less then 100\");\n config = configuration;\n }\n\n function requestStorage(Request calldata request) public {\n require(request.client == msg.sender, \"Invalid client address\");\n\n RequestId id = request.id();\n require(_requests[id].client == address(0), \"Request already exists\");\n\n _requests[id] = request;\n _requestContexts[id].endsAt = block.timestamp + request.ask.duration;\n\n _addToMyRequests(request.client, id);\n\n uint256 amount = request.price();\n _marketplaceTotals.received += amount;\n _transferFrom(msg.sender, amount);\n\n emit StorageRequested(id, request.ask);\n }\n\n function fillSlot(\n RequestId requestId,\n uint256 slotIndex,\n bytes calldata proof\n ) public requestIsKnown(requestId) {\n Request storage request = _requests[requestId];\n require(slotIndex < request.ask.slots, \"Invalid slot\");\n\n SlotId slotId = Requests.slotId(requestId, slotIndex);\n Slot storage slot = _slots[slotId];\n slot.requestId = requestId;\n slot.slotIndex = slotIndex;\n\n require(slotState(slotId) == SlotState.Free, \"Slot is not free\");\n\n _startRequiringProofs(slotId, request.ask.proofProbability);\n submitProof(slotId, proof);\n\n slot.host = msg.sender;\n slot.state = SlotState.Filled;\n RequestContext storage context = _requestContexts[requestId];\n context.slotsFilled += 1;\n\n // Collect collateral\n uint256 collateralAmount = request.ask.collateral;\n _transferFrom(msg.sender, collateralAmount);\n _marketplaceTotals.received += collateralAmount;\n slot.currentCollateral = collateralAmount;\n\n _addToMySlots(slot.host, slotId);\n\n emit SlotFilled(requestId, slotIndex, slotId);\n if (context.slotsFilled == request.ask.slots) {\n context.state = RequestState.Started;\n context.startedAt = block.timestamp;\n emit RequestFulfilled(requestId);\n }\n }\n\n function freeSlot(SlotId slotId) public slotIsNotFree(slotId) {\n Slot storage slot = _slots[slotId];\n require(slot.host == msg.sender, \"Slot filled by other host\");\n SlotState state = slotState(slotId);\n require(state != SlotState.Paid, \"Already paid\");\n\n if (state == SlotState.Finished) {\n _payoutSlot(slot.requestId, slotId);\n } else if (state == SlotState.Failed) {\n _removeFromMySlots(msg.sender, slotId);\n } else if (state == SlotState.Filled) {\n _forciblyFreeSlot(slotId);\n }\n }\n\n function markProofAsMissing(SlotId slotId, Period period) public {\n require(slotState(slotId) == SlotState.Filled, \"Slot not accepting proofs\");\n _markProofAsMissing(slotId, period);\n Slot storage slot = _slots[slotId];\n Request storage request = _requests[slot.requestId];\n\n if (missingProofs(slotId) % config.collateral.slashCriterion == 0) {\n uint256 slashedAmount = (request.ask.collateral * config.collateral.slashPercentage) / 100;\n slot.currentCollateral -= slashedAmount;\n if (missingProofs(slotId) / config.collateral.slashCriterion >= config.collateral.maxNumberOfSlashes) {\n // When the number of slashings is at or above the allowed amount,\n // free the slot.\n _forciblyFreeSlot(slotId);\n }\n }\n }\n\n function _forciblyFreeSlot(SlotId slotId) internal {\n Slot storage slot = _slots[slotId];\n RequestId requestId = slot.requestId;\n RequestContext storage context = _requestContexts[requestId];\n\n _removeFromMySlots(slot.host, slotId);\n\n delete _slots[slotId];\n context.slotsFilled -= 1;\n emit SlotFreed(requestId, slotId);\n resetMissingProofs(slotId);\n\n Request storage request = _requests[requestId];\n uint256 slotsLost = request.ask.slots - context.slotsFilled;\n if (\n slotsLost > request.ask.maxSlotLoss &&\n context.state == RequestState.Started\n ) {\n context.state = RequestState.Failed;\n context.endsAt = block.timestamp - 1;\n emit RequestFailed(requestId);\n\n // TODO: send client remaining funds\n }\n }\n\n function _payoutSlot(\n RequestId requestId,\n SlotId slotId\n ) private requestIsKnown(requestId) {\n RequestContext storage context = _requestContexts[requestId];\n Request storage request = _requests[requestId];\n context.state = RequestState.Finished;\n _removeFromMyRequests(request.client, requestId);\n Slot storage slot = _slots[slotId];\n\n _removeFromMySlots(slot.host, slotId);\n\n uint256 amount = _requests[requestId].pricePerSlot() + slot.currentCollateral;\n _marketplaceTotals.sent += amount;\n slot.state = SlotState.Paid;\n require(token.transfer(slot.host, amount), \"Payment failed\");\n }\n\n /// @notice Withdraws storage request funds back to the client that deposited them.\n /// @dev Request must be expired, must be in RequestState.New, and the transaction must originate from the depositer address.\n /// @param requestId the id of the request\n function withdrawFunds(RequestId requestId) public {\n Request storage request = _requests[requestId];\n require(block.timestamp > request.expiry, \"Request not yet timed out\");\n require(request.client == msg.sender, \"Invalid client address\");\n RequestContext storage context = _requestContexts[requestId];\n require(context.state == RequestState.New, \"Invalid state\");\n\n // Update request state to Cancelled. Handle in the withdraw transaction\n // as there needs to be someone to pay for the gas to update the state\n context.state = RequestState.Cancelled;\n _removeFromMyRequests(request.client, requestId);\n\n emit RequestCancelled(requestId);\n\n // TODO: To be changed once we start paying out hosts for the time they\n // fill a slot. The amount that we paid to hosts will then have to be\n // deducted from the price.\n uint256 amount = request.price();\n _marketplaceTotals.sent += amount;\n require(token.transfer(msg.sender, amount), \"Withdraw failed\");\n }\n\n function getActiveSlot(SlotId slotId)\n public\n view\n slotIsNotFree(slotId)\n returns (ActiveSlot memory)\n {\n Slot storage slot = _slots[slotId];\n ActiveSlot memory activeSlot;\n activeSlot.request = _requests[slot.requestId];\n activeSlot.slotIndex = slot.slotIndex;\n return activeSlot;\n }\n\n modifier requestIsKnown(RequestId requestId) {\n require(_requests[requestId].client != address(0), \"Unknown request\");\n _;\n }\n\n function getRequest(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (Request memory) {\n return _requests[requestId];\n }\n\n modifier slotIsNotFree(SlotId slotId) {\n require(_slots[slotId].state != SlotState.Free, \"Slot is free\");\n _;\n }\n\n function requestEnd(RequestId requestId) public view returns (uint256) {\n uint256 end = _requestContexts[requestId].endsAt;\n RequestState state = requestState(requestId);\n if (state == RequestState.New || state == RequestState.Started) {\n return end;\n } else {\n return Math.min(end, block.timestamp - 1);\n }\n }\n\n function getHost(SlotId slotId) public view returns (address) {\n return _slots[slotId].host;\n }\n\n function requestState(\n RequestId requestId\n ) public view requestIsKnown(requestId) returns (RequestState) {\n RequestContext storage context = _requestContexts[requestId];\n if (\n context.state == RequestState.New &&\n block.timestamp > _requests[requestId].expiry\n ) {\n return RequestState.Cancelled;\n } else if (\n context.state == RequestState.Started && block.timestamp > context.endsAt\n ) {\n return RequestState.Finished;\n } else {\n return context.state;\n }\n }\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n Slot storage slot = _slots[slotId];\n if (RequestId.unwrap(slot.requestId) == 0) {\n return SlotState.Free;\n }\n RequestState reqState = requestState(slot.requestId);\n if (slot.state == SlotState.Paid) {\n return SlotState.Paid;\n }\n if (reqState == RequestState.Cancelled) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Finished) {\n return SlotState.Finished;\n }\n if (reqState == RequestState.Failed) {\n return SlotState.Failed;\n }\n return slot.state;\n }\n\n function _transferFrom(address sender, uint256 amount) internal {\n address receiver = address(this);\n require(token.transferFrom(sender, receiver, amount), \"Transfer failed\");\n }\n\n event StorageRequested(RequestId requestId, Ask ask);\n event RequestFulfilled(RequestId indexed requestId);\n event RequestFailed(RequestId indexed requestId);\n event SlotFilled(\n RequestId indexed requestId,\n uint256 indexed slotIndex,\n SlotId slotId\n );\n event SlotFreed(RequestId indexed requestId, SlotId slotId);\n event RequestCancelled(RequestId indexed requestId);\n\n struct MarketplaceTotals {\n uint256 received;\n uint256 sent;\n }\n}\n" - }, - "contracts/Periods.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ncontract Periods {\n type Period is uint256;\n\n uint256 internal immutable _secondsPerPeriod;\n\n constructor(uint256 secondsPerPeriod) {\n _secondsPerPeriod = secondsPerPeriod;\n }\n\n function _periodOf(uint256 timestamp) internal view returns (Period) {\n return Period.wrap(timestamp / _secondsPerPeriod);\n }\n\n function _blockPeriod() internal view returns (Period) {\n return _periodOf(block.timestamp);\n }\n\n function _nextPeriod(Period period) internal pure returns (Period) {\n return Period.wrap(Period.unwrap(period) + 1);\n }\n\n function _periodStart(Period period) internal view returns (uint256) {\n return Period.unwrap(period) * _secondsPerPeriod;\n }\n\n function _periodEnd(Period period) internal view returns (uint256) {\n return _periodStart(_nextPeriod(period));\n }\n\n function _isBefore(Period a, Period b) internal pure returns (bool) {\n return Period.unwrap(a) < Period.unwrap(b);\n }\n\n function _isAfter(Period a, Period b) internal pure returns (bool) {\n return _isBefore(b, a);\n }\n}\n" - }, - "contracts/Proofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"./Configuration.sol\";\nimport \"./Requests.sol\";\nimport \"./Periods.sol\";\n\nabstract contract Proofs is Periods {\n ProofConfig private _config;\n\n constructor(ProofConfig memory config) Periods(config.period) {\n require(block.number > 256, \"Insufficient block height\");\n _config = config;\n }\n\n mapping(SlotId => uint256) private _slotStarts;\n mapping(SlotId => uint256) private _probabilities;\n mapping(SlotId => uint256) private _missed;\n mapping(SlotId => mapping(Period => bool)) private _received;\n mapping(SlotId => mapping(Period => bool)) private _missing;\n\n function slotState(SlotId id) public view virtual returns (SlotState);\n\n function missingProofs(SlotId slotId) public view returns (uint256) {\n return _missed[slotId];\n }\n\n function resetMissingProofs(SlotId slotId) internal {\n _missed[slotId] = 0;\n }\n\n function _startRequiringProofs(SlotId id, uint256 probability) internal {\n _slotStarts[id] = block.timestamp;\n _probabilities[id] = probability;\n }\n\n function _getPointer(SlotId id, Period period) internal view returns (uint8) {\n uint256 blockNumber = block.number % 256;\n uint256 periodNumber = Period.unwrap(period) % 256;\n uint256 idOffset = uint256(SlotId.unwrap(id)) % 256;\n uint256 pointer = (blockNumber + periodNumber + idOffset) % 256;\n return uint8(pointer);\n }\n\n function getPointer(SlotId id) public view returns (uint8) {\n return _getPointer(id, _blockPeriod());\n }\n\n function _getChallenge(uint8 pointer) internal view returns (bytes32) {\n bytes32 hash = blockhash(block.number - 1 - pointer);\n assert(uint256(hash) != 0);\n return keccak256(abi.encode(hash));\n }\n\n function _getChallenge(\n SlotId id,\n Period period\n ) internal view returns (bytes32) {\n return _getChallenge(_getPointer(id, period));\n }\n\n function getChallenge(SlotId id) public view returns (bytes32) {\n return _getChallenge(id, _blockPeriod());\n }\n\n function _getProofRequirement(\n SlotId id,\n Period period\n ) internal view returns (bool isRequired, uint8 pointer) {\n SlotState state = slotState(id);\n Period start = _periodOf(_slotStarts[id]);\n if (state != SlotState.Filled || !_isAfter(period, start)) {\n return (false, 0);\n }\n pointer = _getPointer(id, period);\n bytes32 challenge = _getChallenge(pointer);\n uint256 probability = (_probabilities[id] * (256 - _config.downtime)) / 256;\n isRequired = probability == 0 || uint256(challenge) % probability == 0;\n }\n\n function _isProofRequired(\n SlotId id,\n Period period\n ) internal view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, period);\n return isRequired && pointer >= _config.downtime;\n }\n\n function isProofRequired(SlotId id) public view returns (bool) {\n return _isProofRequired(id, _blockPeriod());\n }\n\n function willProofBeRequired(SlotId id) public view returns (bool) {\n bool isRequired;\n uint8 pointer;\n (isRequired, pointer) = _getProofRequirement(id, _blockPeriod());\n return isRequired && pointer < _config.downtime;\n }\n\n function submitProof(SlotId id, bytes calldata proof) public {\n require(proof.length > 0, \"Invalid proof\"); // TODO: replace by actual check\n require(!_received[id][_blockPeriod()], \"Proof already submitted\");\n _received[id][_blockPeriod()] = true;\n emit ProofSubmitted(id, proof);\n }\n\n function _markProofAsMissing(SlotId id, Period missedPeriod) internal {\n uint256 end = _periodEnd(missedPeriod);\n require(end < block.timestamp, \"Period has not ended yet\");\n require(block.timestamp < end + _config.timeout, \"Validation timed out\");\n require(!_received[id][missedPeriod], \"Proof was submitted, not missing\");\n require(_isProofRequired(id, missedPeriod), \"Proof was not required\");\n require(!_missing[id][missedPeriod], \"Proof already marked as missing\");\n _missing[id][missedPeriod] = true;\n _missed[id] += 1;\n }\n\n event ProofSubmitted(SlotId id, bytes proof);\n}\n" - }, - "contracts/Requests.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\ntype RequestId is bytes32;\ntype SlotId is bytes32;\n\nstruct Request {\n address client;\n Ask ask;\n Content content;\n uint256 expiry; // timestamp as seconds since unix epoch at which this request expires\n bytes32 nonce; // random nonce to differentiate between similar requests\n}\n\nstruct Ask {\n uint64 slots; // the number of requested slots\n uint256 slotSize; // amount of storage per slot (in number of bytes)\n uint256 duration; // how long content should be stored (in seconds)\n uint256 proofProbability; // how often storage proofs are required\n uint256 reward; // amount of tokens paid per second per slot to hosts\n uint256 collateral; // amount of tokens required to be deposited by the hosts in order to fill the slot\n uint64 maxSlotLoss; // Max slots that can be lost without data considered to be lost\n}\n\nstruct Content {\n string cid; // content id (if part of a larger set, the chunk cid)\n Erasure erasure; // Erasure coding attributes\n PoR por; // Proof of Retrievability parameters\n}\n\nstruct Erasure {\n uint64 totalChunks; // the total number of chunks in the larger data set\n}\n\nstruct PoR {\n bytes u; // parameters u_1..u_s\n bytes publicKey; // public key\n bytes name; // random name\n}\n\nenum RequestState {\n New, // [default] waiting to fill slots\n Started, // all slots filled, accepting regular proofs\n Cancelled, // not enough slots filled before expiry\n Finished, // successfully completed\n Failed // too many nodes have failed to provide proofs, data lost\n}\n\nenum SlotState {\n Free, // [default] not filled yet, or host has vacated the slot\n Filled, // host has filled slot\n Finished, // successfully completed\n Failed, // the request has failed\n Paid // host has been paid\n}\n\nlibrary Requests {\n function id(Request memory request) internal pure returns (RequestId) {\n return RequestId.wrap(keccak256(abi.encode(request)));\n }\n\n function slotId(\n RequestId requestId,\n uint256 slotIndex\n ) internal pure returns (SlotId) {\n return SlotId.wrap(keccak256(abi.encode(requestId, slotIndex)));\n }\n\n function toRequestIds(\n bytes32[] memory ids\n ) internal pure returns (RequestId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function toSlotIds(\n bytes32[] memory ids\n ) internal pure returns (SlotId[] memory result) {\n // solhint-disable-next-line no-inline-assembly\n assembly {\n result := ids\n }\n }\n\n function pricePerSlot(\n Request memory request\n ) internal pure returns (uint256) {\n return request.ask.duration * request.ask.reward;\n }\n\n function price(Request memory request) internal pure returns (uint256) {\n return request.ask.slots * pricePerSlot(request);\n }\n}\n" - }, - "contracts/StateRetrieval.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.8;\n\nimport \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport \"./Requests.sol\";\n\ncontract StateRetrieval {\n using EnumerableSet for EnumerableSet.Bytes32Set;\n using Requests for bytes32[];\n\n mapping(address => EnumerableSet.Bytes32Set) private _requestsPerClient;\n mapping(address => EnumerableSet.Bytes32Set) private _slotsPerHost;\n\n function myRequests() public view returns (RequestId[] memory) {\n return _requestsPerClient[msg.sender].values().toRequestIds();\n }\n\n function mySlots() public view returns (SlotId[] memory) {\n return _slotsPerHost[msg.sender].values().toSlotIds();\n }\n\n function _hasSlots(address host) internal view returns (bool) {\n return _slotsPerHost[host].length() > 0;\n }\n\n function _addToMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].add(RequestId.unwrap(requestId));\n }\n\n function _addToMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].add(SlotId.unwrap(slotId));\n }\n\n function _removeFromMyRequests(address client, RequestId requestId) internal {\n _requestsPerClient[client].remove(RequestId.unwrap(requestId));\n }\n\n function _removeFromMySlots(address host, SlotId slotId) internal {\n _slotsPerHost[host].remove(SlotId.unwrap(slotId));\n }\n}\n" - }, - "contracts/TestMarketplace.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Marketplace.sol\";\n\n// exposes internal functions of Marketplace for testing\ncontract TestMarketplace is Marketplace {\n constructor(\n IERC20 token,\n MarketplaceConfig memory config\n )\n Marketplace(token, config) // solhint-disable-next-line no-empty-blocks\n {}\n\n function forciblyFreeSlot(SlotId slotId) public {\n _forciblyFreeSlot(slotId);\n }\n\n function getSlotCollateral(SlotId slotId) public view returns (uint256) {\n return _slots[slotId].currentCollateral;\n }\n}\n" - }, - "contracts/TestProofs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"./Proofs.sol\";\n\n// exposes internal functions of Proofs for testing\ncontract TestProofs is Proofs {\n mapping(SlotId => SlotState) private _states;\n\n // solhint-disable-next-line no-empty-blocks\n constructor(ProofConfig memory config) Proofs(config) {}\n\n function slotState(SlotId slotId) public view override returns (SlotState) {\n return _states[slotId];\n }\n\n function startRequiringProofs(SlotId slot, uint256 probability) public {\n _startRequiringProofs(slot, probability);\n }\n\n function markProofAsMissing(SlotId id, Period period) public {\n _markProofAsMissing(id, period);\n }\n\n function setSlotState(SlotId id, SlotState state) public {\n _states[id] = state;\n }\n}\n" - }, - "contracts/TestToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TestToken is ERC20 {\n // solhint-disable-next-line no-empty-blocks\n constructor() ERC20(\"TestToken\", \"TST\") {}\n\n function mint(address holder, uint256 amount) public {\n _mint(holder, amount);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 1000 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js index 7bd2cb3..37bf87d 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -1,6 +1,5 @@ -require("@nomiclabs/hardhat-waffle") -require("hardhat-deploy") -require("hardhat-deploy-ethers") +require("@nomicfoundation/hardhat-toolbox") +require("@nomicfoundation/hardhat-ignition-ethers") module.exports = { solidity: { @@ -25,6 +24,10 @@ module.exports = { hardhat: { tags: ["local"], allowBlocksWithSameTimestamp: true, + gas: "auto", + }, + localhost: { + tags: ["local"], }, codexdisttestnetwork: { url: `${process.env.DISTTEST_NETWORK_URL}`, diff --git a/ignition/README.md b/ignition/README.md new file mode 100644 index 0000000..9396b5a --- /dev/null +++ b/ignition/README.md @@ -0,0 +1,33 @@ +# Deployment + +Hardhat Ignition is now used to deploy the contracts, so the old +deployment files are no longer relevant. + +However, the ABI of the contracts has changed due to an OpenZeppelin update. +If we ever need to recreate the artifacts from the previous ABI contracts (for any reason), +we can do so using a small script that imports the previously generated files. +Here is an example: + +```js +module.exports = buildModule("Token", (m) => { + const previousJsonFile = path.join(__dirname, "./TestToken.json"); + const artifact = JSON.parse(fs.readFileSync(previousJsonFile, "utf8")); + const address = artifact.address; + const token = m.contractAt("TestToken", address, {}); + return { token }; +}); +``` + +Then we can run: + +```bash +npx hardhat ignition deploy ignition/modules/migration/token.js --network taiko_test +``` + +**Note:** Check [this comment](https://github.com/codex-storage/codex-contracts-eth/pull/231#issuecomment-2808996517) for more context. + +Here is the list of previous commits containing the ABI contracts that were deployed: + +- [Taiko](https://github.com/codex-storage/codex-contracts-eth/commit/1854dfba9991a25532de5f6a53cf50e66afb3c8b) +- [Testnet](https://github.com/codex-storage/codex-contracts-eth/commit/449d64ffc0dc1478d0690d36f037358084a17b09) +- [Linea](https://github.com/codex-storage/codex-contracts-eth/pull/226/commits/2dddc260152b6e9c24ae372397f9b9b2d27ce8e4) diff --git a/ignition/deployments/chain-789987/deployed_addresses.json b/ignition/deployments/chain-789987/deployed_addresses.json new file mode 100644 index 0000000..20c6c0a --- /dev/null +++ b/ignition/deployments/chain-789987/deployed_addresses.json @@ -0,0 +1,5 @@ +{ + "Token#TestToken": "0x34a22f3911De437307c6f4485931779670f78764", + "Verifier#Groth16Verifier": "0x1f60B2329775545AaeF743dbC3571e699405263e", + "Marketplace#Marketplace": "0xDB2908d724a15d05c0B6B8e8441a8b36E67476d3" +} diff --git a/ignition/modules/endian.js b/ignition/modules/endian.js new file mode 100644 index 0000000..e6247de --- /dev/null +++ b/ignition/modules/endian.js @@ -0,0 +1,9 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") + +module.exports = buildModule("Endian", (m) => { + const endian = m.contract("Endian", [], {}) + + const testEndian = m.contract("TestEndian", [], {}) + + return { endian, testEndian } +}) diff --git a/ignition/modules/marketplace.js b/ignition/modules/marketplace.js new file mode 100644 index 0000000..e0798eb --- /dev/null +++ b/ignition/modules/marketplace.js @@ -0,0 +1,43 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") +const { loadZkeyHash } = require("../../verifier/verifier.js") +const { loadConfiguration } = require("../../configuration/configuration.js") +const TokenModule = require("./token.js") +const VerifierModule = require("./verifier.js") + +function getDefaultConfig() { + const zkeyHash = loadZkeyHash(hre.network.name) + const config = loadConfiguration(hre.network.name) + config.proofs.zkeyHash = zkeyHash + return config +} + +module.exports = buildModule("Marketplace", (m) => { + const { token } = m.useModule(TokenModule) + const { verifier } = m.useModule(VerifierModule) + const configuration = m.getParameter("configuration", getDefaultConfig()) + + const marketplace = m.contract( + "Marketplace", + [configuration, token, verifier], + {}, + ) + + let testMarketplace + const config = hre.network.config + + if (config && config.tags && config.tags.includes("local")) { + const { testVerifier } = m.useModule(VerifierModule) + + testMarketplace = m.contract( + "TestMarketplace", + [configuration, token, testVerifier], + {}, + ) + } + + return { + marketplace, + testMarketplace, + token, + } +}) diff --git a/ignition/modules/periods.js b/ignition/modules/periods.js new file mode 100644 index 0000000..c3a352a --- /dev/null +++ b/ignition/modules/periods.js @@ -0,0 +1,9 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") + +module.exports = buildModule("Periods", (m) => { + const secondsPerPeriod = m.getParameter("secondsPerPeriod", 0) + + const periods = m.contract("Periods", [secondsPerPeriod], {}) + + return { periods } +}) diff --git a/ignition/modules/proofs.js b/ignition/modules/proofs.js new file mode 100644 index 0000000..bc71762 --- /dev/null +++ b/ignition/modules/proofs.js @@ -0,0 +1,11 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") +const VerifierModule = require("./verifier.js") + +module.exports = buildModule("Proofs", (m) => { + const { verifier } = m.useModule(VerifierModule) + const configuration = m.getParameter("configuration", null) + + const testProofs = m.contract("TestProofs", [configuration, verifier], {}) + + return { testProofs } +}) diff --git a/ignition/modules/slot-reservations.js b/ignition/modules/slot-reservations.js new file mode 100644 index 0000000..d795381 --- /dev/null +++ b/ignition/modules/slot-reservations.js @@ -0,0 +1,13 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") + +module.exports = buildModule("SlotReservations", (m) => { + const configuration = m.getParameter("configuration", null) + + const testSlotReservations = m.contract( + "TestSlotReservations", + [configuration], + {}, + ) + + return { testSlotReservations } +}) diff --git a/ignition/modules/token.js b/ignition/modules/token.js new file mode 100644 index 0000000..ed4348c --- /dev/null +++ b/ignition/modules/token.js @@ -0,0 +1,31 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") + +const MAX_ACCOUNTS = 20 +const MINTED_TOKENS = 1_000_000_000_000_000n + +module.exports = buildModule("Token", (m) => { + let token + + if (process.env.TOKEN_ADDRESS) { + console.log( + "Using existing TestToken on address: ", + process.env.TOKEN_ADDRESS, + ) + token = m.contractAt("TestToken", process.env.TOKEN_ADDRESS, {}) + } else { + token = m.contract("TestToken", [], {}) + } + + const config = hre.network.config + + if (config && config.tags && config.tags.includes("local")) { + for (let i = 0; i < MAX_ACCOUNTS; i++) { + const account = m.getAccount(i) + m.call(token, "mint", [account, MINTED_TOKENS], { + id: `SendingTestTokens_${i}`, + }) + } + } + + return { token } +}) diff --git a/ignition/modules/vault.js b/ignition/modules/vault.js new file mode 100644 index 0000000..9a35a73 --- /dev/null +++ b/ignition/modules/vault.js @@ -0,0 +1,10 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") +const TokenModule = require("./token.js") + +module.exports = buildModule("Vault", (m) => { + const { token } = m.useModule(TokenModule) + + const vault = m.contract("Vault", [token], {}) + + return { vault, token } +}) diff --git a/ignition/modules/verifier.js b/ignition/modules/verifier.js new file mode 100644 index 0000000..181e707 --- /dev/null +++ b/ignition/modules/verifier.js @@ -0,0 +1,11 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules") +const { loadVerificationKey } = require("../../verifier/verifier.js") + +module.exports = buildModule("Verifier", (m) => { + const verificationKey = loadVerificationKey(hre.network.name) + const verifier = m.contract("Groth16Verifier", [verificationKey], {}) + + const testVerifier = m.contract("TestVerifier", [], {}) + + return { verifier, testVerifier } +}) diff --git a/package-lock.json b/package-lock.json index 6861e63..da57f6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,27 +1,33 @@ { "name": "codex-contracts-eth", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codex-contracts-eth", "license": "MIT", "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.2.1", - "@nomiclabs/hardhat-waffle": "^2.0.3", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.8", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.11", + "@nomicfoundation/hardhat-toolbox": "^5.0.0", "@openzeppelin/contracts": "^5.3.0", - "@stdlib/stats-binomial-test": "^0.0.7", - "chai": "^4.3.7", - "ethereum-waffle": "^3.4.4", - "ethers": "^5.7.2", - "hardhat": "^2.24.2", - "hardhat-deploy": "^0.11.34", - "hardhat-deploy-ethers": "^0.3.0-beta.13", - "prettier": "^2.8.2", - "prettier-plugin-solidity": "^1.4.2", - "solhint": "^5.0.5" + "@stdlib/stats-binomial-test": "^0.2.2", + "chai": "^4.5.0", + "concurrently": "^9.1.2", + "ethers": "6.14.4", + "hardhat": "^2.24.3", + "prettier": "^3.5.3", + "prettier-plugin-solidity": "^1.4.3", + "solhint": "^5.1.0" } }, + "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, + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -45,245 +51,18 @@ "node": ">=6.9.0" } }, - "node_modules/@ensdomains/ens": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@ensdomains/ens/-/ens-0.4.5.tgz", - "integrity": "sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==", - "deprecated": "Please use @ensdomains/ens-contracts", + "node_modules/@cspotcode/source-map-support": { + "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, + "license": "MIT", + "peer": true, "dependencies": { - "bluebird": "^3.5.2", - "eth-ens-namehash": "^2.0.8", - "solc": "^0.4.20", - "testrpc": "0.0.1", - "web3-utils": "^1.0.0-beta.31" - } - }, - "node_modules/@ensdomains/ens/node_modules/camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@ensdomains/ens/node_modules/cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "node_modules/@ensdomains/ens/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@ensdomains/ens/node_modules/fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "node_modules/@ensdomains/ens/node_modules/get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "node_modules/@ensdomains/ens/node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/@ensdomains/ens/node_modules/require-from-string": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@ensdomains/ens/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/@ensdomains/ens/node_modules/solc": { - "version": "0.4.26", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.26.tgz", - "integrity": "sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==", - "dev": true, - "dependencies": { - "fs-extra": "^0.30.0", - "memorystream": "^0.3.1", - "require-from-string": "^1.1.0", - "semver": "^5.3.0", - "yargs": "^4.7.1" - }, - "bin": { - "solcjs": "solcjs" - } - }, - "node_modules/@ensdomains/ens/node_modules/wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "dev": true, - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/@ensdomains/ens/node_modules/y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, - "node_modules/@ensdomains/ens/node_modules/yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", - "dev": true, - "dependencies": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "node_modules/@ensdomains/ens/node_modules/yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", - "dev": true, - "dependencies": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - }, - "node_modules/@ensdomains/resolver": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@ensdomains/resolver/-/resolver-0.2.4.tgz", - "integrity": "sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==", - "deprecated": "Please use @ensdomains/ens-contracts", - "dev": true - }, - "node_modules/@ethereum-waffle/chai": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/chai/-/chai-3.4.4.tgz", - "integrity": "sha512-/K8czydBtXXkcM9X6q29EqEkc5dN3oYenyH2a9hF7rGAApAJUpH8QBtojxOY/xQ2up5W332jqgxwp0yPiYug1g==", - "dev": true, - "dependencies": { - "@ethereum-waffle/provider": "^3.4.4", - "ethers": "^5.5.2" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/@ethereum-waffle/compiler": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/compiler/-/compiler-3.4.4.tgz", - "integrity": "sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ==", - "dev": true, - "dependencies": { - "@resolver-engine/imports": "^0.3.3", - "@resolver-engine/imports-fs": "^0.3.3", - "@typechain/ethers-v5": "^2.0.0", - "@types/mkdirp": "^0.5.2", - "@types/node-fetch": "^2.5.5", - "ethers": "^5.0.1", - "mkdirp": "^0.5.1", - "node-fetch": "^2.6.1", - "solc": "^0.6.3", - "ts-generator": "^0.1.1", - "typechain": "^3.0.0" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/@ethereum-waffle/ens": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/ens/-/ens-3.4.4.tgz", - "integrity": "sha512-0m4NdwWxliy3heBYva1Wr4WbJKLnwXizmy5FfSSr5PMbjI7SIGCdCB59U7/ZzY773/hY3bLnzLwvG5mggVjJWg==", - "dev": true, - "dependencies": { - "@ensdomains/ens": "^0.4.4", - "@ensdomains/resolver": "^0.2.4", - "ethers": "^5.5.2" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/@ethereum-waffle/mock-contract": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/mock-contract/-/mock-contract-3.4.4.tgz", - "integrity": "sha512-Mp0iB2YNWYGUV+VMl5tjPsaXKbKo8MDH9wSJ702l9EBjdxFf/vBvnMBAC1Fub1lLtmD0JHtp1pq+mWzg/xlLnA==", - "dev": true, - "dependencies": { - "@ethersproject/abi": "^5.5.0", - "ethers": "^5.5.2" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/@ethereum-waffle/provider": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-3.4.4.tgz", - "integrity": "sha512-GK8oKJAM8+PKy2nK08yDgl4A80mFuI8zBkE0C9GqTRYQqvuxIyXoLmJ5NZU9lIwyWVv5/KsoA11BgAv2jXE82g==", - "dev": true, - "dependencies": { - "@ethereum-waffle/ens": "^3.4.4", - "ethers": "^5.5.2", - "ganache-core": "^2.13.2", - "patch-package": "^6.2.2", - "postinstall-postinstall": "^2.1.0" - }, - "engines": { - "node": ">=10.0" + "node": ">=12" } }, "node_modules/@ethereumjs/rlp": { @@ -375,9 +154,9 @@ } }, "node_modules/@ethersproject/abi": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", - "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.8.0.tgz", + "integrity": "sha512-b9YS/43ObplgyV6SlyQsG53/vkSal0MNA1fskSC4mbnCMi8R+NkcH8K9FPYNESf6jUefBUniE4SOKms0E/KK1Q==", "dev": true, "funding": [ { @@ -389,22 +168,23 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@ethersproject/abstract-provider": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", - "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.8.0.tgz", + "integrity": "sha512-wC9SFcmh4UK0oKuLJQItoQdzS/qZ51EJegK6EmAWlh+OptpQ/npECOR3QqECd8iGHC0RJb4WKbVdSfif4ammrg==", "dev": true, "funding": [ { @@ -416,20 +196,21 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/networks": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/web": "^5.8.0" } }, "node_modules/@ethersproject/abstract-signer": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", - "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.8.0.tgz", + "integrity": "sha512-N0XhZTswXcmIZQdYtUnd79VJzvEwXQw6PK0dTl9VoYrEBxxCPXqS0Eod7q5TNKRxe1/5WUMuR0u0nqTF/avdCA==", "dev": true, "funding": [ { @@ -441,18 +222,19 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0" + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0" } }, "node_modules/@ethersproject/address": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", - "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.8.0.tgz", + "integrity": "sha512-GhH/abcC46LJwshoN+uBNoKVFPxUuZm6dA257z0vZkKmU1+t8xTn8oK7B9qrj8W2rFRMch4gbJl6PmVxjxBEBA==", "dev": true, "funding": [ { @@ -464,18 +246,19 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/rlp": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/rlp": "^5.8.0" } }, "node_modules/@ethersproject/base64": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", - "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.8.0.tgz", + "integrity": "sha512-lN0oIwfkYj9LbPx4xEkie6rAMJtySbpOAFXSDVQaBnAzYfB4X2Qr+FXJGxMoc3Bxp2Sm8OwvzMrywxyw0gLjIQ==", "dev": true, "funding": [ { @@ -487,14 +270,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0" + "@ethersproject/bytes": "^5.8.0" } }, "node_modules/@ethersproject/basex": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", - "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.8.0.tgz", + "integrity": "sha512-PIgTszMlDRmNwW9nhS6iqtVfdTAKosA7llYXNmGPw4YAI1PUyMv28988wAb41/gHF/WqGdoLv0erHaRcHRKW2Q==", "dev": true, "funding": [ { @@ -506,15 +290,17 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/properties": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/properties": "^5.8.0" } }, "node_modules/@ethersproject/bignumber": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", - "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.8.0.tgz", + "integrity": "sha512-ZyaT24bHaSeJon2tGPKIiHszWjD/54Sz8t57Toch475lCLljC6MgPmxk7Gtzz+ddNN5LuHea9qhAe0x3D+uYPA==", "dev": true, "funding": [ { @@ -526,16 +312,17 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", "bn.js": "^5.2.1" } }, "node_modules/@ethersproject/bytes": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", - "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.8.0.tgz", + "integrity": "sha512-vTkeohgJVCPVHu5c25XWaWQOZ4v+DkGoC42/TS2ond+PARCxTJvgTFUNDZovyQ/uAQ4EcpqqowKydcdmRKjg7A==", "dev": true, "funding": [ { @@ -547,14 +334,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/constants": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", - "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.8.0.tgz", + "integrity": "sha512-wigX4lrf5Vu+axVTIvNsuL6YrV4O5AXl5ubcURKMEME5TnWBouUh0CDTWxZ2GpnRn1kcCgE7l8O5+VbV9QTTcg==", "dev": true, "funding": [ { @@ -566,14 +354,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bignumber": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0" } }, "node_modules/@ethersproject/contracts": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", - "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.8.0.tgz", + "integrity": "sha512-0eFjGz9GtuAi6MZwhb4uvUM216F38xiuR0yYCjKJpNfSEy4HUM8hvqqBj9Jmm0IUz8l0xKEhWwLIhPgxNY0yvQ==", "dev": true, "funding": [ { @@ -585,23 +374,25 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0" + "@ethersproject/abi": "^5.8.0", + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/transactions": "^5.8.0" } }, "node_modules/@ethersproject/hash": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", - "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.8.0.tgz", + "integrity": "sha512-ac/lBcTbEWW/VGJij0CNSw/wPcw9bSRgCB0AIBz8CvED/jfvDoV9hsIIiWfvWmFEi8RcXtlNwp2jv6ozWOsooA==", "dev": true, "funding": [ { @@ -613,22 +404,23 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/base64": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@ethersproject/hdnode": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", - "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.8.0.tgz", + "integrity": "sha512-4bK1VF6E83/3/Im0ERnnUeWOY3P1BZml4ZD3wcH8Ys0/d1h1xaFt6Zc+Dh9zXf9TapGro0T4wvO71UTCp3/uoA==", "dev": true, "funding": [ { @@ -640,25 +432,27 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/basex": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/pbkdf2": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/wordlists": "^5.8.0" } }, "node_modules/@ethersproject/json-wallets": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", - "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.8.0.tgz", + "integrity": "sha512-HxblNck8FVUtNxS3VTEYJAcwiKYsBIF77W15HufqlBF9gGfhmYOJtYZp8fSDZtn9y5EaXTE87zDwzxRoTFk11w==", "dev": true, "funding": [ { @@ -670,26 +464,28 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hdnode": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/pbkdf2": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" } }, "node_modules/@ethersproject/keccak256": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", - "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.8.0.tgz", + "integrity": "sha512-A1pkKLZSz8pDaQ1ftutZoaN46I6+jvuqugx5KYNeQOPqq+JZ0Txm7dlWesCHB5cndJSu5vP2VKptKf7cksERng==", "dev": true, "funding": [ { @@ -701,31 +497,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", "js-sha3": "0.8.0" } }, "node_modules/@ethersproject/logger": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ] - }, - "node_modules/@ethersproject/networks": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", - "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.8.0.tgz", + "integrity": "sha512-Qe6knGmY+zPPWTC+wQrpitodgBfH7XoceCGL5bJVejmH+yCS3R8jJm8iiWuvWbG76RUmyEG53oqv6GMVWqunjA==", "dev": true, "funding": [ { @@ -737,14 +518,32 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT" + }, + "node_modules/@ethersproject/networks": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.8.0.tgz", + "integrity": "sha512-egPJh3aPVAzbHwq8DD7Po53J4OUSsA1MjQp8Vf/OZPav5rlmWUaFLiq8cvQiGK0Z5K6LYzm29+VA/p4RL1FzNg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/pbkdf2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", - "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.8.0.tgz", + "integrity": "sha512-wuHiv97BrzCmfEaPbUFpMjlVg/IDkZThp9Ri88BpjRleg4iePJaj2SW8AIyE8cXn5V1tuAaMj6lzvsGJkGWskg==", "dev": true, "funding": [ { @@ -756,15 +555,17 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/sha2": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/sha2": "^5.8.0" } }, "node_modules/@ethersproject/properties": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", - "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.8.0.tgz", + "integrity": "sha512-PYuiEoQ+FMaZZNGrStmN7+lWjlsoufGIHdww7454FIaGdbe/p5rnaCXTr5MtBYl3NkeoVhHZuyzChPeGeKIpQw==", "dev": true, "funding": [ { @@ -776,14 +577,15 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/logger": "^5.7.0" + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/providers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", - "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.8.0.tgz", + "integrity": "sha512-3Il3oTzEx3o6kzcg9ZzbE+oCZYyY+3Zh83sKkn4s1DZfTUjIegHnN2Cm0kbn9YFy45FDVcuCLLONhU7ny0SsCw==", "dev": true, "funding": [ { @@ -795,33 +597,58 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0", + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/base64": "^5.8.0", + "@ethersproject/basex": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/networks": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/rlp": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/strings": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/web": "^5.8.0", "bech32": "1.1.4", - "ws": "7.4.6" + "ws": "8.18.0" + } + }, + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/@ethersproject/random": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", - "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.8.0.tgz", + "integrity": "sha512-E4I5TDl7SVqyg4/kkA/qTfuLWAQGXmSOgYyO01So8hLfwgKvYK5snIlzxJMk72IFdG/7oh8yuSqY2KX7MMwg+A==", "dev": true, "funding": [ { @@ -833,15 +660,17 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/rlp": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", - "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.8.0.tgz", + "integrity": "sha512-LqZgAznqDbiEunaUvykH2JAoXTT9NV0Atqk8rQN9nx9SEgThA/WMx5DnW8a9FOufo//6FZOCHZ+XiClzgbqV9Q==", "dev": true, "funding": [ { @@ -853,15 +682,16 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/sha2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", - "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.8.0.tgz", + "integrity": "sha512-dDOUrXr9wF/YFltgTBYS0tKslPEKr6AekjqDW2dbn1L1xmjGR+9GiKu4ajxovnrDbwxAKdHjW8jNcwfz8PAz4A==", "dev": true, "funding": [ { @@ -873,16 +703,18 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/signing-key": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", - "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.8.0.tgz", + "integrity": "sha512-LrPW2ZxoigFi6U6aVkFN/fa9Yx/+4AtIUe4/HACTvKJdhm0eeb107EVCIQcrLZkxaSIgc/eCrX8Q1GtbH+9n3w==", "dev": true, "funding": [ { @@ -894,19 +726,20 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", "bn.js": "^5.2.1", - "elliptic": "6.5.4", + "elliptic": "6.6.1", "hash.js": "1.1.7" } }, "node_modules/@ethersproject/solidity": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", - "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.8.0.tgz", + "integrity": "sha512-4CxFeCgmIWamOHwYN9d+QWGxye9qQLilpgTU0XhYs1OahkclF+ewO+3V1U0mvpiuQxm5EHHmv8f7ClVII8EHsA==", "dev": true, "funding": [ { @@ -918,19 +751,21 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/sha2": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@ethersproject/strings": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", - "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.8.0.tgz", + "integrity": "sha512-qWEAk0MAvl0LszjdfnZ2uC8xbR2wdv4cDabyHiBh3Cldq/T8dPH3V4BbBsAYJUeonwD+8afVXld274Ls+Y1xXg==", "dev": true, "funding": [ { @@ -942,16 +777,17 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/transactions": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", - "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.8.0.tgz", + "integrity": "sha512-UglxSDjByHG0TuU17bDfCemZ3AnKO2vYrL5/2n2oXvKzvb7Cz+W9gOWXKARjp2URVwcWlQlPOEQyAviKwT4AHg==", "dev": true, "funding": [ { @@ -963,22 +799,23 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0" + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/rlp": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0" } }, "node_modules/@ethersproject/units": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", - "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.8.0.tgz", + "integrity": "sha512-lxq0CAnc5kMGIiWW4Mr041VT8IhNM+Pn5T3haO74XZWFulk7wH1Gv64HqE96hT4a7iiNMdOCFEBgaxWuk8ETKQ==", "dev": true, "funding": [ { @@ -990,16 +827,18 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/constants": "^5.8.0", + "@ethersproject/logger": "^5.8.0" } }, "node_modules/@ethersproject/wallet": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", - "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.8.0.tgz", + "integrity": "sha512-G+jnzmgg6UxurVKRKvw27h0kvG75YKXZKdlLYmAHeF32TGUzHkOFd7Zn6QHOTYRFWnfjtSSFjBowKo7vfrXzPA==", "dev": true, "funding": [ { @@ -1011,28 +850,30 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/json-wallets": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" + "@ethersproject/abstract-provider": "^5.8.0", + "@ethersproject/abstract-signer": "^5.8.0", + "@ethersproject/address": "^5.8.0", + "@ethersproject/bignumber": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/hdnode": "^5.8.0", + "@ethersproject/json-wallets": "^5.8.0", + "@ethersproject/keccak256": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/random": "^5.8.0", + "@ethersproject/signing-key": "^5.8.0", + "@ethersproject/transactions": "^5.8.0", + "@ethersproject/wordlists": "^5.8.0" } }, "node_modules/@ethersproject/web": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", - "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.8.0.tgz", + "integrity": "sha512-j7+Ksi/9KfGviws6Qtf9Q7KCqRhpwrYKQPs+JBA/rKVFF/yaWLHJEH3zfVP2plVu+eys0d2DlFmhoQJayFewcw==", "dev": true, "funding": [ { @@ -1044,18 +885,19 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/base64": "^5.8.0", + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" } }, "node_modules/@ethersproject/wordlists": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", - "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.8.0.tgz", + "integrity": "sha512-2df9bbXicZws2Sb5S6ET493uJ0Z84Fjr3pC4tu/qlnZERibZCeUVuqdtt+7Tv9xxhUxHoIekIA7avrKUWHrezg==", "dev": true, "funding": [ { @@ -1067,12 +909,55 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" + "@ethersproject/bytes": "^5.8.0", + "@ethersproject/hash": "^5.8.0", + "@ethersproject/logger": "^5.8.0", + "@ethersproject/properties": "^5.8.0", + "@ethersproject/strings": "^5.8.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@noble/curves": { @@ -1126,292 +1011,603 @@ } ] }, - "node_modules/@nomicfoundation/edr": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.11.0.tgz", - "integrity": "sha512-36WERf8ldvyHR6UAbcYsa+vpbW7tCrJGBwF4gXSsb8+STj1n66Hz85Y/O7B9+8AauX3PhglvV5dKl91tk43mWw==", + "node_modules/@nodelib/fs.scandir": { + "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, + "license": "MIT", + "peer": true, "dependencies": { - "@nomicfoundation/edr-darwin-arm64": "0.11.0", - "@nomicfoundation/edr-darwin-x64": "0.11.0", - "@nomicfoundation/edr-linux-arm64-gnu": "0.11.0", - "@nomicfoundation/edr-linux-arm64-musl": "0.11.0", - "@nomicfoundation/edr-linux-x64-gnu": "0.11.0", - "@nomicfoundation/edr-linux-x64-musl": "0.11.0", - "@nomicfoundation/edr-win32-x64-msvc": "0.11.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nomicfoundation/edr": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.11.1.tgz", + "integrity": "sha512-P97XwcD9DdMMZm9aqw89+mzqzlKmqzSPM3feBES2WVRm5/LOiBYorhpeAX+ANj0X8532SKgxoZK/CN5OWv9vZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nomicfoundation/edr-darwin-arm64": "0.11.1", + "@nomicfoundation/edr-darwin-x64": "0.11.1", + "@nomicfoundation/edr-linux-arm64-gnu": "0.11.1", + "@nomicfoundation/edr-linux-arm64-musl": "0.11.1", + "@nomicfoundation/edr-linux-x64-gnu": "0.11.1", + "@nomicfoundation/edr-linux-x64-musl": "0.11.1", + "@nomicfoundation/edr-win32-x64-msvc": "0.11.1" }, "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-darwin-arm64": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.11.0.tgz", - "integrity": "sha512-aYTVdcSs27XG7ayTzvZ4Yn9z/ABSaUwicrtrYK2NR8IH0ik4N4bWzo/qH8rax6rewVLbHUkGyGYnsy5ZN4iiMw==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.11.1.tgz", + "integrity": "sha512-vjca7gkl1o0yYqMjwxQpMEtdsb20nWHBnnxDO8ZBCTD5IwfYT5LiMxFaJo8NUJ7ODIRkF/zuEtAF3W7+ZlC5RA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-darwin-x64": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.11.0.tgz", - "integrity": "sha512-RxX7UYgvJrfcyT/uHUn44Nsy1XaoW+Q1khKMdHKxeW7BrgIi+Lz+siz3bX5vhSoAnKilDPhIVLrnC8zxQhjR2A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.11.1.tgz", + "integrity": "sha512-0aGStHq9XePXX9UqdU1w60HGO9AfYCgkNEir5sBpntU5E0TvZEK6jwyYr667+s90n2mihdeP97QSA0O/6PT6PA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-arm64-gnu": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.11.0.tgz", - "integrity": "sha512-J0j+rs0s11FuSipt/ymqrFmpJ7c0FSz1/+FohCIlUXDxFv//+1R/8lkGPjEYFmy8DPpk/iO8mcpqHTGckREbqA==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.11.1.tgz", + "integrity": "sha512-OWhCETc03PVdtzatW/c2tpOPx+GxlBfBaLmMuGRD1soAr1nMOmg2WZAlo4i6Up9fkQYl+paiYMMFVat1meaMvQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-arm64-musl": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.11.0.tgz", - "integrity": "sha512-4r32zkGMN7WT/CMEuW0VjbuEdIeCskHNDMW4SSgQSJOE/N9L1KSLJCSsAbPD3aYE+e4WRDTyOwmuLjeUTcLZKQ==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.11.1.tgz", + "integrity": "sha512-p0qvtIvDA2eZ8pQ5XUKnWdW1IrwFzSrjyrO88oYx6Lkw8nYwf2JEeETo5o5W84DDfimfoBGP7RWPTPcTBKCaLQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-x64-gnu": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.11.0.tgz", - "integrity": "sha512-SmdncQHLYtVNWLIMyGaY6LpAfamzTDe3fxjkirmJv3CWR5tcEyC6LMui/GsIVnJzXeNJBXAzwl8hTUAxHTM6kQ==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.11.1.tgz", + "integrity": "sha512-V4Us7Q0E8kng3O/czd5GRcxmZxWX+USgqz9yQ3o7DVq7FP96idaKvtcbMQp64tjHf2zNtX2y77sGzgbVau7Bww==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-linux-x64-musl": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.11.0.tgz", - "integrity": "sha512-w6hUqpn/trwiH6SRuRGysj37LsQVCX5XDCA3Xi81sbOaLhbHrNvK9TXWyZmcuzbdTKQQW6VNywcSxDdOiChcJg==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.11.1.tgz", + "integrity": "sha512-lCSXsF10Kjjvs5duGbM6pi1WciWHXFNWkMgDAY4pg6ZRIy4gh+uGC6CONMfP4BDZwfrALo2p6+LwyotrJEqpyg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, "node_modules/@nomicfoundation/edr-win32-x64-msvc": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.11.0.tgz", - "integrity": "sha512-BLmULjRKoH9BsX+c4Na2ypV7NGeJ+M6Zpqj/faPOwleVscDdSr/IhriyPaXCe8dyfwbge7lWsbekiADtPSnB2Q==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.11.1.tgz", + "integrity": "sha512-sNSmmRTURAd1sdKuyO5tqrFiJvHHVPZLM4HB53F21makGoyInFGhejdo3qZrkoinM8k0ewEJDbUp0YuMEgMOhQ==", "dev": true, + "license": "MIT", "engines": { "node": ">= 18" } }, - "node_modules/@nomicfoundation/solidity-analyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.0.tgz", - "integrity": "sha512-xGWAiVCGOycvGiP/qrlf9f9eOn7fpNbyJygcB0P21a1MDuVPlKt0Srp7rvtBEutYQ48ouYnRXm33zlRnlTOPHg==", + "node_modules/@nomicfoundation/hardhat-chai-matchers": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.9.tgz", + "integrity": "sha512-AbCoBuTKMlwlf1lesSmi/4VvJHNG9EP13EmkCJ+MJS1SBdtVtU4YrBbdYmnYPEvRFcAIMFB/cwcQGmuBYeCoVg==", "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai-as-promised": "^7.1.3", + "chai-as-promised": "^7.1.1", + "deep-eql": "^4.0.1", + "ordinal": "^1.0.3" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.9", + "chai": "^4.2.0", + "ethers": "^6.14.0", + "hardhat": "^2.9.4" + } + }, + "node_modules/@nomicfoundation/hardhat-ethers": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.9.tgz", + "integrity": "sha512-xBJdRUiCwKpr0OYrOzPwAyNGtsVzoBx32HFPJVv6S+sFA9TmBIBDaqNlFPmBH58ZjgNnGhEr/4oBZvGr4q4TjQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "lodash.isequal": "^4.5.0" + }, + "peerDependencies": { + "ethers": "^6.14.0", + "hardhat": "^2.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition": { + "version": "0.15.11", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.11.tgz", + "integrity": "sha512-OXebmK9FCMwwbb4mIeHBbVFFicAGgyGKJT2zrONrpixrROxrVs6KEi1gzsiN25qtQhCQePt8BTjjYrgy86Dfxg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nomicfoundation/ignition-core": "^0.15.11", + "@nomicfoundation/ignition-ui": "^0.15.11", + "chalk": "^4.0.0", + "debug": "^4.3.2", + "fs-extra": "^10.0.0", + "json5": "^2.2.3", + "prompts": "^2.4.2" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-verify": "^2.0.1", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition-ethers": { + "version": "0.15.12", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.12.tgz", + "integrity": "sha512-YEqjtrrMkGNXCFJKNrWgqtLmFSiOXDiEWiKup+yqonCzps1B/e9zg4ezRP5feiKUOIxblD6isCDKtQKu7iY6XA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.9", + "@nomicfoundation/hardhat-ignition": "^0.15.11", + "@nomicfoundation/ignition-core": "^0.15.11", + "ethers": "^6.14.0", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@nomicfoundation/hardhat-ignition/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", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "ethereumjs-util": "^7.1.4" + }, + "peerDependencies": { + "hardhat": "^2.9.5" + } + }, + "node_modules/@nomicfoundation/hardhat-toolbox": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz", + "integrity": "sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.0", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.0", + "@typechain/ethers-v6": "^0.5.0", + "@typechain/hardhat": "^9.0.0", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=18.0.0", + "chai": "^4.2.0", + "ethers": "^6.4.0", + "hardhat": "^2.11.0", + "hardhat-gas-reporter": "^1.0.8", + "solidity-coverage": "^0.8.1", + "ts-node": ">=8.0.0", + "typechain": "^8.3.0", + "typescript": ">=4.5.0" + } + }, + "node_modules/@nomicfoundation/hardhat-verify": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.14.tgz", + "integrity": "sha512-z3iVF1WYZHzcdMMUuureFpSAfcnlfJbJx3faOnGrOYg6PRTki1Ut9JAuRccnFzMHf1AmTEoSUpWcyvBCoxL5Rg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@ethersproject/address": "^5.0.2", + "cbor": "^8.1.0", + "debug": "^4.1.1", + "lodash.clonedeep": "^4.5.0", + "picocolors": "^1.1.0", + "semver": "^6.3.0", + "table": "^6.8.0", + "undici": "^5.14.0" + }, + "peerDependencies": { + "hardhat": "^2.24.1" + } + }, + "node_modules/@nomicfoundation/hardhat-verify/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@nomicfoundation/ignition-core": { + "version": "0.15.11", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.11.tgz", + "integrity": "sha512-PeYKRlrQ0koT72yRnlyyG66cXMFiv5X/cIB8hBFPl3ekeg5tPXcHAgs/VZhOsgwEox4ejphTtItLESb1IDBw0w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/address": "5.6.1", + "@nomicfoundation/solidity-analyzer": "^0.1.1", + "cbor": "^9.0.0", + "debug": "^4.3.2", + "ethers": "^6.7.0", + "fs-extra": "^10.0.0", + "immer": "10.0.2", + "lodash": "4.17.21", + "ndjson": "2.0.0" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/@ethersproject/address": { + "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", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.1" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/cbor": { + "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", + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@nomicfoundation/ignition-core/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", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@nomicfoundation/ignition-ui": { + "version": "0.15.11", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.11.tgz", + "integrity": "sha512-VPOVl5xqCKhYCyPOQlposx+stjCwqXQ+BCs5lnw/f2YUfgII+G5Ye0JfHiJOfCJGmqyS03WertBslcj9zQg50A==", + "dev": true, + "peer": true + }, + "node_modules/@nomicfoundation/solidity-analyzer": { + "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, + "license": "MIT", "engines": { "node": ">= 12" }, "optionalDependencies": { - "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.0", - "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.0", - "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.0" + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.2", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.2" } }, "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.0.tgz", - "integrity": "sha512-vEF3yKuuzfMHsZecHQcnkUrqm8mnTWfJeEVFHpg+cO+le96xQA4lAJYdUan8pXZohQxv1fSReQsn4QGNuBNuCw==", - "cpu": [ - "arm64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.0.tgz", - "integrity": "sha512-dlHeIg0pTL4dB1l9JDwbi/JG6dHQaU1xpDK+ugYO8eJ1kxx9Dh2isEUtA4d02cQAl22cjOHTvifAk96A+ItEHA==", - "cpu": [ - "x64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-freebsd-x64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.0.tgz", - "integrity": "sha512-WFCZYMv86WowDA4GiJKnebMQRt3kCcFqHeIomW6NMyqiKqhK1kIZCxSLDYsxqlx396kKLPN1713Q1S8tu68GKg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.0.tgz", - "integrity": "sha512-DTw6MNQWWlCgc71Pq7CEhEqkb7fZnS7oly13pujs4cMH1sR0JzNk90Mp1zpSCsCs4oKan2ClhMlLKtNat/XRKQ==", - "cpu": [ - "arm64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.0.tgz", - "integrity": "sha512-wUpUnR/3GV5Da88MhrxXh/lhb9kxh9V3Jya2NpBEhKDIRCDmtXMSqPMXHZmOR9DfCwCvG6vLFPr/+YrPCnUN0w==", - "cpu": [ - "arm64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.0.tgz", - "integrity": "sha512-lR0AxK1x/MeKQ/3Pt923kPvwigmGX3OxeU5qNtQ9pj9iucgk4PzhbS3ruUeSpYhUxG50jN4RkIGwUMoev5lguw==", - "cpu": [ - "x64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.0.tgz", - "integrity": "sha512-A1he/8gy/JeBD3FKvmI6WUJrGrI5uWJNr5Xb9WdV+DK0F8msuOqpEByLlnTdLkXMwW7nSl3awvLezOs9xBHJEg==", - "cpu": [ - "x64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.0.tgz", - "integrity": "sha512-7x5SXZ9R9H4SluJZZP8XPN+ju7Mx+XeUMWZw7ZAqkdhP5mK19I4vz3x0zIWygmfE8RT7uQ5xMap0/9NPsO+ykw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.0.tgz", - "integrity": "sha512-m7w3xf+hnE774YRXu+2mGV7RiF3QJtUoiYU61FascCkQhX3QMQavh7saH/vzb2jN5D24nT/jwvaHYX/MAM9zUw==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10" + "node": ">= 12" } }, "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.0.tgz", - "integrity": "sha512-xCuybjY0sLJQnJhupiFAXaek2EqF0AP0eBjgzaalPXSNvCEN6ZYHvUzdA50ENDVeSYFXcUsYf3+FsD3XKaeptA==", - "cpu": [ - "x64" - ], + "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, + "license": "MIT", "optional": true, - "os": [ - "win32" - ], "engines": { - "node": ">= 10" - } - }, - "node_modules/@nomiclabs/hardhat-ethers": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz", - "integrity": "sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg==", - "dev": true, - "peerDependencies": { - "ethers": "^5.0.0", - "hardhat": "^2.0.0" - } - }, - "node_modules/@nomiclabs/hardhat-waffle": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.3.tgz", - "integrity": "sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg==", - "dev": true, - "dependencies": { - "@types/sinon-chai": "^3.2.3", - "@types/web3": "1.0.19" - }, - "peerDependencies": { - "@nomiclabs/hardhat-ethers": "^2.0.0", - "ethereum-waffle": "^3.2.0", - "ethers": "^5.0.0", - "hardhat": "^2.0.0" + "node": ">= 12" } }, "node_modules/@openzeppelin/contracts": { @@ -1456,51 +1652,6 @@ "node": ">=12" } }, - "node_modules/@resolver-engine/core": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", - "integrity": "sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ==", - "dev": true, - "dependencies": { - "debug": "^3.1.0", - "is-url": "^1.2.4", - "request": "^2.85.0" - } - }, - "node_modules/@resolver-engine/fs": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/fs/-/fs-0.3.3.tgz", - "integrity": "sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ==", - "dev": true, - "dependencies": { - "@resolver-engine/core": "^0.3.3", - "debug": "^3.1.0" - } - }, - "node_modules/@resolver-engine/imports": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/imports/-/imports-0.3.3.tgz", - "integrity": "sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==", - "dev": true, - "dependencies": { - "@resolver-engine/core": "^0.3.3", - "debug": "^3.1.0", - "hosted-git-info": "^2.6.0", - "path-browserify": "^1.0.0", - "url": "^0.11.0" - } - }, - "node_modules/@resolver-engine/imports-fs": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz", - "integrity": "sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA==", - "dev": true, - "dependencies": { - "@resolver-engine/fs": "^0.3.3", - "@resolver-engine/imports": "^0.3.3", - "debug": "^3.1.0" - } - }, "node_modules/@scure/base": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", @@ -1658,16 +1809,18 @@ } }, "node_modules/@solidity-parser/parser": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.19.0.tgz", - "integrity": "sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==", - "dev": true + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.20.1.tgz", + "integrity": "sha512-58I2sRpzaQUN+jJmWbHfbWf9AKfzqCI8JAdFB0vbyY+u8tBRcuTt9LxzasvR0LGQpcRv97eyV7l61FQ3Ib7zVw==", + "dev": true, + "license": "MIT" }, "node_modules/@stdlib/array-base-filled": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@stdlib/array-base-filled/-/array-base-filled-0.0.2.tgz", - "integrity": "sha512-X/beQFsIJy2KfLfkxm/F+hMr8esrxbHwPLu+9jBBvN5iGAAb+AMRVunXWdMV02DT12Q/M0vPcMGT1Yd3nJjEaw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-base-filled/-/array-base-filled-0.2.2.tgz", + "integrity": "sha512-T7nB7dni5Y4/nsq6Gc1bAhYfzJbcOdqsmVZJUI698xpDbhCdVCIIaEbf0PnDMGN24psN+5mgAVmnNBom+uF0Xg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1684,15 +1837,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-base-zeros": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@stdlib/array-base-zeros/-/array-base-zeros-0.0.2.tgz", - "integrity": "sha512-Ga4qR5l6RRssonfEMa2YwGd0gGyQXqZQeifirXs8CYmQk/x3n2wMrNgPeSn0RPbLIKWlL8NpSnnx6hSeEPtRRQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-base-zeros/-/array-base-zeros-0.2.2.tgz", + "integrity": "sha512-iwxqaEtpi4c2qpqabmhFdaQGkzgo5COwjHPn2T0S0wfJuM1VuVl5UBl15syr+MmZPJQOB1eBbh6F1uTh9597qw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1705,22 +1859,23 @@ "windows" ], "dependencies": { - "@stdlib/array-base-filled": "^0.0.x" + "@stdlib/array-base-filled": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-float32": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-float32/-/array-float32-0.0.6.tgz", - "integrity": "sha512-QgKT5UaE92Rv7cxfn7wBKZAlwFFHPla8eXsMFsTGt5BiL4yUy36lwinPUh4hzybZ11rw1vifS3VAPuk6JP413Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-float32/-/array-float32-0.2.2.tgz", + "integrity": "sha512-pTcy1FNQrrJLL1LMxJjuVpcKJaibbGCFFTe41iCSXpSOC8SuTBuNohrO6K9+xR301Ruxxn4yrzjJJ6Fa3nQJ2g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1733,22 +1888,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-float32array-support": "^0.0.x" + "@stdlib/assert-has-float32array-support": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-float64": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-float64/-/array-float64-0.0.6.tgz", - "integrity": "sha512-oE8y4a84LyBF1goX5//sU1mOjet8gLI0/6wucZcjg+j/yMmNV1xFu84Az9GOGmFSE6Ze6lirGOhfBeEWNNNaJg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-float64/-/array-float64-0.2.2.tgz", + "integrity": "sha512-ZmV5wcacGrhT0maw9dfLXNv4N3ZwFUV3D7ItFfZFGFnKIJbubrWzwtaYnxzIXigrDc8g3F6FVHRpsQLMxq0/lA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1761,22 +1917,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-float64array-support": "^0.0.x" + "@stdlib/assert-has-float64array-support": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-uint16": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint16/-/array-uint16-0.0.6.tgz", - "integrity": "sha512-/A8Tr0CqJ4XScIDRYQawosko8ha1Uy+50wsTgJhjUtXDpPRp7aUjmxvYkbe7Rm+ImYYbDQVix/uCiPAFQ8ed4Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-uint16/-/array-uint16-0.2.2.tgz", + "integrity": "sha512-z5c/Izw43HkKfb1pTgEUMAS8GFvhtHkkHZSjX3XJN+17P0VjknxjlSvPiCBGqaDX9jXtlWH3mn1LSyDKtJQoeA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1789,22 +1946,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-uint16array-support": "^0.0.x" + "@stdlib/assert-has-uint16array-support": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-uint32": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint32/-/array-uint32-0.0.6.tgz", - "integrity": "sha512-2hFPK1Fg7obYPZWlGDjW9keiIB6lXaM9dKmJubg/ergLQCsJQJZpYsG6mMAfTJi4NT1UF4jTmgvyKD+yf0D9cA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-uint32/-/array-uint32-0.2.2.tgz", + "integrity": "sha512-3T894I9C2MqZJJmRCYFTuJp4Qw9RAt+GzYnVPyIXoK1h3TepUXe9VIVx50cUFIibdXycgu0IFGASeAb3YMyupw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1817,22 +1975,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-uint32array-support": "^0.0.x" + "@stdlib/assert-has-uint32array-support": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/array-uint8": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint8/-/array-uint8-0.0.7.tgz", - "integrity": "sha512-qYJQQfGKIcky6TzHFIGczZYTuVlut7oO+V8qUBs7BJC9TwikVnnOmb3hY3jToY4xaoi5p9OvgdJKPInhyIhzFg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/array-uint8/-/array-uint8-0.2.2.tgz", + "integrity": "sha512-Ip9MUC8+10U9x0crMKWkpvfoUBBhWzc6k5SI4lxx38neFVmiJ3f+5MBADEagjpoKSBs71vlY2drnEZe+Gs2Ytg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1845,22 +2004,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-uint8array-support": "^0.0.x" + "@stdlib/assert-has-uint8array-support": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-float32array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float32array-support/-/assert-has-float32array-support-0.0.8.tgz", - "integrity": "sha512-Yrg7K6rBqwCzDWZ5bN0VWLS5dNUWcoSfUeU49vTERdUmZID06J069CDc07UUl8vfQWhFgBWGocH3rrpKm1hi9w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float32array-support/-/assert-has-float32array-support-0.2.2.tgz", + "integrity": "sha512-pi2akQl8mVki43fF1GNQVLYW0bHIPp2HuRNThX9GjB3OFQTpvrV8/3zPSh4lOxQa5gRiabgf0+Rgeu3AOhEw9A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1873,28 +2033,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-float32array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-float32array-support": "bin/cli" + "@stdlib/assert-is-float32array": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-float64array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float64array-support/-/assert-has-float64array-support-0.0.8.tgz", - "integrity": "sha512-UVQcoeWqgMw9b8PnAmm/sgzFnuWkZcNhJoi7xyMjbiDV/SP1qLCrvi06mq86cqS3QOCma1fEayJdwgteoXyyuw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float64array-support/-/assert-has-float64array-support-0.2.2.tgz", + "integrity": "sha512-8L3GuKY1o0dJARCOsW9MXcugXapaMTpSG6dGxyNuUVEvFfY5UOzcj9/JIDal5FjqSgqVOGL5qZl2qtRwub34VA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1907,27 +2063,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-float64array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-float64array-support": "bin/cli" + "@stdlib/assert-is-float64array": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-generator-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-generator-support/-/assert-has-generator-support-0.0.8.tgz", - "integrity": "sha512-TejqpxFYY1NVGGamtxvUrt1TiiSFMt5bL2X84GSmqZGFE8C7CEWevKF462dH+uquf5K7OfJVOaL6XSnDXLTG+g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-generator-support/-/assert-has-generator-support-0.2.2.tgz", + "integrity": "sha512-TcE9BGV8i7B2OmxPlJ/2DUrAwG0W4fFS/DE7HmVk68PXVZsgyNQ/WP/IHBoazHDjhN5c3dU21c20kM/Bw007Rw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -1940,60 +2092,23 @@ "windows" ], "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/utils-eval": "^0.0.x" - }, - "bin": { - "has-generator-support": "bin/cli" + "@stdlib/utils-eval": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/assert-has-node-buffer-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-node-buffer-support/-/assert-has-node-buffer-support-0.0.8.tgz", - "integrity": "sha512-fgI+hW4Yg4ciiv4xVKH+1rzdV7e5+6UKgMnFbc1XDXHcxLub3vOr8+H6eDECdAIfgYNA7X0Dxa/DgvX9dwDTAQ==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-buffer": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-node-buffer-support": "bin/cli" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-own-property": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-own-property/-/assert-has-own-property-0.0.7.tgz", - "integrity": "sha512-3YHwSWiUqGlTLSwxAWxrqaD1PkgcJniGyotJeIt5X0tSNmSW0/c9RWroCImTUUB3zBkyBJ79MyU9Nf4Qgm59fQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-own-property/-/assert-has-own-property-0.2.2.tgz", + "integrity": "sha512-m5rV4Z2/iNkwx2vRsNheM6sQZMzc8rQQOo90LieICXovXZy8wA5jNld4kRKjMNcRt/TjrNP7i2Rhh8hruRDlHg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2010,15 +2125,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-symbol-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-symbol-support/-/assert-has-symbol-support-0.0.8.tgz", - "integrity": "sha512-PoQ9rk8DgDCuBEkOIzGGQmSnjtcdagnUIviaP5YskB45/TJHXseh4NASWME8FV77WFW9v/Wt1MzKFKMzpDFu4Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-symbol-support/-/assert-has-symbol-support-0.2.2.tgz", + "integrity": "sha512-vCsGGmDZz5dikGgdF26rIL0y0nHvH7qaVf89HLLTybceuZijAqFSJEqcB3Gpl5uaeueLNAWExHi2EkoUVqKHGg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2030,27 +2146,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-symbol-support": "bin/cli" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-tostringtag-support": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-tostringtag-support/-/assert-has-tostringtag-support-0.0.9.tgz", - "integrity": "sha512-UTsqdkrnQ7eufuH5BeyWOJL3ska3u5nvDWKqw3onNNZ2mvdgkfoFD7wHutVGzAA2rkTsSJAMBHVwWLsm5SbKgw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-tostringtag-support/-/assert-has-tostringtag-support-0.2.2.tgz", + "integrity": "sha512-bSHGqku11VH0swPEzO4Y2Dr+lTYEtjSWjamwqCTC8udOiOIOHKoxuU4uaMGKJjVfXG1L+XefLHqzuO5azxdRaA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2063,27 +2173,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-symbol-support": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-tostringtag-support": "bin/cli" + "@stdlib/assert-has-symbol-support": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-uint16array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint16array-support/-/assert-has-uint16array-support-0.0.8.tgz", - "integrity": "sha512-vqFDn30YrtzD+BWnVqFhB130g3cUl2w5AdOxhIkRkXCDYAM5v7YwdNMJEON+D4jI8YB4D5pEYjqKweYaCq4nyg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint16array-support/-/assert-has-uint16array-support-0.2.2.tgz", + "integrity": "sha512-aL188V7rOkkEH4wYjfpB+1waDO4ULxo5ppGEK6X0kG4YiXYBL2Zyum53bjEQvo0Nkn6ixe18dNzqqWWytBmDeg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2096,28 +2202,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-uint16array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint16-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-uint16array-support": "bin/cli" + "@stdlib/assert-is-uint16array": "^0.2.1", + "@stdlib/constants-uint16-max": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-uint32array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint32array-support/-/assert-has-uint32array-support-0.0.8.tgz", - "integrity": "sha512-tJtKuiFKwFSQQUfRXEReOVGXtfdo6+xlshSfwwNWXL1WPP2LrceoiUoQk7zMCMT6VdbXgGH92LDjVcPmSbH4Xw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint32array-support/-/assert-has-uint32array-support-0.2.2.tgz", + "integrity": "sha512-+UHKP3mZOACkJ9CQjeKNfbXHm5HGQB862V5nV5q3UQlHPzhslnXKyG1SwAxTx+0g88C/2vlDLeqG8H4TH2UTFA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2130,28 +2232,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-uint32array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint32-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-uint32array-support": "bin/cli" + "@stdlib/assert-is-uint32array": "^0.2.1", + "@stdlib/constants-uint32-max": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-has-uint8array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint8array-support/-/assert-has-uint8array-support-0.0.8.tgz", - "integrity": "sha512-ie4vGTbAS/5Py+LLjoSQi0nwtYBp+WKk20cMYCzilT0rCsBI/oez0RqHrkYYpmt4WaJL4eJqC+/vfQ5NsI7F5w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint8array-support/-/assert-has-uint8array-support-0.2.2.tgz", + "integrity": "sha512-VfzrB0BMik9MvPyKcMDJL3waq4nM30RZUrr2EuuQ/RbUpromRWSDbzGTlRq5SfjtJrHDxILPV3rytDCc03dgWA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2164,28 +2262,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-uint8array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint8-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "has-uint8array-support": "bin/cli" + "@stdlib/assert-is-uint8array": "^0.2.1", + "@stdlib/constants-uint8-max": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-array": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array/-/assert-is-array-0.0.7.tgz", - "integrity": "sha512-/o6KclsGkNcZ5hiROarsD9XUs6xQMb4lTwF6O71UHbKWTtomEF/jD0rxLvlvj0BiCxfKrReddEYd2CnhUyskMA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array/-/assert-is-array-0.2.2.tgz", + "integrity": "sha512-aJyTX2U3JqAGCATgaAX9ygvDHc97GCIKkIhiZm/AZaLoFHPtMA1atQ4bKcefEC8Um9eefryxTHfFPfSr9CoNQQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2198,22 +2292,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-array-like": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array-like/-/assert-is-array-like-0.0.8.tgz", - "integrity": "sha512-LV1MSacc3cUsDl17rT5kQswzOeACwaWiEU5T3KKWkr2QezST17RTf2ItthWBwXFKeE2YUDn0hI4QC08PeHOQ6w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array-like/-/assert-is-array-like-0.2.2.tgz", + "integrity": "sha512-kOa5oNJucpBI4rn4+EPL+FlGm7nvTOrYmjD0tdl8JsaNNiQ1w2u2i7fBvCz2iKiQmtuI/+Cu/ES5BtjYoPRxAQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2226,23 +2321,24 @@ "windows" ], "dependencies": { - "@stdlib/constants-array-max-array-length": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x" + "@stdlib/constants-array-max-array-length": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-big-endian": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-big-endian/-/assert-is-big-endian-0.0.7.tgz", - "integrity": "sha512-BvutsX84F76YxaSIeS5ZQTl536lz+f+P7ew68T1jlFqxBhr4v7JVYFmuf24U040YuK1jwZ2sAq+bPh6T09apwQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-big-endian/-/assert-is-big-endian-0.2.2.tgz", + "integrity": "sha512-mPEl30/bqZh++UyQbxlyOuB7k0wC73y5J9nD2J6Ud6Fcl76R5IAGHRW0WT3W18is/6jG1jzMd8hrISFyD7N0sA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2255,28 +2351,24 @@ "windows" ], "dependencies": { - "@stdlib/array-uint16": "^0.0.x", - "@stdlib/array-uint8": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "is-big-endian": "bin/cli" + "@stdlib/array-uint16": "^0.2.1", + "@stdlib/array-uint8": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-boolean": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-boolean/-/assert-is-boolean-0.0.8.tgz", - "integrity": "sha512-PRCpslMXSYqFMz1Yh4dG2K/WzqxTCtlKbgJQD2cIkAtXux4JbYiXCtepuoV7l4Wv1rm0a1eU8EqNPgnOmWajGw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-boolean/-/assert-is-boolean-0.2.2.tgz", + "integrity": "sha512-3KFLRTYZpX6u95baZ6PubBvjehJs2xBU6+zrenR0jx8KToUYCnJPxqqj7JXRhSD+cOURmcjj9rocVaG9Nz18Pg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2289,24 +2381,26 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-has-tostringtag-support": "^0.2.2", + "@stdlib/boolean-ctor": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-buffer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-buffer/-/assert-is-buffer-0.0.8.tgz", - "integrity": "sha512-SYmGwOXkzZVidqUyY1IIx6V6QnSL36v3Lcwj8Rvne/fuW0bU2OomsEBzYCFMvcNgtY71vOvgZ9VfH3OppvV6eA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-buffer/-/assert-is-buffer-0.2.2.tgz", + "integrity": "sha512-4/WMFTEcDYlVbRhxY8Wlqag4S70QCnn6WmQ4wmfiLW92kqQHsLvTNvdt/qqh/SDyDV31R/cpd3QPsVN534dNEA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2319,22 +2413,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-object-like": "^0.0.x" + "@stdlib/assert-is-object-like": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-float32array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float32array/-/assert-is-float32array-0.0.8.tgz", - "integrity": "sha512-Phk0Ze7Vj2/WLv5Wy8Oo7poZIDMSTiTrEnc1t4lBn3Svz2vfBXlvCufi/i5d93vc4IgpkdrOEwfry6nldABjNQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float32array/-/assert-is-float32array-0.2.2.tgz", + "integrity": "sha512-hxEKz/Y4m1NYuOaiQKoqQA1HeAYwNXFqSk3FJ4hC71DuGNit2tuxucVyck3mcWLpLmqo0+Qlojgwo5P9/C/9MQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2347,22 +2442,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-float64array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float64array/-/assert-is-float64array-0.0.8.tgz", - "integrity": "sha512-UC0Av36EEYIgqBbCIz1lj9g7qXxL5MqU1UrWun+n91lmxgdJ+Z77fHy75efJbJlXBf6HXhcYXECIsc0u3SzyDQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float64array/-/assert-is-float64array-0.2.2.tgz", + "integrity": "sha512-3R1wLi6u/IHXsXMtaLnvN9BSpqAJ8tWhwjOOr6kadDqCWsU7Odc7xKLeAXAInAxwnV8VDpO4ifym4A3wehazPQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2375,22 +2471,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-function": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-function/-/assert-is-function-0.0.8.tgz", - "integrity": "sha512-M55Dt2njp5tnY8oePdbkKBRIypny+LpCMFZhEjJIxjLE4rA6zSlHs1yRMqD4PmW+Wl9WTeEM1GYO4AQHl1HAjA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-function/-/assert-is-function-0.2.2.tgz", + "integrity": "sha512-whY69DUYWljCJ79Cvygp7VzWGOtGTsh3SQhzNuGt+ut6EsOW+8nwiRkyBXYKf/MOF+NRn15pxg8cJEoeRgsPcA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2403,22 +2500,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-type-of": "^0.0.x" + "@stdlib/utils-type-of": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-integer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-integer/-/assert-is-integer-0.0.8.tgz", - "integrity": "sha512-gCjuKGglSt0IftXJXIycLFNNRw0C+8235oN0Qnw3VAdMuEWauwkNhoiw0Zsu6Arzvud8MQJY0oBGZtvLUC6QzQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-integer/-/assert-is-integer-0.2.2.tgz", + "integrity": "sha512-2d4CioQmnPcNDvNfC3Q6+xAJLwYYcSUamnxP0bSBJ1oAazWaVArdXNUAUxufek2Uaq6TVIM2gNSMyivIKIJd2w==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2431,26 +2529,27 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.4", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-little-endian": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-little-endian/-/assert-is-little-endian-0.0.7.tgz", - "integrity": "sha512-SPObC73xXfDXY0dOewXR0LDGN3p18HGzm+4K8azTj6wug0vpRV12eB3hbT28ybzRCa6TAKUjwM/xY7Am5QzIlA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-little-endian/-/assert-is-little-endian-0.2.2.tgz", + "integrity": "sha512-KMzPndj85jDiE1+hYCpw12k2OQOVkfpCo7ojCmCl8366wtKGEaEdGbz1iH98zkxRvnZLSMXcYXI2z3gtdmB0Ag==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2463,28 +2562,24 @@ "windows" ], "dependencies": { - "@stdlib/array-uint16": "^0.0.x", - "@stdlib/array-uint8": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "is-little-endian": "bin/cli" + "@stdlib/array-uint16": "^0.2.1", + "@stdlib/array-uint8": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-nan": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nan/-/assert-is-nan-0.0.8.tgz", - "integrity": "sha512-K57sjcRzBybdRpCoiuqyrn/d+R0X98OVlmXT4xEk3VPYqwux8e0NModVFHDehe+zuhmZLvYM50mNwp1TQC2AxA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nan/-/assert-is-nan-0.2.2.tgz", + "integrity": "sha512-Wh7KPIVfi6UVBRuPgkjVnoJP6mVtDNg+Y4m3Hko86TSf78KqFXfyZy/m6hnlYBWZRkNJDKo1J/7A/zpPwcEUVg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2497,24 +2592,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-nonnegative-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nonnegative-integer/-/assert-is-nonnegative-integer-0.0.7.tgz", - "integrity": "sha512-+5SrGM3C1QRpzmi+JnyZF9QsH29DCkSONm2558yOTdfCLClYOXDs++ktQo/8baCBFSi9JnFaLXVt1w1sayQeEQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nonnegative-integer/-/assert-is-nonnegative-integer-0.2.2.tgz", + "integrity": "sha512-4t2FoZQeZ5nMYHYSeTVlgAp/HLEMYqe9qMcJgbvj63KTrGCDsuIpTE0S+UTxAc6Oc3Ftgb0ygjBFJQ0mxwN0Ow==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2527,23 +2623,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-is-integer": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-number": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number/-/assert-is-number-0.0.7.tgz", - "integrity": "sha512-mNV4boY1cUOmoWWfA2CkdEJfXA6YvhcTvwKC0Fzq+HoFFOuTK/scpTd9HanUyN6AGBlWA8IW+cQ1ZwOT3XMqag==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number/-/assert-is-number-0.2.2.tgz", + "integrity": "sha512-sWpJ59GqGbmlcdYSUV/OYkmQW8k47w10+E0K0zPu1x1VKzhjgA5ZB2sJcpgI8Vt3ckRLjdhuc62ZHJkrJujG7A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2556,25 +2653,26 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/number-ctor": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-has-tostringtag-support": "^0.2.2", + "@stdlib/number-ctor": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-number-array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number-array/-/assert-is-number-array-0.0.8.tgz", - "integrity": "sha512-HYkUu8uKRa1gwfHEMLA6iGSXSa4ZQRviIJV4A3XIROIUAVSsobIUt7EDaloZ4m9tyUokY5d7J0bLTjBlhOZcUg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number-array/-/assert-is-number-array-0.2.2.tgz", + "integrity": "sha512-8aQ/unulf5ED1Pu7na1Y1YPRigIBIMw/OiO99V69aGyYmlJaIQPAaYYecmRo1tMzKwP/jkhm3mTBsaPtCpJiLw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2587,24 +2685,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/assert-tools-array-like-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/assert-tools-array-like-function": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-object": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object/-/assert-is-object-0.0.8.tgz", - "integrity": "sha512-ooPfXDp9c7w+GSqD2NBaZ/Du1JRJlctv+Abj2vRJDcDPyrnRTb1jmw+AuPgcW7Ca7op39JTbArI+RVHm/FPK+Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object/-/assert-is-object-0.2.2.tgz", + "integrity": "sha512-sNnphJuHyMDHHHaonlx6vaCKMe4sHOn0ag5Ck4iW3kJtM2OZB2J4h8qFcwKzlMk7fgFu7vYNGCZtpm1dYbbUfQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2617,22 +2716,23 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-array": "^0.0.x" + "@stdlib/assert-is-array": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-object-like": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object-like/-/assert-is-object-like-0.0.8.tgz", - "integrity": "sha512-pe9selDPYAu/lYTFV5Rj4BStepgbzQCr36b/eC8EGSJh6gMgRXgHVv0R+EbdJ69KNkHvKKRjnWj0A/EmCwW+OA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object-like/-/assert-is-object-like-0.2.2.tgz", + "integrity": "sha512-MjQBpHdEebbJwLlxh/BKNH8IEHqY0YlcCMRKOQU0UOlILSJg0vG+GL4fDDqtx9FSXxcTqC+w3keHx8kAKvQhzg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2645,23 +2745,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-tools-array-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-tools-array-function": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-plain-object": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-plain-object/-/assert-is-plain-object-0.0.7.tgz", - "integrity": "sha512-t/CEq2a083ajAgXgSa5tsH8l3kSoEqKRu1qUwniVLFYL4RGv3615CrpJUDQKVtEX5S/OKww5q0Byu3JidJ4C5w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-plain-object/-/assert-is-plain-object-0.2.2.tgz", + "integrity": "sha512-o4AFWgBsSNzZAOOfIrxoDFYTqnLuGiaHDFwIeZGUHdpQeav2Fll+sGeaqOcekF7yKawoswnwWdJqTsjapb4Yzw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2674,26 +2775,27 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-object": "^0.0.x", - "@stdlib/utils-get-prototype-of": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-has-own-property": "^0.2.1", + "@stdlib/assert-is-function": "^0.2.1", + "@stdlib/assert-is-object": "^0.2.1", + "@stdlib/utils-get-prototype-of": "^0.2.1", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-positive-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-positive-integer/-/assert-is-positive-integer-0.0.7.tgz", - "integrity": "sha512-Znm/lyZk27C5qirlA9pEyTEgxlpE8e7KwjUhkEWdSZzKV3rzxheHbTQ5MYIVcc4nClmwWm8Ep4lQ0BkSwjkfKg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-positive-integer/-/assert-is-positive-integer-0.2.2.tgz", + "integrity": "sha512-cHdVJC88DZYpN4q39cWjx9fAqKBY9x0FFf3yY6aFBUaAXP/K5Ptdh22+y1wX210vC/wvxL5V9n4pcWO3wmBGHg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2706,23 +2808,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/assert-is-integer": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-regexp": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-regexp/-/assert-is-regexp-0.0.7.tgz", - "integrity": "sha512-ty5qvLiqkDq6AibHlNJe0ZxDJ9Mg896qolmcHb69mzp64vrsORnPPOTzVapAq0bEUZbXoypeijypLPs9sCGBSQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-regexp/-/assert-is-regexp-0.2.2.tgz", + "integrity": "sha512-2JtiUtRJxPaVXL7dkWoV3n5jouI65DwYDXsDXg3xo23TXlTNGgU/HhKO4FWC1Yqju7YMZi0hcZSW6E9v8ISqeQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2735,60 +2838,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-has-tostringtag-support": "^0.2.2", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/assert-is-regexp-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-regexp-string/-/assert-is-regexp-string-0.0.9.tgz", - "integrity": "sha512-FYRJJtH7XwXEf//X6UByUC0Eqd0ZYK5AC8or5g5m5efQrgr2lOaONHyDQ3Scj1A2D6QLIJKZc9XBM4uq5nOPXA==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/regexp-regexp": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x" - }, - "bin": { - "is-regexp-string": "bin/cli" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-string": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-string/-/assert-is-string-0.0.8.tgz", - "integrity": "sha512-Uk+bR4cglGBbY0q7O7HimEJiW/DWnO1tSzr4iAGMxYgf+VM2PMYgI5e0TLy9jOSOzWon3YS39lc63eR3a9KqeQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-string/-/assert-is-string-0.2.2.tgz", + "integrity": "sha512-SOkFg4Hq443hkadM4tzcwTHWvTyKP9ULOZ8MSnnqmU0nBX1zLVFLFGY8jnF6Cary0dL0V7QQBCfuxqKFM6u2PQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2801,24 +2868,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-has-tostringtag-support": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-uint16array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint16array/-/assert-is-uint16array-0.0.8.tgz", - "integrity": "sha512-M+qw7au+qglRXcXHjvoUZVLlGt1mPjuKudrVRto6KL4+tDsP2j+A89NDP3Fz8/XIUD+5jhj+65EOKHSMvDYnng==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint16array/-/assert-is-uint16array-0.2.2.tgz", + "integrity": "sha512-w3+HeTiXGLJGw5nCqr0WbvgArNMEj7ulED1Yd19xXbmmk2W1ZUB+g9hJDOQTiKsTU4AVyH4/As+aA8eDVmWtmg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2831,22 +2899,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-uint32array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint32array/-/assert-is-uint32array-0.0.8.tgz", - "integrity": "sha512-cnZi2DicYcplMnkJ3dBxBVKsRNFjzoGpmG9A6jXq4KH5rFl52SezGAXSVY9o5ZV7bQGaF5JLyCLp6n9Y74hFGg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint32array/-/assert-is-uint32array-0.2.2.tgz", + "integrity": "sha512-3F4nIHg1Qp0mMIsImWUC8DwQ3qBK5vdIJTjS2LufLbFBhHNmv5kK1yJiIXQDTLkENU0STZe05TByo01ZNLOmDQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2859,22 +2928,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-is-uint8array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint8array/-/assert-is-uint8array-0.0.8.tgz", - "integrity": "sha512-8cqpDQtjnJAuVtRkNAktn45ixq0JHaGJxVsSiK79k7GRggvMI6QsbzO6OvcLnZ/LimD42FmgbLd13Yc2esDmZw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint8array/-/assert-is-uint8array-0.2.2.tgz", + "integrity": "sha512-51WnDip6H2RrN0CbqWmfqySAjam8IZ0VjlfUDc3PtcgrZGrKKjVgyHAsT/L3ZDydwF+aB94uvYJu5QyrCPNaZw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2887,22 +2957,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-tools-array-function": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-function/-/assert-tools-array-function-0.0.7.tgz", - "integrity": "sha512-3lqkaCIBMSJ/IBHHk4NcCnk2NYU52tmwTYbbqhAmv7vim8rZPNmGfj3oWkzrCsyCsyTF7ooD+In2x+qTmUbCtQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-function/-/assert-tools-array-function-0.2.2.tgz", + "integrity": "sha512-FYeT7X9x0C8Nh+MN6IJUDz+7i7yB6mio2/SDlrvyepjyPSU/cfHfwW0GEOnQhxZ+keLZC/YqDD930WjRODwMdA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2915,22 +2986,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-array": "^0.0.x" + "@stdlib/assert-is-array": "^0.2.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-format": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/assert-tools-array-like-function": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-like-function/-/assert-tools-array-like-function-0.0.7.tgz", - "integrity": "sha512-k2eh70W1Fz96b0s1vRF+MmyBdKdILIQLShT/Z+/+r1PNWlQRsZcIhAVpGJk9Ukv9Yijgcj03WA1sYvE0dnPblQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-like-function/-/assert-tools-array-like-function-0.2.2.tgz", + "integrity": "sha512-j/lK6Bap3uyfIKxpQjAZ4zKG5YhJR0J50bVNN+dZ+W3KVgPQ4aQCJ4to6poOF2hHB/oCpKkHMydA7XGe8yw0xw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2943,22 +3017,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-array-like": "^0.0.x" + "@stdlib/assert-is-array-like": "^0.2.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-format": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, - "node_modules/@stdlib/buffer-ctor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/buffer-ctor/-/buffer-ctor-0.0.7.tgz", - "integrity": "sha512-4IyTSGijKUQ8+DYRaKnepf9spvKLZ+nrmZ+JrRcB3FrdTX/l9JDpggcUcC/Fe+A4KIZOnClfxLn6zfIlkCZHNA==", + "node_modules/@stdlib/boolean-ctor": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/boolean-ctor/-/boolean-ctor-0.2.2.tgz", + "integrity": "sha512-qIkHzmfxDvGzQ3XI9R7sZG97QSaWG5TvWVlrvcysOGT1cs6HtQgnf4D//SRzZ52VLm8oICP+6OKtd8Hpm6G7Ww==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -2970,84 +3047,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/assert-has-node-buffer-support": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/buffer-from-string": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/buffer-from-string/-/buffer-from-string-0.0.8.tgz", - "integrity": "sha512-Dws5ZbK2M9l4Bkn/ODHFm3lNZ8tWko+NYXqGS/UH/RIQv3PGp+1tXFUSvjwjDneM6ppjQVExzVedUH1ftABs9A==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/buffer-ctor": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/cli-ctor": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@stdlib/cli-ctor/-/cli-ctor-0.0.3.tgz", - "integrity": "sha512-0zCuZnzFyxj66GoF8AyIOhTX5/mgGczFvr6T9h4mXwegMZp8jBC/ZkOGMwmp+ODLBTvlcnnDNpNFkDDyR6/c2g==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-noop": "^0.0.x", - "minimist": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/complex-float32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/complex-float32/-/complex-float32-0.0.7.tgz", - "integrity": "sha512-POCtQcBZnPm4IrFmTujSaprR1fcOFr/MRw2Mt7INF4oed6b1nzeG647K+2tk1m4mMrMPiuXCdvwJod4kJ0SXxQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float32/-/complex-float32-0.2.1.tgz", + "integrity": "sha512-tp83HfJzcZLK7/6P6gZPcAa/8F/aHS7gBHgB6ft45d/n6oE+/VbnyOvsJKanRv8S96kBRj8xkvlWHz4IiBrT0Q==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3060,26 +3074,91 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/number-float64-base-to-float32": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/assert-is-number": "^0.2.1", + "@stdlib/number-float64-base-to-float32": "^0.2.1", + "@stdlib/string-format": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", + "@stdlib/utils-define-property": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/complex-float32-ctor": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float32-ctor/-/complex-float32-ctor-0.0.2.tgz", + "integrity": "sha512-QsTLynhTRmDT0mSkfdHj0FSqQSxh2nKx+vvrH3Y0/Cd/r0WoHFZwyibndDxshfkf9B7nist8QKyvV82I3IZciA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/number-float64-base-to-float32": "^0.2.1", + "@stdlib/string-format": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-define-property": "^0.2.4" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/complex-float32-reim": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float32-reim/-/complex-float32-reim-0.1.2.tgz", + "integrity": "sha512-24H+t1xwQF6vhOoMZdDA3TFB4M+jb5Swm/FwNaepovlzVIG2NlthUZs6mZg1T3oegqesIRQRwhpn4jIPjuGiTw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/array-float32": "^0.2.2", + "@stdlib/complex-float32-ctor": "^0.0.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/complex-float64": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/complex-float64/-/complex-float64-0.0.8.tgz", - "integrity": "sha512-lUJwsXtGEziOWAqCcnKnZT4fcVoRsl6t6ECaCJX45Z7lAc70yJLiwUieLWS5UXmyoADHuZyUXkxtI4oClfpnaw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float64/-/complex-float64-0.2.1.tgz", + "integrity": "sha512-vN9GqlSaonoREf8/RIN9tfNLnkfN4s7AI0DPsGnvc1491oOqq9UqMw8rYTrnxuum9/OaNAAUqDkb5GLu5uTveQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3092,26 +3171,91 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/assert-is-number": "^0.2.1", + "@stdlib/complex-float32": "^0.2.1", + "@stdlib/string-format": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1", + "@stdlib/utils-define-property": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/complex-float64-ctor": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float64-ctor/-/complex-float64-ctor-0.0.3.tgz", + "integrity": "sha512-oixCtBif+Uab2rKtgedwQTbQTEC+wVSu4JQH935eJ8Jo0eL6vXUHHlVrkLgYKlCDLvq5px1QQn42Czg/ixh6Gw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/complex-float32-ctor": "^0.0.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-format": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-define-property": "^0.2.4" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/complex-float64-reim": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@stdlib/complex-float64-reim/-/complex-float64-reim-0.1.2.tgz", + "integrity": "sha512-q6RnfgbUunApAYuGmkft1oOM3x3xVMVJwNRlRgfIXwKDb8pYt+S/CeIwi3Su5SF6ay3AqA1s+ze7m21osXAJyw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/array-float64": "^0.2.2", + "@stdlib/complex-float64-ctor": "^0.0.3" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/complex-reim": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/complex-reim/-/complex-reim-0.0.6.tgz", - "integrity": "sha512-28WXfPSIFMtHb0YgdatkGS4yxX5sPYea5MiNgqPv3E78+tFcg8JJG52NQ/MviWP2wsN9aBQAoCPeu8kXxSPdzA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/complex-reim/-/complex-reim-0.2.1.tgz", + "integrity": "sha512-67nakj+HwBRx/ha3j/sLbrMr2hwFVgEZtaczOgn1Jy/cU03lKvNbMkR7QI9s+sA+b+A3yJB3ob8ZQSqh3D1+dA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3124,25 +3268,24 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/complex-float64": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/complex-reimf": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/complex-reimf/-/complex-reimf-0.0.1.tgz", - "integrity": "sha512-P9zu05ZW2i68Oppp3oHelP7Tk0D7tGBL0hGl1skJppr2vY9LltuNbeYI3C96tQe/7Enw/5GyAWgxoQI4cWccQA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/complex-reimf/-/complex-reimf-0.2.1.tgz", + "integrity": "sha512-6HyPPmo0CEHoBjOg2w70mMFLcFEunM78ljnW6kf1OxjM/mqMaBM1NRpDrQoFwCIdh1RF1ojl3JR0YLllEf0qyQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3155,25 +3298,24 @@ "windows" ], "dependencies": { - "@stdlib/array-float32": "^0.0.x", - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float32": "^0.2.1", + "@stdlib/complex-float32": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-array-max-array-length": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-array-max-array-length/-/constants-array-max-array-length-0.0.7.tgz", - "integrity": "sha512-JkZipiDUgJ1/H8lKjGllbvMREYwlF/S9rVZtPhqRsf1CMySLAFP56fs4szwmFB2Yz2//JxJedN/sS9niULAJHw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-array-max-array-length/-/constants-array-max-array-length-0.2.2.tgz", + "integrity": "sha512-fZzM6cvIEXhNSXR+erL1PYYIbZYAXGss9aN7C8KXVGGDfq4Eebts7ZWcqLgPfxftMnJ07yPyPffFqRnsDSfqqQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3190,15 +3332,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float32-max": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-max/-/constants-float32-max-0.0.8.tgz", - "integrity": "sha512-3WEx/X5uottIFyhuNJxfgfknQkKCKKxbwMlqJ2rJUc/HPgffOta/7upxOcG6TOK9DOu3lQlbv3gnQXVlCPsd8A==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-max/-/constants-float32-max-0.2.2.tgz", + "integrity": "sha512-uxvIm/KmIeZP4vyfoqPd72l5/uidnCN9YJT3p7Z2LD8hYN3PPLu6pd/5b51HMFLwfkZ27byRJ9+YK6XnneJP0Q==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3210,23 +3353,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float32-smallest-normal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-smallest-normal/-/constants-float32-smallest-normal-0.0.8.tgz", - "integrity": "sha512-WXNkxGNXsOFGbyEakZswheMtQen+kX2neBK5PpGzHI3YzgBetE4rh40A1YXxBl2c05aikGjjV/TL9ANMQuUAUQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-smallest-normal/-/constants-float32-smallest-normal-0.2.2.tgz", + "integrity": "sha512-2qkGjGML2/8P9YguHnac2AKXLbfycpYdCxKmuXQdAVzMMNCJWjHoIqZMFG29WBEDBOP057X+48S6WhIqoxRpWA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3238,23 +3379,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-e": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-e/-/constants-float64-e-0.0.8.tgz", - "integrity": "sha512-RUDKwoMQguOxvNa6QQImChDJsCAjB5YQAg4caaOki06eV7Qm+xee+KSgsQJyjmEFXvjOfuQTBYqUDSuWyW7EZw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-e/-/constants-float64-e-0.2.2.tgz", + "integrity": "sha512-7fxHaABwosbUzpBsw6Z9Dd9MqUYne8x+44EjohVcWDr0p0mHB/DXVYEYTlwEP/U/XbRrKdO3jUG6IO/GsEjzWg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3266,23 +3405,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-eps": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eps/-/constants-float64-eps-0.0.8.tgz", - "integrity": "sha512-jfsy5syNCwt5xQu0+TG+2MZzWS0x0OwHkPjhsShfPcS0fOLg/Si7V3RU057HEvViYfqJI48bfjswmko9/Jb21w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eps/-/constants-float64-eps-0.2.2.tgz", + "integrity": "sha512-61Pb2ip9aPhHXxiCn+VZ0UVw2rMYUp0xrX93FXyB3UTLacrofRKLMKtbV0SFac4VXx5igv2+0G+h6G/fwCgjyw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3294,23 +3431,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-eulergamma": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eulergamma/-/constants-float64-eulergamma-0.0.8.tgz", - "integrity": "sha512-VZhhSQtVatnxgJlW9t2ewDtzhQ02WOTQcTSSwIXc1bGbrglIaBZGusHPIxGXCv1tQwBx67tfd6Rho1QjMdHSAQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eulergamma/-/constants-float64-eulergamma-0.2.2.tgz", + "integrity": "sha512-XsuVud0d1hLTQspFzgUSH2e3IawTXLlJi2k4Vg0Nn6juulxfNO9PnAGtHz+p1BynYF/YwN+qhKnISQxrN31rsQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3322,23 +3457,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-exponent-bias": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-exponent-bias/-/constants-float64-exponent-bias-0.0.8.tgz", - "integrity": "sha512-IzBJQw9hYgWCki7VoC/zJxEA76Nmf8hmY+VkOWnJ8IyfgTXClgY8tfDGS1cc4l/hCOEllxGp9FRvVdn24A5tKQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-exponent-bias/-/constants-float64-exponent-bias-0.2.2.tgz", + "integrity": "sha512-zLWkjzDYHSsBsXB/4mwHysOGl64JS3XBt/McjvjCLc/IZpfsUNFxLCl7oVCplXzYYHcQj/RfEBFy6cxQ6FvdpQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3350,23 +3483,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-fourth-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-fourth-pi/-/constants-float64-fourth-pi-0.0.8.tgz", - "integrity": "sha512-WGiyq8jVw7e8hI6fUh4VVhkpP0Ycdt+agTxJEQeHdab0ZsloIPpt/Yj7UjQ7iH63ARC6jdVWH1CmnxQFuIBMWg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-fourth-pi/-/constants-float64-fourth-pi-0.2.2.tgz", + "integrity": "sha512-j0NOg45ouibms4ML8pfS/eDrurdtnhJTNPCGQM4mg3X+1ljsuO0pvkpVCvuz29t5J23KTcfGBXXr90ikoBmjlw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3378,23 +3509,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-gamma-lanczos-g": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-gamma-lanczos-g/-/constants-float64-gamma-lanczos-g-0.0.8.tgz", - "integrity": "sha512-yTSjiOeqD3VPEFPHBmk5EqroUy7+CoNRe7L0a3+rvgcgcs8Gw5+RDWiCRPh1Q1p/41BKeVmVEV7/ZTjz7Wkc3Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-gamma-lanczos-g/-/constants-float64-gamma-lanczos-g-0.2.2.tgz", + "integrity": "sha512-hCaZbZ042htCy9mlGrfUEbz4d0xW/DLdr3vHs5KiBWU+G+WHVH33vubSnEoyT0ugWpAk2ZqWXe/V8sLGgOu0xg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3406,23 +3535,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-half-ln-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-ln-two/-/constants-float64-half-ln-two-0.0.8.tgz", - "integrity": "sha512-DrVD4BN2O3VLNtLixx2BQxqfy7ZSuABjyUQ03Hsgg862UnjJB5SxRy8OPjlYOdQ8QQtefyv0fJNshyw1P/hZQg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-ln-two/-/constants-float64-half-ln-two-0.2.2.tgz", + "integrity": "sha512-yv1XhzZR2AfJmnAGL0kdWlIUhc/vqdWol+1Gq2brXPVfgqbUmJu5XZuuK+jZA2k+fHyvRHNEwQRv9OPnOjchFg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3434,23 +3561,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-half-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-pi/-/constants-float64-half-pi-0.0.8.tgz", - "integrity": "sha512-g37Iw0h6603VNNxalTI6b2wIqGP8T17Z6rHQ/WFmau2tx3pb2zQD6OveZ90Mr8vyZ8fyKBbwUAaHSwWCAS7FEw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-pi/-/constants-float64-half-pi-0.2.2.tgz", + "integrity": "sha512-lM3SiDsZCKiuF5lPThZFFqioIwh1bUiBUnnDMLB04/QkVRCAaXUo+dsq2hOB6iBhHoYhiKds6T+PsHSBlpqAaA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3462,23 +3587,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-high-word-abs-mask": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-abs-mask/-/constants-float64-high-word-abs-mask-0.0.1.tgz", - "integrity": "sha512-1vy8SUyMHFBwqUUVaZFA7r4/E3cMMRKSwsaa/EZ15w7Kmc01W/ZmaaTLevRcIdACcNgK+8i8813c8H7LScXNcQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-abs-mask/-/constants-float64-high-word-abs-mask-0.2.2.tgz", + "integrity": "sha512-YtYngcHlw9qvOpmsSlkNHi6cy/7Y7QkyYh5kJbDvuOUXPDKa3rEwBln4mKjbWsXhmmN0bk7TLypH7Ryd/UAjUQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3490,23 +3613,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-high-word-exponent-mask": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-exponent-mask/-/constants-float64-high-word-exponent-mask-0.0.8.tgz", - "integrity": "sha512-z28/EQERc0VG7N36bqdvtrRWjFc8600PKkwvl/nqx6TpKAzMXNw55BS1xT4C28Sa9Z7uBWeUj3UbIFedbkoyMw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-exponent-mask/-/constants-float64-high-word-exponent-mask-0.2.2.tgz", + "integrity": "sha512-LhYUXvpnLOFnWr8ucHA9N/H75VxcS2T9EoBDTmWBZoKj2Pg0icGVDmcNciRLIWbuPA9osgcKpxoU+ADIfaipVA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3518,23 +3639,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-high-word-sign-mask": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-sign-mask/-/constants-float64-high-word-sign-mask-0.0.1.tgz", - "integrity": "sha512-hmTr5caK1lh1m0eyaQqt2Vt3y+eEdAx57ndbADEbXhxC9qSGd0b4bLSzt/Xp4MYBYdQkHAE/BlkgUiRThswhCg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-sign-mask/-/constants-float64-high-word-sign-mask-0.2.1.tgz", + "integrity": "sha512-Fep/Ccgvz5i9d5k96zJsDjgXGno8HJfmH7wihLmziFmA2z9t7NSacH4/BH4rPJ5yXFHLkacNLDxaF1gO1XpcLA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3546,23 +3665,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-high-word-significand-mask": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-significand-mask/-/constants-float64-high-word-significand-mask-0.0.8.tgz", - "integrity": "sha512-axiB0JMao3ZYTxPtK3K75q+UjTDF1OM2KoCYVukZbs+GWenAR4EkEsCJ4nW5a4ONDXNLsVuRVeL8sgte7prt4g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-significand-mask/-/constants-float64-high-word-significand-mask-0.2.2.tgz", + "integrity": "sha512-eDDyiQ5PR1/qyklrW0Pus0ZopM7BYjkWTjqhSHhj0DibH6UMwSMlIl4ddCh3VX37p5eByuAavnaPgizk5c9mUw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3574,23 +3691,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-ln-sqrt-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-sqrt-two-pi/-/constants-float64-ln-sqrt-two-pi-0.0.8.tgz", - "integrity": "sha512-/tfOMZs4ZyhY1nIrxUgGAVXjR9vLXNC5RyZjYIfRMfS9Xov1mZwu0TtnYbRMRP1/rWyMJHs5RrVk0BpYT/Cm9g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-sqrt-two-pi/-/constants-float64-ln-sqrt-two-pi-0.2.2.tgz", + "integrity": "sha512-C9YS9W/lvv54wUC7DojQSRH9faKw0sMAM09oMRVm8OOYNr01Rs1wXeSPStl9ns4qiV/G13vZzd1I3nGqgqihbw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3602,23 +3717,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-ln-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-two/-/constants-float64-ln-two-0.0.8.tgz", - "integrity": "sha512-XwhMhGkimMpDa8Dgk7HnZd+Bzs1SerCTJqRfDRODQFzf0lj7y27SAB0vK3XYWfY7YJSLRUNXMIQ9MrALu6Sg4g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-two/-/constants-float64-ln-two-0.2.2.tgz", + "integrity": "sha512-EQ8EJ6B1wPfuhva0aApKIsF7lTna++txV4AUzL2wTfwDHw6RzWpA44u+k54KnLF8ZXUNIYDNQHHvtzdfKrFzCA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3630,23 +3743,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max/-/constants-float64-max-0.0.8.tgz", - "integrity": "sha512-I1Dm73NUAJl7z/TtXwow/4nZeFhhs4VFdPSZR3nwqrZbvBQyEhQx/aX1hCjiQiktXDeLQm8mMYCth7KB0RuTMQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max/-/constants-float64-max-0.2.2.tgz", + "integrity": "sha512-S3kcIKTK65hPqirziof3KTYqfFKopgaTnaiDlDKdzaCzBZ5qkrAcRd4vl+W1KHoZruUyWC2/RYZUa/8+h075TQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3658,23 +3769,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max-base10-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base10-exponent/-/constants-float64-max-base10-exponent-0.0.8.tgz", - "integrity": "sha512-evqQtzfKUnFEsmg+0INRoLTTym1NUk/vpxu3zm7i3Cc2NGh9+H+4SZ+JFUVhNeXg0x5ZA4tMxHJeaj+FdCegSA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base10-exponent/-/constants-float64-max-base10-exponent-0.2.2.tgz", + "integrity": "sha512-Jammf5J//rhgT66DtAk1sVYPQqCwNVptImfpIN2ZTo8krx0HcvDWFEmsNZwVq6q5iUhKhSShzWSvty5ysswp1A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3686,23 +3795,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max-base2-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent/-/constants-float64-max-base2-exponent-0.0.8.tgz", - "integrity": "sha512-xBAOtso1eiy27GnTut2difuSdpsGxI8dJhXupw0UukGgvy/3CSsyNm+a1Suz/dhqK4tPOTe5QboIdNMw5IgXKQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent/-/constants-float64-max-base2-exponent-0.2.2.tgz", + "integrity": "sha512-KmDe98pJ2HXz2SbqyFfSDhlSSVD7JssjbZ5K11HEK2avqMcoCbdHH20T+6/TpA01VqaK8dLbeyphOfALcDdMKA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3714,23 +3821,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max-base2-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent-subnormal/-/constants-float64-max-base2-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-YGBZykSiXFebznnJfWFDwhho2Q9xhUWOL+X0lZJ4ItfTTo40W6VHAyNYz98tT/gJECFype0seNzzo1nUxCE7jQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent-subnormal/-/constants-float64-max-base2-exponent-subnormal-0.2.1.tgz", + "integrity": "sha512-D1wBNn54Hu2pK6P/yBz0FtPBI3/7HdgK8igYjWDKWUKzC92R/6PHZ9q5NzedcGxoBs8MUk1zNpP0tZyYj9Y4YQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3742,23 +3847,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max-ln": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-ln/-/constants-float64-max-ln-0.0.8.tgz", - "integrity": "sha512-wrZTI9ncpIWZBmfS0PuKhB8jxjT3KWmJs3/SjOB8l0gA/6tBV/Wjw5IrO+fgut0NgT3SJRjbu/hrz06iKUeS7Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-ln/-/constants-float64-max-ln-0.2.2.tgz", + "integrity": "sha512-FPAEGjnoQMDPWJbCyyto7HWQ/SY2jjD8IkjyD8aOwENqbswjCbOINXRiK2ar27OOXG7Dv7CCpFpoorTxv0gmfA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3770,23 +3873,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-max-safe-integer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-safe-integer/-/constants-float64-max-safe-integer-0.0.8.tgz", - "integrity": "sha512-0W7bE7Ph74i5+wHoaUQveAyUZCjmfO3f2E20Na2+ruRBAQgGXNybzEKTUwLCDFniEHdBzJdCiYcxFxmaV5dFTQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-safe-integer/-/constants-float64-max-safe-integer-0.2.2.tgz", + "integrity": "sha512-d+sxmxhkt980SDFhnnRDSpujPQTv4nEt5Ox3L86HgYZU4mQU/wbzYVkMuHIANW9x3ehww5blnGXTKYG9rQCXAw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3798,23 +3899,47 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/constants-float64-max-safe-nth-factorial": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-safe-nth-factorial/-/constants-float64-max-safe-nth-factorial-0.1.0.tgz", + "integrity": "sha512-sppIfkBbeyKNwfRbmNFi5obI7Q+IJCQzfWKYqvzmEJVOkmEg6hhtEeFc8zZJGCU7+Pndc3M2wdbTT5a3rhamHw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-min-base10-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent/-/constants-float64-min-base10-exponent-0.0.8.tgz", - "integrity": "sha512-X/asZnJiLcRkgw6hO5LF7niyTtOtip5mUQl66BR0XiJo1zW3i5jYtq2zElvvbY5VlL7lBEQrlbvZwo1gMp+SqQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent/-/constants-float64-min-base10-exponent-0.2.2.tgz", + "integrity": "sha512-xrDj8cT4Aojo3TO1zm2LcFjXfkpf/NzNONkkE+YEnq+wHjV7UcXLTJefLPBET2T1uSwEXYYw7ZlbpQ7vbhNDEg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3826,23 +3951,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-min-base10-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent-subnormal/-/constants-float64-min-base10-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-0to1PTsNMBkm23pPYZIYQCEbSN0c2vd/PwVkHX6D2L2ZYy3UYlCFTydMhvhLEsHeZWZaUJz67sDTieTiYue9Yg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent-subnormal/-/constants-float64-min-base10-exponent-subnormal-0.2.1.tgz", + "integrity": "sha512-AghpVQcTuhPiLE1IAk+e8HNU+wce/132Sg3MsL60CQaRVnG8X/VdivzEJGt2Nw9uH5rctvVINFrNnM0gxtmzJg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3854,23 +3977,47 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/constants-float64-min-base2-exponent": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base2-exponent/-/constants-float64-min-base2-exponent-0.2.2.tgz", + "integrity": "sha512-YZmBiKik6LbWB4EOZ/ZUs/u6OIF742xNK8mhEqL0OEN4NuJe3OdErpOic6KjMmHjQuqCXdFoSqsWZaFHcIN7HA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-min-base2-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base2-exponent-subnormal/-/constants-float64-min-base2-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-bt81nBus/91aEqGRQBenEFCyWNsf8uaxn4LN1NjgkvY92S1yVxXFlC65fJHsj9FTqvyZ+uj690/gdMKUDV3NjQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base2-exponent-subnormal/-/constants-float64-min-base2-exponent-subnormal-0.2.1.tgz", + "integrity": "sha512-fTXfvctXWj/48gK+gbRBrHuEHEKY4QOJoXSGp414Sz6vUxHusHJJ686p8ze3XqM7CY6fmL09ZgdGz/uhJl/7lw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3882,23 +4029,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-min-ln": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-ln/-/constants-float64-min-ln-0.0.8.tgz", - "integrity": "sha512-+FLeaQGpa7Pt53jU+hPL7GQI++BAsDy3MiYW8n97AvMDvgAecbq1UjbJFWYu91ZtdOk8S8mwNRrm4jo//Hy3/w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-ln/-/constants-float64-min-ln-0.2.2.tgz", + "integrity": "sha512-N1Sxjo3uTdEIpHeG2TzaX06UuvpcKHvjYKpIMhJSajbxvfVDURHlc9kIpfbP9C9/YYoCy0FvewA/kvbqNaYypA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3910,23 +4055,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-ninf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ninf/-/constants-float64-ninf-0.0.8.tgz", - "integrity": "sha512-bn/uuzCne35OSLsQZJlNrkvU1/40spGTm22g1+ZI1LL19J8XJi/o4iupIHRXuLSTLFDBqMoJlUNphZlWQ4l8zw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ninf/-/constants-float64-ninf-0.2.2.tgz", + "integrity": "sha512-Iu+wZs/vgudAKVg9FEcRY3FadkmvsWuq/wJ3jIHjhaP5xcnoF3XJUO4IneEndybHwehfJL65NShnDsJcg1gicw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3939,23 +4082,23 @@ "windows" ], "dependencies": { - "@stdlib/number-ctor": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/number-ctor": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pi/-/constants-float64-pi-0.0.8.tgz", - "integrity": "sha512-MgIu0vc3fq+AcXPWGgP2dfNoeKRd1KHpRNL5S0m8olKRg+6cn5Ac+aQtRCmya3reUojDxytipBGPGHDPxUK5iw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pi/-/constants-float64-pi-0.2.2.tgz", + "integrity": "sha512-ix34KmpUQ0LUM++L6avLhM9LFCcGTlsUDyWD/tYVGZBiIzDS3TMKShHRkZvC+v87fuyYNPoxolYtk5AlbacI6g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3967,23 +4110,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-pinf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pinf/-/constants-float64-pinf-0.0.8.tgz", - "integrity": "sha512-I3R4rm2cemoMuiDph07eo5oWZ4ucUtpuK73qBJiJPDQKz8fSjSe4wJBAigq2AmWYdd7yJHsl5NJd8AgC6mP5Qw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pinf/-/constants-float64-pinf-0.2.2.tgz", + "integrity": "sha512-UcwnWaSkUMD8QyKADwkXPlY7yOosCPZpE2EDXf/+WOzuWi5vpsec+JaasD5ggAN8Rv8OTVmexTFs1uZfrHgqVQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -3995,23 +4136,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-smallest-normal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-normal/-/constants-float64-smallest-normal-0.0.8.tgz", - "integrity": "sha512-Qwxpn5NA3RXf+mQcffCWRcsHSPTUQkalsz0+JDpblDszuz2XROcXkOdDr5LKgTAUPIXsjOgZzTsuRONENhsSEg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-normal/-/constants-float64-smallest-normal-0.2.2.tgz", + "integrity": "sha512-GXNBkdqLT9X+dU59O1kmb7W5da/RhSXSvxx0xG5r7ipJPOtRLfTXGGvvTzWD4xA3Z5TKlrEL6ww5sph9BsPJnA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4023,23 +4162,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-smallest-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-subnormal/-/constants-float64-smallest-subnormal-0.0.8.tgz", - "integrity": "sha512-LCvJyC8FEsA3Qf18nGmq/J2yuW2jgSXTzT9zBND/x0Zk9GYXcPYqaZkv3pk297WZqBbZOnI0Ho13EBAL4NqRVA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-subnormal/-/constants-float64-smallest-subnormal-0.2.2.tgz", + "integrity": "sha512-KuF+scDOsP0okx8RLF+q3l1RheaYChf+u/HbhzFbz82GeCIdIVp86UMwoBgfn8AT8cnR5SrtvLtQw15MGfa/vg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4051,23 +4188,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-sqrt-eps": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-eps/-/constants-float64-sqrt-eps-0.0.8.tgz", - "integrity": "sha512-3VjVQczBFNy74xABiTwN38Hdr2ApgWfaY04iI5eBufWjPw3M1bNVE5UMk6HSYJseEIP3PevcZxqJ3XehCgPZHA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-eps/-/constants-float64-sqrt-eps-0.2.2.tgz", + "integrity": "sha512-X7LnGfnwNnhiwlY+zd3FX6zclsx61MaboGTNAAdaV78YjBDTdGdWMHk5MQo1U17ryPlhdGphOAejhDHeaSnTXQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4079,23 +4214,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-sqrt-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two/-/constants-float64-sqrt-two-0.0.8.tgz", - "integrity": "sha512-OTZ1KE21bO26bD/Rp/ldf2GiYH913jkpYhkyvDWNROw8ZSQ+G+ntJvymuvsYtFnUHJgv7bjk1tUpaKXuTXpxYA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two/-/constants-float64-sqrt-two-0.2.2.tgz", + "integrity": "sha512-iqqouCuS9pUhjD91i5siScxLDtQTF1HsSZor6jaZRviMiOjCj/mjzxxTFHWUlU/rxHMBBhj/u7i12fv6a7dCAQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4107,23 +4240,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-sqrt-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two-pi/-/constants-float64-sqrt-two-pi-0.0.8.tgz", - "integrity": "sha512-xSMg6UreLhgUUFhA0yhJWfyROJvOJ+gUtjcbj8GFlym18EjQ13x9x8gNgUocPNm4qvQVKWBDDXcbkc+fPTp+eg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two-pi/-/constants-float64-sqrt-two-pi-0.2.2.tgz", + "integrity": "sha512-I8Ylr64x8AFSQ2hFBT8szuIBAy2wqPx69taJMzfcmuM5SnSbS8SE/H19YnCimZErVFo4bz0Rh8Fp3edN4i6teQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4135,23 +4266,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-float64-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-two-pi/-/constants-float64-two-pi-0.0.8.tgz", - "integrity": "sha512-YxgFEytCkQDhdBZpjWOCtUBgp6PPuuQZP5dXlpSNGKBShEQ60Sr3xTpdQt6WzErr+ZeNBvxaw6BlY8Mw6oK12Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-two-pi/-/constants-float64-two-pi-0.2.2.tgz", + "integrity": "sha512-cyXuwYOersVsA8tDSJ0ocMbtOc5KGxjlGvYC4vrpLQVkgNpxcGbA57n6JvaGmNk7+InXXbQ7qhTWGbTNgafcLQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4163,23 +4292,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-int32-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-int32-max/-/constants-int32-max-0.0.7.tgz", - "integrity": "sha512-um/tgiIotQy7jkN6b7GzaOMQT4PN/o7Z6FR0CJn0cHIZfWCNKyVObfaR68uDX1nDwYGfNrO7BkCbU4ccrtflDA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/constants-int32-max/-/constants-int32-max-0.3.0.tgz", + "integrity": "sha512-jYN84QfG/yP2RYw98OR6UYehFFs0PsGAihV6pYU0ey+WF9IOXgSjRP56KMoZ7ctHwl4wsnj9I+qB2tGuEXr+pQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4196,15 +4323,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-uint16-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint16-max/-/constants-uint16-max-0.0.7.tgz", - "integrity": "sha512-7TPoku7SlskA67mAm7mykIAjeEnkQJemw1cnKZur0mT5W4ryvDR6iFfL9xBiByVnWYq/+ei7DHbOv6/2b2jizw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-uint16-max/-/constants-uint16-max-0.2.2.tgz", + "integrity": "sha512-qaFXbxgFnAkt73P5Ch7ODb0TsOTg0LEBM52hw6qt7+gTMZUdS0zBAiy5J2eEkTxA9rD9X3nIyUtLf2C7jafNdw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4221,15 +4349,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-uint32-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint32-max/-/constants-uint32-max-0.0.7.tgz", - "integrity": "sha512-8+NK0ewqc1vnEZNqzwFJgFSy3S543Eft7i8WyW/ygkofiqEiLAsujvYMHzPAB8/3D+PYvjTSe37StSwRwvQ6uw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-uint32-max/-/constants-uint32-max-0.2.2.tgz", + "integrity": "sha512-2G44HQgIKDrh3tJUkmvtz+eM+uwDvOMF+2I3sONcTHacANb+zP7la4LDYiTp+HFkPJyfh/kPapXBiHpissAb1A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4246,15 +4375,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/constants-uint8-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint8-max/-/constants-uint8-max-0.0.7.tgz", - "integrity": "sha512-fqV+xds4jgwFxwWu08b8xDuIoW6/D4/1dtEjZ1sXVeWR7nf0pjj1cHERq4kdkYxsvOGu+rjoR3MbjzpFc4fvSw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/constants-uint8-max/-/constants-uint8-max-0.2.2.tgz", + "integrity": "sha512-ZTBQq3fqS/Y4ll6cPY5SKaS266EfmKP9PW3YLJaTELmYIzVo9w2RFtfCqN05G3olTQ6Le9MUEE/C6VFgZNElDQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4271,15 +4401,42 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/error-tools-fmtprodmsg": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/error-tools-fmtprodmsg/-/error-tools-fmtprodmsg-0.2.2.tgz", + "integrity": "sha512-2IliQfTes4WV5odPidZFGD5eYDswZrPXob7oOu95Q69ERqImo8WzSwnG2EDbHPyOyYCewuMfM5Ha6Ggf+u944Q==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/fs-exists": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-exists/-/fs-exists-0.0.8.tgz", - "integrity": "sha512-mZktcCxiLmycCJefm1+jbMTYkmhK6Jk1ShFmUVqJvs+Ps9/2EEQXfPbdEniLoVz4HeHLlcX90JWobUEghOOnAQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/fs-exists/-/fs-exists-0.2.2.tgz", + "integrity": "sha512-uGLqc7izCIam2aTyv0miyktl4l8awgRkCS39eIEvvvnKIaTBF6pxfac7FtFHeEQKE3XhtKsOmdQ/yJjUMChLuA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4292,60 +4449,23 @@ "windows" ], "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-cwd": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - }, - "bin": { - "exists": "bin/cli" + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/fs-read-file": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-read-file/-/fs-read-file-0.0.8.tgz", - "integrity": "sha512-pIZID/G91+q7ep4x9ECNC45+JT2j0+jdz/ZQVjCHiEwXCwshZPEvxcPQWb9bXo6coOY+zJyX5TwBIpXBxomWFg==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - }, - "bin": { - "read-file": "bin/cli" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/fs-resolve-parent-path": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-resolve-parent-path/-/fs-resolve-parent-path-0.0.8.tgz", - "integrity": "sha512-ok1bTWsAziChibQE3u7EoXwbCQUDkFjjRAHSxh7WWE5JEYVJQg1F0o3bbjRr4D/wfYYPWLAt8AFIKBUDmWghpg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/fs-resolve-parent-path/-/fs-resolve-parent-path-0.2.2.tgz", + "integrity": "sha512-ZG78ouZc+pdPLtU+sSpYTvbKTiLUgn6NTtlVFYmcmkYRFn+fGOOakwVuhYMcYG6ti10cLD6WzB/YujxIt8f+nA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4358,33 +4478,57 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-exists": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-cwd": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - }, - "bin": { - "resolve-parent-path": "bin/cli" + "@stdlib/assert-has-own-property": "^0.2.2", + "@stdlib/assert-is-function": "^0.2.2", + "@stdlib/assert-is-plain-object": "^0.2.2", + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/fs-exists": "^0.2.2", + "@stdlib/process-cwd": "^0.2.2", + "@stdlib/string-format": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/function-ctor": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/function-ctor/-/function-ctor-0.2.2.tgz", + "integrity": "sha512-qSn1XQnnhgCSYBfFy4II0dY5eW4wdOprgDTHcOJ3PkPWuZHDC1fXZsok1OYAosHqIiIw44zBFcMS/JRex4ebdQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-even": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-even/-/math-base-assert-is-even-0.0.7.tgz", - "integrity": "sha512-tKHutmKSPsJ41DVZBbdfSW6njZtTjqeAIpS4ZjKom4AJwvqJGRDjOzLOzi8+jeRn3bhjfABRPCd35EAkHUnNog==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-even/-/math-base-assert-is-even-0.2.3.tgz", + "integrity": "sha512-cziGv8F/aNyfME7Wx2XJjnYBnf9vIeh8yTIzlLELd0OqGHqfsHU5OQxxcl9x5DbjZ1G/w0lphWxHFHYCuwFCHw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4397,22 +4541,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-integer": "^0.0.x" + "@stdlib/math-base-assert-is-integer": "^0.2.4", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-infinite": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-infinite/-/math-base-assert-is-infinite-0.0.9.tgz", - "integrity": "sha512-JuPDdmxd+AtPWPHu9uaLvTsnEPaZODZk+zpagziNbDKy8DRiU1cy+t+QEjB5WizZt0A5MkuxDTjZ/8/sG5GaYQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-infinite/-/math-base-assert-is-infinite-0.2.2.tgz", + "integrity": "sha512-4zDZuinC3vkXRdQepr0ZTwWX3KgM0VIWqYthOmCSgLLA87L9M9z9MgUZL1QeYeYa0+60epjDcQ8MS3ecT70Jxw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4425,24 +4571,25 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-integer/-/math-base-assert-is-integer-0.0.7.tgz", - "integrity": "sha512-swIEKQJZOwzacYDiX5SSt5/nHd6PYJkLlVKZiVx/GCpflstQnseWA0TmudG7XU5HJnxDGV/w6UL02dEyBH7VEw==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-integer/-/math-base-assert-is-integer-0.2.5.tgz", + "integrity": "sha512-Zi8N66GbWtSCR3OUsRdBknjNlX+aBN8w6CaVEP5+Jy/a7MgMYzevS52TNS5sm8jqzKBlFhZlPLex+Zl2GlPvSA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4455,22 +4602,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-special-floor": "^0.0.x" + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-nan": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nan/-/math-base-assert-is-nan-0.0.8.tgz", - "integrity": "sha512-m+gCVBxLFW8ZdAfdkATetYMvM7sPFoMKboacHjb1pe21jHQqVb+/4bhRSDg6S7HGX7/8/bSzEUm9zuF7vqK5rQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nan/-/math-base-assert-is-nan-0.2.2.tgz", + "integrity": "sha512-QVS8rpWdkR9YmHqiYLDVLsCiM+dASt/2feuTl4T/GSdou3Y/PS/4j/tuDvCDoHDNfDkULUW+FCVjKYpbyoeqBQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4483,22 +4632,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/utils-library-manifest": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-negative-zero": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-negative-zero/-/math-base-assert-is-negative-zero-0.0.8.tgz", - "integrity": "sha512-xajwAxn1SC0HWx9Fw8wQZ/RGTpG7Pf9ZA13rpnKvq/4yblCk8tT8Ws+zEwgbHCt5PQe45SEtUZOQ42k3YpX3DA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-negative-zero/-/math-base-assert-is-negative-zero-0.2.2.tgz", + "integrity": "sha512-WvKNuBZ6CDarOTzOuFLmO1jwZnFD+butIvfD2Ws6SsuqSCiWOaF4OhIckqPzo1XEdkqqhRNPqBxqc0D+hsEYVA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4511,23 +4661,24 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-nonnegative-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nonnegative-integer/-/math-base-assert-is-nonnegative-integer-0.0.7.tgz", - "integrity": "sha512-G43o1iesRe86xm+JX8uf6bW4iNlyRvhasba4Q3IwqZBvnK9q916xzaqxFPaZmzBWhuXqg5jcaAB/j9xRm3MALA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nonnegative-integer/-/math-base-assert-is-nonnegative-integer-0.2.1.tgz", + "integrity": "sha512-WSD5fblgbQW7DR5qoTJu6oQa062Xz8Eboe6Igghe5fX7Up7GZ3vdnMpSgmsu0cRKm8W6ua2rVJKlXcoDZEnRLw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4540,22 +4691,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-special-floor": "^0.0.x" + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-odd": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-odd/-/math-base-assert-is-odd-0.0.7.tgz", - "integrity": "sha512-ZjIIu1AX57ZnKDxJW67t/FUyMkDnZLCZgvWiDr7+nkfTfGB1uLckJtwkmnZqz0CGtkpTU3geELbvGQ+e60kLEA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-odd/-/math-base-assert-is-odd-0.3.0.tgz", + "integrity": "sha512-V44F3xdR5/bHXqqYvE/AldLnVmijLr/rgf7EjnJXXDQLfPCgemy0iHTFl19N68KG1YO9SMPdyOaNjh4K0O9Qqw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4568,22 +4721,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-even": "^0.0.x" + "@stdlib/math-base-assert-is-even": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-assert-is-positive-zero": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-positive-zero/-/math-base-assert-is-positive-zero-0.0.8.tgz", - "integrity": "sha512-/9OtPelOyekHTk5hOvPjJl6LCY8CHQmib6TFKbRjqhqwjnqUGIO4bv80TSCKFddoEj/viIHXQfYHXXuQosMTVg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-positive-zero/-/math-base-assert-is-positive-zero-0.2.2.tgz", + "integrity": "sha512-mMX5xsemKpHRAgjpVJCb3eVZ3WIkZh6KnHQH8i8n4vI44pcdpN5rcTdEAMlhLjxT/rT7H2wq85f7/FRsq9r9rw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4596,23 +4751,24 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-napi-binary": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.0.8.tgz", - "integrity": "sha512-B8d0HBPhfXefbdl/h0h5c+lM2sE+/U7Fb7hY/huVeoQtBtEx0Jbx/qKvPSVxMjmWCKfWlbPpbgKpN5GbFgLiAg==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.3.0.tgz", + "integrity": "sha512-bhwsmGMOMN1srcpNAFRjDMSXe9ue1s/XmaoBBlqcG6S2nqRQlIVnKKH4WZx4hmC1jDqoFXuNPJGE47VXpVV+mA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4625,26 +4781,27 @@ "windows" ], "dependencies": { - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/complex-reim": "^0.0.x", - "@stdlib/complex-reimf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/complex-float32-ctor": "^0.0.2", + "@stdlib/complex-float32-reim": "^0.1.2", + "@stdlib/complex-float64-ctor": "^0.0.3", + "@stdlib/complex-float64-reim": "^0.1.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-napi-unary": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-unary/-/math-base-napi-unary-0.0.8.tgz", - "integrity": "sha512-xKbGBxbgrEe7dxCDXJrooXPhXSDUl/QPqsN74Qa0+8Svsc4sbYVdU3yHSN5vDgrcWt3ZkH51j0vCSBIjvLL15g==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-unary/-/math-base-napi-unary-0.2.3.tgz", + "integrity": "sha512-BCyJmpq2S8EFo2yMt1z+v1EL7nn8RHcM6jn7fa8n3BTP679K0MSlawIh3A0CFogfrTdjPM4G44VO1ddsdLExcg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4657,26 +4814,27 @@ "windows" ], "dependencies": { - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/complex-reim": "^0.0.x", - "@stdlib/complex-reimf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/complex-float32-ctor": "^0.0.2", + "@stdlib/complex-float32-reim": "^0.1.1", + "@stdlib/complex-float64-ctor": "^0.0.3", + "@stdlib/complex-float64-reim": "^0.1.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-abs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-abs/-/math-base-special-abs-0.0.6.tgz", - "integrity": "sha512-FaaMUnYs2qIVN3kI5m/qNlBhDnjszhDOzEhxGEoQWR/k0XnxbCsTyjNesR2DkpiKuoAXAr9ojoDe2qBYdirWoQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-abs/-/math-base-special-abs-0.2.2.tgz", + "integrity": "sha512-cw5CXj05c/L0COaD9J+paHXwmoN5IBYh+Spk0331f1pEMvGxSO1KmCREZaooUEEFKPhKDukEHKeitja2yAQh4Q==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4689,24 +4847,26 @@ "windows" ], "dependencies": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/number-float64-base-to-words": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-acos": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-acos/-/math-base-special-acos-0.0.7.tgz", - "integrity": "sha512-SLxb4Od8nKPxgTqfDnGrhUquANVQFmdz5Ao/pjraelVQEoRLc/lFKGNZQkyQNxlRX/CQelA8Ea20rauSL/hoSg==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-acos/-/math-base-special-acos-0.2.3.tgz", + "integrity": "sha512-f66Ikq0E3U5XQm6sTu4UHwP3TmcPrVgSK/mZTvg2JenswZ6qPtGO1A8KHZ5+/5bk1TSc9EW4zDGUqWG7mGzT4Q==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4719,25 +4879,28 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-fourth-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" + "@stdlib/constants-float64-fourth-pi": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-asin": "^0.2.2", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-asin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-asin/-/math-base-special-asin-0.0.7.tgz", - "integrity": "sha512-S0lAJy6jMLmVy4u3O5cnANq57W7ND8D/tnGZUm87yQqGAR4ZUXqLwH/RjB0fc9l/yhMqFGHP3+xWRjjD23M41Q==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-asin/-/math-base-special-asin-0.2.3.tgz", + "integrity": "sha512-Ju1UFJspOOL630SqBtVmUh3lHv5JMu1szcAgx7kQupJwZiwWljoVQ5MmxlNY4l3nGM5oMokenlqTDNXOau43lw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4750,24 +4913,27 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-fourth-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" + "@stdlib/constants-float64-fourth-pi": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-beta": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-beta/-/math-base-special-beta-0.0.6.tgz", - "integrity": "sha512-t5O3R7bsvl7tK0jXmm+X6zYEomIZELiaboiZfJFX0gsiawVaogT/8jLuCjiGE7o3jB65PGSY7hYAChQ0Gl6CKw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-beta/-/math-base-special-beta-0.3.0.tgz", + "integrity": "sha512-SWUF1AZLqaEJ8g1Lj0/UOfj955AsIS3QPYH/ZMijELVxCwmp7VRgalI0AxMM09IraJt1cH5WrSwSnouH1WC3ZQ==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -4780,29 +4946,32 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" + "@stdlib/constants-float64-e": "^0.2.2", + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-betainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betainc/-/math-base-special-betainc-0.0.6.tgz", - "integrity": "sha512-xV/4zuikNN7zaU+XGmTRKV87kv0JkAqPIvX3PWD+dO8jy5Pmy+iaRkF99wFk8XjpDKj0fpK0yMf7W6i7kT12BA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betainc/-/math-base-special-betainc-0.2.2.tgz", + "integrity": "sha512-95tzDgn5d9RV9al4gxHwKfszd9M6AizlpnhAiwIi0JwqcO+OY3xgbABWal4/H09Tb8DaC9jDqiyGuyPuB0iDew==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -4815,22 +4984,23 @@ "windows" ], "dependencies": { - "@stdlib/math-base-special-kernel-betainc": "^0.0.x" + "@stdlib/math-base-special-kernel-betainc": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-betaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaincinv/-/math-base-special-betaincinv-0.0.6.tgz", - "integrity": "sha512-Re3ArtbFKKf7dynIJDccz4ohifhD24zAnGRS3nYAO+DoYWfVxiit4K2j2Tg3bINXhsH0x/uDWeqIwpWJrlDo9Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaincinv/-/math-base-special-betaincinv-0.2.2.tgz", + "integrity": "sha512-anq6c9R77aRuGdyd18jG16/cVocQhJNd5HLgA3jjowjfmLM1GCcBdbJmlvE61s+RHJxYuC8IiyZXPZaXfUWVHw==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -4843,23 +5013,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-kernel-betaincinv": "^0.0.x" + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-kernel-betaincinv": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-betaln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaln/-/math-base-special-betaln-0.0.6.tgz", - "integrity": "sha512-KrHivIFThZ2NrJPbQbkNTgywPnWKrCXJ3Nisk3Dus6AedLb4gZILd1+X3zXVqugKPCUlv47J3CYB7RTVHsxVjA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaln/-/math-base-special-betaln-0.2.2.tgz", + "integrity": "sha512-/PUE6gOGCcsOlognxHpF2rNbfPPJ88ehaD1xlbm0ObIu71Bjq4mfMcAVuylvjl5xLGoXyrUAFLO0mykruoPHiA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4872,31 +5043,109 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x" + "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-special-gamma": "^0.3.0", + "@stdlib/math-base-special-gammaln": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-max": "^0.3.0", + "@stdlib/math-base-special-min": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-betaln/node_modules/@stdlib/math-base-special-gamma": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.3.0.tgz", + "integrity": "sha512-YfW+e5xuSDoUxgpquXPrFtAbdwOzE7Kqt7M0dcAkDNot8/yUn+QmrDGzURyBVzUyhRm9SaC9bACHxTShdJkcuA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-eulergamma": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sin": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-betaln/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-binomcoef": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoef/-/math-base-special-binomcoef-0.0.8.tgz", - "integrity": "sha512-N1eWKSA4PknbU0HwRhUOTQvAog79C0fOp+eg2Q7U8WH+mCDKMS9LErs0hsA6dRlRZu+5DzldZr5ae6RHxNzlhA==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoef/-/math-base-special-binomcoef-0.2.3.tgz", + "integrity": "sha512-RxnQ/QGgKUeqTvBL+7IH8rNKQYCfGs0I3PsFYfb0e9V1O2yIVvthURUpzjukurZM89JRapK1dN6aeZ5UM71Zgw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4909,25 +5158,29 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-odd": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x" + "@stdlib/constants-float64-max-safe-integer": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-odd": "^0.3.0", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-gcd": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-binomcoefln": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoefln/-/math-base-special-binomcoefln-0.0.7.tgz", - "integrity": "sha512-mdEEefX9hRs2fyyX3fbXR5tN1Cogaszp+BLsKND2hJmhxy3zJzDRFSYimDrMmbEJMAbzXr26JHQw0feCiyevZQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoefln/-/math-base-special-binomcoefln-0.2.2.tgz", + "integrity": "sha512-7hSOIpC+YRoCbyPy3YW+hhPaQU4oyzYmfYlN1xcFLFWA07OCBdfuiQnMnFi8t77BYLCKYbWUgzE9FEGl7eMF8g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4940,27 +5193,28 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-betaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-betaln": "^0.2.1", + "@stdlib/math-base-special-ln": "^0.2.4" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-ceil": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ceil/-/math-base-special-ceil-0.0.8.tgz", - "integrity": "sha512-TP6DWHXreyjO3iZntIsMcHcVYhQEhaQavjYX5z9FiYt8WOEliGRmb9TBAl4SWrHqIq+RTP8IwOydkBpAFndIbA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ceil/-/math-base-special-ceil-0.2.2.tgz", + "integrity": "sha512-zGkDaMcPrxQ9Zo+fegf2MyI8UPIrVTK5sc/FgCN9qdwEFJTKGLsBd249T3xH7L2MDxx5JbIMGrr6L4U4uEm2Hw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -4973,23 +5227,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-copysign": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-copysign/-/math-base-special-copysign-0.0.7.tgz", - "integrity": "sha512-7Br7oeuVJSBKG8BiSk/AIRFTBd2sbvHdV3HaqRj8tTZHX8BQomZ3Vj4Qsiz3kPyO4d6PpBLBTYlGTkSDlGOZJA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-copysign/-/math-base-special-copysign-0.2.2.tgz", + "integrity": "sha512-m9nWIQhKsaNrZtS2vIPeToWDbzs/T0d0NWy7gSci38auQVufSbF6FYnCKl0f+uwiWlh5GYXs0uVbyCp7FFXN+A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5002,28 +5257,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-high-word-abs-mask": "^0.0.x", - "@stdlib/constants-float64-high-word-sign-mask": "^0.0.x", - "@stdlib/math-base-napi-binary": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-sign-mask": "^0.2.1", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/number-float64-base-from-words": "^0.2.2", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/number-float64-base-to-words": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-cos": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-cos/-/math-base-special-cos-0.0.6.tgz", - "integrity": "sha512-dmBXZ5iRnC8u13EiZEfkjIzzOFiasvPM9MZldW6qK70aP1U+bmw1/Y27rwe4na+X6Yrkh+Vg/88NIjAOWccCXQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-cos/-/math-base-special-cos-0.3.0.tgz", + "integrity": "sha512-SsZpptPgCn15MjpWqEei6XaI60N+lrP0B7pFL89KFOXmagN4MprdU/YUmG413yPgUDLEEQfA0C9KbRWuf9uRvw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5036,25 +5292,30 @@ "windows" ], "dependencies": { - "@stdlib/math-base-special-kernel-cos": "^0.0.x", - "@stdlib/math-base-special-kernel-sin": "^0.0.x", - "@stdlib/math-base-special-rempio2": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-kernel-cos": "^0.2.3", + "@stdlib/math-base-special-kernel-sin": "^0.2.3", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-erfc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfc/-/math-base-special-erfc-0.0.6.tgz", - "integrity": "sha512-QLqfjP55VK9aW0VOq30lsi3ymDSvDBjUOI1fTRZmqMNizB38AM+ZlPkn9e9SNLYXRxp8BHZUEjOsEi6b5HnNIw==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfc/-/math-base-special-erfc-0.2.4.tgz", + "integrity": "sha512-tVI+mMnW+oDfQXwoH86sZ8q4ximpUXX6wZFCYZB6KcO5GXeKuvK74DnU0YyIm+sTV+r9WJiTSBEW9iVQLZOkzg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5067,26 +5328,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/number-float64-base-set-low-word": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/number-float64-base-set-low-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-erfcinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfcinv/-/math-base-special-erfcinv-0.0.6.tgz", - "integrity": "sha512-OBXoR771SxlJarOARcvEIcIlMTCdEsR0wg20oHZO/vvLNwB8znMCC2ZGC76jzqBVlo41V2p34L2FPjLJfwJeXQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfcinv/-/math-base-special-erfcinv-0.2.3.tgz", + "integrity": "sha512-B8u7WZiIh0+rX8VWNOwvjPWpmeKBHIQoJtIigUseBgbch/rmgV43k63MCkjh2u+V2SmcFo38yD94qJg5bYyWeA==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5099,26 +5363,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-exp": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-exp/-/math-base-special-exp-0.0.6.tgz", - "integrity": "sha512-oHhH7WlPIwoT/nY29p3eLn/Zh1oAOLsZvr3kf5Lb/ntenkpgB7wMjynsiGKyBupNR49esB4/FaBbGqhYmKgwaQ==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-exp/-/math-base-special-exp-0.2.4.tgz", + "integrity": "sha512-G6pZqu1wA4WwBj7DcnztA+/ro61wXJUTpKFLOwrIb2f/28pHGpA//Lub+3vAk6/ksAkhJ+qM/dfdM2ue7zLuEw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5131,26 +5398,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-ldexp": "^0.2.3", + "@stdlib/math-base-special-trunc": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-expm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-expm1/-/math-base-special-expm1-0.0.6.tgz", - "integrity": "sha512-q6csQF1XZD5ikudP8laJwPh390VnqkEkL7Nv39GSa4JKuQUt+EAxc+Y1HEWEw+Io06eTLl36SYEZy7Pz/NL1PA==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-expm1/-/math-base-special-expm1-0.2.3.tgz", + "integrity": "sha512-uJlYZjPjG9X8owuwp1h1/iz9xf21v3dlyEAuutQ0NoacUDzZKVSCbQ3Of0i2Mujn+4N+kjCvEeph6cqhfYAl+A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5163,28 +5433,32 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-half-ln-two": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-half-ln-two": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/number-float64-base-from-words": "^0.2.2", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/number-float64-base-set-high-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-factorial": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-factorial/-/math-base-special-factorial-0.0.6.tgz", - "integrity": "sha512-FU3CpQ3bhAGhw9fP6yNI+U0i1qEtAvT3Xhu6yAGMPDsfB2tdi8YLipiqFPKiS6i3ub7srknYkLFKq6M9n1tHNw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-factorial/-/math-base-special-factorial-0.2.1.tgz", + "integrity": "sha512-uqsANeW4gHFzhgDrV9X0INEwO74MPzQvDVXbxY9+b0E13Vq2HHCi0GqdtPOWXdhOCUk8RkLRs9GizU3X6Coy8A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5197,25 +5471,26 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x" + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-special-gamma": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-floor": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-floor/-/math-base-special-floor-0.0.8.tgz", - "integrity": "sha512-VwpaiU0QhQKB8p+r9p9mNzhrjU5ZVBnUcLjKNCDADiGNvO5ACI/I+W++8kxBz5XSp5PAQhaFCH4MpRM1tSkd/w==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-floor/-/math-base-special-floor-0.2.3.tgz", + "integrity": "sha512-zTkxVRawtWwJ4NmAT/1e+ZsIoBj1JqUquGOpiNVGNIKtyLOeCONZlZSbN7zuxPkshvmcSjpQ/VLKR8Tw/37E9A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5228,23 +5503,62 @@ "windows" ], "dependencies": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-fmod": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-fmod/-/math-base-special-fmod-0.1.0.tgz", + "integrity": "sha512-osHwmEOT5MPWOXRx8y3wKCp362eGHIcJRt8LARJJICr/qTZlu1HMnZnbwuhfy1NIQzpJ8aLOhEdl2PrProTt3A==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-sign-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-significand-mask": "^0.2.2", + "@stdlib/constants-float64-min-base2-exponent": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/number-float64-base-from-words": "^0.2.2", + "@stdlib/number-float64-base-to-words": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gamma": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.0.6.tgz", - "integrity": "sha512-UqxLakbDrCsobOFzp0VC/OCTLimgnZPJOyrUJ4Vw3UAObmkqrH+Lxh3cYZgX/AMLAcWdN/MSPdRK9QMAp5vHYQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.2.1.tgz", + "integrity": "sha512-Sfq1HnVoL4kN9EDHH3YparEAF0r7QD5jNFppUTOXmrqkofgImSl5tLttttnr2I7O9zsNhYkBAiTx9q0y25bAiA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5257,34 +5571,35 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-eulergamma": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-negative-zero": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x" + "@stdlib/constants-float64-eulergamma": "^0.2.1", + "@stdlib/constants-float64-ninf": "^0.2.1", + "@stdlib/constants-float64-pi": "^0.2.1", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/math-base-special-exp": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.1", + "@stdlib/math-base-special-pow": "^0.2.1", + "@stdlib/math-base-special-sin": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gamma-delta-ratio": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-delta-ratio/-/math-base-special-gamma-delta-ratio-0.0.6.tgz", - "integrity": "sha512-d4so1qxVsPZF1cBtprdFOjyQIUxawiMI/rl+L8LTlGPaJvo9b/pChVkLl1eS2r/EuPvTD0YwzDoNWXWVpyi9qA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-delta-ratio/-/math-base-special-gamma-delta-ratio-0.2.2.tgz", + "integrity": "sha512-lan+cfafH7aoyUxa88vLO+pYwLA+0uiyVFmCumxDemQUboCrTiNCYhBjONFGI/ljE3RukHoE3ZV4AccIcx526A==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5297,32 +5612,33 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-factorial": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x" + "@stdlib/constants-float64-e": "^0.2.2", + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/constants-float64-gamma-lanczos-g": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-factorial": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-gamma": "^0.2.1", + "@stdlib/math-base-special-gamma-lanczos-sum": "^0.3.0", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gamma-lanczos-sum": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum/-/math-base-special-gamma-lanczos-sum-0.0.7.tgz", - "integrity": "sha512-Exmay1SmzBCwscGOZZYeQwaOQvjUlYWR8UI0WPSeWRLa9Myhhj+Cu98pHuKsvNaktDKyeWGgW/QhFPudRyIoVw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum/-/math-base-special-gamma-lanczos-sum-0.3.0.tgz", + "integrity": "sha512-q13p6r7G0TmbD54cU8QgG8wGgdGGznV9dNKiNszw+hOqCQ+1DqziG8I6vN64R3EQLP7QN4yVprZcmuXSK+fgsg==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5334,20 +5650,26 @@ "win32", "windows" ], + "dependencies": { + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled/-/math-base-special-gamma-lanczos-sum-expg-scaled-0.0.7.tgz", - "integrity": "sha512-zjdpS8owElpxosiEs78XawbJ/+pvMsUdEN7ThLiGpTToSqffb/L9FGlD3uD/LiXHgiqs4CwsU1xBaX8cI6tn2A==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled/-/math-base-special-gamma-lanczos-sum-expg-scaled-0.3.0.tgz", + "integrity": "sha512-hScjKZvueOK5piX84ZLIV3ZiYvtvYtcixN8psxkPIxJlN7Bd5nAmSkEOBL+T+LeW2RjmdEMXFFJMF7FsK1js/Q==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5359,20 +5681,135 @@ "win32", "windows" ], + "dependencies": { + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gamma/node_modules/@stdlib/math-base-assert-is-odd": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-odd/-/math-base-assert-is-odd-0.2.1.tgz", + "integrity": "sha512-V4qQuCO6/AA5udqlNatMRZ8R/MgpqD8mPIkFrpSZJdpLcGYSz815uAAf3NBOuWXkE2Izw0/Tg/hTQ+YcOW2g5g==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/math-base-assert-is-even": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gamma/node_modules/@stdlib/math-base-special-pow": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-pow/-/math-base-special-pow-0.2.1.tgz", + "integrity": "sha512-7SvgVzDkuilZKrHh4tPiXx9fypF/V7PSvAcUVjvcRj5kVEwv/15RpzlmCJlT9B20VPSx4gJ1S0UIA6xgmYFuAg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-exponent-bias": "^0.2.1", + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-significand-mask": "^0.2.1", + "@stdlib/constants-float64-ln-two": "^0.2.1", + "@stdlib/constants-float64-ninf": "^0.2.1", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/math-base-assert-is-infinite": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-assert-is-odd": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/math-base-special-copysign": "^0.2.1", + "@stdlib/math-base-special-ldexp": "^0.2.1", + "@stdlib/math-base-special-sqrt": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1", + "@stdlib/number-float64-base-set-high-word": "^0.2.1", + "@stdlib/number-float64-base-set-low-word": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/number-uint32-base-to-int32": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gamma/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gamma1pm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma1pm1/-/math-base-special-gamma1pm1-0.0.6.tgz", - "integrity": "sha512-MAyGncYTJjdSAUCjezMq9ah+hEc4A3yiyTmBMtJ60xkFzRiMOgI+KZV8Yb3brtRWtMayGmRsarqbroXeAnzJKQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma1pm1/-/math-base-special-gamma1pm1-0.2.2.tgz", + "integrity": "sha512-lNT1lk0ifK2a/ta3GfR5V8KvfgkgheE44n5AQ/07BBfcVBMiAdqNuyjSMeWqsH/zVGzjU6G8+kLBzmaJXivPXQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5385,27 +5822,28 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x" + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-expm1": "^0.2.3", + "@stdlib/math-base-special-gamma": "^0.2.1", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gammainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammainc/-/math-base-special-gammainc-0.0.6.tgz", - "integrity": "sha512-KZ5Fz/DVyTTeuEckXxU6OKouAzjEHPBTIyDi8ttoeYV1CEtaBkdI/7azrw/27lPrxFGChX9+T7b5bInyBoCSeg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammainc/-/math-base-special-gammainc-0.2.2.tgz", + "integrity": "sha512-ffKZFiv/41SXs2Xms7IW3lPnICR898yfWAidq5uKjOLgRb3wrzNjq0sZ6EAVXvdBwyGULvSjyud28PpVhDLv3A==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5418,49 +5856,51 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-max-ln": "^0.0.x", - "@stdlib/constants-float64-min-ln": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-eps": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-two-pi": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-erfc": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.0.x", - "@stdlib/math-base-special-gamma1pm1": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-powm1": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-continued-fraction": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x", - "@stdlib/math-base-tools-sum-series": "^0.0.x" + "@stdlib/constants-float64-e": "^0.2.2", + "@stdlib/constants-float64-gamma-lanczos-g": "^0.2.2", + "@stdlib/constants-float64-max": "^0.2.2", + "@stdlib/constants-float64-max-ln": "^0.2.2", + "@stdlib/constants-float64-min-ln": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-eps": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/constants-float64-two-pi": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-erfc": "^0.2.4", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-gamma": "^0.3.0", + "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.3.0", + "@stdlib/math-base-special-gamma1pm1": "^0.2.2", + "@stdlib/math-base-special-gammaln": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-log1pmx": "^0.2.3", + "@stdlib/math-base-special-max": "^0.3.0", + "@stdlib/math-base-special-min": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-powm1": "^0.3.0", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/math-base-tools-continued-fraction": "^0.2.2", + "@stdlib/math-base-tools-evalpoly": "^0.2.2", + "@stdlib/math-base-tools-sum-series": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, - "node_modules/@stdlib/math-base-special-gammaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaincinv/-/math-base-special-gammaincinv-0.0.6.tgz", - "integrity": "sha512-4FIUriC46apqk+CaoPtcW6B1bu71RMnez/cxCJ8o+wpU4O6sAgzYweVqf8Z9EITkrILwAgtXIRo9qb/FmMiBiQ==", + "node_modules/@stdlib/math-base-special-gammainc/node_modules/@stdlib/math-base-special-gamma": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.3.0.tgz", + "integrity": "sha512-YfW+e5xuSDoUxgpquXPrFtAbdwOzE7Kqt7M0dcAkDNot8/yUn+QmrDGzURyBVzUyhRm9SaC9bACHxTShdJkcuA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5473,24 +5913,101 @@ "windows" ], "dependencies": { - "@stdlib/constants-float32-max": "^0.0.x", - "@stdlib/constants-float32-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-two-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-erfcinv": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gammainc": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x", + "@stdlib/constants-float64-eulergamma": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sin": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gammainc/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gammaincinv": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaincinv/-/math-base-special-gammaincinv-0.2.2.tgz", + "integrity": "sha512-bIZ94ob1rY87seDWsvBTBRxp8Ja2Y46DLtQYuaylHUQuK+I2xKy8XKL2ZHPsOfuwhXRqm+q+91PDjPEAdH1dQw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float32-max": "^0.2.2", + "@stdlib/constants-float32-smallest-normal": "^0.2.2", + "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/constants-float64-two-pi": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-erfcinv": "^0.2.3", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-gamma": "^0.3.0", + "@stdlib/math-base-special-gammainc": "^0.2.2", + "@stdlib/math-base-special-gammaln": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-min": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/math-base-tools-evalpoly": "^0.2.2", "debug": "^2.6.9" }, "engines": { @@ -5498,8 +6015,85 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gammaincinv/node_modules/@stdlib/math-base-special-gamma": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.3.0.tgz", + "integrity": "sha512-YfW+e5xuSDoUxgpquXPrFtAbdwOzE7Kqt7M0dcAkDNot8/yUn+QmrDGzURyBVzUyhRm9SaC9bACHxTShdJkcuA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-eulergamma": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sin": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gammaincinv/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-gammaincinv/node_modules/debug": { @@ -5507,6 +6101,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -5515,13 +6110,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@stdlib/math-base-special-gammaln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaln/-/math-base-special-gammaln-0.0.6.tgz", - "integrity": "sha512-qrFAPEcwHcTsDBUJkqDY5VmhW6NU8UcN7n14zo1SO/cguks8bmFRe7kqxmKMzy5xI2Xff/NmgYpLcAIc+gC9Hw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaln/-/math-base-special-gammaln-0.2.2.tgz", + "integrity": "sha512-opG6HUlspi/GLvQAr4pcwyAevm7BYuymlopgNZ1VulWUvksDpytalaX3zva0idlD2HvniKrDmzHngT1N9p0J1A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5534,29 +6131,89 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-sinpi": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-sinpi": "^0.2.1", + "@stdlib/math-base-special-trunc": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gcd": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gcd/-/math-base-special-gcd-0.2.1.tgz", + "integrity": "sha512-w10k9W176lDkbiDIwnmVr1nkTyypTQLwA3/CN9qEUmXh/u8NlxkSnDYBpArcWnxE0oFaIggw8sLJ58TuMvxMaw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-ninf": "^0.2.1", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/constants-int32-max": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-gcd/node_modules/@stdlib/constants-int32-max": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/constants-int32-max/-/constants-int32-max-0.2.1.tgz", + "integrity": "sha512-vKtp3q/HdAeGG8BJBZdNzFrYpVQeleODgvOxh9Pn/TX1Ktjc50I9TVl7nTVWsT2QnacruOorILk2zNsdgBHPUQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-kernel-betainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betainc/-/math-base-special-kernel-betainc-0.0.6.tgz", - "integrity": "sha512-tvmVgDIrffI3ySspU+b8XwUmzBXf7ggbf3PRX1Gq4unOJteV6b+Kw1f979FuWzV4iDKzTAqkex6xGeNlWavZtQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betainc/-/math-base-special-kernel-betainc-0.2.2.tgz", + "integrity": "sha512-DQwQUWQkmZtjRgdvZ1yZOEdAYLQoEUEndbr47Z69Oe6AgwKwxxpZUh09h9imKheFCFHLVnwVUz20azIM5KifQw==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5569,57 +6226,286 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/constants-float64-half-pi": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-max-ln": "^0.0.x", - "@stdlib/constants-float64-min-ln": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/constants-int32-max": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-beta": "^0.0.x", - "@stdlib/math-base-special-binomcoef": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-factorial": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-delta-ratio": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.0.x", - "@stdlib/math-base-special-gammainc": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-maxabs": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-minabs": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-continued-fraction": "^0.0.x", - "@stdlib/math-base-tools-sum-series": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/constants-float64-e": "^0.2.2", + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/constants-float64-gamma-lanczos-g": "^0.2.2", + "@stdlib/constants-float64-half-pi": "^0.2.2", + "@stdlib/constants-float64-max": "^0.2.2", + "@stdlib/constants-float64-max-ln": "^0.2.2", + "@stdlib/constants-float64-min-ln": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-smallest-normal": "^0.2.2", + "@stdlib/constants-int32-max": "^0.3.0", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-asin": "^0.2.3", + "@stdlib/math-base-special-beta": "^0.3.0", + "@stdlib/math-base-special-binomcoef": "^0.2.3", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-expm1": "^0.2.3", + "@stdlib/math-base-special-factorial": "^0.3.0", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-gamma": "^0.3.0", + "@stdlib/math-base-special-gamma-delta-ratio": "^0.2.2", + "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.3.0", + "@stdlib/math-base-special-gammainc": "^0.2.1", + "@stdlib/math-base-special-gammaln": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-max": "^0.3.0", + "@stdlib/math-base-special-maxabs": "^0.3.0", + "@stdlib/math-base-special-min": "^0.2.3", + "@stdlib/math-base-special-minabs": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/math-base-tools-continued-fraction": "^0.2.2", + "@stdlib/math-base-tools-sum-series": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-assert-is-odd": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-odd/-/math-base-assert-is-odd-0.2.1.tgz", + "integrity": "sha512-V4qQuCO6/AA5udqlNatMRZ8R/MgpqD8mPIkFrpSZJdpLcGYSz815uAAf3NBOuWXkE2Izw0/Tg/hTQ+YcOW2g5g==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/math-base-assert-is-even": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-special-factorial": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-factorial/-/math-base-special-factorial-0.3.0.tgz", + "integrity": "sha512-tXdXqstF4gmy4HpzALo3Bhkj2UQSlyk+PU3alWXZH5XtKUozHuXhQDnak+2c4w0JqnKxHq4mnaR2qgjfkDNZcA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-max-safe-nth-factorial": "^0.1.0", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-gamma": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-special-factorial/node_modules/@stdlib/math-base-special-gamma": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.2.1.tgz", + "integrity": "sha512-Sfq1HnVoL4kN9EDHH3YparEAF0r7QD5jNFppUTOXmrqkofgImSl5tLttttnr2I7O9zsNhYkBAiTx9q0y25bAiA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-eulergamma": "^0.2.1", + "@stdlib/constants-float64-ninf": "^0.2.1", + "@stdlib/constants-float64-pi": "^0.2.1", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/math-base-special-exp": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.1", + "@stdlib/math-base-special-pow": "^0.2.1", + "@stdlib/math-base-special-sin": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-special-factorial/node_modules/@stdlib/math-base-special-pow": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-pow/-/math-base-special-pow-0.2.1.tgz", + "integrity": "sha512-7SvgVzDkuilZKrHh4tPiXx9fypF/V7PSvAcUVjvcRj5kVEwv/15RpzlmCJlT9B20VPSx4gJ1S0UIA6xgmYFuAg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-exponent-bias": "^0.2.1", + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-significand-mask": "^0.2.1", + "@stdlib/constants-float64-ln-two": "^0.2.1", + "@stdlib/constants-float64-ninf": "^0.2.1", + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/math-base-assert-is-infinite": "^0.2.1", + "@stdlib/math-base-assert-is-integer": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-assert-is-odd": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/math-base-special-copysign": "^0.2.1", + "@stdlib/math-base-special-ldexp": "^0.2.1", + "@stdlib/math-base-special-sqrt": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1", + "@stdlib/number-float64-base-set-high-word": "^0.2.1", + "@stdlib/number-float64-base-set-low-word": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/number-uint32-base-to-int32": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-special-gamma": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.3.0.tgz", + "integrity": "sha512-YfW+e5xuSDoUxgpquXPrFtAbdwOzE7Kqt7M0dcAkDNot8/yUn+QmrDGzURyBVzUyhRm9SaC9bACHxTShdJkcuA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-eulergamma": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/constants-float64-sqrt-two-pi": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-sin": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-kernel-betainc/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-kernel-betaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betaincinv/-/math-base-special-kernel-betaincinv-0.0.6.tgz", - "integrity": "sha512-3qAYsk7QgbvKQr1vAUHiEddEBLXvMZd0H+HBHnLs19vXmklJOlxIPJjCpVSH0XnAT8iM6F7Qtb7ph88J0RYLdg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betaincinv/-/math-base-special-kernel-betaincinv-0.2.2.tgz", + "integrity": "sha512-FVGf/clx14n3cPfRLKmd8+vAj90F200VxFOlf8kEULqGKbcQfoTHUfsViJ+r8l0cz1xf9K6uyfAl5KfqUIln4w==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -5632,52 +6518,53 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-half-pi": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-smallest-subnormal": "^0.0.x", - "@stdlib/constants-float64-sqrt-two": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-acos": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-beta": "^0.0.x", - "@stdlib/math-base-special-betainc": "^0.0.x", - "@stdlib/math-base-special-cos": "^0.0.x", - "@stdlib/math-base-special-erfcinv": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma-delta-ratio": "^0.0.x", - "@stdlib/math-base-special-gammaincinv": "^0.0.x", - "@stdlib/math-base-special-kernel-betainc": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x", - "@stdlib/math-base-special-signum": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x" + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/constants-float64-half-pi": "^0.2.2", + "@stdlib/constants-float64-max": "^0.2.2", + "@stdlib/constants-float64-pi": "^0.2.2", + "@stdlib/constants-float64-smallest-normal": "^0.2.2", + "@stdlib/constants-float64-smallest-subnormal": "^0.2.2", + "@stdlib/constants-float64-sqrt-two": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-acos": "^0.2.3", + "@stdlib/math-base-special-asin": "^0.2.3", + "@stdlib/math-base-special-beta": "^0.3.0", + "@stdlib/math-base-special-betainc": "^0.2.2", + "@stdlib/math-base-special-cos": "^0.3.0", + "@stdlib/math-base-special-erfcinv": "^0.2.3", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-expm1": "^0.2.3", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-gamma-delta-ratio": "^0.2.2", + "@stdlib/math-base-special-gammaincinv": "^0.2.2", + "@stdlib/math-base-special-kernel-betainc": "^0.2.2", + "@stdlib/math-base-special-ldexp": "^0.2.3", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-special-max": "^0.3.0", + "@stdlib/math-base-special-min": "^0.2.3", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-round": "^0.3.0", + "@stdlib/math-base-special-signum": "^0.2.2", + "@stdlib/math-base-special-sin": "^0.3.0", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/math-base-tools-evalpoly": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-kernel-cos": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-cos/-/math-base-special-kernel-cos-0.0.7.tgz", - "integrity": "sha512-u3u7xKJtEjfYMSVokJuX+09wNqLpVEaSnHTDVyWl2zkUzHVt0hZ/okd1T7hTZ444pIA10d9niI3OWXWiYryBrw==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-cos/-/math-base-special-kernel-cos-0.2.3.tgz", + "integrity": "sha512-K5FbN25SmEc5Z89GejUkrZpqCv05ZX6D7g9SUFcKWFJ1fwiZNgxrF8q4aJtGDQhuV3q66C1gaKJyQeLq/OI8lQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5689,20 +6576,25 @@ "win32", "windows" ], + "dependencies": { + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/utils-library-manifest": "^0.2.2" + }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-kernel-sin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-sin/-/math-base-special-kernel-sin-0.0.7.tgz", - "integrity": "sha512-fhTxDb9klS2F4an7W7iyDcc2Nh/MzE7U4dAtxsVXviHiVNYc///wPkg9hHXqYe/c6q7FxnanXCGW9FOTWfhe/Q==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-sin/-/math-base-special-kernel-sin-0.2.3.tgz", + "integrity": "sha512-PFnlGdapUaCaMXqZr+tG5Ioq+l4TCyGE5e8XEYlsyhNDILf0XE2ghHzlROA/wW365Arl4sPLWUoo4oH98DUPqw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5714,20 +6606,25 @@ "win32", "windows" ], + "dependencies": { + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/utils-library-manifest": "^0.2.2" + }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-ldexp": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ldexp/-/math-base-special-ldexp-0.0.8.tgz", - "integrity": "sha512-VTzu2kdgzQT3ebHGtCegKDpTA3RtsUVhb7V3IjAu/dHFLlXPXh5MEuxK/gV4vCpGBW0MKPTO73vwBjo6RT4xUg==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ldexp/-/math-base-special-ldexp-0.2.3.tgz", + "integrity": "sha512-yD4YisQGVTJmTJUshuzpaoq34sxJtrU+Aw4Ih39mzgXiQi6sh3E3nijB8WXDNKr2v05acUWJ1PRMkkJSfu16Kg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5740,34 +6637,38 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-max-base2-exponent": "^0.0.x", - "@stdlib/constants-float64-max-base2-exponent-subnormal": "^0.0.x", - "@stdlib/constants-float64-min-base2-exponent-subnormal": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/number-float64-base-exponent": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-normalize": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-max-base2-exponent": "^0.2.2", + "@stdlib/constants-float64-max-base2-exponent-subnormal": "^0.2.1", + "@stdlib/constants-float64-min-base2-exponent-subnormal": "^0.2.1", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-copysign": "^0.2.1", + "@stdlib/number-float32-base-to-word": "^0.2.2", + "@stdlib/number-float64-base-exponent": "^0.2.2", + "@stdlib/number-float64-base-from-words": "^0.2.2", + "@stdlib/number-float64-base-normalize": "^0.2.3", + "@stdlib/number-float64-base-to-words": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-ln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ln/-/math-base-special-ln-0.0.6.tgz", - "integrity": "sha512-WswUUVL/PLCglfp8yDD1CjkaEofzaNkDnTkQgCEMFuEqlKQEeMS3D8Z5skThILZtT/EF6YupmBezQKXTEqTFiQ==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ln/-/math-base-special-ln-0.2.4.tgz", + "integrity": "sha512-lSB47USaixrEmxwadT0/yByvTtxNhaRwN0FIXt5oj38bsgMXGW4V8xrANOy1N+hrn3KGfHJNDyFPYbXWVdMTIw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5780,26 +6681,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/number-float64-base-set-high-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-log1p": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-log1p/-/math-base-special-log1p-0.0.6.tgz", - "integrity": "sha512-/azhtpBdJ2DJBRunAyPe/+Hr2YhWh21WJ7Lytc/uxaUvHCLVjPRZBjZW3lcjpweHIECd1+m4jBb2RYYqHGWjfQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-log1p/-/math-base-special-log1p-0.2.3.tgz", + "integrity": "sha512-1Pu3attNR+DcskIvhvyls+2KRZ0UCHQ/jP2tvgFI9bWDCgb4oEimXPzjFteGNg9Mj6WlAW2b9wU9tHt3bp8R3g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5812,27 +6716,65 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/number-float64-base-set-high-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-log1pmx": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-log1pmx/-/math-base-special-log1pmx-0.2.3.tgz", + "integrity": "sha512-HfjDXcbFztm/GQRrn7a9FMYS0rm/4VPXWa50sYQzBHSYaEwYv5Y1awaZz+cA/ncuqAq1Mw0dfcwEMNRmZtnxEQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/math-base-tools-sum-series": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-max/-/math-base-special-max-0.0.7.tgz", - "integrity": "sha512-BCvHfLflabBPBv7Ueoe48AmdDZLsp0eOfwkA84+WHvr/MthXUf6Ptz6GqDkEjKNQNMN+reSluyq3uCB2HLrr3Q==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-max/-/math-base-special-max-0.3.0.tgz", + "integrity": "sha512-yXsmdFCLHRB24l34Kn1kHZXHKoGqBxPY/5Mi+n5qLg+FwrX85ZG6KGVbO3DfcpG1NxDTcEKb1hxbUargI0P5fw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5845,25 +6787,60 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-positive-zero": "^0.0.x" + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-positive-zero": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-max/node_modules/@stdlib/math-base-napi-binary": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.2.1.tgz", + "integrity": "sha512-ewGarSRaz5gaLsE17yJ4me03e56ICgPAA0ru0SYFCeMK2E5Z4Z2Lbu7HAQTTg+8XhpoaZSw0h2GJopTV7PCKmw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/complex-float32": "^0.2.1", + "@stdlib/complex-float64": "^0.2.1", + "@stdlib/complex-reim": "^0.2.1", + "@stdlib/complex-reimf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-maxabs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-maxabs/-/math-base-special-maxabs-0.0.6.tgz", - "integrity": "sha512-AbTCAyrX5CULvQ9te4YBqJlcfTuTj31TlGtF8NEm8v+SWt5Bbu2DSfGrwND/9ppWZcOVhRZm1RnCUwDfzRbEKQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-maxabs/-/math-base-special-maxabs-0.3.0.tgz", + "integrity": "sha512-SDj+rGD9itZ/YG2hKzhLX4Tf13SNJdOyNsMy1ezjec6Az3xJXKzv2wJAJIteo0KF6jQnEDkI/F6OIF65MY+o0g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5876,24 +6853,90 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x" + "@stdlib/math-base-napi-binary": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-max": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-maxabs/node_modules/@stdlib/math-base-napi-binary": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.2.1.tgz", + "integrity": "sha512-ewGarSRaz5gaLsE17yJ4me03e56ICgPAA0ru0SYFCeMK2E5Z4Z2Lbu7HAQTTg+8XhpoaZSw0h2GJopTV7PCKmw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/complex-float32": "^0.2.1", + "@stdlib/complex-float64": "^0.2.1", + "@stdlib/complex-reim": "^0.2.1", + "@stdlib/complex-reimf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-maxabs/node_modules/@stdlib/math-base-special-max": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-max/-/math-base-special-max-0.2.1.tgz", + "integrity": "sha512-jsA3x5azfclbULDFwvHjNlB2nciUDHwrw7qHP/QlSdJi47E1iBDNYdzhlOa3JKzblbrITpzgZEsGBcpCinEInQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-pinf": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-assert-is-positive-zero": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-min": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-min/-/math-base-special-min-0.0.7.tgz", - "integrity": "sha512-xaQeSHElt75MkOhqQ+6TWjbf5I5PmlnGyWY5QZRdrr9YWuWsOVuxW75VPHwNFQ1YmnD5d6TtB6pbCE9FKEBzQA==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-min/-/math-base-special-min-0.2.3.tgz", + "integrity": "sha512-tNrKnkcHCRVWzteZJpZ/xql9B6N6EzecnUVizDYqG9y66bOVtI+TADcQ5I/bijEwAIi2BjrIVeq/TBEgQEQBkw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5906,25 +6949,60 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-negative-zero": "^0.0.x" + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-min/node_modules/@stdlib/math-base-napi-binary": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.2.1.tgz", + "integrity": "sha512-ewGarSRaz5gaLsE17yJ4me03e56ICgPAA0ru0SYFCeMK2E5Z4Z2Lbu7HAQTTg+8XhpoaZSw0h2GJopTV7PCKmw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/complex-float32": "^0.2.1", + "@stdlib/complex-float64": "^0.2.1", + "@stdlib/complex-reim": "^0.2.1", + "@stdlib/complex-reimf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-minabs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-minabs/-/math-base-special-minabs-0.0.6.tgz", - "integrity": "sha512-yLAbgqNAl48bgMvXc/iQLDgg0Ao4GnSEBwq72somqCFY3MWYTkEXXbkgtpJdSjSj196IgN2lTwPnxPXun3IH/Q==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-minabs/-/math-base-special-minabs-0.2.3.tgz", + "integrity": "sha512-IV7PSL09S2GHmsxxtFgebPEwLm/wHnC1e1ulP8Uiuo2zinOiv4NXy2tpf9T+nq95d0ICFMnr9IGxFs6Nd74hRw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5937,24 +7015,59 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x" + "@stdlib/math-base-napi-binary": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-min": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-minabs/node_modules/@stdlib/math-base-napi-binary": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.2.1.tgz", + "integrity": "sha512-ewGarSRaz5gaLsE17yJ4me03e56ICgPAA0ru0SYFCeMK2E5Z4Z2Lbu7HAQTTg+8XhpoaZSw0h2GJopTV7PCKmw==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/complex-float32": "^0.2.1", + "@stdlib/complex-float64": "^0.2.1", + "@stdlib/complex-reim": "^0.2.1", + "@stdlib/complex-reimf": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-pow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-pow/-/math-base-special-pow-0.0.7.tgz", - "integrity": "sha512-sOew6OWapY6uesIg/i4eOveORzE0MfA7XtFcNgkpdsLJ4A4AkSZTz4zMmDxX2C22vI30aHR47O2ro3UZHFWCzw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-pow/-/math-base-special-pow-0.3.0.tgz", + "integrity": "sha512-sMDYRUYGFyMXDHcCYy7hE07lV7jgI6rDspLMROKyESWcH4n8j54XE4/0w0i8OpdzR40H895MaPWU/tVnU1tP6w==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -5967,40 +7080,43 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-high-word-abs-mask": "^0.0.x", - "@stdlib/constants-float64-high-word-significand-mask": "^0.0.x", - "@stdlib/constants-float64-ln-two": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-odd": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-low-word": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/number-uint32-base-to-int32": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-significand-mask": "^0.2.2", + "@stdlib/constants-float64-ln-two": "^0.2.2", + "@stdlib/constants-float64-ninf": "^0.2.2", + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-integer": "^0.2.5", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-odd": "^0.3.0", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-copysign": "^0.2.1", + "@stdlib/math-base-special-ldexp": "^0.2.2", + "@stdlib/math-base-special-sqrt": "^0.2.2", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/number-float64-base-set-high-word": "^0.2.2", + "@stdlib/number-float64-base-set-low-word": "^0.2.2", + "@stdlib/number-float64-base-to-words": "^0.2.2", + "@stdlib/number-uint32-base-to-int32": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-powm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-powm1/-/math-base-special-powm1-0.0.6.tgz", - "integrity": "sha512-cOfqg4QXRcgra/uv0azCwQArsl9+KOQo5YQoLGOWc7IVHibVW3s2DPXLh1JaEAeSu+/H1W9/970O6Uo86TwGgQ==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-powm1/-/math-base-special-powm1-0.3.1.tgz", + "integrity": "sha512-Pz7e2JlZH9EktJCDuyFPoT9IxMUSiZiJquyh2xB92NQQi9CAIdyaPUryNo36LxG65bne5GZF47MeiWCE8oWgiA==", "dev": true, + "license": "Apache-2.0 AND BSL-1.0", "os": [ "aix", "darwin", @@ -6013,27 +7129,32 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-expm1": "^0.2.3", + "@stdlib/math-base-special-fmod": "^0.1.0", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-trunc": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-rempio2": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-rempio2/-/math-base-special-rempio2-0.0.6.tgz", - "integrity": "sha512-0cSuSZwkTiPWxDdIZggyNdp3WSPqmY/oWd0tEZ47gpg3rIOwShiq0wyncX6v1MVEMJeSg5M9rhxb8WZlgD6RWw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-rempio2/-/math-base-special-rempio2-0.2.1.tgz", + "integrity": "sha512-ErV5EAe3SQCSijg4Pi4Z0sRPOGrODF3jkyCeiLM+iYj2TMOwDaOWQ0xCTME0p9G45TDrbZCLM5arxN83TfzgXQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6046,29 +7167,58 @@ "windows" ], "dependencies": { - "@stdlib/array-base-zeros": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-get-low-word": "^0.0.x", - "@stdlib/types": "^0.0.x" + "@stdlib/array-base-zeros": "^0.2.1", + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-significand-mask": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.1", + "@stdlib/math-base-special-ldexp": "^0.2.1", + "@stdlib/math-base-special-round": "^0.2.1", + "@stdlib/number-float64-base-from-words": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1", + "@stdlib/number-float64-base-get-low-word": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-rempio2/node_modules/@stdlib/math-base-special-round": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-round/-/math-base-special-round-0.2.1.tgz", + "integrity": "sha512-ibeKiN9z//6wS4H4uaa+vGnh/t1vJtZYXz+NqRVtwoP+nnE/mtL+fIrBlAnkIWVIH+smQPNNo8qsohjyGLBvUQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-round": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-round/-/math-base-special-round-0.0.7.tgz", - "integrity": "sha512-uFPWDru18ouUFD5/TQzm3fNzds/IlQbpQXjUBjIDpxN9PizneZLZSNNYg6ECq+FQv8WK1CQmyj10bu2zLReqGQ==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-round/-/math-base-special-round-0.3.0.tgz", + "integrity": "sha512-LwHmjWKL88u1HttH3Tmu3qrETb1KZ0J7uvhVkHvU7KgfCvCU8SX/wep47xv74rKDZMXyVEtmp7ZwpZPFm/zBcg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6080,20 +7230,28 @@ "win32", "windows" ], + "dependencies": { + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-negative-zero": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" + }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-roundn": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-roundn/-/math-base-special-roundn-0.0.6.tgz", - "integrity": "sha512-lNpL3AMQBQfXrxDKaQzzEGWFHgYsTKPDVXbUfmfBM+RQAxSNT4gS04us5tjnax3u4n9LpANPEiHAG4Olxc/RMA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-roundn/-/math-base-special-roundn-0.2.2.tgz", + "integrity": "sha512-V9MOFB92s29sV0khneJWte8H4wiatypkthq6BP7HABcUxNLzW/oeBsLR+DpRhG04jaC1jowjcpV2PeyKdzvK0A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6106,30 +7264,33 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-max-base10-exponent": "^0.0.x", - "@stdlib/constants-float64-max-safe-integer": "^0.0.x", - "@stdlib/constants-float64-min-base10-exponent": "^0.0.x", - "@stdlib/constants-float64-min-base10-exponent-subnormal": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x" + "@stdlib/constants-float64-max-base10-exponent": "^0.2.2", + "@stdlib/constants-float64-max-safe-integer": "^0.2.2", + "@stdlib/constants-float64-min-base10-exponent": "^0.2.2", + "@stdlib/constants-float64-min-base10-exponent-subnormal": "^0.2.1", + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-binary": "^0.3.0", + "@stdlib/math-base-special-abs": "^0.2.2", + "@stdlib/math-base-special-pow": "^0.3.0", + "@stdlib/math-base-special-round": "^0.3.0", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-signum": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-signum/-/math-base-special-signum-0.0.8.tgz", - "integrity": "sha512-+N65a4Dgsq342kSX77aHIf+mQJt10sZe0Y5vmfwR/LRmRGW2g+exBIH7goZKLxagV5MdyDuoyjEwEuzVJAdryg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-signum/-/math-base-special-signum-0.2.2.tgz", + "integrity": "sha512-cszwgkfeMTnUiORRWdWv6Q/tpoXkXkMYNMoAFO5qzHTuahnDP37Lkn8fTmCEtgHEasg3Cm69xLbqP0UDuNPHyA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6142,24 +7303,25 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-sin": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.0.6.tgz", - "integrity": "sha512-gymfzwJ/ROkLDWD/gBIjFDjsWweXgH7zV24qlsQ/z4XUG2jET9yFqzO5wIFnMzrQsTcRGkiXb9Q69pIoGxx1ww==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.3.0.tgz", + "integrity": "sha512-n5qefWrHs0tZ8hM73EvixH5nFnTU/IW2BnY9/Gamtsu90oTusqOi0WB1jVOMypC8i1mJEHdOWrsip7aDRWk1kQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6172,25 +7334,30 @@ "windows" ], "dependencies": { - "@stdlib/math-base-special-kernel-cos": "^0.0.x", - "@stdlib/math-base-special-kernel-sin": "^0.0.x", - "@stdlib/math-base-special-rempio2": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.2", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.2", + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-kernel-cos": "^0.2.3", + "@stdlib/math-base-special-kernel-sin": "^0.2.3", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-sinpi": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sinpi/-/math-base-special-sinpi-0.0.6.tgz", - "integrity": "sha512-g1uvvnolfkqJTozdrm/OtxEaTpz2nDwe9PeT/M1zm/J+MR6V9paoJCUAz4MfAwsz6VKRgA5FH+8BkCIsItl0Mg==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sinpi/-/math-base-special-sinpi-0.2.1.tgz", + "integrity": "sha512-Q3yCp1CoD7gemIILO28bU7iBn8OFiCgXm9vP/9q0tRBxmjtiUnjqbFd+3jRXdAmiCc/B/bPjwGBtVnCnrEMY9g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6203,28 +7370,95 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/math-base-special-cos": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x" + "@stdlib/constants-float64-pi": "^0.2.1", + "@stdlib/math-base-assert-is-infinite": "^0.2.1", + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/math-base-special-copysign": "^0.2.1", + "@stdlib/math-base-special-cos": "^0.2.1", + "@stdlib/math-base-special-sin": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-sinpi/node_modules/@stdlib/math-base-special-cos": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-cos/-/math-base-special-cos-0.2.1.tgz", + "integrity": "sha512-Yre+ASwsv4pQJk5dqY6488ZfmYDA6vtUTdapAVjCx28NluSFhXw1+S8EmsqnzYnqp/4x7Y1H7V2UPZfw+AdnbQ==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/math-base-special-sinpi/node_modules/@stdlib/math-base-special-sin": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.2.1.tgz", + "integrity": "sha512-IQ6+bzfiZ6/VUn5DIe6iwCsYERE1pwtAOsAWkgNZ1Ih3FzXUxdEOyHtv1zraPrVUb8mR+V5q7OfAGy8TCTnkUg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/constants-float64-high-word-abs-mask": "^0.2.1", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.1", + "@stdlib/math-base-special-kernel-cos": "^0.2.1", + "@stdlib/math-base-special-kernel-sin": "^0.2.1", + "@stdlib/math-base-special-rempio2": "^0.2.1", + "@stdlib/number-float64-base-get-high-word": "^0.2.1" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-sqrt": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sqrt/-/math-base-special-sqrt-0.0.8.tgz", - "integrity": "sha512-obYr15u/c76VEeAAXhvyUgVsxJb357CTgerLoFJqMj0diKXdjisLIWSlU+UZHKerYH9gnzZPN24gwwaTLJDmaw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sqrt/-/math-base-special-sqrt-0.2.2.tgz", + "integrity": "sha512-YWxe9vVE5blDbRPDAdZfU03vfGTBHy/8pLDa/qLz7SiJj5n5sVWKObdbMR2oPHF4c6DaZh4IYkrcHFleiY8YkQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6237,23 +7471,24 @@ "windows" ], "dependencies": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/math-base-napi-unary": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-special-trunc": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-trunc/-/math-base-special-trunc-0.0.8.tgz", - "integrity": "sha512-nSio+gKcZARQWH9a/mKYPjT5v1uNW2PztaToGY2Qt53ij8iWx4cNEBgR3J9ewXgAuoPTjJ0eHcfc6JeyFlBITQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-trunc/-/math-base-special-trunc-0.2.2.tgz", + "integrity": "sha512-cvizbo6oFEbdiv7BrtEMODGW+cJcBgyAIleJnIpCf75C722Y/IZgWikWhACSjv4stxGywFubx85B7uvm3vLgwA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6266,25 +7501,26 @@ "windows" ], "dependencies": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/math-base-special-ceil": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/math-base-napi-unary": "^0.2.3", + "@stdlib/math-base-special-ceil": "^0.2.1", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-tools-continued-fraction": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-continued-fraction/-/math-base-tools-continued-fraction-0.0.6.tgz", - "integrity": "sha512-eKIZIbkS5glfPIzPsK7037EPNsLPxm7lG2Eww0TmV+kvCXsDMpus4wUpJv0g1QbjVAXQizyBky8izbWk3ChlUw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-continued-fraction/-/math-base-tools-continued-fraction-0.2.2.tgz", + "integrity": "sha512-5dm72lTXwSVOsBsOLF57RZqqHehRd9X3HKdQ3WhOoHx7fNc0lxJJEDjtK8gMdV3NvfoER1MBiGbs2h23oaK5qw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6297,26 +7533,26 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-generator-support": "^0.0.x", - "@stdlib/constants-float32-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x" + "@stdlib/assert-has-generator-support": "^0.2.2", + "@stdlib/constants-float32-smallest-normal": "^0.2.2", + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-tools-evalpoly": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-evalpoly/-/math-base-tools-evalpoly-0.0.7.tgz", - "integrity": "sha512-Ktc3h4nr6V2I++vUQ1lbuONwoI7BccLeYbqXsu9PhUfNZsgzK4z4mc1GPpVGkKk21352DJLJC2rC4/O7wPo17g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-evalpoly/-/math-base-tools-evalpoly-0.2.2.tgz", + "integrity": "sha512-vLvfkMkccXZGFiyI3GPf8Ayi6vPEZeHgENnoBDGC+eMIDIoVWmOpVWsjpUz8xtc5xGNsa1hKalSI40IrouHsYA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6329,22 +7565,24 @@ "windows" ], "dependencies": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/function-ctor": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/math-base-tools-sum-series": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-sum-series/-/math-base-tools-sum-series-0.0.6.tgz", - "integrity": "sha512-9YT53LEPPC9Us2wRbGWzoCgm/U7NyXgubgmioIJ16hwwj5X69dYgOppzGGgq4/VJsgVMRLJH3sSu/51joWDjfg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-sum-series/-/math-base-tools-sum-series-0.2.2.tgz", + "integrity": "sha512-P3X+jMONClp93ucJi1Up/x26uwL0kH20CMV9bLzcQyRY8Mceh7jPZuEwzGQR0jq/tJ/4J7AnHg4kdrx4Pd+BNA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6357,25 +7595,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-generator-support": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x" + "@stdlib/assert-has-generator-support": "^0.2.2", + "@stdlib/constants-float64-eps": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-ctor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-ctor/-/number-ctor-0.0.7.tgz", - "integrity": "sha512-kXNwKIfnb10Ro3RTclhAYqbE3DtIXax+qpu0z1/tZpI2vkmTfYDQLno2QJrzJsZZgdeFtXIws+edONN9kM34ow==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-ctor/-/number-ctor-0.2.2.tgz", + "integrity": "sha512-98pL4f1uiXVIw9uRV6t4xecMFUYRRTUoctsqDDV8MSRtKEYDzqkWCNz/auupJFJ135L1ejzkejh73fASsgcwKQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6392,15 +7630,47 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/number-float32-base-to-word": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float32-base-to-word/-/number-float32-base-to-word-0.2.2.tgz", + "integrity": "sha512-/I866ocLExPpAjgZnHAjeaBw3ZHg5tVPcRdJoTPEiBG2hwD/OonHdCsfB9lu6FxO6sbp7I9BR1JolCoEyrhmYg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "dependencies": { + "@stdlib/array-float32": "^0.2.2", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-exponent": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-exponent/-/number-float64-base-exponent-0.0.6.tgz", - "integrity": "sha512-wLXsG+cvynmapoffmj5hVNDH7BuHIGspBcTCdjPaD+tnqPDIm03qV5Z9YBhDh91BdOCuPZQ8Ovu2WBpX+ySeGg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-exponent/-/number-float64-base-exponent-0.2.2.tgz", + "integrity": "sha512-mYivBQKCuu54ulorf5A5rIhFaGPjGvmtkxhvK14q7gzRA80si83dk8buUsLpeeYsakg7yLn10RCVjBEP9/gm7Q==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6413,24 +7683,26 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-high-word-exponent-mask": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" + "@stdlib/constants-float64-exponent-bias": "^0.2.2", + "@stdlib/constants-float64-high-word-exponent-mask": "^0.2.2", + "@stdlib/number-float64-base-get-high-word": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-from-words": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-from-words/-/number-float64-base-from-words-0.0.6.tgz", - "integrity": "sha512-r0elnekypCN831aw9Gp8+08br8HHAqvqtc5uXaxEh3QYIgBD/QM5qSb3b7WSAQ0ZxJJKdoykupODWWBkWQTijg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-from-words/-/number-float64-base-from-words-0.2.2.tgz", + "integrity": "sha512-SzMDXSnIDZ8l3PDmtN9TPKTf0mUmh83kKCtj4FisKTcTbcmUmT/ovmrpMTiqdposymjHBieNvGiCz/K03NmlAA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6443,26 +7715,27 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-get-high-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-high-word/-/number-float64-base-get-high-word-0.0.6.tgz", - "integrity": "sha512-jSFSYkgiG/IzDurbwrDKtWiaZeSEJK8iJIsNtbPG1vOIdQMRyw+t0bf3Kf3vuJu/+bnSTvYZLqpCO6wzT/ve9g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-high-word/-/number-float64-base-get-high-word-0.2.2.tgz", + "integrity": "sha512-LMNQAHdLZepKOFMRXAXLuq30GInmEdTtR0rO7Ka4F3m7KpYvw84JMyvZByMQHBu+daR6JNr2a/o9aFjmVIe51g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6475,26 +7748,27 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-get-low-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-low-word/-/number-float64-base-get-low-word-0.0.6.tgz", - "integrity": "sha512-N2h2QuhmuEA/TOq6W/B1oAHesX5IYtH46Fvo/tLzlodSsFq292kKWGlq9N6AhlVVIJOGibBQN+EHrAPGcNn2wA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-low-word/-/number-float64-base-get-low-word-0.2.2.tgz", + "integrity": "sha512-VZjflvoQ9//rZwwuhl7uSLUnnscdIIYmBrHofnBHRjHwdLGUzSd9PM0iagtvI82OHw5QnydBYI4hohBeAAg+aQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6507,27 +7781,27 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-normalize": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-normalize/-/number-float64-base-normalize-0.0.9.tgz", - "integrity": "sha512-+rm7RQJEj8zHkqYFE2a6DgNQSB5oKE/IydHAajgZl40YB91BoYRYf/ozs5/tTwfy2Fc04+tIpSfFtzDr4ZY19Q==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-normalize/-/number-float64-base-normalize-0.2.3.tgz", + "integrity": "sha512-HT+3fhYZOEg2JgHBWS/ysc9ZveQZV10weKbtxhLHOsvceQVp1GbThsLik62mU2/3f96S9MgiVfPfSDI3jnBoYw==", "dev": true, - "hasInstallScript": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6540,28 +7814,28 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/constants-float64-smallest-normal": "^0.2.2", + "@stdlib/math-base-assert-is-infinite": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-abs": "^0.2.1", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-set-high-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-high-word/-/number-float64-base-set-high-word-0.0.6.tgz", - "integrity": "sha512-Hqds3oALktHGDV5fNRjjwGBnb1ydOhQFrglRXrsAtJojq8KzIAQVGtYkkFtfmG+xadPNIW+PI95OBK3SgIoQDA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-high-word/-/number-float64-base-set-high-word-0.2.2.tgz", + "integrity": "sha512-bLvH15GJgX5URMaOOJAQgO8/dCJPYUQoXPZH7ecSC3XnnVMfWEf43knkjEGYCnWp4nro5hPRElbtdV4mKEjpUg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6574,26 +7848,27 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-set-low-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-low-word/-/number-float64-base-set-low-word-0.0.6.tgz", - "integrity": "sha512-8CMrWsL93rHELNAcKstKQpGH2XVIELm7BSut3ye0Ffa3ATTxuOfn2zXzS7yvlu/Lqi/47h5prpjRNsKQuLpp2Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-low-word/-/number-float64-base-set-low-word-0.2.2.tgz", + "integrity": "sha512-E1pGjTwacJ+Tkt5rKQNdwitKnM1iDgMlulYosNdn6CtvU0Pkq359bNhscMscxehdY3MifwuJpuGzDWD2EGUXzQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6606,26 +7881,27 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/number-float64-base-to-words": "^0.2.1", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-to-float32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-float32/-/number-float64-base-to-float32-0.0.7.tgz", - "integrity": "sha512-PNUSi6+cqfFiu4vgFljUKMFY2O9PxI6+T+vqtIoh8cflf+PjSGj3v4QIlstK9+6qU40eGR5SHZyLTWdzmNqLTQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-float32/-/number-float64-base-to-float32-0.2.2.tgz", + "integrity": "sha512-T5snDkVNZY6pomrSW/qLWQfZ9JHgqCFLi8jaaarfNj2o+5NMUuvvRifLUIacTm8/uC96xB0j3+wKTh1zbIV5ig==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6638,22 +7914,23 @@ "windows" ], "dependencies": { - "@stdlib/array-float32": "^0.0.x" + "@stdlib/array-float32": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-float64-base-to-words": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-words/-/number-float64-base-to-words-0.0.7.tgz", - "integrity": "sha512-7wsYuq+2MGp9rAkTnQ985rah7EJI9TfgHrYSSd4UIu4qIjoYmWIKEhIDgu7/69PfGrls18C3PxKg1pD/v7DQTg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-words/-/number-float64-base-to-words-0.2.2.tgz", + "integrity": "sha512-nkFHHXoMhb3vcfl7ZvzgiNdqBdBfbKxHtgvDXRxrNQoVmyYbnjljjYD489d2/TAhe+Zvn7qph6QLgTod3zaeww==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6666,29 +7943,29 @@ "windows" ], "dependencies": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/os-byte-order": "^0.0.x", - "@stdlib/os-float-word-order": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" + "@stdlib/array-float64": "^0.2.1", + "@stdlib/array-uint32": "^0.2.2", + "@stdlib/assert-is-little-endian": "^0.2.1", + "@stdlib/os-byte-order": "^0.2.1", + "@stdlib/os-float-word-order": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2", + "@stdlib/utils-library-manifest": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/number-uint32-base-to-int32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-uint32-base-to-int32/-/number-uint32-base-to-int32-0.0.7.tgz", - "integrity": "sha512-KoDNJFtd/lzQQPR6HB3TPiC9DgQGXkBKHYeiYZVUaCW4uGu2IM5KtVOnnI2wkXPGQYpSuUiU9MGf9EywY+YHcA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/number-uint32-base-to-int32/-/number-uint32-base-to-int32-0.2.2.tgz", + "integrity": "sha512-NPADfdHE/3VEifKDttXM24dRj5YQqxwh2wTRD8fQrpHeaWiMIUo8yDqWrrFNIdLVAcqjL2SwWpo4VJ7oKTYaIA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6705,15 +7982,42 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/object-ctor": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@stdlib/object-ctor/-/object-ctor-0.2.1.tgz", + "integrity": "sha512-HEIBBpfdQS9Nh5mmIqMk9fzedx6E0tayJrVa2FD7No86rVuq/Ikxq1QP7qNXm+i6z9iNUUS/lZq7BmJESWO/Zg==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/os-byte-order": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/os-byte-order/-/os-byte-order-0.0.7.tgz", - "integrity": "sha512-rRJWjFM9lOSBiIX4zcay7BZsqYBLoE32Oz/Qfim8cv1cN1viS5D4d3DskRJcffw7zXDnG3oZAOw5yZS0FnlyUg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/os-byte-order/-/os-byte-order-0.2.2.tgz", + "integrity": "sha512-2y6rHAvZo43YmZu9u/E/7cnqZa0hNTLoIiMpV1IxQ/7iv03xZ45Z3xyvWMk0b7bAWwWL7iUknOAAmEchK/kHBA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6726,29 +8030,24 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-big-endian": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - }, - "bin": { - "byte-order": "bin/cli" + "@stdlib/assert-is-big-endian": "^0.2.1", + "@stdlib/assert-is-little-endian": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/os-float-word-order": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/os-float-word-order/-/os-float-word-order-0.0.7.tgz", - "integrity": "sha512-gXIcIZf+ENKP7E41bKflfXmPi+AIfjXW/oU+m8NbP3DQasqHaZa0z5758qvnbO8L1lRJb/MzLOkIY8Bx/0cWEA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/os-float-word-order/-/os-float-word-order-0.2.2.tgz", + "integrity": "sha512-5xpcEuxv/CudKctHS5czKdM7Bj/gC+sm/5R5bRPYyqxANM67t365j3v2v8rmmOxkEp9t0fa8Dggx8VmOkpJXaA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6761,28 +8060,23 @@ "windows" ], "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/os-byte-order": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - }, - "bin": { - "float-word-order": "bin/cli" + "@stdlib/os-byte-order": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/process-cwd": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/process-cwd/-/process-cwd-0.0.8.tgz", - "integrity": "sha512-GHINpJgSlKEo9ODDWTHp0/Zc/9C/qL92h5Mc0QlIFBXAoUjy6xT4FB2U16wCNZMG3eVOzt5+SjmCwvGH0Wbg3Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/process-cwd/-/process-cwd-0.2.2.tgz", + "integrity": "sha512-8Q/nA/ud5d5PEzzG6ZtKzcOw+RMLm5CWR8Wd+zVO5vcPj+JD7IV7M2lBhbzfUzr63Torrf/vEhT3cob8vUHV/A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6794,92 +8088,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "cwd": "bin/cli" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/process-read-stdin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/process-read-stdin/-/process-read-stdin-0.0.7.tgz", - "integrity": "sha512-nep9QZ5iDGrRtrZM2+pYAvyCiYG4HfO0/9+19BiLJepjgYq4GKeumPAQo22+1xawYDL7Zu62uWzYszaVZcXuyw==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/buffer-ctor": "^0.0.x", - "@stdlib/buffer-from-string": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/utils-next-tick": "^0.0.x" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/regexp-eol": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-eol/-/regexp-eol-0.0.7.tgz", - "integrity": "sha512-BTMpRWrmlnf1XCdTxOrb8o6caO2lmu/c80XSyhYCi1DoizVIZnqxOaN5yUJNCr50g28vQ47PpsT3Yo7J3SdlRA==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-boolean": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/regexp-extended-length-path": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-extended-length-path/-/regexp-extended-length-path-0.0.7.tgz", - "integrity": "sha512-z6uqzMWq3WPDKbl4MIZJoNA5ZsYLQI9G3j2TIvhU8X2hnhlku8p4mvK9F+QmoVvgPxKliwNnx/DAl7ltutSDKw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/regexp-extended-length-path/-/regexp-extended-length-path-0.2.2.tgz", + "integrity": "sha512-z3jqauEsaxpsQU3rj1A1QnOgu17pyW5kt+Az8QkoTk7wqNE8HhPikI6k4o7XBHV689rSFWZCl4c4W+7JAiNObQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6892,22 +8115,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/regexp-function-name": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-function-name/-/regexp-function-name-0.0.7.tgz", - "integrity": "sha512-MaiyFUUqkAUpUoz/9F6AMBuMQQfA9ssQfK16PugehLQh4ZtOXV1LhdY8e5Md7SuYl9IrvFVg1gSAVDysrv5ZMg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/regexp-function-name/-/regexp-function-name-0.2.2.tgz", + "integrity": "sha512-0z/KRsgHJJ3UQkmBeLH+Nin0hXIeA+Fw1T+mnG2V5CHnTA6FKlpxJxWrvwLEsRX7mR/DNtDp06zGyzMFE/4kig==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6920,50 +8144,23 @@ "windows" ], "dependencies": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/regexp-regexp": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-regexp/-/regexp-regexp-0.0.8.tgz", - "integrity": "sha512-S5PZICPd/XRcn1dncVojxIDzJsHtEleuJHHD7ji3o981uPHR7zI2Iy9a1eV2u7+ABeUswbI1Yuix6fXJfcwV1w==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/stats-base-dists-beta-quantile": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-beta-quantile/-/stats-base-dists-beta-quantile-0.0.7.tgz", - "integrity": "sha512-K15aNEiAT9YznlvEUkM7P+6dyMiRprVArybocMvEKmXaKjTamPMKLaTLGfKPKlEtRajJYqWQZzEA9ibT9tQOdA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-beta-quantile/-/stats-base-dists-beta-quantile-0.2.2.tgz", + "integrity": "sha512-MIVBqlDzrnJjDizwEB2nSadK5QNAnJL8CepEc4e2S4WnNWbRZ8gXBsJpWPNyh8ORSFKNa5MKQbBaWmpf9sbQcg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -6976,25 +8173,26 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-betaincinv": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-special-betaincinv": "^0.2.1", + "@stdlib/utils-constant-function": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/stats-base-dists-binomial-cdf": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-cdf/-/stats-base-dists-binomial-cdf-0.0.7.tgz", - "integrity": "sha512-lHf38UyG6lVPJjkbjY/UhIGHO4aHEZm1yn+PSJZZUyvYZuMzSQ94hVcMcZjFHv2Nn3lNwEVXbRzjaxys8EoZfw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-cdf/-/stats-base-dists-binomial-cdf-0.2.2.tgz", + "integrity": "sha512-TAgPtNIcscX5PWxXa0Rbl2L2czb+0yirOw0m6eYtFWtLCwJCV71ckZU71Xp4HVo3PO+4N9NPJ7bHo5TLURefeQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7007,28 +8205,29 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/math-base-special-betainc": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-nonnegative-integer": "^0.2.1", + "@stdlib/math-base-special-betainc": "^0.2.2", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/utils-constant-function": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/stats-base-dists-binomial-pmf": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-pmf/-/stats-base-dists-binomial-pmf-0.0.7.tgz", - "integrity": "sha512-IHB//+mk9jNYNpaaI1Nz6mJkg1QnRV/HdzmKBM/G3nI7TcIvXJbDinIE8a5j6jq0tj6ac66Xxq5E6+6NVOcRkA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-pmf/-/stats-base-dists-binomial-pmf-0.2.2.tgz", + "integrity": "sha512-rl/pbaQWM3TUZ7143saaKHR52D3JggWv00CLGhLeqlMf2e2FjVuNrcwDSZOvhxG6vdwwx0dCdrRDdqnOq9wYtg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7041,31 +8240,32 @@ "windows" ], "dependencies": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/math-base-special-binomcoefln": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/stats-base-dists-degenerate-pmf": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/constants-float64-pinf": "^0.2.2", + "@stdlib/math-base-assert-is-nan": "^0.2.2", + "@stdlib/math-base-assert-is-nonnegative-integer": "^0.2.1", + "@stdlib/math-base-special-binomcoefln": "^0.2.1", + "@stdlib/math-base-special-exp": "^0.2.4", + "@stdlib/math-base-special-ln": "^0.2.4", + "@stdlib/math-base-special-log1p": "^0.2.3", + "@stdlib/stats-base-dists-degenerate-pmf": "^0.2.2", + "@stdlib/utils-constant-function": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/stats-base-dists-degenerate-pmf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-degenerate-pmf/-/stats-base-dists-degenerate-pmf-0.0.8.tgz", - "integrity": "sha512-RJybhanXnMpI5bYYXOGujLYo1ZZBbD3UyqVIofJZwUqOkDYd8AV+J/Sl8RWkiA/um8blgQO+PhQGs3yFZs/ZkQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-degenerate-pmf/-/stats-base-dists-degenerate-pmf-0.2.2.tgz", + "integrity": "sha512-ZJ6zaIGCswYL+RdeMZIDMxbG88Xzq0N93Rb8cV4Oad9AP4/wO0fugwWsoNZASVCFbRp5yoFOFAm7AYXpwprvJQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7078,24 +8278,25 @@ "windows" ], "dependencies": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" + "@stdlib/math-base-assert-is-nan": "^0.2.1", + "@stdlib/utils-constant-function": "^0.2.2", + "@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/stats-binomial-test": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-binomial-test/-/stats-binomial-test-0.0.7.tgz", - "integrity": "sha512-I+bLc7jOeuV0hauMBEjXS+ey/QE93fSJn099e4okqkEyDVuc6E+2tbWRaL+wsINlgaOjlwP/o1gA7UM0RHqquA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/stats-binomial-test/-/stats-binomial-test-0.2.2.tgz", + "integrity": "sha512-K7YUckYbFZiBFA9nwE/B26+d8KzIgcVGi6D6KdtbFdr+jq4fupGkuQ44rpKJEQQcFJ9Dccsz47Q6TjMqcexAwQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7108,62 +8309,40 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-boolean": "^0.0.x", - "@stdlib/assert-is-nan": "^0.0.x", - "@stdlib/assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/assert-is-number-array": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-positive-integer": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/math-base-special-ceil": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-roundn": "^0.0.x", - "@stdlib/stats-base-dists-beta-quantile": "^0.0.x", - "@stdlib/stats-base-dists-binomial-cdf": "^0.0.x", - "@stdlib/stats-base-dists-binomial-pmf": "^0.0.x", - "@stdlib/utils-define-read-only-property": "^0.0.x" + "@stdlib/assert-has-own-property": "^0.2.2", + "@stdlib/assert-is-boolean": "^0.2.2", + "@stdlib/assert-is-nan": "^0.2.2", + "@stdlib/assert-is-nonnegative-integer": "^0.2.2", + "@stdlib/assert-is-number": "^0.2.2", + "@stdlib/assert-is-number-array": "^0.2.2", + "@stdlib/assert-is-plain-object": "^0.2.2", + "@stdlib/assert-is-positive-integer": "^0.2.2", + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/math-base-special-ceil": "^0.2.2", + "@stdlib/math-base-special-floor": "^0.2.3", + "@stdlib/math-base-special-roundn": "^0.2.2", + "@stdlib/stats-base-dists-beta-quantile": "^0.2.1", + "@stdlib/stats-base-dists-binomial-cdf": "^0.2.2", + "@stdlib/stats-base-dists-binomial-pmf": "^0.2.2", + "@stdlib/string-format": "^0.2.2", + "@stdlib/utils-define-read-only-property": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/streams-node-stdin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/streams-node-stdin/-/streams-node-stdin-0.0.7.tgz", - "integrity": "sha512-gg4lgrjuoG3V/L29wNs32uADMCqepIcmoOFHJCTAhVe0GtHDLybUVnLljaPfdvmpPZmTvmusPQtIcscbyWvAyg==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/string-base-format-interpolate": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-interpolate/-/string-base-format-interpolate-0.0.4.tgz", - "integrity": "sha512-8FC8+/ey+P5hf1B50oXpXzRzoAgKI1rikpyKZ98Xmjd5rcbSq3NWYi8TqOF8mUHm9hVZ2CXWoNCtEe2wvMQPMg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-interpolate/-/string-base-format-interpolate-0.2.2.tgz", + "integrity": "sha512-i9nU9rAB2+o/RR66TS9iQ8x+YzeUDL1SGiAo6GY3hP6Umz5Dx9Qp/v8T69gWVsb4a1YSclz5+YeCWaFgwvPjKA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7180,15 +8359,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/string-base-format-tokenize": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-tokenize/-/string-base-format-tokenize-0.0.4.tgz", - "integrity": "sha512-+vMIkheqAhDeT/iF5hIQo95IMkt5IzC68eR3CxW1fhc48NMkKFE2UfN73ET8fmLuOanLo/5pO2E90c2G7PExow==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-tokenize/-/string-base-format-tokenize-0.2.2.tgz", + "integrity": "sha512-kXq2015i+LJjqth5dN+hYnvJXBSzRm8w0ABWB5tYAsIuQTpQK+mSo2muM8JBEFEnqUHAwpUsu2qNTK/9o8lsJg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7205,15 +8385,68 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/string-base-lowercase": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@stdlib/string-base-lowercase/-/string-base-lowercase-0.4.0.tgz", + "integrity": "sha512-IH35Z5e4T+S3b3SfYY39mUhrD2qvJVp4VS7Rn3+jgj4+C3syocuAPsJ8C4OQXWGfblX/N9ymizbpFBCiVvMW8w==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" + } + }, + "node_modules/@stdlib/string-base-replace": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/string-base-replace/-/string-base-replace-0.2.2.tgz", + "integrity": "sha512-Y4jZwRV4Uertw7AlA/lwaYl1HjTefSriN5+ztRcQQyDYmoVN3gzoVKLJ123HPiggZ89vROfC+sk/6AKvly+0CA==", + "dev": true, + "license": "Apache-2.0", + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/string-format": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@stdlib/string-format/-/string-format-0.0.3.tgz", - "integrity": "sha512-1jiElUQXlI/tTkgRuzJi9jUz/EjrO9kzS8VWHD3g7gdc3ZpxlA5G9JrIiPXGw/qmZTi0H1pXl6KmX+xWQEQJAg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/string-format/-/string-format-0.2.2.tgz", + "integrity": "sha512-GUa50uxgMAtoItsxTbMmwkyhIwrCxCrsjzk3nAbLnt/1Kt1EWOWMwsALqZdD6K4V/xSJ4ns6PZur3W6w+vKk9g==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7226,59 +8459,24 @@ "windows" ], "dependencies": { - "@stdlib/string-base-format-interpolate": "^0.0.x", - "@stdlib/string-base-format-tokenize": "^0.0.x" + "@stdlib/string-base-format-interpolate": "^0.2.1", + "@stdlib/string-base-format-tokenize": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/string-lowercase": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/string-lowercase/-/string-lowercase-0.0.9.tgz", - "integrity": "sha512-tXFFjbhIlDak4jbQyV1DhYiSTO8b1ozS2g/LELnsKUjIXECDKxGFyWYcz10KuyAWmFotHnCJdIm8/blm2CfDIA==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - }, - "bin": { - "lowercase": "bin/cli" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/string-replace": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@stdlib/string-replace/-/string-replace-0.0.11.tgz", - "integrity": "sha512-F0MY4f9mRE5MSKpAUfL4HLbJMCbG6iUTtHAWnNeAXIvUX1XYIw/eItkA58R9kNvnr1l5B08bavnjrgTJGIKFFQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/string-replace/-/string-replace-0.2.2.tgz", + "integrity": "sha512-czNS5IU7sBuHjac45Y3VWUTsUoi82yc8JsMZrOMcjgSrEuDrVmA6sNJg7HC1DuSpdPjm/v9uUk102s1gIfk3Nw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7291,36 +8489,29 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-regexp": "^0.0.x", - "@stdlib/assert-is-regexp-string": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-format": "^0.0.x", - "@stdlib/utils-escape-regexp-string": "^0.0.x", - "@stdlib/utils-regexp-from-string": "^0.0.x" - }, - "bin": { - "replace": "bin/cli" + "@stdlib/assert-is-function": "^0.2.2", + "@stdlib/assert-is-regexp": "^0.2.2", + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-base-replace": "^0.2.2", + "@stdlib/string-format": "^0.2.2", + "@stdlib/utils-escape-regexp-string": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, - "node_modules/@stdlib/types": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@stdlib/types/-/types-0.0.14.tgz", - "integrity": "sha512-AP3EI9/il/xkwUazcoY+SbjtxHRrheXgSbWZdEGD+rWpEgj6n2i63hp6hTOpAB5NipE0tJwinQlDGOuQ1lCaCw==", + "node_modules/@stdlib/symbol-ctor": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/symbol-ctor/-/symbol-ctor-0.2.2.tgz", + "integrity": "sha512-XsmiTfHnTb9jSPf2SoK3O0wrNOXMxqzukvDvtzVur1XBKfim9+seaAS4akmV1H3+AroAXQWVtde885e1B6jz1w==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7337,15 +8528,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-constant-function": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-constant-function/-/utils-constant-function-0.0.8.tgz", - "integrity": "sha512-GZNs2F/BmvTtUigAC3ig26++EOmoHMRpKZQE+DEMTTFPImOylXdvbi2HsZsDtbv2s/Fi016BqWNU/4fpnqPWsg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-constant-function/-/utils-constant-function-0.2.2.tgz", + "integrity": "sha512-ezRenGy5zU4R0JTfha/bpF8U+Hx0b52AZV++ca/pcaQVvPBRkgCsJacXX0eDbexoBB4+ZZ1vcyIi4RKJ0RRlbQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7362,15 +8554,16 @@ "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-constructor-name": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-constructor-name/-/utils-constructor-name-0.0.8.tgz", - "integrity": "sha512-GXpyNZwjN8u3tyYjL2GgGfrsxwvfogUC3gg7L7NRZ1i86B6xmgfnJUYHYOUnSfB+R531ET7NUZlK52GxL7P82Q==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-constructor-name/-/utils-constructor-name-0.2.2.tgz", + "integrity": "sha512-TBtO3MKDAf05ij5ajmyBCbpKKt0Lfahn5tu18gqds4PkFltgcw5tVZfSHY5DZ2HySJQ2GMMYjPW2Kbg6yPCSVg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7383,24 +8576,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-buffer": "^0.0.x", - "@stdlib/regexp-function-name": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-is-buffer": "^0.2.1", + "@stdlib/regexp-function-name": "^0.2.2", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-convert-path": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-convert-path/-/utils-convert-path-0.0.8.tgz", - "integrity": "sha512-GNd8uIswrcJCctljMbmjtE4P4oOjhoUIfMvdkqfSrRLRY+ZqPB2xM+yI0MQFfUq/0Rnk/xtESlGSVLz9ZDtXfA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-convert-path/-/utils-convert-path-0.2.2.tgz", + "integrity": "sha512-8nNuAgt23Np9NssjShUrPK42c6gRTweGuoQw+yTpTfBR9VQv8WFyt048n8gRGUlAHizrdMNpEY9VAb7IBzpVYw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7413,33 +8607,28 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/regexp-extended-length-path": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-lowercase": "^0.0.x", - "@stdlib/string-replace": "^0.0.x" - }, - "bin": { - "convert-path": "bin/cli" + "@stdlib/assert-is-string": "^0.2.2", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/regexp-extended-length-path": "^0.2.2", + "@stdlib/string-base-lowercase": "^0.4.0", + "@stdlib/string-format": "^0.2.2", + "@stdlib/string-replace": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-define-nonenumerable-read-only-property": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-nonenumerable-read-only-property/-/utils-define-nonenumerable-read-only-property-0.0.7.tgz", - "integrity": "sha512-c7dnHDYuS4Xn3XBRWIQBPcROTtP/4lkcFyq0FrQzjXUjimfMgHF7cuFIIob6qUTnU8SOzY9p0ydRR2QJreWE6g==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-define-nonenumerable-read-only-property/-/utils-define-nonenumerable-read-only-property-0.2.2.tgz", + "integrity": "sha512-V3mpAesJemLYDKG376CsmoczWPE/4LKsp8xBvUxCt5CLNAx3J/1W39iZQyA5q6nY1RStGinGn1/dYZwa8ig0Uw==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7452,23 +8641,23 @@ "windows" ], "dependencies": { - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x" + "@stdlib/utils-define-property": "^0.2.3" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-define-property": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-property/-/utils-define-property-0.0.9.tgz", - "integrity": "sha512-pIzVvHJvVfU/Lt45WwUAcodlvSPDDSD4pIPc9WmIYi4vnEBA9U7yHtiNz2aTvfGmBMTaLYTVVFIXwkFp+QotMA==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@stdlib/utils-define-property/-/utils-define-property-0.2.4.tgz", + "integrity": "sha512-XlMdz7xwuw/sqXc9LbsV8XunCzZXjbZPC+OAdf4t4PBw4ZRwGzlTI6WED+f4PYR5Tp9F1cHgLPyMYCIBfA2zRg==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7481,22 +8670,24 @@ "windows" ], "dependencies": { - "@stdlib/types": "^0.0.x" + "@stdlib/error-tools-fmtprodmsg": "^0.2.1", + "@stdlib/string-format": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-define-read-only-property": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-read-only-property/-/utils-define-read-only-property-0.0.8.tgz", - "integrity": "sha512-luKlGCarho88e/WXvQzkSFF7ZFN6Q3Uszo4EfcXVYPGJfP448YMAsEwnXzUWkzCGfKPKubr03w94p87JrYrgSQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-define-read-only-property/-/utils-define-read-only-property-0.2.2.tgz", + "integrity": "sha512-JcoavbkwxXFWtIHNypiL/5oCFU76WXYUFTeUMKPTNx0oyO2UjW9sKNuJfpoY9ksHPZNZGHRTsNbXVHabkNjVBQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7509,23 +8700,23 @@ "windows" ], "dependencies": { - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x" + "@stdlib/utils-define-property": "^0.2.3" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-escape-regexp-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-escape-regexp-string/-/utils-escape-regexp-string-0.0.9.tgz", - "integrity": "sha512-E+9+UDzf2mlMLgb+zYrrPy2FpzbXh189dzBJY6OG+XZqEJAXcjWs7DURO5oGffkG39EG5KXeaQwDXUavcMDCIw==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-escape-regexp-string/-/utils-escape-regexp-string-0.2.2.tgz", + "integrity": "sha512-areCibzgpmvm6pGKBg+mXkSDJW4NxtS5jcAT7RtunGMdAYhA/I5whISMPaeJkIT2XhjjFkjKBaIs5pF6aPr4fQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7538,23 +8729,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/string-format": "^0.0.x" + "@stdlib/assert-is-string": "^0.2.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-format": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-eval": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-eval/-/utils-eval-0.0.8.tgz", - "integrity": "sha512-eJae8XdBRcHKQQuuW96VmfmXauZHICrLqNERtWgtJW75i0lEE0Le2jYk32O+UVETAFT8rzxMxfBxMckKfdJNaQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-eval/-/utils-eval-0.2.2.tgz", + "integrity": "sha512-MaFpWZh3fGcTjUeozju5faXqH8w4MRVfpO/M5pon3osTM0by8zrKiI5D9oWqNVygb9JBd+etE+4tj2L1nr5j2A==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7566,27 +8759,21 @@ "win32", "windows" ], - "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - }, - "bin": { - "js-eval": "bin/cli" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-get-prototype-of": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-get-prototype-of/-/utils-get-prototype-of-0.0.7.tgz", - "integrity": "sha512-fCUk9lrBO2ELrq+/OPJws1/hquI4FtwG0SzVRH6UJmJfwb1zoEFnjcwyDAy+HWNVmo3xeRLsrz6XjHrJwer9pg==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-get-prototype-of/-/utils-get-prototype-of-0.2.2.tgz", + "integrity": "sha512-eDb1BAvt7GW/jduBkfuQrUsA9p09mV8RW20g0DWPaxci6ORYg/UB0tdbAA23aZz2QUoxdYY5s/UJxlq/GHwoKQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7599,23 +8786,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" + "@stdlib/assert-is-function": "^0.2.1", + "@stdlib/object-ctor": "^0.2.1", + "@stdlib/utils-native-class": "^0.2.1" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-global": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-global/-/utils-global-0.0.7.tgz", - "integrity": "sha512-BBNYBdDUz1X8Lhfw9nnnXczMv9GztzGpQ88J/6hnY7PHJ71av5d41YlijWeM9dhvWjnH9I7HNE3LL7R07yw0kA==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-global/-/utils-global-0.2.2.tgz", + "integrity": "sha512-A4E8VFHn+1bpfJ4PA8H2b62CMQpjv2A+H3QDEBrouLFWne0wrx0TNq8vH6VYHxx9ZRxhgWQjfHiSAxtUJobrbQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7628,22 +8817,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-is-boolean": "^0.0.x" + "@stdlib/assert-is-boolean": "^0.2.1", + "@stdlib/error-tools-fmtprodmsg": "^0.2.2", + "@stdlib/string-format": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-library-manifest": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-library-manifest/-/utils-library-manifest-0.0.8.tgz", - "integrity": "sha512-IOQSp8skSRQn9wOyMRUX9Hi0j/P5v5TvD8DJWTqtE8Lhr8kVVluMBjHfvheoeKHxfWAbNHSVpkpFY/Bdh/SHgQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-library-manifest/-/utils-library-manifest-0.2.2.tgz", + "integrity": "sha512-YqzVLuBsB4wTqzdUtRArAjBJoT3x61iop2jFChXexhl6ejV3vDpHcukEEkqIOcJKut+1cG5TLJdexgHNt1C0NA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7656,22 +8848,18 @@ "windows" ], "dependencies": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-resolve-parent-path": "^0.0.x", - "@stdlib/utils-convert-path": "^0.0.x", + "@stdlib/fs-resolve-parent-path": "^0.2.1", + "@stdlib/utils-convert-path": "^0.2.1", "debug": "^2.6.9", "resolve": "^1.1.7" }, - "bin": { - "library-manifest": "bin/cli" - }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-library-manifest/node_modules/debug": { @@ -7679,6 +8867,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, + "license": "MIT", "dependencies": { "ms": "2.0.0" } @@ -7687,13 +8876,15 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@stdlib/utils-native-class": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-native-class/-/utils-native-class-0.0.8.tgz", - "integrity": "sha512-0Zl9me2V9rSrBw/N8o8/9XjmPUy8zEeoMM0sJmH3N6C9StDsYTjXIAMPGzYhMEWaWHvGeYyNteFK2yDOVGtC3w==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-native-class/-/utils-native-class-0.2.2.tgz", + "integrity": "sha512-cSn/FozbEpfR/FlJAoceQtZ8yUJFhZ8RFkbEsxW/7+H4o09yln3lBS0HSfUJISYNtpTNN/2/Fup88vmvwspvwA==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7706,103 +8897,25 @@ "windows" ], "dependencies": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-has-tostringtag-support": "^0.0.x" + "@stdlib/assert-has-own-property": "^0.2.1", + "@stdlib/assert-has-tostringtag-support": "^0.2.2", + "@stdlib/symbol-ctor": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/utils-next-tick": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-next-tick/-/utils-next-tick-0.0.8.tgz", - "integrity": "sha512-l+hPl7+CgLPxk/gcWOXRxX/lNyfqcFCqhzzV/ZMvFCYLY/wI9lcWO4xTQNMALY2rp+kiV+qiAiO9zcO+hewwUg==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/utils-noop": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/@stdlib/utils-noop/-/utils-noop-0.0.13.tgz", - "integrity": "sha512-JRWHGWYWP5QK7SQ2cOYiL8NETw8P33LriZh1p9S2xC4e0rBoaY849h1A2IL2y1+x3s29KNjSaBWMrMUIV5HCSw==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" - } - }, - "node_modules/@stdlib/utils-regexp-from-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-regexp-from-string/-/utils-regexp-from-string-0.0.9.tgz", - "integrity": "sha512-3rN0Mcyiarl7V6dXRjFAUMacRwe0/sYX7ThKYurf0mZkMW9tjTP+ygak9xmL9AL0QQZtbrFFwWBrDO+38Vnavw==", - "dev": true, - "os": [ - "aix", - "darwin", - "freebsd", - "linux", - "macos", - "openbsd", - "sunos", - "win32", - "windows" - ], - "dependencies": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/regexp-regexp": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - }, - "engines": { - "node": ">=0.10.0", - "npm": ">2.7.0" - }, - "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@stdlib/utils-type-of": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-type-of/-/utils-type-of-0.0.8.tgz", - "integrity": "sha512-b4xqdy3AnnB7NdmBBpoiI67X4vIRxvirjg3a8BfhM5jPr2k0njby1jAbG9dUxJvgAV6o32S4kjUgfIdjEYpTNQ==", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@stdlib/utils-type-of/-/utils-type-of-0.2.2.tgz", + "integrity": "sha512-RLGFxPNgY9AtVVrFGdKO6Y3pOd/Ov2WA4O2/czZN/AbgYzbPdoF0KkfvHRIney6k+TtvoyYB8YqZXJ4G88f9BQ==", "dev": true, + "license": "Apache-2.0", "os": [ "aix", "darwin", @@ -7815,16 +8928,16 @@ "windows" ], "dependencies": { - "@stdlib/utils-constructor-name": "^0.0.x", - "@stdlib/utils-global": "^0.0.x" + "@stdlib/utils-constructor-name": "^0.2.1", + "@stdlib/utils-global": "^0.2.2" }, "engines": { "node": ">=0.10.0", "npm": ">2.7.0" }, "funding": { - "type": "patreon", - "url": "https://www.patreon.com/athan" + "type": "opencollective", + "url": "https://opencollective.com/stdlib" } }, "node_modules/@szmarczak/http-timer": { @@ -7839,17 +8952,123 @@ "node": ">=14.16" } }, - "node_modules/@typechain/ethers-v5": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz", - "integrity": "sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw==", + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true, "dependencies": { - "ethers": "^5.0.2" + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" }, "peerDependencies": { - "ethers": "^5.0.0", - "typechain": "^3.0.0" + "ethers": "6.x", + "typechain": "^8.3.2", + "typescript": ">=4.7.0" + } + }, + "node_modules/@typechain/ethers-v6/node_modules/ts-essentials": { + "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, + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": ">=3.7.0" + } + }, + "node_modules/@typechain/hardhat": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-9.1.0.tgz", + "integrity": "sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fs-extra": "^9.1.0" + }, + "peerDependencies": { + "@typechain/ethers-v6": "^0.5.1", + "ethers": "^6.1.0", + "hardhat": "^2.9.9", + "typechain": "^8.3.2" + } + }, + "node_modules/@typechain/hardhat/node_modules/fs-extra": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typechain/hardhat/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@typechain/hardhat/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" } }, "node_modules/@types/bn.js": { @@ -7865,7 +9084,52 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai-as-promised": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", + "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } }, "node_modules/@types/http-cache-semantics": { "version": "4.0.4", @@ -7879,36 +9143,39 @@ "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", "dev": true }, - "node_modules/@types/mkdirp": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz", - "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", + "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, - "dependencies": { - "@types/node": "*" - } + "license": "MIT", + "peer": true + }, + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", - "dev": true - }, - "node_modules/@types/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" + "undici-types": "~6.19.2" } }, "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "@types/node": "*" } @@ -7917,79 +9184,63 @@ "version": "2.7.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/qs": { "version": "6.9.7", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true - }, - "node_modules/@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", "dev": true, - "dependencies": { - "@types/node": "*" - } + "peer": true }, "node_modules/@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", + "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "@types/node": "*" } }, - "node_modules/@types/sinon": { - "version": "10.0.13", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", - "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", + "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, - "dependencies": { - "@types/sinonjs__fake-timers": "*" + "license": "ISC", + "peer": true + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, - "node_modules/@types/sinon-chai": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.9.tgz", - "integrity": "sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ==", + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "@types/chai": "*", - "@types/sinon": "*" + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" } }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", - "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", - "dev": true - }, - "node_modules/@types/underscore": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.4.tgz", - "integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==", - "dev": true - }, - "node_modules/@types/web3": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/@types/web3/-/web3-1.0.19.tgz", - "integrity": "sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A==", - "dev": true, - "dependencies": { - "@types/bn.js": "*", - "@types/underscore": "*" - } - }, - "node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true - }, "node_modules/adm-zip": { "version": "0.4.16", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", @@ -8003,7 +9254,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/agent-base": { "version": "6.0.2", @@ -8017,29 +9269,6 @@ "node": ">= 6.0.0" } }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -8069,6 +9298,18 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "dev": true, + "license": "BSD-3-Clause OR MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.2" + } + }, "node_modules/ansi-align": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", @@ -8078,50 +9319,6 @@ "string-width": "^4.1.0" } }, - "node_modules/ansi-align/node_modules/ansi-regex": { - "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" - } - }, - "node_modules/ansi-align/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/ansi-align/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-align/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -8147,12 +9344,13 @@ } }, "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/ansi-styles": { @@ -8160,6 +9358,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "peer": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -8176,6 +9375,14 @@ "node": ">=16" } }, + "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, + "license": "BSD-3-Clause", + "peer": true + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -8189,6 +9396,14 @@ "node": ">= 8" } }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -8196,35 +9411,46 @@ "dev": true }, "node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, + "license": "MIT", + "peer": true, "engines": { - "node": ">=4" + "node": ">=6" } }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "node_modules/array-union": { + "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, - "dependencies": { - "safer-buffer": "~2.1.0" + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": ">=0.8" + "node": ">=0.10.0" } }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -8249,45 +9475,31 @@ "node": ">=8" } }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "dev": true, + "peer": true }, "node_modules/at-least-node": { "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, + "peer": true, "engines": { "node": ">= 4.0.0" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true - }, - "node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.0" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -8295,34 +9507,22 @@ "dev": true }, "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "safe-buffer": "^5.0.1" } }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/bcrypt-pbkdf/node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, "node_modules/bech32": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/binary-extensions": { "version": "2.2.0", @@ -8337,13 +9537,9 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", - "dev": true - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/bn.js": { "version": "5.2.1", @@ -8373,15 +9569,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/boxen/node_modules/ansi-regex": { - "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" - } - }, "node_modules/boxen/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -8440,41 +9627,6 @@ "node": ">=8" } }, - "node_modules/boxen/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/boxen/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/boxen/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/boxen/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8500,22 +9652,25 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -8525,7 +9680,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/browser-stdout": { "version": "1.3.1", @@ -8538,6 +9694,8 @@ "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -8552,6 +9710,8 @@ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "base-x": "^3.0.2" } @@ -8561,6 +9721,8 @@ "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "bs58": "^4.0.0", "create-hash": "^1.1.0", @@ -8577,19 +9739,9 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", "dev": true, - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } + "license": "MIT", + "peer": true }, "node_modules/bytes": { "version": "3.1.2", @@ -8632,6 +9784,7 @@ "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, + "peer": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -8640,6 +9793,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -8665,31 +9833,61 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true + "dev": true, + "peer": true + }, + "node_modules/cbor": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", + "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } }, "node_modules/chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "dev": true, + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" } }, + "node_modules/chai-as-promised": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "dev": true, + "license": "WTFPL", + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, "node_modules/chalk": { "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, + "peer": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -8699,11 +9897,26 @@ "node": ">=4" } }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "node_modules/charenc": { + "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, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -8746,6 +9959,7 @@ "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, + "peer": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -8772,6 +9986,75 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table3": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "object-assign": "^4.1.0", + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "colors": "^1.1.2" + } + }, + "node_modules/cli-table3/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/strip-ansi": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -8783,64 +10066,12 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "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" - } - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/cliui/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color-convert": { "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, + "peer": true, "dependencies": { "color-name": "1.1.3" } @@ -8849,13 +10080,26 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "peer": true + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.1.90" + } }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "peer": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -8870,30 +10114,282 @@ "dev": true }, "node_modules/command-line-args": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz", - "integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "array-back": "^2.0.0", - "find-replace": "^1.0.3", - "typical": "^2.6.1" + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" }, - "bin": { - "command-line-args": "bin/cli.js" + "engines": { + "node": ">=4.0.0" } }, - "node_modules/commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true + "node_modules/command-line-usage": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } }, "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 + "dev": true, + "peer": true + }, + "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" + ], + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/concurrently": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.1.2.tgz", + "integrity": "sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/concurrently/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } }, "node_modules/config-chain": { "version": "1.1.13", @@ -8918,7 +10414,8 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/cosmiconfig": { "version": "8.3.6", @@ -8960,6 +10457,7 @@ "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, + "peer": true, "dependencies": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -8973,6 +10471,8 @@ "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -8982,50 +10482,48 @@ "sha.js": "^2.4.8" } }, - "node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "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, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, + "license": "MIT", + "peer": true + }, + "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, + "license": "BSD-3-Clause", + "peer": true, "engines": { - "node": ">=4.8" + "node": "*" } }, - "node_modules/cross-spawn/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "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, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } + "peer": true }, "node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "^2.1.1" + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/decamelize": { @@ -9088,6 +10586,14 @@ "node": ">=4.0.0" } }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/defer-to-connect": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", @@ -9102,6 +10608,7 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, + "peer": true, "engines": { "node": ">=0.4.0" } @@ -9116,29 +10623,75 @@ } }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "node_modules/difflib": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", + "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", "dev": true, + "peer": true, "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "heap": ">= 0.2.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", "dev": true, + "license": "MIT", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -9150,10 +10703,11 @@ } }, "node_modules/elliptic/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 + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "dev": true, + "license": "MIT" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -9161,12 +10715,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/encode-utf8": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", - "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==", - "dev": true - }, "node_modules/enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", @@ -9197,6 +10745,59 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -9211,31 +10812,214 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "peer": true, "engines": { "node": ">=0.8.0" } }, - "node_modules/eth-ens-namehash": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", + "node_modules/escodegen": { + "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, + "license": "BSD-2-Clause", + "peer": true, "dependencies": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" } }, - "node_modules/eth-ens-namehash/node_modules/js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==", - "dev": true + "node_modules/escodegen/node_modules/source-map": { + "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, + "peer": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/estraverse": { + "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, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eth-gas-reporter": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@solidity-parser/parser": "^0.14.0", + "axios": "^1.5.1", + "cli-table3": "^0.5.0", + "colors": "1.4.0", + "ethereum-cryptography": "^1.0.3", + "ethers": "^5.7.2", + "fs-readdir-recursive": "^1.1.0", + "lodash": "^4.17.14", + "markdown-table": "^1.1.3", + "mocha": "^10.2.0", + "req-cwd": "^2.0.0", + "sha1": "^1.1.1", + "sync-request": "^6.0.0" + }, + "peerDependencies": { + "@codechecks/client": "^0.1.0" + }, + "peerDependenciesMeta": { + "@codechecks/client": { + "optional": true + } + } + }, + "node_modules/eth-gas-reporter/node_modules/@solidity-parser/parser": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", + "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "node_modules/eth-gas-reporter/node_modules/axios": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz", + "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/ethers": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.8.0.tgz", + "integrity": "sha512-DUq+7fHrCg1aPDFCHx6UIPb3nmt2XMpM7Y/g2gLhsl3lIBqeAfOJIl1qEvRf2uq3BiKxmh6Fh5pfp2ieyek7Kg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.8.0", + "@ethersproject/abstract-provider": "5.8.0", + "@ethersproject/abstract-signer": "5.8.0", + "@ethersproject/address": "5.8.0", + "@ethersproject/base64": "5.8.0", + "@ethersproject/basex": "5.8.0", + "@ethersproject/bignumber": "5.8.0", + "@ethersproject/bytes": "5.8.0", + "@ethersproject/constants": "5.8.0", + "@ethersproject/contracts": "5.8.0", + "@ethersproject/hash": "5.8.0", + "@ethersproject/hdnode": "5.8.0", + "@ethersproject/json-wallets": "5.8.0", + "@ethersproject/keccak256": "5.8.0", + "@ethersproject/logger": "5.8.0", + "@ethersproject/networks": "5.8.0", + "@ethersproject/pbkdf2": "5.8.0", + "@ethersproject/properties": "5.8.0", + "@ethersproject/providers": "5.8.0", + "@ethersproject/random": "5.8.0", + "@ethersproject/rlp": "5.8.0", + "@ethersproject/sha2": "5.8.0", + "@ethersproject/signing-key": "5.8.0", + "@ethersproject/solidity": "5.8.0", + "@ethersproject/strings": "5.8.0", + "@ethersproject/transactions": "5.8.0", + "@ethersproject/units": "5.8.0", + "@ethersproject/wallet": "5.8.0", + "@ethersproject/web": "5.8.0", + "@ethersproject/wordlists": "5.8.0" + } + }, + "node_modules/eth-gas-reporter/node_modules/form-data": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } }, "node_modules/ethereum-bloom-filters": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", "dev": true, + "peer": true, "dependencies": { "js-sha3": "^0.8.0" } @@ -9252,71 +11036,138 @@ "@scure/bip39": "1.1.0" } }, - "node_modules/ethereum-waffle": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-3.4.4.tgz", - "integrity": "sha512-PA9+jCjw4WC3Oc5ocSMBj5sXvueWQeAbvCA+hUlb6oFgwwKyq5ka3bWQ7QZcjzIX+TdFkxP4IbFmoY2D8Dkj9Q==", + "node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dev": true, + "license": "MPL-2.0", + "peer": true, "dependencies": { - "@ethereum-waffle/chai": "^3.4.4", - "@ethereum-waffle/compiler": "^3.4.4", - "@ethereum-waffle/mock-contract": "^3.4.4", - "@ethereum-waffle/provider": "^3.4.4", - "ethers": "^5.0.1" - }, - "bin": { - "waffle": "bin/waffle" + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" }, "engines": { - "node": ">=10.0" + "node": ">=10.0.0" + } + }, + "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" } }, "node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "version": "6.14.4", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.14.4.tgz", + "integrity": "sha512-Jm/dzRs2Z9iBrT6e9TvGxyb5YVKAPLlpna7hjxH7KH/++DSh2T/JVmQUv7iHI5E55hDbp/gEVvstWYXVxXFzsA==", "dev": true, "funding": [ { "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + "url": "https://github.com/sponsors/ethers-io/" }, { "type": "individual", "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/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, + "license": "MIT" + }, + "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, + "license": "0BSD" + }, + "node_modules/ethers/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, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } } }, "node_modules/ethjs-unit": { @@ -9324,6 +11175,7 @@ "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", "dev": true, + "peer": true, "dependencies": { "bn.js": "4.11.6", "number-to-bn": "1.7.0" @@ -9337,33 +11189,21 @@ "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 + "dev": true, + "peer": true }, "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -9376,12 +11216,38 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/fast-uri": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", @@ -9398,11 +11264,23 @@ } ] }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/fastq": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -9411,30 +11289,19 @@ } }, "node_modules/find-replace": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", - "integrity": "sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA==", + "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, + "license": "MIT", + "peer": true, "dependencies": { - "array-back": "^1.0.4", - "test-value": "^2.1.0" + "array-back": "^3.0.1" }, "engines": { "node": ">=4.0.0" } }, - "node_modules/find-replace/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -9451,15 +11318,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "dev": true, - "dependencies": { - "micromatch": "^4.0.2" - } - }, "node_modules/flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", @@ -9469,19 +11327,10 @@ "flat": "cli.js" } }, - "node_modules/fmix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz", - "integrity": "sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==", - "dev": true, - "dependencies": { - "imul": "^1.0.0" - } - }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", "dev": true, "funding": [ { @@ -9489,6 +11338,7 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -9498,29 +11348,6 @@ } } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/form-data-encoder": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", @@ -9550,9210 +11377,31 @@ "node": ">=6 <7 || >=8" } }, + "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, + "license": "MIT", + "peer": true + }, "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 }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/ganache-core": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/ganache-core/-/ganache-core-2.13.2.tgz", - "integrity": "sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw==", - "bundleDependencies": [ - "keccak" - ], - "deprecated": "ganache-core is now ganache; visit https://trfl.io/g7 for details", - "dev": true, - "hasShrinkwrap": true, - "dependencies": { - "abstract-leveldown": "3.0.0", - "async": "2.6.2", - "bip39": "2.5.0", - "cachedown": "1.0.0", - "clone": "2.1.2", - "debug": "3.2.6", - "encoding-down": "5.0.4", - "eth-sig-util": "3.0.0", - "ethereumjs-abi": "0.6.8", - "ethereumjs-account": "3.0.0", - "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.0", - "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "6.2.1", - "ethereumjs-vm": "4.2.0", - "heap": "0.2.6", - "keccak": "3.0.1", - "level-sublevel": "6.6.4", - "levelup": "3.1.1", - "lodash": "4.17.20", - "lru-cache": "5.1.1", - "merkle-patricia-tree": "3.0.0", - "patch-package": "6.2.2", - "seedrandom": "3.0.1", - "source-map-support": "0.5.12", - "tmp": "0.1.0", - "web3-provider-engine": "14.2.1", - "websocket": "1.0.32" - }, - "engines": { - "node": ">=8.9.0" - }, - "optionalDependencies": { - "ethereumjs-wallet": "0.6.5", - "web3": "1.2.11" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/abi": { - "version": "5.0.0-beta.153", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/address": ">=5.0.0-beta.128", - "@ethersproject/bignumber": ">=5.0.0-beta.130", - "@ethersproject/bytes": ">=5.0.0-beta.129", - "@ethersproject/constants": ">=5.0.0-beta.128", - "@ethersproject/hash": ">=5.0.0-beta.128", - "@ethersproject/keccak256": ">=5.0.0-beta.127", - "@ethersproject/logger": ">=5.0.0-beta.129", - "@ethersproject/properties": ">=5.0.0-beta.131", - "@ethersproject/strings": ">=5.0.0-beta.130" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/abstract-provider": { - "version": "5.0.8", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/networks": "^5.0.7", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/transactions": "^5.0.9", - "@ethersproject/web": "^5.0.12" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/abstract-signer": { - "version": "5.0.10", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/abstract-provider": "^5.0.8", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/address": { - "version": "5.0.9", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/rlp": "^5.0.7" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/base64": { - "version": "5.0.7", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/bignumber": { - "version": "5.0.13", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "bn.js": "^4.4.0" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/bytes": { - "version": "5.0.9", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/logger": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/constants": { - "version": "5.0.8", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bignumber": "^5.0.13" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/hash": { - "version": "5.0.10", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/abstract-signer": "^5.0.10", - "@ethersproject/address": "^5.0.9", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/strings": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/keccak256": { - "version": "5.0.7", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9", - "js-sha3": "0.5.7" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/logger": { - "version": "5.0.8", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/@ethersproject/networks": { - "version": "5.0.7", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/logger": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/properties": { - "version": "5.0.7", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/logger": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/rlp": { - "version": "5.0.7", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/signing-key": { - "version": "5.0.8", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "elliptic": "6.5.3" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/strings": { - "version": "5.0.8", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/constants": "^5.0.8", - "@ethersproject/logger": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/transactions": { - "version": "5.0.9", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/address": "^5.0.9", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/constants": "^5.0.8", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/rlp": "^5.0.7", - "@ethersproject/signing-key": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@ethersproject/web": { - "version": "5.0.12", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "license": "MIT", - "optional": true, - "dependencies": { - "@ethersproject/base64": "^5.0.7", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/strings": "^5.0.8" - } - }, - "node_modules/ganache-core/node_modules/@sindresorhus/is": { - "version": "0.14.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/@szmarczak/http-timer": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", - "optional": true, - "dependencies": { - "defer-to-connect": "^1.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/@types/bn.js": { - "version": "4.11.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ganache-core/node_modules/@types/node": { - "version": "14.14.20", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/@types/pbkdf2": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ganache-core/node_modules/@types/secp256k1": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/ganache-core/node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/ganache-core/node_modules/abstract-leveldown": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/accepts": { - "version": "1.3.7", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/aes-js": { - "version": "3.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/ajv": { - "version": "6.12.6", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ganache-core/node_modules/ansi-styles": { - "version": "3.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/arr-diff": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/arr-flatten": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/arr-union": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/array-flatten": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/array-unique": { - "version": "0.3.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/asn1": { - "version": "0.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/ganache-core/node_modules/asn1.js": { - "version": "5.4.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ganache-core/node_modules/assert-plus": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/ganache-core/node_modules/assign-symbols": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/async": { - "version": "2.6.2", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.11" - } - }, - "node_modules/ganache-core/node_modules/async-eventemitter": { - "version": "0.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "async": "^2.4.0" - } - }, - "node_modules/ganache-core/node_modules/async-limiter": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/asynckit": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/atob": { - "version": "2.1.2", - "dev": true, - "license": "(MIT OR Apache-2.0)", - "bin": { - "atob": "bin/atob.js" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/ganache-core/node_modules/aws-sign2": { - "version": "0.7.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/aws4": { - "version": "1.11.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-code-frame": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - } - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/ansi-regex": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/ansi-styles": { - "version": "2.2.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/chalk": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/js-tokens": { - "version": "3.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/strip-ansi": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-code-frame/node_modules/supports-color": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ganache-core/node_modules/babel-core": { - "version": "6.26.3", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - } - }, - "node_modules/ganache-core/node_modules/babel-core/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/babel-core/node_modules/json5": { - "version": "0.5.1", - "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/ganache-core/node_modules/babel-core/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-core/node_modules/slash": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-generator": { - "version": "6.26.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/babel-generator/node_modules/jsesc": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-call-delegate": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-define-map": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-function-name": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-get-function-arity": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-hoist-variables": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-optimise-call-expression": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-regex": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helper-replace-supers": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-helpers": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-messages": { - "version": "6.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-regenerator": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerator-transform": "^0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "node_modules/ganache-core/node_modules/babel-preset-env": { - "version": "1.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - } - }, - "node_modules/ganache-core/node_modules/babel-preset-env/node_modules/semver": { - "version": "5.7.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/babel-register": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - } - }, - "node_modules/ganache-core/node_modules/babel-register/node_modules/source-map-support": { - "version": "0.4.18", - "dev": true, - "license": "MIT", - "dependencies": { - "source-map": "^0.5.6" - } - }, - "node_modules/ganache-core/node_modules/babel-runtime": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "node_modules/ganache-core/node_modules/babel-template": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "node_modules/ganache-core/node_modules/babel-traverse": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - } - }, - "node_modules/ganache-core/node_modules/babel-traverse/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/babel-traverse/node_modules/globals": { - "version": "9.18.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babel-traverse/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/babel-types": { - "version": "6.26.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "node_modules/ganache-core/node_modules/babel-types/node_modules/to-fast-properties": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/babelify": { - "version": "7.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "babel-core": "^6.0.14", - "object-assign": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/babylon": { - "version": "6.18.0", - "dev": true, - "license": "MIT", - "bin": { - "babylon": "bin/babylon.js" - } - }, - "node_modules/ganache-core/node_modules/backoff": { - "version": "2.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "precond": "0.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/balanced-match": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/base": { - "version": "0.11.2", - "dev": true, - "license": "MIT", - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/base-x": { - "version": "3.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ganache-core/node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/base64-js": { - "version": "1.5.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/ganache-core/node_modules/bcrypt-pbkdf/node_modules/tweetnacl": { - "version": "0.14.5", - "dev": true, - "license": "Unlicense" - }, - "node_modules/ganache-core/node_modules/bignumber.js": { - "version": "9.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/bip39": { - "version": "2.5.0", - "dev": true, - "license": "ISC", - "dependencies": { - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" - } - }, - "node_modules/ganache-core/node_modules/blakejs": { - "version": "1.1.0", - "dev": true, - "license": "CC0-1.0" - }, - "node_modules/ganache-core/node_modules/bluebird": { - "version": "3.7.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/bn.js": { - "version": "4.11.9", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/body-parser": { - "version": "1.19.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/body-parser/node_modules/qs": { - "version": "6.7.0", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/ganache-core/node_modules/brace-expansion": { - "version": "1.1.11", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/ganache-core/node_modules/brorand": { - "version": "1.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/browserify-aes": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ganache-core/node_modules/browserify-cipher": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/browserify-des": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/ganache-core/node_modules/browserify-rsa": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "node_modules/ganache-core/node_modules/browserify-rsa/node_modules/bn.js": { - "version": "5.1.3", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/browserify-sign": { - "version": "4.2.1", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "node_modules/ganache-core/node_modules/browserify-sign/node_modules/bn.js": { - "version": "5.1.3", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ganache-core/node_modules/browserslist": { - "version": "3.2.8", - "dev": true, - "license": "MIT", - "dependencies": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - }, - "bin": { - "browserslist": "cli.js" - } - }, - "node_modules/ganache-core/node_modules/bs58": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/ganache-core/node_modules/bs58check": { - "version": "2.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/ganache-core/node_modules/buffer": { - "version": "5.7.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/ganache-core/node_modules/buffer-from": { - "version": "1.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/buffer-to-arraybuffer": { - "version": "0.0.5", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/buffer-xor": { - "version": "1.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/bufferutil": { - "version": "4.0.3", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-gyp-build": "^4.2.0" - } - }, - "node_modules/ganache-core/node_modules/bytes": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/bytewise": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "bytewise-core": "^1.2.2", - "typewise": "^1.0.3" - } - }, - "node_modules/ganache-core/node_modules/bytewise-core": { - "version": "1.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "typewise-core": "^1.2" - } - }, - "node_modules/ganache-core/node_modules/cache-base": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/cacheable-request": { - "version": "6.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ganache-core/node_modules/cacheable-request/node_modules/lowercase-keys": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ganache-core/node_modules/cachedown": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "^2.4.1", - "lru-cache": "^3.2.0" - } - }, - "node_modules/ganache-core/node_modules/cachedown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/cachedown/node_modules/lru-cache": { - "version": "3.2.0", - "dev": true, - "license": "ISC", - "dependencies": { - "pseudomap": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/call-bind": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ganache-core/node_modules/caniuse-lite": { - "version": "1.0.30001174", - "dev": true, - "license": "CC-BY-4.0" - }, - "node_modules/ganache-core/node_modules/caseless": { - "version": "0.12.0", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/ganache-core/node_modules/chalk": { - "version": "2.4.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/checkpoint-store": { - "version": "1.1.0", - "dev": true, - "license": "ISC", - "dependencies": { - "functional-red-black-tree": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/chownr": { - "version": "1.1.4", - "dev": true, - "license": "ISC", - "optional": true - }, - "node_modules/ganache-core/node_modules/ci-info": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/cids": { - "version": "0.7.5", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - }, - "engines": { - "node": ">=4.0.0", - "npm": ">=3.0.0" - } - }, - "node_modules/ganache-core/node_modules/cids/node_modules/multicodec": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer": "^5.6.0", - "varint": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/cipher-base": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ganache-core/node_modules/class-is": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/class-utils": { - "version": "0.3.6", - "dev": true, - "license": "MIT", - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/class-utils/node_modules/kind-of": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/clone": { - "version": "2.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/ganache-core/node_modules/clone-response": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "mimic-response": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/collection-visit": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/color-convert": { - "version": "1.9.3", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/ganache-core/node_modules/color-name": { - "version": "1.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/combined-stream": { - "version": "1.0.8", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/component-emitter": { - "version": "1.3.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/concat-map": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/concat-stream": { - "version": "1.6.2", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/ganache-core/node_modules/content-disposition": { - "version": "0.5.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safe-buffer": "5.1.2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/content-disposition/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/content-hash": { - "version": "2.5.2", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "cids": "^0.7.1", - "multicodec": "^0.5.5", - "multihashes": "^0.4.15" - } - }, - "node_modules/ganache-core/node_modules/content-type": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/convert-source-map": { - "version": "1.7.0", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/convert-source-map/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/cookie": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/cookie-signature": { - "version": "1.0.6", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/cookiejar": { - "version": "2.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/copy-descriptor": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/core-js": { - "version": "2.6.12", - "dev": true, - "hasInstallScript": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/core-js-pure": { - "version": "3.8.2", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/ganache-core/node_modules/core-util-is": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/cors": { - "version": "2.8.5", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ganache-core/node_modules/create-ecdh": { - "version": "4.0.4", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "node_modules/ganache-core/node_modules/create-hash": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/ganache-core/node_modules/create-hmac": { - "version": "1.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/ganache-core/node_modules/cross-fetch": { - "version": "2.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" - } - }, - "node_modules/ganache-core/node_modules/crypto-browserify": { - "version": "3.12.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/d": { - "version": "1.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/dashdash": { - "version": "1.14.1", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/ganache-core/node_modules/debug": { - "version": "3.2.6", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/ganache-core/node_modules/decode-uri-component": { - "version": "0.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/ganache-core/node_modules/decompress-response": { - "version": "3.3.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/deep-equal": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/defer-to-connect": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/deferred-leveldown": { - "version": "4.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/deferred-leveldown/node_modules/abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/define-properties": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ganache-core/node_modules/define-property": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/defined": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/delayed-stream": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ganache-core/node_modules/depd": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/des.js": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/destroy": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/detect-indent": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "repeating": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/diffie-hellman": { - "version": "5.0.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/dom-walk": { - "version": "0.1.2", - "dev": true - }, - "node_modules/ganache-core/node_modules/dotignore": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "minimatch": "^3.0.4" - }, - "bin": { - "ignored": "bin/ignored" - } - }, - "node_modules/ganache-core/node_modules/duplexer3": { - "version": "0.1.4", - "dev": true, - "license": "BSD-3-Clause", - "optional": true - }, - "node_modules/ganache-core/node_modules/ecc-jsbn": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ganache-core/node_modules/ee-first": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/electron-to-chromium": { - "version": "1.3.636", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/elliptic": { - "version": "6.5.3", - "dev": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/encodeurl": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/encoding": { - "version": "0.1.13", - "dev": true, - "license": "MIT", - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/ganache-core/node_modules/encoding-down": { - "version": "5.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/encoding-down/node_modules/abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.2", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/end-of-stream": { - "version": "1.4.4", - "dev": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/ganache-core/node_modules/errno": { - "version": "0.1.8", - "dev": true, - "license": "MIT", - "dependencies": { - "prr": "~1.0.1" - }, - "bin": { - "errno": "cli.js" - } - }, - "node_modules/ganache-core/node_modules/es-abstract": { - "version": "1.18.0-next.1", - "dev": true, - "license": "MIT", - "dependencies": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/es-to-primitive": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/es5-ext": { - "version": "0.10.53", - "dev": true, - "license": "ISC", - "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "node_modules/ganache-core/node_modules/es6-iterator": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/ganache-core/node_modules/es6-symbol": { - "version": "3.1.3", - "dev": true, - "license": "ISC", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/ganache-core/node_modules/escape-html": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/escape-string-regexp": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ganache-core/node_modules/esutils": { - "version": "2.0.3", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/etag": { - "version": "1.8.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/eth-block-tracker": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - } - }, - "node_modules/ganache-core/node_modules/eth-block-tracker/node_modules/ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-block-tracker/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-block-tracker/node_modules/pify": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/eth-ens-namehash": { - "version": "2.0.8", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-infura": { - "version": "3.2.1", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-fetch": "^2.1.1", - "eth-json-rpc-middleware": "^1.5.0", - "json-rpc-engine": "^3.4.0", - "json-rpc-error": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware": { - "version": "1.6.0", - "dev": true, - "license": "ISC", - "dependencies": { - "async": "^2.5.0", - "eth-query": "^2.1.2", - "eth-tx-summary": "^3.1.2", - "ethereumjs-block": "^1.6.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.2", - "ethereumjs-vm": "^2.1.0", - "fetch-ponyfill": "^4.0.0", - "json-rpc-engine": "^3.6.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "tape": "^4.6.3" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.6.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-block/node_modules/ethereum-common": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-vm/node_modules/ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-vm/node_modules/ethereumjs-block/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-vm/node_modules/ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ethereumjs-vm/node_modules/ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/isarray": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-codec": { - "version": "7.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-errors": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "1.1.14", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-ws": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-ws/node_modules/readable-stream": { - "version": "1.0.34", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/level-ws/node_modules/xtend": { - "version": "2.1.2", - "dev": true, - "dependencies": { - "object-keys": "~0.4.0" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/levelup": { - "version": "1.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/memdown": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/memdown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/merkle-patricia-tree/node_modules/async": { - "version": "1.5.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/object-keys": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/semver": { - "version": "5.4.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/eth-json-rpc-middleware/node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-lib": { - "version": "0.1.29", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/ganache-core/node_modules/eth-query": { - "version": "2.1.2", - "dev": true, - "license": "ISC", - "dependencies": { - "json-rpc-random-id": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "node_modules/ganache-core/node_modules/eth-sig-util": { - "version": "3.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "buffer": "^5.2.1", - "elliptic": "^6.4.0", - "ethereumjs-abi": "0.6.5", - "ethereumjs-util": "^5.1.1", - "tweetnacl": "^1.0.0", - "tweetnacl-util": "^0.15.0" - } - }, - "node_modules/ganache-core/node_modules/eth-sig-util/node_modules/ethereumjs-abi": { - "version": "0.6.5", - "dev": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^4.3.0" - } - }, - "node_modules/ganache-core/node_modules/eth-sig-util/node_modules/ethereumjs-abi/node_modules/ethereumjs-util": { - "version": "4.5.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-sig-util/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary": { - "version": "3.2.4", - "dev": true, - "license": "ISC", - "dependencies": { - "async": "^2.1.2", - "clone": "^2.0.0", - "concat-stream": "^1.5.1", - "end-of-stream": "^1.1.0", - "eth-query": "^2.0.2", - "ethereumjs-block": "^1.4.1", - "ethereumjs-tx": "^1.1.1", - "ethereumjs-util": "^5.0.1", - "ethereumjs-vm": "^2.6.0", - "through2": "^2.0.3" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.6.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-block/node_modules/ethereum-common": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-vm/node_modules/ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-vm/node_modules/ethereumjs-block/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-vm/node_modules/ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ethereumjs-vm/node_modules/ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/isarray": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-codec": { - "version": "7.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-errors": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "1.1.14", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-ws": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-ws/node_modules/readable-stream": { - "version": "1.0.34", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/level-ws/node_modules/xtend": { - "version": "2.1.2", - "dev": true, - "dependencies": { - "object-keys": "~0.4.0" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/levelup": { - "version": "1.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/memdown": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/memdown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/merkle-patricia-tree/node_modules/async": { - "version": "1.5.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/object-keys": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/semver": { - "version": "5.4.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/eth-tx-summary/node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethashjs": { - "version": "0.0.8", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.1.2", - "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.0.2", - "miller-rabin": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethashjs/node_modules/bn.js": { - "version": "5.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethashjs/node_modules/buffer-xor": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethashjs/node_modules/ethereumjs-util": { - "version": "7.0.7", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereum-bloom-filters": { - "version": "1.0.7", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "js-sha3": "^0.8.0" - } - }, - "node_modules/ganache-core/node_modules/ethereum-bloom-filters/node_modules/js-sha3": { - "version": "0.8.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/ethereum-common": { - "version": "0.0.18", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-abi": { - "version": "0.6.8", - "dev": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-account": { - "version": "3.0.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.6.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/isarray": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-codec": { - "version": "7.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-errors": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "1.1.14", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-ws": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-ws/node_modules/readable-stream": { - "version": "1.0.34", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/level-ws/node_modules/xtend": { - "version": "2.1.2", - "dev": true, - "dependencies": { - "object-keys": "~0.4.0" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/levelup": { - "version": "1.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/memdown": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/memdown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/merkle-patricia-tree/node_modules/async": { - "version": "1.5.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/object-keys": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/semver": { - "version": "5.4.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-block/node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-blockchain": { - "version": "4.0.4", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-common": { - "version": "1.5.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm": { - "version": "4.2.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.6.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/isarray": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-codec": { - "version": "7.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-errors": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "1.1.14", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-ws": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-ws/node_modules/readable-stream": { - "version": "1.0.34", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/level-ws/node_modules/xtend": { - "version": "2.1.2", - "dev": true, - "dependencies": { - "object-keys": "~0.4.0" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/levelup": { - "version": "1.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/memdown": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/memdown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/merkle-patricia-tree/node_modules/async": { - "version": "1.5.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/merkle-patricia-tree/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/object-keys": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/semver": { - "version": "5.4.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/ethereumjs-vm/node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ethereumjs-wallet": { - "version": "0.6.5", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "aes-js": "^3.1.1", - "bs58check": "^2.1.2", - "ethereum-cryptography": "^0.1.3", - "ethereumjs-util": "^6.0.0", - "randombytes": "^2.0.6", - "safe-buffer": "^5.1.2", - "scryptsy": "^1.2.1", - "utf8": "^3.0.0", - "uuid": "^3.3.2" - } - }, - "node_modules/ganache-core/node_modules/ethjs-unit": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ganache-core/node_modules/ethjs-unit/node_modules/bn.js": { - "version": "4.11.6", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/ethjs-util": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ganache-core/node_modules/eventemitter3": { - "version": "4.0.4", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/events": { - "version": "3.2.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/ganache-core/node_modules/evp_bytestokey": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets": { - "version": "2.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/kind-of": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/express": { - "version": "4.17.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/ganache-core/node_modules/express/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/express/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/express/node_modules/qs": { - "version": "6.7.0", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/ganache-core/node_modules/express/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/ext": { - "version": "1.4.0", - "dev": true, - "license": "ISC", - "dependencies": { - "type": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/ext/node_modules/type": { - "version": "2.1.0", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/extend": { - "version": "3.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/extend-shallow": { - "version": "3.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/extglob": { - "version": "2.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/extsprintf": { - "version": "1.3.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/fake-merkle-patricia-tree": { - "version": "1.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "checkpoint-store": "^1.1.0" - } - }, - "node_modules/ganache-core/node_modules/fast-deep-equal": { - "version": "3.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/fetch-ponyfill": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "~1.7.1" - } - }, - "node_modules/ganache-core/node_modules/fetch-ponyfill/node_modules/is-stream": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/fetch-ponyfill/node_modules/node-fetch": { - "version": "1.7.3", - "dev": true, - "license": "MIT", - "dependencies": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/finalhandler": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root": { - "version": "1.2.1", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "fs-extra": "^4.0.3", - "micromatch": "^3.1.4" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/braces": { - "version": "2.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/fill-range": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/fs-extra": { - "version": "4.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/is-number": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/micromatch": { - "version": "3.1.10", - "dev": true, - "license": "MIT", - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/find-yarn-workspace-root/node_modules/to-regex-range": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/flow-stoplight": { - "version": "1.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/for-each": { - "version": "0.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/ganache-core/node_modules/for-in": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/forever-agent": { - "version": "0.6.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/form-data": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/ganache-core/node_modules/forwarded": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/fragment-cache": { - "version": "0.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/fresh": { - "version": "0.5.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/fs-extra": { - "version": "7.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/ganache-core/node_modules/fs.realpath": { - "version": "1.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/function-bind": { - "version": "1.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/functional-red-black-tree": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/get-intrinsic": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/get-stream": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ganache-core/node_modules/get-value": { - "version": "2.0.6", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/getpass": { - "version": "0.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/glob": { - "version": "7.1.3", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/global": { - "version": "4.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, - "node_modules/ganache-core/node_modules/got": { - "version": "9.6.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/ganache-core/node_modules/got/node_modules/get-stream": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/graceful-fs": { - "version": "4.2.4", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/har-schema": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/har-validator": { - "version": "5.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/has": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/ganache-core/node_modules/has-ansi": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-flag": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/has-symbol-support-x": { - "version": "1.4.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/has-symbols": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/has-to-string-tag-x": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "has-symbol-support-x": "^1.4.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/has-value": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-values": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-values/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/hash-base": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ganache-core/node_modules/hash.js": { - "version": "1.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/heap": { - "version": "0.2.6", - "dev": true - }, - "node_modules/ganache-core/node_modules/hmac-drbg": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/home-or-tmp": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/http-cache-semantics": { - "version": "4.1.0", - "dev": true, - "license": "BSD-2-Clause", - "optional": true - }, - "node_modules/ganache-core/node_modules/http-errors": { - "version": "1.7.2", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/http-errors/node_modules/inherits": { - "version": "2.0.3", - "dev": true, - "license": "ISC", - "optional": true - }, - "node_modules/ganache-core/node_modules/http-https": { - "version": "1.0.0", - "dev": true, - "license": "ISC", - "optional": true - }, - "node_modules/ganache-core/node_modules/http-signature": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/ganache-core/node_modules/iconv-lite": { - "version": "0.4.24", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/idna-uts46-hx": { - "version": "2.3.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "punycode": "2.1.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/ganache-core/node_modules/idna-uts46-hx/node_modules/punycode": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/ieee754": { - "version": "1.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/ganache-core/node_modules/immediate": { - "version": "3.2.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/inflight": { - "version": "1.0.6", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/ganache-core/node_modules/inherits": { - "version": "2.0.4", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/invariant": { - "version": "2.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "loose-envify": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/ipaddr.js": { - "version": "1.9.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ganache-core/node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-arguments": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-callable": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-ci": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/ganache-core/node_modules/is-data-descriptor": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-date-object": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-descriptor": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-extendable": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-finite": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ganache-core/node_modules/is-fn": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-function": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/is-hex-prefixed": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ganache-core/node_modules/is-negative-zero": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-object": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "optional": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-plain-obj": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-plain-object": { - "version": "2.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-regex": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-retry-allowed": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/is-symbol": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/is-typedarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/is-windows": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/isarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/isexe": { - "version": "2.0.0", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/isobject": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/isstream": { - "version": "0.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/isurl": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/ganache-core/node_modules/js-sha3": { - "version": "0.5.7", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/js-tokens": { - "version": "4.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/jsbn": { - "version": "0.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/json-buffer": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/json-rpc-engine": { - "version": "3.8.0", - "dev": true, - "license": "ISC", - "dependencies": { - "async": "^2.0.1", - "babel-preset-env": "^1.7.0", - "babelify": "^7.3.0", - "json-rpc-error": "^2.0.0", - "promise-to-callback": "^1.0.0", - "safe-event-emitter": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/json-rpc-error": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1" - } - }, - "node_modules/ganache-core/node_modules/json-rpc-random-id": { - "version": "1.0.1", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/json-schema": { - "version": "0.2.3", - "dev": true - }, - "node_modules/ganache-core/node_modules/json-schema-traverse": { - "version": "0.4.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/json-stable-stringify": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "jsonify": "~0.0.0" - } - }, - "node_modules/ganache-core/node_modules/json-stringify-safe": { - "version": "5.0.1", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/jsonfile": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/ganache-core/node_modules/jsonify": { - "version": "0.0.0", - "dev": true, - "license": "Public Domain" - }, - "node_modules/ganache-core/node_modules/jsprim": { - "version": "1.4.1", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "node_modules/ganache-core/node_modules/keccak": { - "version": "3.0.1", - "dev": true, - "hasInstallScript": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/ganache-core/node_modules/keyv": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "json-buffer": "3.0.0" - } - }, - "node_modules/ganache-core/node_modules/kind-of": { - "version": "6.0.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/klaw-sync": { - "version": "6.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.1.11" - } - }, - "node_modules/ganache-core/node_modules/level-codec": { - "version": "9.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-errors": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-iterator-stream": { - "version": "2.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/level-mem": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-mem/node_modules/abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-mem/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/level-mem/node_modules/memdown": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-mem/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/level-packager": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/level-post": { - "version": "1.0.7", - "dev": true, - "license": "MIT", - "dependencies": { - "ltgt": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/level-sublevel": { - "version": "6.6.4", - "dev": true, - "license": "MIT", - "dependencies": { - "bytewise": "~1.1.0", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "level-iterator-stream": "^2.0.3", - "ltgt": "~2.1.1", - "pull-defer": "^0.2.2", - "pull-level": "^2.0.3", - "pull-stream": "^3.6.8", - "typewiselite": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/level-ws": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/levelup": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/levelup/node_modules/level-iterator-stream": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/lodash": { - "version": "4.17.20", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/looper": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/loose-envify": { - "version": "1.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, - "node_modules/ganache-core/node_modules/lowercase-keys": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/lru-cache": { - "version": "5.1.1", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/ganache-core/node_modules/ltgt": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/map-cache": { - "version": "0.2.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/map-visit": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/md5.js": { - "version": "1.3.5", - "dev": true, - "license": "MIT", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/ganache-core/node_modules/media-typer": { - "version": "0.3.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/merge-descriptors": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/merkle-patricia-tree": { - "version": "3.0.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.6.1", - "ethereumjs-util": "^5.2.0", - "level-mem": "^3.0.1", - "level-ws": "^1.0.0", - "readable-stream": "^3.0.6", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/readable-stream": { - "version": "3.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ganache-core/node_modules/methods": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/miller-rabin": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/ganache-core/node_modules/mime": { - "version": "1.6.0", - "dev": true, - "license": "MIT", - "optional": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/mime-db": { - "version": "1.45.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/mime-types": { - "version": "2.1.28", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.45.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/mimic-response": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/min-document": { - "version": "2.19.0", - "dev": true, - "dependencies": { - "dom-walk": "^0.1.0" - } - }, - "node_modules/ganache-core/node_modules/minimalistic-assert": { - "version": "1.0.1", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/minimatch": { - "version": "3.0.4", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/minimist": { - "version": "1.2.5", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/minizlib": { - "version": "1.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "minipass": "^2.9.0" - } - }, - "node_modules/ganache-core/node_modules/minizlib/node_modules/minipass": { - "version": "2.9.0", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/ganache-core/node_modules/mixin-deep": { - "version": "1.3.2", - "dev": true, - "license": "MIT", - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/mkdirp": { - "version": "0.5.5", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/ganache-core/node_modules/mkdirp-promise": { - "version": "5.0.1", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "mkdirp": "*" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/mock-fs": { - "version": "4.13.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/multibase": { - "version": "0.6.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "node_modules/ganache-core/node_modules/multicodec": { - "version": "0.5.7", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "varint": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/multihashes": { - "version": "0.4.21", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer": "^5.5.0", - "multibase": "^0.7.0", - "varint": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/multihashes/node_modules/multibase": { - "version": "0.7.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "node_modules/ganache-core/node_modules/nano-json-stream-parser": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/nanomatch": { - "version": "1.2.13", - "dev": true, - "license": "MIT", - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/negotiator": { - "version": "0.6.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/next-tick": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/nice-try": { - "version": "1.0.5", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/node-addon-api": { - "version": "2.0.2", - "dev": true, - "inBundle": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/node-fetch": { - "version": "2.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/ganache-core/node_modules/node-gyp-build": { - "version": "4.2.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/ganache-core/node_modules/normalize-url": { - "version": "4.5.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ganache-core/node_modules/number-to-bn": { - "version": "1.7.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ganache-core/node_modules/number-to-bn/node_modules/bn.js": { - "version": "4.11.6", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/oauth-sign": { - "version": "0.9.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/object-assign": { - "version": "4.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object-inspect": { - "version": "1.9.0", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/object-is": { - "version": "1.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/object-keys": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ganache-core/node_modules/object-visit": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/object.assign": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/object.getownpropertydescriptors": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/object.pick": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/oboe": { - "version": "2.1.4", - "dev": true, - "license": "BSD", - "optional": true, - "dependencies": { - "http-https": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/on-finished": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/once": { - "version": "1.4.0", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/ganache-core/node_modules/os-homedir": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/os-tmpdir": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/p-cancelable": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/p-timeout": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "p-finally": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/p-timeout/node_modules/p-finally": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/parse-asn1": { - "version": "5.1.6", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/parse-headers": { - "version": "2.0.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/parseurl": { - "version": "1.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/pascalcase": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/patch-package": { - "version": "6.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^1.2.1", - "fs-extra": "^7.0.1", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.0", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33" - }, - "bin": { - "patch-package": "index.js" - }, - "engines": { - "npm": ">5" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/cross-spawn": { - "version": "6.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/path-key": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/semver": { - "version": "5.7.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/shebang-command": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/shebang-regex": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/slash": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/tmp": { - "version": "0.0.33", - "dev": true, - "license": "MIT", - "dependencies": { - "os-tmpdir": "~1.0.2" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/ganache-core/node_modules/patch-package/node_modules/which": { - "version": "1.3.1", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/ganache-core/node_modules/path-is-absolute": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/path-parse": { - "version": "1.0.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/path-to-regexp": { - "version": "0.1.7", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/pbkdf2": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/ganache-core/node_modules/performance-now": { - "version": "2.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/posix-character-classes": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/precond": { - "version": "0.2.3", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/prepend-http": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/private": { - "version": "0.1.8", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/process": { - "version": "0.11.10", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/ganache-core/node_modules/process-nextick-args": { - "version": "2.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/promise-to-callback": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/proxy-addr": { - "version": "2.0.6", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ganache-core/node_modules/prr": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/pseudomap": { - "version": "1.0.2", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/psl": { - "version": "1.8.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/public-encrypt": { - "version": "4.0.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/ganache-core/node_modules/pull-cat": { - "version": "1.1.11", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/pull-defer": { - "version": "0.2.3", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/pull-level": { - "version": "2.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "level-post": "^1.0.7", - "pull-cat": "^1.1.9", - "pull-live": "^1.0.1", - "pull-pushable": "^2.0.0", - "pull-stream": "^3.4.0", - "pull-window": "^2.1.4", - "stream-to-pull-stream": "^1.7.1" - } - }, - "node_modules/ganache-core/node_modules/pull-live": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "pull-cat": "^1.1.9", - "pull-stream": "^3.4.0" - } - }, - "node_modules/ganache-core/node_modules/pull-pushable": { - "version": "2.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/pull-stream": { - "version": "3.6.14", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/pull-window": { - "version": "2.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "looper": "^2.0.0" - } - }, - "node_modules/ganache-core/node_modules/pump": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/ganache-core/node_modules/punycode": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/qs": { - "version": "6.5.2", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/ganache-core/node_modules/query-string": { - "version": "5.1.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/randombytes": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/ganache-core/node_modules/randomfill": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/ganache-core/node_modules/range-parser": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/raw-body": { - "version": "2.4.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/readable-stream": { - "version": "2.3.7", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/ganache-core/node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/regenerate": { - "version": "1.4.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/regenerator-runtime": { - "version": "0.11.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/regenerator-transform": { - "version": "0.10.1", - "dev": true, - "license": "BSD", - "dependencies": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, - "node_modules/ganache-core/node_modules/regex-not": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/regexp.prototype.flags": { - "version": "1.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/regexp.prototype.flags/node_modules/es-abstract": { - "version": "1.17.7", - "dev": true, - "license": "MIT", - "dependencies": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/regexpu-core": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "node_modules/ganache-core/node_modules/regjsgen": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/regjsparser": { - "version": "0.1.5", - "dev": true, - "license": "BSD", - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/ganache-core/node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/ganache-core/node_modules/repeat-element": { - "version": "1.1.3", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/repeat-string": { - "version": "1.6.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10" - } - }, - "node_modules/ganache-core/node_modules/repeating": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-finite": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/request": { - "version": "2.88.2", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ganache-core/node_modules/resolve-url": { - "version": "0.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/responselike": { - "version": "1.0.2", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "lowercase-keys": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/resumer": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "~2.3.4" - } - }, - "node_modules/ganache-core/node_modules/ret": { - "version": "0.1.15", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12" - } - }, - "node_modules/ganache-core/node_modules/rimraf": { - "version": "2.6.3", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/ganache-core/node_modules/ripemd160": { - "version": "2.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/ganache-core/node_modules/rlp": { - "version": "2.2.6", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.1" - }, - "bin": { - "rlp": "bin/rlp" - } - }, - "node_modules/ganache-core/node_modules/rustbn.js": { - "version": "0.2.0", - "dev": true, - "license": "(MIT OR Apache-2.0)" - }, - "node_modules/ganache-core/node_modules/safe-buffer": { - "version": "5.2.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/safe-event-emitter": { - "version": "1.0.1", - "dev": true, - "license": "ISC", - "dependencies": { - "events": "^3.0.0" - } - }, - "node_modules/ganache-core/node_modules/safe-regex": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/ganache-core/node_modules/safer-buffer": { - "version": "2.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/scrypt-js": { - "version": "3.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/scryptsy": { - "version": "1.2.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "pbkdf2": "^3.0.3" - } - }, - "node_modules/ganache-core/node_modules/secp256k1": { - "version": "4.0.2", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "elliptic": "^6.5.2", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/ganache-core/node_modules/seedrandom": { - "version": "3.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/semaphore": { - "version": "1.1.0", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ganache-core/node_modules/send": { - "version": "0.17.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ganache-core/node_modules/send/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/send/node_modules/ms": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/serve-static": { - "version": "1.14.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/ganache-core/node_modules/servify": { - "version": "0.1.12", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/set-immediate-shim": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/set-value": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/set-value/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/set-value/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/setimmediate": { - "version": "1.0.5", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/setprototypeof": { - "version": "1.1.1", - "dev": true, - "license": "ISC", - "optional": true - }, - "node_modules/ganache-core/node_modules/sha.js": { - "version": "2.4.11", - "dev": true, - "license": "(MIT AND BSD-3-Clause)", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/ganache-core/node_modules/simple-concat": { - "version": "1.0.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/simple-get": { - "version": "2.8.1", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon": { - "version": "0.8.2", - "dev": true, - "license": "MIT", - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon-node": { - "version": "2.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon-util": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon-util/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/kind-of": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/source-map": { - "version": "0.5.7", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/source-map-resolve": { - "version": "0.5.3", - "dev": true, - "license": "MIT", - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/ganache-core/node_modules/source-map-support": { - "version": "0.5.12", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/ganache-core/node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/source-map-url": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/split-string": { - "version": "3.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/sshpk": { - "version": "1.16.1", - "dev": true, - "license": "MIT", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/sshpk/node_modules/tweetnacl": { - "version": "0.14.5", - "dev": true, - "license": "Unlicense" - }, - "node_modules/ganache-core/node_modules/static-extend": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "dev": true, - "license": "MIT", - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/static-extend/node_modules/kind-of": { - "version": "5.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/statuses": { - "version": "1.5.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/stream-to-pull-stream": { - "version": "1.7.3", - "dev": true, - "license": "MIT", - "dependencies": { - "looper": "^3.0.0", - "pull-stream": "^3.2.3" - } - }, - "node_modules/ganache-core/node_modules/stream-to-pull-stream/node_modules/looper": { - "version": "3.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/strict-uri-encode": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/string_decoder": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/ganache-core/node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/string.prototype.trim": { - "version": "1.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/string.prototype.trimend": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/string.prototype.trimstart": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/strip-hex-prefix": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "is-hex-prefixed": "1.0.0" - }, - "engines": { - "node": ">=6.5.0", - "npm": ">=3" - } - }, - "node_modules/ganache-core/node_modules/supports-color": { - "version": "5.5.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/swarm-js": { - "version": "0.1.40", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "eth-lib": "^0.1.26", - "fs-extra": "^4.0.2", - "got": "^7.1.0", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar": "^4.0.2", - "xhr-request": "^1.0.1" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/fs-extra": { - "version": "4.0.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/get-stream": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/got": { - "version": "7.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/is-stream": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/p-cancelable": { - "version": "0.3.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/prepend-http": { - "version": "1.0.4", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/swarm-js/node_modules/url-parse-lax": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "prepend-http": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/tape": { - "version": "4.13.3", - "dev": true, - "license": "MIT", - "dependencies": { - "deep-equal": "~1.1.1", - "defined": "~1.0.0", - "dotignore": "~0.1.2", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.6", - "has": "~1.0.3", - "inherits": "~2.0.4", - "is-regex": "~1.0.5", - "minimist": "~1.2.5", - "object-inspect": "~1.7.0", - "resolve": "~1.17.0", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.1", - "through": "~2.3.8" - }, - "bin": { - "tape": "bin/tape" - } - }, - "node_modules/ganache-core/node_modules/tape/node_modules/glob": { - "version": "7.1.6", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ganache-core/node_modules/tape/node_modules/is-regex": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/tape/node_modules/object-inspect": { - "version": "1.7.0", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/tape/node_modules/resolve": { - "version": "1.17.0", - "dev": true, - "license": "MIT", - "dependencies": { - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/tar": { - "version": "4.4.13", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "engines": { - "node": ">=4.5" - } - }, - "node_modules/ganache-core/node_modules/tar/node_modules/fs-minipass": { - "version": "1.2.7", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^2.6.0" - } - }, - "node_modules/ganache-core/node_modules/tar/node_modules/minipass": { - "version": "2.9.0", - "dev": true, - "license": "ISC", - "optional": true, - "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "node_modules/ganache-core/node_modules/through": { - "version": "2.3.8", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/through2": { - "version": "2.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/ganache-core/node_modules/timed-out": { - "version": "4.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/tmp": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "rimraf": "^2.6.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/to-object-path": { - "version": "0.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/to-object-path/node_modules/is-buffer": { - "version": "1.1.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/to-readable-stream": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ganache-core/node_modules/to-regex": { - "version": "3.0.2", - "dev": true, - "license": "MIT", - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/toidentifier": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.6" - } - }, - "node_modules/ganache-core/node_modules/tough-cookie": { - "version": "2.5.0", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/ganache-core/node_modules/trim-right": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/tunnel-agent": { - "version": "0.6.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ganache-core/node_modules/tweetnacl": { - "version": "1.0.3", - "dev": true, - "license": "Unlicense" - }, - "node_modules/ganache-core/node_modules/tweetnacl-util": { - "version": "0.15.1", - "dev": true, - "license": "Unlicense" - }, - "node_modules/ganache-core/node_modules/type": { - "version": "1.2.0", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/type-is": { - "version": "1.6.18", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ganache-core/node_modules/typedarray": { - "version": "0.0.6", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/ganache-core/node_modules/typewise": { - "version": "1.0.3", - "dev": true, - "license": "MIT", - "dependencies": { - "typewise-core": "^1.2.0" - } - }, - "node_modules/ganache-core/node_modules/typewise-core": { - "version": "1.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/typewiselite": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/ultron": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/underscore": { - "version": "1.9.1", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/union-value": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/universalify": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/ganache-core/node_modules/unorm": { - "version": "1.6.0", - "dev": true, - "license": "MIT or GPL-2.0", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/ganache-core/node_modules/unpipe": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/unset-value": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/uri-js": { - "version": "4.4.1", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/ganache-core/node_modules/urix": { - "version": "0.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/url-parse-lax": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "prepend-http": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/ganache-core/node_modules/url-set-query": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/url-to-options": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/ganache-core/node_modules/use": { - "version": "3.1.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ganache-core/node_modules/utf-8-validate": { - "version": "5.0.4", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "node-gyp-build": "^4.2.0" - } - }, - "node_modules/ganache-core/node_modules/utf8": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/util-deprecate": { - "version": "1.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/util.promisify": { - "version": "1.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "for-each": "^0.3.3", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ganache-core/node_modules/utils-merge": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/ganache-core/node_modules/uuid": { - "version": "3.4.0", - "dev": true, - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/ganache-core/node_modules/varint": { - "version": "5.0.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/vary": { - "version": "1.1.2", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/ganache-core/node_modules/verror": { - "version": "1.10.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/ganache-core/node_modules/web3": { - "version": "1.2.11", - "dev": true, - "hasInstallScript": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "web3-bzz": "1.2.11", - "web3-core": "1.2.11", - "web3-eth": "1.2.11", - "web3-eth-personal": "1.2.11", - "web3-net": "1.2.11", - "web3-shh": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-bzz": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@types/node": "^12.12.6", - "got": "9.6.0", - "swarm-js": "^0.1.40", - "underscore": "1.9.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-bzz/node_modules/@types/node": { - "version": "12.19.12", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/web3-core": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@types/bn.js": "^4.11.5", - "@types/node": "^12.12.6", - "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-requestmanager": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core-helpers": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "underscore": "1.9.1", - "web3-eth-iban": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core-method": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@ethersproject/transactions": "^5.0.0-beta.135", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core-promievent": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "eventemitter3": "4.0.4" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core-requestmanager": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "web3-providers-http": "1.2.11", - "web3-providers-ipc": "1.2.11", - "web3-providers-ws": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core-subscriptions": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "eventemitter3": "4.0.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-core/node_modules/@types/node": { - "version": "12.19.12", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/web3-eth": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-eth-accounts": "1.2.11", - "web3-eth-contract": "1.2.11", - "web3-eth-ens": "1.2.11", - "web3-eth-iban": "1.2.11", - "web3-eth-personal": "1.2.11", - "web3-net": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-abi": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@ethersproject/abi": "5.0.0-beta.153", - "underscore": "1.9.1", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-accounts": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.8", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "scrypt-js": "^3.0.1", - "underscore": "1.9.1", - "uuid": "3.3.2", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-accounts/node_modules/eth-lib": { - "version": "0.2.8", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-accounts/node_modules/uuid": { - "version": "3.3.2", - "dev": true, - "license": "MIT", - "optional": true, - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-contract": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@types/bn.js": "^4.11.5", - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-ens": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "content-hash": "^2.5.2", - "eth-ens-namehash": "2.0.8", - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-eth-contract": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-iban": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "bn.js": "^4.11.9", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-personal": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "@types/node": "^12.12.6", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-net": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-eth-personal/node_modules/@types/node": { - "version": "12.19.12", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/web3-net": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "web3-core": "1.2.11", - "web3-core-method": "1.2.11", - "web3-utils": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine": { - "version": "14.2.1", - "dev": true, - "license": "MIT", - "dependencies": { - "async": "^2.5.0", - "backoff": "^2.5.0", - "clone": "^2.0.0", - "cross-fetch": "^2.1.0", - "eth-block-tracker": "^3.0.0", - "eth-json-rpc-infura": "^3.1.0", - "eth-sig-util": "3.0.0", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.5", - "ethereumjs-vm": "^2.3.4", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.85.0", - "semaphore": "^1.0.3", - "ws": "^5.1.1", - "xhr": "^2.2.0", - "xtend": "^4.0.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.6.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/eth-sig-util": { - "version": "1.4.2", - "dev": true, - "license": "ISC", - "dependencies": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", - "ethereumjs-util": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-block/node_modules/ethereum-common": { - "version": "0.2.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-vm/node_modules/ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-vm/node_modules/ethereumjs-block/node_modules/ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-vm/node_modules/ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ethereumjs-vm/node_modules/ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/isarray": { - "version": "0.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-codec": { - "version": "7.0.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-errors": { - "version": "1.0.5", - "dev": true, - "license": "MIT", - "dependencies": { - "errno": "~0.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-iterator-stream/node_modules/readable-stream": { - "version": "1.1.14", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-ws": { - "version": "0.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-ws/node_modules/readable-stream": { - "version": "1.0.34", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/level-ws/node_modules/xtend": { - "version": "2.1.2", - "dev": true, - "dependencies": { - "object-keys": "~0.4.0" - }, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/levelup": { - "version": "1.3.9", - "dev": true, - "license": "MIT", - "dependencies": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ltgt": { - "version": "2.2.1", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/memdown": { - "version": "1.4.1", - "dev": true, - "license": "MIT", - "dependencies": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/memdown/node_modules/abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "license": "MIT", - "dependencies": { - "xtend": "~4.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/merkle-patricia-tree/node_modules/async": { - "version": "1.5.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/object-keys": { - "version": "0.4.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/semver": { - "version": "5.4.1", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/string_decoder": { - "version": "0.10.31", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/web3-provider-engine/node_modules/ws": { - "version": "5.2.2", - "dev": true, - "license": "MIT", - "dependencies": { - "async-limiter": "~1.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-providers-http": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "web3-core-helpers": "1.2.11", - "xhr2-cookies": "1.1.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-providers-ipc": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "oboe": "2.1.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-providers-ws": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "eventemitter3": "4.0.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "websocket": "^1.0.31" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-shh": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "web3-core": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-net": "1.2.11" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-utils": { - "version": "1.2.11", - "dev": true, - "license": "LGPL-3.0", - "optional": true, - "dependencies": { - "bn.js": "^4.11.9", - "eth-lib": "0.2.8", - "ethereum-bloom-filters": "^1.0.6", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "underscore": "1.9.1", - "utf8": "3.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ganache-core/node_modules/web3-utils/node_modules/eth-lib": { - "version": "0.2.8", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "node_modules/ganache-core/node_modules/websocket": { - "version": "1.0.32", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/ganache-core/node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/ganache-core/node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/whatwg-fetch": { - "version": "2.0.4", - "dev": true, - "license": "MIT" - }, - "node_modules/ganache-core/node_modules/wrappy": { - "version": "1.0.2", - "dev": true, - "license": "ISC" - }, - "node_modules/ganache-core/node_modules/ws": { - "version": "3.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - } - }, - "node_modules/ganache-core/node_modules/ws/node_modules/safe-buffer": { - "version": "5.1.2", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/ganache-core/node_modules/xhr": { - "version": "2.6.0", - "dev": true, - "license": "MIT", - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/ganache-core/node_modules/xhr-request": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" - } - }, - "node_modules/ganache-core/node_modules/xhr-request-promise": { - "version": "0.1.3", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "xhr-request": "^1.1.0" - } - }, - "node_modules/ganache-core/node_modules/xhr2-cookies": { - "version": "1.1.0", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "cookiejar": "^2.1.1" - } - }, - "node_modules/ganache-core/node_modules/xtend": { - "version": "4.0.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/ganache-core/node_modules/yaeti": { - "version": "0.0.6", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/ganache-core/node_modules/yallist": { - "version": "3.1.1", - "dev": true, - "license": "ISC" - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -18764,28 +11412,67 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, + "license": "MIT", "engines": { "node": "*" } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -18798,13 +11485,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "node_modules/ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", "dev": true, + "license": "ISC", + "peer": true, "dependencies": { - "assert-plus": "^1.0.0" + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" } }, "node_modules/glob": { @@ -18812,6 +11505,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -18839,6 +11533,82 @@ "node": ">= 6" } }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/globby/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/got": { "version": "12.6.1", "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", @@ -18870,38 +11640,39 @@ "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" }, "engines": { - "node": ">=6" + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" } }, "node_modules/hardhat": { - "version": "2.24.2", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.24.2.tgz", - "integrity": "sha512-oYt+tcN2379Z3kqIhvVw6IFgWqTm/ixcrTvyAuQdE2RbD+kknwF7hDfUeggy0akrw6xdgCtXvnw9DFrxAB70hA==", + "version": "2.24.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.24.3.tgz", + "integrity": "sha512-2dhniQ1wW8/Wh3mP91kKcEnVva93mWYRaYLkV+a0ATkUEKrByGF2P5hCrlNHbqYP//D7L0CGYLtDjPQY6ILaVA==", "dev": true, + "license": "MIT", "dependencies": { "@ethereumjs/util": "^9.1.0", "@ethersproject/abi": "^5.1.2", - "@nomicfoundation/edr": "^0.11.0", + "@nomicfoundation/edr": "^0.11.1", "@nomicfoundation/solidity-analyzer": "^0.1.0", "@sentry/node": "^5.18.1", "@types/bn.js": "^5.1.0", @@ -18957,188 +11728,20 @@ } } }, - "node_modules/hardhat-deploy": { - "version": "0.11.34", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.34.tgz", - "integrity": "sha512-N6xcwD8LSMV/IyfEr8TfR2YRbOh9Q4QvitR9MKZRTXQmgQiiMGjX+2efMjKgNMxwCVlmpfnE1tyDxOJOOUseLQ==", + "node_modules/hardhat-gas-reporter": { + "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, + "license": "MIT", + "peer": true, "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@ethersproject/solidity": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wallet": "^5.7.0", - "@types/qs": "^6.9.7", - "axios": "^0.21.1", - "chalk": "^4.1.2", - "chokidar": "^3.5.2", - "debug": "^4.3.2", - "enquirer": "^2.3.6", - "ethers": "^5.5.3", - "form-data": "^4.0.0", - "fs-extra": "^10.0.0", - "match-all": "^1.2.6", - "murmur-128": "^0.2.1", - "qs": "^6.9.4", - "zksync-web3": "^0.14.3" - } - }, - "node_modules/hardhat-deploy-ethers": { - "version": "0.3.0-beta.13", - "resolved": "https://registry.npmjs.org/hardhat-deploy-ethers/-/hardhat-deploy-ethers-0.3.0-beta.13.tgz", - "integrity": "sha512-PdWVcKB9coqWV1L7JTpfXRCI91Cgwsm7KLmBcwZ8f0COSm1xtABHZTyz3fvF6p42cTnz1VM0QnfDvMFlIRkSNw==", - "dev": true, + "array-uniq": "1.0.3", + "eth-gas-reporter": "^0.2.25", + "sha1": "^1.1.1" + }, "peerDependencies": { - "ethers": "^5.0.0", - "hardhat": "^2.0.0" - } - }, - "node_modules/hardhat-deploy/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/hardhat-deploy/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/hardhat-deploy/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/hardhat-deploy/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/hardhat-deploy/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/hardhat-deploy/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/hardhat-deploy/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, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/hardhat-deploy/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat-deploy/node_modules/jsonfile": { - "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" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/hardhat-deploy/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/hardhat-deploy/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/hardhat-deploy/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" + "hardhat": "^2.0.2" } }, "node_modules/hardhat/node_modules/chokidar": { @@ -19165,29 +11768,6 @@ "node": ">= 12" } }, - "node_modules/hardhat/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/hardhat/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/hardhat/node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -19202,10 +11782,11 @@ } }, "node_modules/hardhat/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, + "license": "ISC", "bin": { "semver": "bin/semver.js" } @@ -19240,32 +11821,40 @@ "semver": "bin/semver" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "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, + "peer": true, "engines": { "node": ">=4" } }, "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, "engines": { "node": ">= 0.4" }, @@ -19278,6 +11867,7 @@ "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, + "peer": true, "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", @@ -19297,6 +11887,20 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -19306,22 +11910,42 @@ "he": "bin/he" } }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "dev": true, + "license": "MIT", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true + "node_modules/http-basic": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } }, "node_modules/http-cache-semantics": { "version": "4.1.1", @@ -19345,21 +11969,25 @@ "node": ">= 0.8" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "node_modules/http-response-object": { + "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, + "license": "MIT", + "peer": true, "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "@types/node": "^10.0.3" } }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/http2-wrapper": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", @@ -19386,29 +12014,6 @@ "node": ">= 6" } }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -19421,18 +12026,6 @@ "node": ">=0.10.0" } }, - "node_modules/idna-uts46-hx": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", - "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", - "dev": true, - "dependencies": { - "punycode": "2.1.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -19442,6 +12035,18 @@ "node": ">= 4" } }, + "node_modules/immer": { + "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", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, "node_modules/immutable": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.2.2.tgz", @@ -19464,15 +12069,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/imul": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz", - "integrity": "sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", @@ -19504,13 +12100,15 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "node_modules/invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">= 0.10" } }, "node_modules/io-ts": { @@ -19540,33 +12138,6 @@ "node": ">=8" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -19577,15 +12148,13 @@ } }, "node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "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, - "dependencies": { - "number-is-nan": "^1.0.0" - }, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/is-glob": { @@ -19605,6 +12174,7 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", "dev": true, + "peer": true, "engines": { "node": ">=6.5.0", "npm": ">=3" @@ -19615,6 +12185,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -19628,12 +12199,6 @@ "node": ">=8" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -19646,41 +12211,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, - "node_modules/is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", - "dev": true - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true, - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } + "license": "MIT", + "peer": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/js-sha3": { "version": "0.8.0", @@ -19706,12 +12250,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", @@ -19724,12 +12262,6 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -19749,7 +12281,22 @@ "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 + "dev": true, + "peer": true + }, + "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, + "license": "MIT", + "peer": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } }, "node_modules/jsonfile": { "version": "4.0.0", @@ -19760,19 +12307,15 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "node_modules/jsonschema": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.5.0.tgz", + "integrity": "sha512-K+A9hhqbn0f3pJX17Q/7H6yQfD/5OXgdrR5UE12gMXCiN9D5Xq2o5mddV2QEcX/bjla99ASsAAQUyMCCRWAEhw==", "dev": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, + "license": "MIT", + "peer": true, "engines": { - "node": ">=0.6.0" + "node": "*" } }, "node_modules/keccak": { @@ -19799,22 +12342,26 @@ "json-buffer": "3.0.1" } }, - "node_modules/klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "node_modules/kind-of": { + "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, - "optionalDependencies": { - "graceful-fs": "^4.1.9" + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11" + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" } }, "node_modules/latest-version": { @@ -19832,16 +12379,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "invert-kv": "^1.0.0" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, "node_modules/lines-and-columns": { @@ -19850,34 +12400,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/load-json-file/node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", - "dev": true, - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -19899,11 +12421,30 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==", - "dev": true + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/lodash.truncate": { "version": "4.4.2", @@ -20024,17 +12565,39 @@ "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", "dev": true }, - "node_modules/match-all": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", - "integrity": "sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ==", - "dev": true + "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, + "license": "ISC", + "peer": true + }, + "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, + "license": "MIT", + "peer": true + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, + "peer": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -20050,6 +12613,17 @@ "node": ">= 0.10.0" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micro-eth-signer": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/micro-eth-signer/-/micro-eth-signer-0.14.0.tgz", @@ -20095,12 +12669,14 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -20112,6 +12688,7 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, + "peer": true, "engines": { "node": ">= 0.6" } @@ -20121,6 +12698,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, + "peer": true, "dependencies": { "mime-db": "1.52.0" }, @@ -20150,13 +12728,15 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, + "peer": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -20178,6 +12758,7 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "peer": true, "dependencies": { "minimist": "^1.2.6" }, @@ -20195,32 +12776,32 @@ } }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", @@ -20228,53 +12809,18 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/mocha/node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" } }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/mocha/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/mocha/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/mocha/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -20287,6 +12833,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "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, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mocha/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -20297,10 +12864,11 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -20329,34 +12897,34 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/murmur-128": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/murmur-128/-/murmur-128-0.2.1.tgz", - "integrity": "sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==", + "node_modules/ndjson": { + "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", + "peer": true, "dependencies": { - "encode-utf8": "^1.0.2", - "fmix": "^0.1.0", - "imul": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, + "json-stringify-safe": "^5.0.1", + "minimist": "^1.2.5", + "readable-stream": "^3.6.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, "bin": { - "nanoid": "bin/nanoid.cjs" + "ndjson": "cli.js" }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=10" } }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "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, + "license": "MIT", + "peer": true }, "node_modules/node-addon-api": { "version": "2.0.2", @@ -20364,24 +12932,15 @@ "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "dev": true }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "node_modules/node-emoji": { + "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, + "license": "MIT", + "peer": true, "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "lodash": "^4.17.21" } }, "node_modules/node-gyp-build": { @@ -20395,25 +12954,29 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node_modules/nofilter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", + "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.19" } }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "abbrev": "1" + }, "bin": { - "semver": "bin/semver" + "nopt": "bin/nopt.js" } }, "node_modules/normalize-path": { @@ -20437,20 +13000,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/number-to-bn": { "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, + "peer": true, "dependencies": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -20464,15 +13019,18 @@ "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 - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true, + "peer": true + }, + "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, + "license": "MIT", + "peer": true, "engines": { - "node": "*" + "node": ">=0.10.0" } }, "node_modules/object-inspect": { @@ -20480,6 +13038,7 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true, + "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -20499,33 +13058,31 @@ "wrappy": "1" } }, - "node_modules/open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 0.8.0" } }, - "node_modules/os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "node_modules/ordinal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ordinal/-/ordinal-1.0.3.tgz", + "integrity": "sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ==", "dev": true, - "dependencies": { - "lcid": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, "node_modules/os-tmpdir": { "version": "1.0.2", @@ -20620,6 +13177,13 @@ "node": ">=6" } }, + "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, + "peer": true + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -20638,156 +13202,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/patch-package": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.5.1.tgz", - "integrity": "sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==", - "dev": true, - "dependencies": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^4.1.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.6", - "open": "^7.4.2", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33", - "yaml": "^1.10.2" - }, - "bin": { - "patch-package": "index.js" - }, - "engines": { - "node": ">=10", - "npm": ">5" - } - }, - "node_modules/patch-package/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/patch-package/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/patch-package/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/patch-package/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/patch-package/node_modules/fs-extra": { - "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", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/patch-package/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/patch-package/node_modules/jsonfile": { - "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" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/patch-package/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/patch-package/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/patch-package/node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -20802,39 +13216,17 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "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 }, - "node_modules/path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", @@ -20849,6 +13241,8 @@ "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", @@ -20860,12 +13254,6 @@ "node": ">=0.12" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -20884,36 +13272,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", - "dev": true, - "dependencies": { - "pinkie": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", @@ -20923,36 +13281,39 @@ "node": ">=4" } }, - "node_modules/postinstall-postinstall": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", - "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", "dev": true, - "hasInstallScript": true + "peer": true, + "engines": { + "node": ">= 0.8.0" + } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-plugin-solidity": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.2.tgz", - "integrity": "sha512-VVD/4XlDjSzyPWWCPW8JEleFa8JNKFYac5kNlMjVXemQyQZKfpekPMhFZSePuXB6L+RixlFvWe20iacGjFYrLw==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.3.tgz", + "integrity": "sha512-Mrr/iiR9f9IaeGRMZY2ApumXcn/C5Gs3S7B7hWB3gigBFML06C0yEyW86oLp0eqiA0qg+46FaChgLPJCj/pIlg==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.19.0", - "semver": "^7.6.3" + "@solidity-parser/parser": "^0.20.1", + "semver": "^7.7.1" }, "engines": { "node": ">=18" @@ -20961,17 +13322,66 @@ "prettier": ">=2.3.0" } }, + "node_modules/prettier-plugin-solidity/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/punycode": { "version": "2.1.0", @@ -20987,6 +13397,7 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dev": true, + "peer": true, "dependencies": { "side-channel": "^1.0.4" }, @@ -20997,15 +13408,27 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, - "engines": { - "node": ">=0.4.x" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "peer": true }, "node_modules/quick-lru": { "version": "5.1.1", @@ -21067,58 +13490,6 @@ "node": ">=0.10.0" } }, - "node_modules/read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "dev": true, - "dependencies": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", - "dev": true, - "dependencies": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "dev": true, - "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", - "dev": true, - "dependencies": { - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -21145,6 +13516,44 @@ "node": ">=8.10.0" } }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "peer": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/recursive-readdir": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/reduce-flatten": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/registry-auth-token": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.3.tgz", @@ -21172,69 +13581,43 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "node_modules/req-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", + "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" + "req-from": "^2.0.0" }, "engines": { - "node": ">= 6" + "node": ">=4" } }, - "node_modules/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "node_modules/req-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", + "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "resolve-from": "^3.0.0" }, "engines": { - "node": ">= 0.12" + "node": ">=4" } }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "node_modules/req-from/node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" + "node": ">=4" } }, "node_modules/require-directory": { @@ -21255,12 +13638,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", - "dev": true - }, "node_modules/resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", @@ -21303,16 +13680,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" } }, "node_modules/ripemd160": { @@ -21320,6 +13697,7 @@ "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, + "peer": true, "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -21330,6 +13708,7 @@ "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", "dev": true, + "peer": true, "dependencies": { "bn.js": "^5.2.0" }, @@ -21337,6 +13716,48 @@ "rlp": "bin/rlp" } }, + "node_modules/run-parallel": { + "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", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -21363,27 +13784,158 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "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, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "node_modules/sc-istanbul/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/sc-istanbul/node_modules/glob": { + "version": "5.0.15", + "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, + "license": "ISC", + "peer": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/sc-istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml/node_modules/esprima": { + "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, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/scrypt-js": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", - "dev": true + "dev": true, + "peer": true }, "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz", + "integrity": "sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==", "dev": true, "hasInstallScript": true, + "license": "MIT", + "peer": true, "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", + "elliptic": "^6.5.7", + "node-addon-api": "^5.0.0", "node-gyp-build": "^4.2.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=18.0.0" } }, + "node_modules/secp256k1/node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -21397,25 +13949,22 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true + "dev": true, + "license": "MIT", + "peer": true }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -21428,6 +13977,7 @@ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, + "peer": true, "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -21436,25 +13986,51 @@ "sha.js": "bin.js" } }, - "node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "node_modules/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", "dev": true, + "license": "BSD-3-Clause", + "peer": true, "dependencies": { - "shebang-regex": "^1.0.0" + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" }, "engines": { - "node": ">=0.10.0" + "node": "*" } }, - "node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" } }, "node_modules/side-channel": { @@ -21462,6 +14038,7 @@ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, + "peer": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -21471,14 +14048,13 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true, - "engines": { - "node": ">=6" - } + "license": "MIT", + "peer": true }, "node_modules/slice-ansi": { "version": "4.0.0", @@ -21530,75 +14106,13 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/solc": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.12.tgz", - "integrity": "sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g==", - "dev": true, - "dependencies": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "bin": { - "solcjs": "solcjs" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/solc/node_modules/fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "node_modules/solc/node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/solc/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/solhint": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.5.tgz", - "integrity": "sha512-WrnG6T+/UduuzSWsSOAbfq1ywLUDwNea3Gd5hg6PS+pLUm8lz2ECNr0beX609clBxmDeZ3676AiA9nPDljmbJQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.1.0.tgz", + "integrity": "sha512-KWg4gnOnznxHXzH0fUvnhnxnk+1R50GiPChcPeQgA7SKQTSF1LLIEh8R1qbkCEn/fFzz4CfJs+Gh7Rl9uhHy+g==", "dev": true, "dependencies": { - "@solidity-parser/parser": "^0.19.0", + "@solidity-parser/parser": "^0.20.0", "ajv": "^6.12.6", "antlr4": "^4.13.1-patch-1", "ast-parents": "^0.0.1", @@ -21624,15 +14138,6 @@ "prettier": "^2.8.3" } }, - "node_modules/solhint/node_modules/ansi-regex": { - "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" - } - }, "node_modules/solhint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -21649,10 +14154,11 @@ } }, "node_modules/solhint/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -21741,16 +14247,21 @@ "node": ">=10" } }, - "node_modules/solhint/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/solhint/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" + "license": "MIT", + "optional": true, + "bin": { + "prettier": "bin-prettier.js" }, "engines": { - "node": ">=8" + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/solhint/node_modules/supports-color": { @@ -21765,6 +14276,68 @@ "node": ">=8" } }, + "node_modules/solidity-coverage": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.16.tgz", + "integrity": "sha512-qKqgm8TPpcnCK0HCDLJrjbOA2tQNEJY4dHX/LSSQ9iwYFS973MwjtgYn2Iv3vfCEQJTj5xtm4cuUMzlJsJSMbg==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.0.9", + "@solidity-parser/parser": "^0.20.1", + "chalk": "^2.4.2", + "death": "^1.1.0", + "difflib": "^0.2.4", + "fs-extra": "^8.1.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.21", + "mocha": "^10.2.0", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.6" + }, + "bin": { + "solidity-coverage": "plugins/bin.js" + }, + "peerDependencies": { + "hardhat": "^2.11.0" + } + }, + "node_modules/solidity-coverage/node_modules/fs-extra": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/solidity-coverage/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -21784,68 +14357,24 @@ "source-map": "^0.6.0" } }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, + "license": "ISC", + "peer": true, "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "readable-stream": "^3.0.0" } }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "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, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", - "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", - "dev": true - }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dev": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sshpk/node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true + "license": "BSD-3-Clause", + "peer": true }, "node_modules/stacktrace-parser": { "version": "0.1.10", @@ -21877,15 +14406,6 @@ "node": ">= 0.8" } }, - "node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -21895,42 +14415,40 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", + "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, + "license": "WTFPL OR MIT", + "peer": true + }, + "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, + "license": "MIT", "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "dev": true, - "dependencies": { - "is-utf8": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/strip-hex-prefix": { @@ -21938,6 +14456,7 @@ "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", "dev": true, + "peer": true, "dependencies": { "is-hex-prefixed": "1.0.0" }, @@ -21963,6 +14482,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -21970,6 +14490,33 @@ "node": ">=4" } }, + "node_modules/sync-request": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/sync-rpc": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "get-port": "^3.1.0" + } + }, "node_modules/table": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", @@ -21986,6 +14533,45 @@ "node": ">=10.0.0" } }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "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, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, "node_modules/table/node_modules/ajv": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", @@ -22002,94 +14588,79 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/table/node_modules/ansi-regex": { - "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" - } - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "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" - } - }, "node_modules/table/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 }, - "node_modules/table/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/test-value": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", - "dev": true, - "dependencies": { - "array-back": "^1.0.3", - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/test-value/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/testrpc": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/testrpc/-/testrpc-0.0.1.tgz", - "integrity": "sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==", - "deprecated": "testrpc has been renamed to ganache-cli, please use this package from now on.", - "dev": true - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/then-request": { + "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, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "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, + "license": "MIT", + "peer": true + }, + "node_modules/then-request/node_modules/form-data": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.3.tgz", + "integrity": "sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.35", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "readable-stream": "3" + } + }, "node_modules/tinyglobby": { "version": "0.2.14", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", @@ -22149,6 +14720,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -22165,58 +14737,169 @@ "node": ">=0.6" } }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true, - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" + "license": "MIT", + "bin": { + "tree-kill": "cli.js" } }, - "node_modules/tough-cookie/node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "node_modules/ts-essentials": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", - "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", - "dev": true - }, - "node_modules/ts-generator": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ts-generator/-/ts-generator-0.1.1.tgz", - "integrity": "sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ==", + "node_modules/ts-command-line-args": { + "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, + "license": "ISC", + "peer": true, "dependencies": { - "@types/mkdirp": "^0.5.2", - "@types/prettier": "^2.1.1", - "@types/resolve": "^0.0.8", - "chalk": "^2.4.1", - "glob": "^7.1.2", - "mkdirp": "^0.5.1", - "prettier": "^2.1.2", - "resolve": "^1.8.1", - "ts-essentials": "^1.0.0" + "chalk": "^4.1.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "string-format": "^2.0.0" }, "bin": { - "ts-generator": "dist/cli/run.js" + "write-markdown": "dist/write-markdown.js" + } + }, + "node_modules/ts-command-line-args/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-command-line-args/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-command-line-args/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-command-line-args/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/ts-command-line-args/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-command-line-args/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.3.1" } }, "node_modules/tslib": { @@ -22231,23 +14914,26 @@ "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", "dev": true }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "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, + "license": "MIT", + "peer": true, "dependencies": { - "safe-buffer": "^5.0.1" + "prelude-ls": "~1.1.2" }, "engines": { - "node": "*" + "node": ">= 0.8.0" } }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -22265,55 +14951,104 @@ } }, "node_modules/typechain": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/typechain/-/typechain-3.0.0.tgz", - "integrity": "sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", + "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", "dev": true, + "license": "MIT", + "peer": true, "dependencies": { - "command-line-args": "^4.0.7", - "debug": "^4.1.1", + "@types/prettier": "^2.1.1", + "debug": "^4.3.1", "fs-extra": "^7.0.0", + "glob": "7.1.7", "js-sha3": "^0.8.0", "lodash": "^4.17.15", - "ts-essentials": "^6.0.3", - "ts-generator": "^0.1.1" + "mkdirp": "^1.0.4", + "prettier": "^2.3.1", + "ts-command-line-args": "^2.2.0", + "ts-essentials": "^7.0.1" }, "bin": { "typechain": "dist/cli/cli.js" + }, + "peerDependencies": { + "typescript": ">=4.3.0" } }, - "node_modules/typechain/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/typechain/node_modules/glob": { + "version": "7.1.7", + "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, + "license": "ISC", + "peer": true, "dependencies": { - "ms": "2.1.2" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=6.0" + "node": "*" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/typechain/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "node_modules/typechain/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/typechain/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } }, "node_modules/typechain/node_modules/ts-essentials": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.7.tgz", - "integrity": "sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==", + "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, + "license": "MIT", + "peer": true, "peerDependencies": { "typescript": ">=3.7.0" } }, + "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, + "license": "MIT", + "peer": true + }, "node_modules/typescript": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", @@ -22329,23 +15064,51 @@ } }, "node_modules/typical": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", - "dev": true - }, - "node_modules/undici": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", - "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", "dev": true, - "dependencies": { - "busboy": "^1.6.0" + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uglify-js": { + "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, + "license": "BSD-2-Clause", + "optional": true, + "peer": true, + "bin": { + "uglifyjs": "bin/uglifyjs" }, "engines": { - "node": ">=12.18" + "node": ">=0.8.0" } }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -22373,27 +15136,12 @@ "punycode": "^2.1.0" } }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - }, "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 + "dev": true, + "peer": true }, "node_modules/util-deprecate": { "version": "1.0.2", @@ -22410,35 +15158,20 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "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, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } + "license": "MIT", + "peer": true }, "node_modules/web3-utils": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.1.tgz", "integrity": "sha512-LgnM9p6V7rHHUGfpMZod+NST8cRfGzJ1BTXAyNo7A9cJX9LczBfSRxJp+U/GInYe9mby40t3v22AJdlELibnsQ==", "dev": true, + "peer": true, "dependencies": { "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", @@ -22452,66 +15185,12 @@ "node": ">=8.0.0" } }, - "node_modules/web3-utils/node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dev": true, - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/web3-utils/node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dev": true, - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, + "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -22519,12 +15198,6 @@ "which": "bin/which" } }, - "node_modules/which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", - "dev": true - }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", @@ -22537,67 +15210,57 @@ "node": ">=8" } }, - "node_modules/widest-line/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/widest-line/node_modules/is-fullwidth-code-point": { - "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==", + "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, - "engines": { - "node": ">=8" - } + "license": "MIT", + "peer": true }, - "node_modules/widest-line/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==", + "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, + "license": "MIT", + "peer": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" }, "engines": { - "node": ">=8" + "node": ">=8.0.0" } }, - "node_modules/widest-line/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", + "peer": true, "engines": { "node": ">=8" } }, - "node_modules/window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==", - "dev": true, - "bin": { - "window-size": "cli.js" - }, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/wrap-ansi": { "version": "7.0.0", @@ -22616,15 +15279,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "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" - } - }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -22658,41 +15312,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/wrap-ansi/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -22700,10 +15319,11 @@ "dev": true }, "node_modules/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8.3.0" }, @@ -22729,15 +15349,6 @@ "node": ">=10" } }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -22757,10 +15368,11 @@ } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "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, + "license": "ISC", "engines": { "node": ">=10" } @@ -22780,48 +15392,15 @@ "node": ">=10" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", + "peer": true, "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "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" - } - }, - "node_modules/yargs/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", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "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" - }, - "engines": { - "node": ">=8" + "node": ">=6" } }, "node_modules/yocto-queue": { @@ -22835,14973 +15414,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/zksync-web3": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.3.tgz", - "integrity": "sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ==", - "dev": true, - "peerDependencies": { - "ethers": "^5.7.0" - } - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.25.9", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true - }, - "@ensdomains/ens": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/@ensdomains/ens/-/ens-0.4.5.tgz", - "integrity": "sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw==", - "dev": true, - "requires": { - "bluebird": "^3.5.2", - "eth-ens-namehash": "^2.0.8", - "solc": "^0.4.20", - "testrpc": "0.0.1", - "web3-utils": "^1.0.0-beta.31" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", - "dev": true - }, - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "require-from-string": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "solc": { - "version": "0.4.26", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.26.tgz", - "integrity": "sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA==", - "dev": true, - "requires": { - "fs-extra": "^0.30.0", - "memorystream": "^0.3.1", - "require-from-string": "^1.1.0", - "semver": "^5.3.0", - "yargs": "^4.7.1" - } - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - }, - "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", - "dev": true, - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", - "dev": true, - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - } - } - }, - "@ensdomains/resolver": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@ensdomains/resolver/-/resolver-0.2.4.tgz", - "integrity": "sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==", - "dev": true - }, - "@ethereum-waffle/chai": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/chai/-/chai-3.4.4.tgz", - "integrity": "sha512-/K8czydBtXXkcM9X6q29EqEkc5dN3oYenyH2a9hF7rGAApAJUpH8QBtojxOY/xQ2up5W332jqgxwp0yPiYug1g==", - "dev": true, - "requires": { - "@ethereum-waffle/provider": "^3.4.4", - "ethers": "^5.5.2" - } - }, - "@ethereum-waffle/compiler": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/compiler/-/compiler-3.4.4.tgz", - "integrity": "sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ==", - "dev": true, - "requires": { - "@resolver-engine/imports": "^0.3.3", - "@resolver-engine/imports-fs": "^0.3.3", - "@typechain/ethers-v5": "^2.0.0", - "@types/mkdirp": "^0.5.2", - "@types/node-fetch": "^2.5.5", - "ethers": "^5.0.1", - "mkdirp": "^0.5.1", - "node-fetch": "^2.6.1", - "solc": "^0.6.3", - "ts-generator": "^0.1.1", - "typechain": "^3.0.0" - } - }, - "@ethereum-waffle/ens": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/ens/-/ens-3.4.4.tgz", - "integrity": "sha512-0m4NdwWxliy3heBYva1Wr4WbJKLnwXizmy5FfSSr5PMbjI7SIGCdCB59U7/ZzY773/hY3bLnzLwvG5mggVjJWg==", - "dev": true, - "requires": { - "@ensdomains/ens": "^0.4.4", - "@ensdomains/resolver": "^0.2.4", - "ethers": "^5.5.2" - } - }, - "@ethereum-waffle/mock-contract": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/mock-contract/-/mock-contract-3.4.4.tgz", - "integrity": "sha512-Mp0iB2YNWYGUV+VMl5tjPsaXKbKo8MDH9wSJ702l9EBjdxFf/vBvnMBAC1Fub1lLtmD0JHtp1pq+mWzg/xlLnA==", - "dev": true, - "requires": { - "@ethersproject/abi": "^5.5.0", - "ethers": "^5.5.2" - } - }, - "@ethereum-waffle/provider": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-3.4.4.tgz", - "integrity": "sha512-GK8oKJAM8+PKy2nK08yDgl4A80mFuI8zBkE0C9GqTRYQqvuxIyXoLmJ5NZU9lIwyWVv5/KsoA11BgAv2jXE82g==", - "dev": true, - "requires": { - "@ethereum-waffle/ens": "^3.4.4", - "ethers": "^5.5.2", - "ganache-core": "^2.13.2", - "patch-package": "^6.2.2", - "postinstall-postinstall": "^2.1.0" - } - }, - "@ethereumjs/rlp": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-5.0.2.tgz", - "integrity": "sha512-DziebCdg4JpGlEqEdGgXmjqcFoJi+JGulUXwEjsZGAscAQ7MyD/7LE/GVCP29vEQxKc7AAwjT3A2ywHp2xfoCA==", - "dev": true - }, - "@ethereumjs/util": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-9.1.0.tgz", - "integrity": "sha512-XBEKsYqLGXLah9PNJbgdkigthkG7TAGvlD/sH12beMXEyHDyigfcbdvHhmLyDWgDyOJn4QwiQUaF7yeuhnjdog==", - "dev": true, - "requires": { - "@ethereumjs/rlp": "^5.0.2", - "ethereum-cryptography": "^2.2.1" - }, - "dependencies": { - "@noble/curves": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", - "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", - "dev": true, - "requires": { - "@noble/hashes": "1.4.0" - } - }, - "@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true - }, - "@scure/bip32": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", - "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", - "dev": true, - "requires": { - "@noble/curves": "~1.4.0", - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - } - }, - "@scure/bip39": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", - "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", - "dev": true, - "requires": { - "@noble/hashes": "~1.4.0", - "@scure/base": "~1.1.6" - } - }, - "ethereum-cryptography": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", - "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", - "dev": true, - "requires": { - "@noble/curves": "1.4.2", - "@noble/hashes": "1.4.0", - "@scure/bip32": "1.4.0", - "@scure/bip39": "1.3.0" - } - } - } - }, - "@ethersproject/abi": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", - "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", - "dev": true, - "requires": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "@ethersproject/abstract-provider": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", - "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", - "dev": true, - "requires": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0" - } - }, - "@ethersproject/abstract-signer": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", - "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", - "dev": true, - "requires": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "@ethersproject/address": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", - "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", - "dev": true, - "requires": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/rlp": "^5.7.0" - } - }, - "@ethersproject/base64": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", - "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0" - } - }, - "@ethersproject/basex": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", - "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "@ethersproject/bignumber": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", - "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "bn.js": "^5.2.1" - } - }, - "@ethersproject/bytes": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", - "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", - "dev": true, - "requires": { - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/constants": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", - "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", - "dev": true, - "requires": { - "@ethersproject/bignumber": "^5.7.0" - } - }, - "@ethersproject/contracts": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", - "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", - "dev": true, - "requires": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0" - } - }, - "@ethersproject/hash": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", - "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", - "dev": true, - "requires": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "@ethersproject/hdnode": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", - "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", - "dev": true, - "requires": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "@ethersproject/json-wallets": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", - "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", - "dev": true, - "requires": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "aes-js": "3.0.0", - "scrypt-js": "3.0.1" - } - }, - "@ethersproject/keccak256": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", - "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "js-sha3": "0.8.0" - } - }, - "@ethersproject/logger": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", - "dev": true - }, - "@ethersproject/networks": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", - "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", - "dev": true, - "requires": { - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/pbkdf2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", - "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/sha2": "^5.7.0" - } - }, - "@ethersproject/properties": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", - "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", - "dev": true, - "requires": { - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/providers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", - "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", - "dev": true, - "requires": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0", - "bech32": "1.1.4", - "ws": "7.4.6" - } - }, - "@ethersproject/random": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", - "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/rlp": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", - "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/sha2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", - "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "hash.js": "1.1.7" - } - }, - "@ethersproject/signing-key": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", - "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "bn.js": "^5.2.1", - "elliptic": "6.5.4", - "hash.js": "1.1.7" - } - }, - "@ethersproject/solidity": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", - "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", - "dev": true, - "requires": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "@ethersproject/strings": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", - "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/transactions": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", - "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", - "dev": true, - "requires": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0" - } - }, - "@ethersproject/units": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", - "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", - "dev": true, - "requires": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "@ethersproject/wallet": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", - "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", - "dev": true, - "requires": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/json-wallets": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "@ethersproject/web": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", - "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", - "dev": true, - "requires": { - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "@ethersproject/wordlists": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", - "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", - "dev": true, - "requires": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "@noble/curves": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.2.tgz", - "integrity": "sha512-vnI7V6lFNe0tLAuJMu+2sX+FcL14TaCWy1qiczg1VwRmPrpQCdq5ESXQMqUc2tluRNf6irBXrWbl1mGN8uaU/g==", - "dev": true, - "requires": { - "@noble/hashes": "1.7.2" - }, - "dependencies": { - "@noble/hashes": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", - "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", - "dev": true - } - } - }, - "@noble/hashes": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", - "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", - "dev": true - }, - "@noble/secp256k1": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz", - "integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==", - "dev": true - }, - "@nomicfoundation/edr": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.11.0.tgz", - "integrity": "sha512-36WERf8ldvyHR6UAbcYsa+vpbW7tCrJGBwF4gXSsb8+STj1n66Hz85Y/O7B9+8AauX3PhglvV5dKl91tk43mWw==", - "dev": true, - "requires": { - "@nomicfoundation/edr-darwin-arm64": "0.11.0", - "@nomicfoundation/edr-darwin-x64": "0.11.0", - "@nomicfoundation/edr-linux-arm64-gnu": "0.11.0", - "@nomicfoundation/edr-linux-arm64-musl": "0.11.0", - "@nomicfoundation/edr-linux-x64-gnu": "0.11.0", - "@nomicfoundation/edr-linux-x64-musl": "0.11.0", - "@nomicfoundation/edr-win32-x64-msvc": "0.11.0" - } - }, - "@nomicfoundation/edr-darwin-arm64": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.11.0.tgz", - "integrity": "sha512-aYTVdcSs27XG7ayTzvZ4Yn9z/ABSaUwicrtrYK2NR8IH0ik4N4bWzo/qH8rax6rewVLbHUkGyGYnsy5ZN4iiMw==", - "dev": true - }, - "@nomicfoundation/edr-darwin-x64": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.11.0.tgz", - "integrity": "sha512-RxX7UYgvJrfcyT/uHUn44Nsy1XaoW+Q1khKMdHKxeW7BrgIi+Lz+siz3bX5vhSoAnKilDPhIVLrnC8zxQhjR2A==", - "dev": true - }, - "@nomicfoundation/edr-linux-arm64-gnu": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.11.0.tgz", - "integrity": "sha512-J0j+rs0s11FuSipt/ymqrFmpJ7c0FSz1/+FohCIlUXDxFv//+1R/8lkGPjEYFmy8DPpk/iO8mcpqHTGckREbqA==", - "dev": true - }, - "@nomicfoundation/edr-linux-arm64-musl": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.11.0.tgz", - "integrity": "sha512-4r32zkGMN7WT/CMEuW0VjbuEdIeCskHNDMW4SSgQSJOE/N9L1KSLJCSsAbPD3aYE+e4WRDTyOwmuLjeUTcLZKQ==", - "dev": true - }, - "@nomicfoundation/edr-linux-x64-gnu": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.11.0.tgz", - "integrity": "sha512-SmdncQHLYtVNWLIMyGaY6LpAfamzTDe3fxjkirmJv3CWR5tcEyC6LMui/GsIVnJzXeNJBXAzwl8hTUAxHTM6kQ==", - "dev": true - }, - "@nomicfoundation/edr-linux-x64-musl": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.11.0.tgz", - "integrity": "sha512-w6hUqpn/trwiH6SRuRGysj37LsQVCX5XDCA3Xi81sbOaLhbHrNvK9TXWyZmcuzbdTKQQW6VNywcSxDdOiChcJg==", - "dev": true - }, - "@nomicfoundation/edr-win32-x64-msvc": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.11.0.tgz", - "integrity": "sha512-BLmULjRKoH9BsX+c4Na2ypV7NGeJ+M6Zpqj/faPOwleVscDdSr/IhriyPaXCe8dyfwbge7lWsbekiADtPSnB2Q==", - "dev": true - }, - "@nomicfoundation/solidity-analyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.0.tgz", - "integrity": "sha512-xGWAiVCGOycvGiP/qrlf9f9eOn7fpNbyJygcB0P21a1MDuVPlKt0Srp7rvtBEutYQ48ouYnRXm33zlRnlTOPHg==", - "dev": true, - "requires": { - "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.0", - "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.0", - "@nomicfoundation/solidity-analyzer-freebsd-x64": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.0", - "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": "0.1.0", - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.0" - } - }, - "@nomicfoundation/solidity-analyzer-darwin-arm64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.0.tgz", - "integrity": "sha512-vEF3yKuuzfMHsZecHQcnkUrqm8mnTWfJeEVFHpg+cO+le96xQA4lAJYdUan8pXZohQxv1fSReQsn4QGNuBNuCw==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-darwin-x64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.0.tgz", - "integrity": "sha512-dlHeIg0pTL4dB1l9JDwbi/JG6dHQaU1xpDK+ugYO8eJ1kxx9Dh2isEUtA4d02cQAl22cjOHTvifAk96A+ItEHA==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-freebsd-x64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.0.tgz", - "integrity": "sha512-WFCZYMv86WowDA4GiJKnebMQRt3kCcFqHeIomW6NMyqiKqhK1kIZCxSLDYsxqlx396kKLPN1713Q1S8tu68GKg==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.0.tgz", - "integrity": "sha512-DTw6MNQWWlCgc71Pq7CEhEqkb7fZnS7oly13pujs4cMH1sR0JzNk90Mp1zpSCsCs4oKan2ClhMlLKtNat/XRKQ==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-linux-arm64-musl": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.0.tgz", - "integrity": "sha512-wUpUnR/3GV5Da88MhrxXh/lhb9kxh9V3Jya2NpBEhKDIRCDmtXMSqPMXHZmOR9DfCwCvG6vLFPr/+YrPCnUN0w==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-linux-x64-gnu": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.0.tgz", - "integrity": "sha512-lR0AxK1x/MeKQ/3Pt923kPvwigmGX3OxeU5qNtQ9pj9iucgk4PzhbS3ruUeSpYhUxG50jN4RkIGwUMoev5lguw==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-linux-x64-musl": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.0.tgz", - "integrity": "sha512-A1he/8gy/JeBD3FKvmI6WUJrGrI5uWJNr5Xb9WdV+DK0F8msuOqpEByLlnTdLkXMwW7nSl3awvLezOs9xBHJEg==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-win32-arm64-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.0.tgz", - "integrity": "sha512-7x5SXZ9R9H4SluJZZP8XPN+ju7Mx+XeUMWZw7ZAqkdhP5mK19I4vz3x0zIWygmfE8RT7uQ5xMap0/9NPsO+ykw==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-win32-ia32-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.0.tgz", - "integrity": "sha512-m7w3xf+hnE774YRXu+2mGV7RiF3QJtUoiYU61FascCkQhX3QMQavh7saH/vzb2jN5D24nT/jwvaHYX/MAM9zUw==", - "dev": true, - "optional": true - }, - "@nomicfoundation/solidity-analyzer-win32-x64-msvc": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.0.tgz", - "integrity": "sha512-xCuybjY0sLJQnJhupiFAXaek2EqF0AP0eBjgzaalPXSNvCEN6ZYHvUzdA50ENDVeSYFXcUsYf3+FsD3XKaeptA==", - "dev": true, - "optional": true - }, - "@nomiclabs/hardhat-ethers": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz", - "integrity": "sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg==", - "dev": true, - "requires": {} - }, - "@nomiclabs/hardhat-waffle": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.3.tgz", - "integrity": "sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg==", - "dev": true, - "requires": { - "@types/sinon-chai": "^3.2.3", - "@types/web3": "1.0.19" - } - }, - "@openzeppelin/contracts": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.3.0.tgz", - "integrity": "sha512-zj/KGoW7zxWUE8qOI++rUM18v+VeLTTzKs/DJFkSzHpQFPD/jKKF0TrMxBfGLl3kpdELCNccvB3zmofSzm4nlA==", - "dev": true - }, - "@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "dev": true - }, - "@pnpm/network.ca-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", - "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", - "dev": true, - "requires": { - "graceful-fs": "4.2.10" - } - }, - "@pnpm/npm-conf": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", - "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", - "dev": true, - "requires": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - } - }, - "@resolver-engine/core": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/core/-/core-0.3.3.tgz", - "integrity": "sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "is-url": "^1.2.4", - "request": "^2.85.0" - } - }, - "@resolver-engine/fs": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/fs/-/fs-0.3.3.tgz", - "integrity": "sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ==", - "dev": true, - "requires": { - "@resolver-engine/core": "^0.3.3", - "debug": "^3.1.0" - } - }, - "@resolver-engine/imports": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/imports/-/imports-0.3.3.tgz", - "integrity": "sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q==", - "dev": true, - "requires": { - "@resolver-engine/core": "^0.3.3", - "debug": "^3.1.0", - "hosted-git-info": "^2.6.0", - "path-browserify": "^1.0.0", - "url": "^0.11.0" - } - }, - "@resolver-engine/imports-fs": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz", - "integrity": "sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA==", - "dev": true, - "requires": { - "@resolver-engine/fs": "^0.3.3", - "@resolver-engine/imports": "^0.3.3", - "debug": "^3.1.0" - } - }, - "@scure/base": { - "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 - }, - "@scure/bip32": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.0.tgz", - "integrity": "sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q==", - "dev": true, - "requires": { - "@noble/hashes": "~1.1.1", - "@noble/secp256k1": "~1.6.0", - "@scure/base": "~1.1.0" - } - }, - "@scure/bip39": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", - "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", - "dev": true, - "requires": { - "@noble/hashes": "~1.1.1", - "@scure/base": "~1.1.0" - } - }, - "@sentry/core": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", - "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", - "dev": true, - "requires": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - } - }, - "@sentry/hub": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", - "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "dev": true, - "requires": { - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "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, - "requires": { - "@sentry/hub": "5.30.0", - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - } - }, - "@sentry/node": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", - "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", - "dev": true, - "requires": { - "@sentry/core": "5.30.0", - "@sentry/hub": "5.30.0", - "@sentry/tracing": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - } - }, - "@sentry/tracing": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", - "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", - "dev": true, - "requires": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - } - }, - "@sentry/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", - "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", - "dev": true - }, - "@sentry/utils": { - "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, - "requires": { - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" - } - }, - "@sindresorhus/is": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.6.0.tgz", - "integrity": "sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==", - "dev": true - }, - "@solidity-parser/parser": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.19.0.tgz", - "integrity": "sha512-RV16k/qIxW/wWc+mLzV3ARyKUaMUTBy9tOLMzFhtNSKYeTAanQ3a5MudJKf/8arIFnA2L27SNjarQKmFg0w/jA==", - "dev": true - }, - "@stdlib/array-base-filled": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@stdlib/array-base-filled/-/array-base-filled-0.0.2.tgz", - "integrity": "sha512-X/beQFsIJy2KfLfkxm/F+hMr8esrxbHwPLu+9jBBvN5iGAAb+AMRVunXWdMV02DT12Q/M0vPcMGT1Yd3nJjEaw==", - "dev": true - }, - "@stdlib/array-base-zeros": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@stdlib/array-base-zeros/-/array-base-zeros-0.0.2.tgz", - "integrity": "sha512-Ga4qR5l6RRssonfEMa2YwGd0gGyQXqZQeifirXs8CYmQk/x3n2wMrNgPeSn0RPbLIKWlL8NpSnnx6hSeEPtRRQ==", - "dev": true, - "requires": { - "@stdlib/array-base-filled": "^0.0.x" - } - }, - "@stdlib/array-float32": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-float32/-/array-float32-0.0.6.tgz", - "integrity": "sha512-QgKT5UaE92Rv7cxfn7wBKZAlwFFHPla8eXsMFsTGt5BiL4yUy36lwinPUh4hzybZ11rw1vifS3VAPuk6JP413Q==", - "dev": true, - "requires": { - "@stdlib/assert-has-float32array-support": "^0.0.x" - } - }, - "@stdlib/array-float64": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-float64/-/array-float64-0.0.6.tgz", - "integrity": "sha512-oE8y4a84LyBF1goX5//sU1mOjet8gLI0/6wucZcjg+j/yMmNV1xFu84Az9GOGmFSE6Ze6lirGOhfBeEWNNNaJg==", - "dev": true, - "requires": { - "@stdlib/assert-has-float64array-support": "^0.0.x" - } - }, - "@stdlib/array-uint16": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint16/-/array-uint16-0.0.6.tgz", - "integrity": "sha512-/A8Tr0CqJ4XScIDRYQawosko8ha1Uy+50wsTgJhjUtXDpPRp7aUjmxvYkbe7Rm+ImYYbDQVix/uCiPAFQ8ed4Q==", - "dev": true, - "requires": { - "@stdlib/assert-has-uint16array-support": "^0.0.x" - } - }, - "@stdlib/array-uint32": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint32/-/array-uint32-0.0.6.tgz", - "integrity": "sha512-2hFPK1Fg7obYPZWlGDjW9keiIB6lXaM9dKmJubg/ergLQCsJQJZpYsG6mMAfTJi4NT1UF4jTmgvyKD+yf0D9cA==", - "dev": true, - "requires": { - "@stdlib/assert-has-uint32array-support": "^0.0.x" - } - }, - "@stdlib/array-uint8": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/array-uint8/-/array-uint8-0.0.7.tgz", - "integrity": "sha512-qYJQQfGKIcky6TzHFIGczZYTuVlut7oO+V8qUBs7BJC9TwikVnnOmb3hY3jToY4xaoi5p9OvgdJKPInhyIhzFg==", - "dev": true, - "requires": { - "@stdlib/assert-has-uint8array-support": "^0.0.x" - } - }, - "@stdlib/assert-has-float32array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float32array-support/-/assert-has-float32array-support-0.0.8.tgz", - "integrity": "sha512-Yrg7K6rBqwCzDWZ5bN0VWLS5dNUWcoSfUeU49vTERdUmZID06J069CDc07UUl8vfQWhFgBWGocH3rrpKm1hi9w==", - "dev": true, - "requires": { - "@stdlib/assert-is-float32array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-float64array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-float64array-support/-/assert-has-float64array-support-0.0.8.tgz", - "integrity": "sha512-UVQcoeWqgMw9b8PnAmm/sgzFnuWkZcNhJoi7xyMjbiDV/SP1qLCrvi06mq86cqS3QOCma1fEayJdwgteoXyyuw==", - "dev": true, - "requires": { - "@stdlib/assert-is-float64array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-generator-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-generator-support/-/assert-has-generator-support-0.0.8.tgz", - "integrity": "sha512-TejqpxFYY1NVGGamtxvUrt1TiiSFMt5bL2X84GSmqZGFE8C7CEWevKF462dH+uquf5K7OfJVOaL6XSnDXLTG+g==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/utils-eval": "^0.0.x" - } - }, - "@stdlib/assert-has-node-buffer-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-node-buffer-support/-/assert-has-node-buffer-support-0.0.8.tgz", - "integrity": "sha512-fgI+hW4Yg4ciiv4xVKH+1rzdV7e5+6UKgMnFbc1XDXHcxLub3vOr8+H6eDECdAIfgYNA7X0Dxa/DgvX9dwDTAQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-buffer": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-own-property": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-own-property/-/assert-has-own-property-0.0.7.tgz", - "integrity": "sha512-3YHwSWiUqGlTLSwxAWxrqaD1PkgcJniGyotJeIt5X0tSNmSW0/c9RWroCImTUUB3zBkyBJ79MyU9Nf4Qgm59fQ==", - "dev": true - }, - "@stdlib/assert-has-symbol-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-symbol-support/-/assert-has-symbol-support-0.0.8.tgz", - "integrity": "sha512-PoQ9rk8DgDCuBEkOIzGGQmSnjtcdagnUIviaP5YskB45/TJHXseh4NASWME8FV77WFW9v/Wt1MzKFKMzpDFu4Q==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-tostringtag-support": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-tostringtag-support/-/assert-has-tostringtag-support-0.0.9.tgz", - "integrity": "sha512-UTsqdkrnQ7eufuH5BeyWOJL3ska3u5nvDWKqw3onNNZ2mvdgkfoFD7wHutVGzAA2rkTsSJAMBHVwWLsm5SbKgw==", - "dev": true, - "requires": { - "@stdlib/assert-has-symbol-support": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-uint16array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint16array-support/-/assert-has-uint16array-support-0.0.8.tgz", - "integrity": "sha512-vqFDn30YrtzD+BWnVqFhB130g3cUl2w5AdOxhIkRkXCDYAM5v7YwdNMJEON+D4jI8YB4D5pEYjqKweYaCq4nyg==", - "dev": true, - "requires": { - "@stdlib/assert-is-uint16array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint16-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-uint32array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint32array-support/-/assert-has-uint32array-support-0.0.8.tgz", - "integrity": "sha512-tJtKuiFKwFSQQUfRXEReOVGXtfdo6+xlshSfwwNWXL1WPP2LrceoiUoQk7zMCMT6VdbXgGH92LDjVcPmSbH4Xw==", - "dev": true, - "requires": { - "@stdlib/assert-is-uint32array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint32-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-has-uint8array-support": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-has-uint8array-support/-/assert-has-uint8array-support-0.0.8.tgz", - "integrity": "sha512-ie4vGTbAS/5Py+LLjoSQi0nwtYBp+WKk20cMYCzilT0rCsBI/oez0RqHrkYYpmt4WaJL4eJqC+/vfQ5NsI7F5w==", - "dev": true, - "requires": { - "@stdlib/assert-is-uint8array": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/constants-uint8-max": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-is-array": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array/-/assert-is-array-0.0.7.tgz", - "integrity": "sha512-/o6KclsGkNcZ5hiROarsD9XUs6xQMb4lTwF6O71UHbKWTtomEF/jD0rxLvlvj0BiCxfKrReddEYd2CnhUyskMA==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-array-like": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-array-like/-/assert-is-array-like-0.0.8.tgz", - "integrity": "sha512-LV1MSacc3cUsDl17rT5kQswzOeACwaWiEU5T3KKWkr2QezST17RTf2ItthWBwXFKeE2YUDn0hI4QC08PeHOQ6w==", - "dev": true, - "requires": { - "@stdlib/constants-array-max-array-length": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x" - } - }, - "@stdlib/assert-is-big-endian": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-big-endian/-/assert-is-big-endian-0.0.7.tgz", - "integrity": "sha512-BvutsX84F76YxaSIeS5ZQTl536lz+f+P7ew68T1jlFqxBhr4v7JVYFmuf24U040YuK1jwZ2sAq+bPh6T09apwQ==", - "dev": true, - "requires": { - "@stdlib/array-uint16": "^0.0.x", - "@stdlib/array-uint8": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-is-boolean": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-boolean/-/assert-is-boolean-0.0.8.tgz", - "integrity": "sha512-PRCpslMXSYqFMz1Yh4dG2K/WzqxTCtlKbgJQD2cIkAtXux4JbYiXCtepuoV7l4Wv1rm0a1eU8EqNPgnOmWajGw==", - "dev": true, - "requires": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-buffer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-buffer/-/assert-is-buffer-0.0.8.tgz", - "integrity": "sha512-SYmGwOXkzZVidqUyY1IIx6V6QnSL36v3Lcwj8Rvne/fuW0bU2OomsEBzYCFMvcNgtY71vOvgZ9VfH3OppvV6eA==", - "dev": true, - "requires": { - "@stdlib/assert-is-object-like": "^0.0.x" - } - }, - "@stdlib/assert-is-float32array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float32array/-/assert-is-float32array-0.0.8.tgz", - "integrity": "sha512-Phk0Ze7Vj2/WLv5Wy8Oo7poZIDMSTiTrEnc1t4lBn3Svz2vfBXlvCufi/i5d93vc4IgpkdrOEwfry6nldABjNQ==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-float64array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-float64array/-/assert-is-float64array-0.0.8.tgz", - "integrity": "sha512-UC0Av36EEYIgqBbCIz1lj9g7qXxL5MqU1UrWun+n91lmxgdJ+Z77fHy75efJbJlXBf6HXhcYXECIsc0u3SzyDQ==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-function": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-function/-/assert-is-function-0.0.8.tgz", - "integrity": "sha512-M55Dt2njp5tnY8oePdbkKBRIypny+LpCMFZhEjJIxjLE4rA6zSlHs1yRMqD4PmW+Wl9WTeEM1GYO4AQHl1HAjA==", - "dev": true, - "requires": { - "@stdlib/utils-type-of": "^0.0.x" - } - }, - "@stdlib/assert-is-integer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-integer/-/assert-is-integer-0.0.8.tgz", - "integrity": "sha512-gCjuKGglSt0IftXJXIycLFNNRw0C+8235oN0Qnw3VAdMuEWauwkNhoiw0Zsu6Arzvud8MQJY0oBGZtvLUC6QzQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-little-endian": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-little-endian/-/assert-is-little-endian-0.0.7.tgz", - "integrity": "sha512-SPObC73xXfDXY0dOewXR0LDGN3p18HGzm+4K8azTj6wug0vpRV12eB3hbT28ybzRCa6TAKUjwM/xY7Am5QzIlA==", - "dev": true, - "requires": { - "@stdlib/array-uint16": "^0.0.x", - "@stdlib/array-uint8": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/assert-is-nan": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nan/-/assert-is-nan-0.0.8.tgz", - "integrity": "sha512-K57sjcRzBybdRpCoiuqyrn/d+R0X98OVlmXT4xEk3VPYqwux8e0NModVFHDehe+zuhmZLvYM50mNwp1TQC2AxA==", - "dev": true, - "requires": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-nonnegative-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-nonnegative-integer/-/assert-is-nonnegative-integer-0.0.7.tgz", - "integrity": "sha512-+5SrGM3C1QRpzmi+JnyZF9QsH29DCkSONm2558yOTdfCLClYOXDs++ktQo/8baCBFSi9JnFaLXVt1w1sayQeEQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-number": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number/-/assert-is-number-0.0.7.tgz", - "integrity": "sha512-mNV4boY1cUOmoWWfA2CkdEJfXA6YvhcTvwKC0Fzq+HoFFOuTK/scpTd9HanUyN6AGBlWA8IW+cQ1ZwOT3XMqag==", - "dev": true, - "requires": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/number-ctor": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-number-array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-number-array/-/assert-is-number-array-0.0.8.tgz", - "integrity": "sha512-HYkUu8uKRa1gwfHEMLA6iGSXSa4ZQRviIJV4A3XIROIUAVSsobIUt7EDaloZ4m9tyUokY5d7J0bLTjBlhOZcUg==", - "dev": true, - "requires": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/assert-tools-array-like-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-object": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object/-/assert-is-object-0.0.8.tgz", - "integrity": "sha512-ooPfXDp9c7w+GSqD2NBaZ/Du1JRJlctv+Abj2vRJDcDPyrnRTb1jmw+AuPgcW7Ca7op39JTbArI+RVHm/FPK+Q==", - "dev": true, - "requires": { - "@stdlib/assert-is-array": "^0.0.x" - } - }, - "@stdlib/assert-is-object-like": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-object-like/-/assert-is-object-like-0.0.8.tgz", - "integrity": "sha512-pe9selDPYAu/lYTFV5Rj4BStepgbzQCr36b/eC8EGSJh6gMgRXgHVv0R+EbdJ69KNkHvKKRjnWj0A/EmCwW+OA==", - "dev": true, - "requires": { - "@stdlib/assert-tools-array-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-plain-object": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-plain-object/-/assert-is-plain-object-0.0.7.tgz", - "integrity": "sha512-t/CEq2a083ajAgXgSa5tsH8l3kSoEqKRu1qUwniVLFYL4RGv3615CrpJUDQKVtEX5S/OKww5q0Byu3JidJ4C5w==", - "dev": true, - "requires": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-object": "^0.0.x", - "@stdlib/utils-get-prototype-of": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-positive-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-positive-integer/-/assert-is-positive-integer-0.0.7.tgz", - "integrity": "sha512-Znm/lyZk27C5qirlA9pEyTEgxlpE8e7KwjUhkEWdSZzKV3rzxheHbTQ5MYIVcc4nClmwWm8Ep4lQ0BkSwjkfKg==", - "dev": true, - "requires": { - "@stdlib/assert-is-integer": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/assert-is-regexp": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-regexp/-/assert-is-regexp-0.0.7.tgz", - "integrity": "sha512-ty5qvLiqkDq6AibHlNJe0ZxDJ9Mg896qolmcHb69mzp64vrsORnPPOTzVapAq0bEUZbXoypeijypLPs9sCGBSQ==", - "dev": true, - "requires": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-regexp-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-regexp-string/-/assert-is-regexp-string-0.0.9.tgz", - "integrity": "sha512-FYRJJtH7XwXEf//X6UByUC0Eqd0ZYK5AC8or5g5m5efQrgr2lOaONHyDQ3Scj1A2D6QLIJKZc9XBM4uq5nOPXA==", - "dev": true, - "requires": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/regexp-regexp": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x" - } - }, - "@stdlib/assert-is-string": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-string/-/assert-is-string-0.0.8.tgz", - "integrity": "sha512-Uk+bR4cglGBbY0q7O7HimEJiW/DWnO1tSzr4iAGMxYgf+VM2PMYgI5e0TLy9jOSOzWon3YS39lc63eR3a9KqeQ==", - "dev": true, - "requires": { - "@stdlib/assert-has-tostringtag-support": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-uint16array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint16array/-/assert-is-uint16array-0.0.8.tgz", - "integrity": "sha512-M+qw7au+qglRXcXHjvoUZVLlGt1mPjuKudrVRto6KL4+tDsP2j+A89NDP3Fz8/XIUD+5jhj+65EOKHSMvDYnng==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-uint32array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint32array/-/assert-is-uint32array-0.0.8.tgz", - "integrity": "sha512-cnZi2DicYcplMnkJ3dBxBVKsRNFjzoGpmG9A6jXq4KH5rFl52SezGAXSVY9o5ZV7bQGaF5JLyCLp6n9Y74hFGg==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-is-uint8array": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/assert-is-uint8array/-/assert-is-uint8array-0.0.8.tgz", - "integrity": "sha512-8cqpDQtjnJAuVtRkNAktn45ixq0JHaGJxVsSiK79k7GRggvMI6QsbzO6OvcLnZ/LimD42FmgbLd13Yc2esDmZw==", - "dev": true, - "requires": { - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/assert-tools-array-function": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-function/-/assert-tools-array-function-0.0.7.tgz", - "integrity": "sha512-3lqkaCIBMSJ/IBHHk4NcCnk2NYU52tmwTYbbqhAmv7vim8rZPNmGfj3oWkzrCsyCsyTF7ooD+In2x+qTmUbCtQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-array": "^0.0.x" - } - }, - "@stdlib/assert-tools-array-like-function": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/assert-tools-array-like-function/-/assert-tools-array-like-function-0.0.7.tgz", - "integrity": "sha512-k2eh70W1Fz96b0s1vRF+MmyBdKdILIQLShT/Z+/+r1PNWlQRsZcIhAVpGJk9Ukv9Yijgcj03WA1sYvE0dnPblQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-array-like": "^0.0.x" - } - }, - "@stdlib/buffer-ctor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/buffer-ctor/-/buffer-ctor-0.0.7.tgz", - "integrity": "sha512-4IyTSGijKUQ8+DYRaKnepf9spvKLZ+nrmZ+JrRcB3FrdTX/l9JDpggcUcC/Fe+A4KIZOnClfxLn6zfIlkCZHNA==", - "dev": true, - "requires": { - "@stdlib/assert-has-node-buffer-support": "^0.0.x" - } - }, - "@stdlib/buffer-from-string": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/buffer-from-string/-/buffer-from-string-0.0.8.tgz", - "integrity": "sha512-Dws5ZbK2M9l4Bkn/ODHFm3lNZ8tWko+NYXqGS/UH/RIQv3PGp+1tXFUSvjwjDneM6ppjQVExzVedUH1ftABs9A==", - "dev": true, - "requires": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/buffer-ctor": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - } - }, - "@stdlib/cli-ctor": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@stdlib/cli-ctor/-/cli-ctor-0.0.3.tgz", - "integrity": "sha512-0zCuZnzFyxj66GoF8AyIOhTX5/mgGczFvr6T9h4mXwegMZp8jBC/ZkOGMwmp+ODLBTvlcnnDNpNFkDDyR6/c2g==", - "dev": true, - "requires": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-noop": "^0.0.x", - "minimist": "^1.2.0" - } - }, - "@stdlib/complex-float32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/complex-float32/-/complex-float32-0.0.7.tgz", - "integrity": "sha512-POCtQcBZnPm4IrFmTujSaprR1fcOFr/MRw2Mt7INF4oed6b1nzeG647K+2tk1m4mMrMPiuXCdvwJod4kJ0SXxQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/number-float64-base-to-float32": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/complex-float64": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/complex-float64/-/complex-float64-0.0.8.tgz", - "integrity": "sha512-lUJwsXtGEziOWAqCcnKnZT4fcVoRsl6t6ECaCJX45Z7lAc70yJLiwUieLWS5UXmyoADHuZyUXkxtI4oClfpnaw==", - "dev": true, - "requires": { - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/complex-reim": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/complex-reim/-/complex-reim-0.0.6.tgz", - "integrity": "sha512-28WXfPSIFMtHb0YgdatkGS4yxX5sPYea5MiNgqPv3E78+tFcg8JJG52NQ/MviWP2wsN9aBQAoCPeu8kXxSPdzA==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/complex-reimf": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/complex-reimf/-/complex-reimf-0.0.1.tgz", - "integrity": "sha512-P9zu05ZW2i68Oppp3oHelP7Tk0D7tGBL0hGl1skJppr2vY9LltuNbeYI3C96tQe/7Enw/5GyAWgxoQI4cWccQA==", - "dev": true, - "requires": { - "@stdlib/array-float32": "^0.0.x", - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-array-max-array-length": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-array-max-array-length/-/constants-array-max-array-length-0.0.7.tgz", - "integrity": "sha512-JkZipiDUgJ1/H8lKjGllbvMREYwlF/S9rVZtPhqRsf1CMySLAFP56fs4szwmFB2Yz2//JxJedN/sS9niULAJHw==", - "dev": true - }, - "@stdlib/constants-float32-max": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-max/-/constants-float32-max-0.0.8.tgz", - "integrity": "sha512-3WEx/X5uottIFyhuNJxfgfknQkKCKKxbwMlqJ2rJUc/HPgffOta/7upxOcG6TOK9DOu3lQlbv3gnQXVlCPsd8A==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float32-smallest-normal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float32-smallest-normal/-/constants-float32-smallest-normal-0.0.8.tgz", - "integrity": "sha512-WXNkxGNXsOFGbyEakZswheMtQen+kX2neBK5PpGzHI3YzgBetE4rh40A1YXxBl2c05aikGjjV/TL9ANMQuUAUQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-e": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-e/-/constants-float64-e-0.0.8.tgz", - "integrity": "sha512-RUDKwoMQguOxvNa6QQImChDJsCAjB5YQAg4caaOki06eV7Qm+xee+KSgsQJyjmEFXvjOfuQTBYqUDSuWyW7EZw==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-eps": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eps/-/constants-float64-eps-0.0.8.tgz", - "integrity": "sha512-jfsy5syNCwt5xQu0+TG+2MZzWS0x0OwHkPjhsShfPcS0fOLg/Si7V3RU057HEvViYfqJI48bfjswmko9/Jb21w==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-eulergamma": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-eulergamma/-/constants-float64-eulergamma-0.0.8.tgz", - "integrity": "sha512-VZhhSQtVatnxgJlW9t2ewDtzhQ02WOTQcTSSwIXc1bGbrglIaBZGusHPIxGXCv1tQwBx67tfd6Rho1QjMdHSAQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-exponent-bias": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-exponent-bias/-/constants-float64-exponent-bias-0.0.8.tgz", - "integrity": "sha512-IzBJQw9hYgWCki7VoC/zJxEA76Nmf8hmY+VkOWnJ8IyfgTXClgY8tfDGS1cc4l/hCOEllxGp9FRvVdn24A5tKQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-fourth-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-fourth-pi/-/constants-float64-fourth-pi-0.0.8.tgz", - "integrity": "sha512-WGiyq8jVw7e8hI6fUh4VVhkpP0Ycdt+agTxJEQeHdab0ZsloIPpt/Yj7UjQ7iH63ARC6jdVWH1CmnxQFuIBMWg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-gamma-lanczos-g": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-gamma-lanczos-g/-/constants-float64-gamma-lanczos-g-0.0.8.tgz", - "integrity": "sha512-yTSjiOeqD3VPEFPHBmk5EqroUy7+CoNRe7L0a3+rvgcgcs8Gw5+RDWiCRPh1Q1p/41BKeVmVEV7/ZTjz7Wkc3Q==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-half-ln-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-ln-two/-/constants-float64-half-ln-two-0.0.8.tgz", - "integrity": "sha512-DrVD4BN2O3VLNtLixx2BQxqfy7ZSuABjyUQ03Hsgg862UnjJB5SxRy8OPjlYOdQ8QQtefyv0fJNshyw1P/hZQg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-half-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-half-pi/-/constants-float64-half-pi-0.0.8.tgz", - "integrity": "sha512-g37Iw0h6603VNNxalTI6b2wIqGP8T17Z6rHQ/WFmau2tx3pb2zQD6OveZ90Mr8vyZ8fyKBbwUAaHSwWCAS7FEw==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-high-word-abs-mask": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-abs-mask/-/constants-float64-high-word-abs-mask-0.0.1.tgz", - "integrity": "sha512-1vy8SUyMHFBwqUUVaZFA7r4/E3cMMRKSwsaa/EZ15w7Kmc01W/ZmaaTLevRcIdACcNgK+8i8813c8H7LScXNcQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-high-word-exponent-mask": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-exponent-mask/-/constants-float64-high-word-exponent-mask-0.0.8.tgz", - "integrity": "sha512-z28/EQERc0VG7N36bqdvtrRWjFc8600PKkwvl/nqx6TpKAzMXNw55BS1xT4C28Sa9Z7uBWeUj3UbIFedbkoyMw==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-high-word-sign-mask": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-sign-mask/-/constants-float64-high-word-sign-mask-0.0.1.tgz", - "integrity": "sha512-hmTr5caK1lh1m0eyaQqt2Vt3y+eEdAx57ndbADEbXhxC9qSGd0b4bLSzt/Xp4MYBYdQkHAE/BlkgUiRThswhCg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-high-word-significand-mask": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-high-word-significand-mask/-/constants-float64-high-word-significand-mask-0.0.8.tgz", - "integrity": "sha512-axiB0JMao3ZYTxPtK3K75q+UjTDF1OM2KoCYVukZbs+GWenAR4EkEsCJ4nW5a4ONDXNLsVuRVeL8sgte7prt4g==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-ln-sqrt-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-sqrt-two-pi/-/constants-float64-ln-sqrt-two-pi-0.0.8.tgz", - "integrity": "sha512-/tfOMZs4ZyhY1nIrxUgGAVXjR9vLXNC5RyZjYIfRMfS9Xov1mZwu0TtnYbRMRP1/rWyMJHs5RrVk0BpYT/Cm9g==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-ln-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ln-two/-/constants-float64-ln-two-0.0.8.tgz", - "integrity": "sha512-XwhMhGkimMpDa8Dgk7HnZd+Bzs1SerCTJqRfDRODQFzf0lj7y27SAB0vK3XYWfY7YJSLRUNXMIQ9MrALu6Sg4g==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max/-/constants-float64-max-0.0.8.tgz", - "integrity": "sha512-I1Dm73NUAJl7z/TtXwow/4nZeFhhs4VFdPSZR3nwqrZbvBQyEhQx/aX1hCjiQiktXDeLQm8mMYCth7KB0RuTMQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max-base10-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base10-exponent/-/constants-float64-max-base10-exponent-0.0.8.tgz", - "integrity": "sha512-evqQtzfKUnFEsmg+0INRoLTTym1NUk/vpxu3zm7i3Cc2NGh9+H+4SZ+JFUVhNeXg0x5ZA4tMxHJeaj+FdCegSA==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max-base2-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent/-/constants-float64-max-base2-exponent-0.0.8.tgz", - "integrity": "sha512-xBAOtso1eiy27GnTut2difuSdpsGxI8dJhXupw0UukGgvy/3CSsyNm+a1Suz/dhqK4tPOTe5QboIdNMw5IgXKQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max-base2-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-base2-exponent-subnormal/-/constants-float64-max-base2-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-YGBZykSiXFebznnJfWFDwhho2Q9xhUWOL+X0lZJ4ItfTTo40W6VHAyNYz98tT/gJECFype0seNzzo1nUxCE7jQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max-ln": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-ln/-/constants-float64-max-ln-0.0.8.tgz", - "integrity": "sha512-wrZTI9ncpIWZBmfS0PuKhB8jxjT3KWmJs3/SjOB8l0gA/6tBV/Wjw5IrO+fgut0NgT3SJRjbu/hrz06iKUeS7Q==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-max-safe-integer": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-max-safe-integer/-/constants-float64-max-safe-integer-0.0.8.tgz", - "integrity": "sha512-0W7bE7Ph74i5+wHoaUQveAyUZCjmfO3f2E20Na2+ruRBAQgGXNybzEKTUwLCDFniEHdBzJdCiYcxFxmaV5dFTQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-min-base10-exponent": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent/-/constants-float64-min-base10-exponent-0.0.8.tgz", - "integrity": "sha512-X/asZnJiLcRkgw6hO5LF7niyTtOtip5mUQl66BR0XiJo1zW3i5jYtq2zElvvbY5VlL7lBEQrlbvZwo1gMp+SqQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-min-base10-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base10-exponent-subnormal/-/constants-float64-min-base10-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-0to1PTsNMBkm23pPYZIYQCEbSN0c2vd/PwVkHX6D2L2ZYy3UYlCFTydMhvhLEsHeZWZaUJz67sDTieTiYue9Yg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-min-base2-exponent-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-base2-exponent-subnormal/-/constants-float64-min-base2-exponent-subnormal-0.0.8.tgz", - "integrity": "sha512-bt81nBus/91aEqGRQBenEFCyWNsf8uaxn4LN1NjgkvY92S1yVxXFlC65fJHsj9FTqvyZ+uj690/gdMKUDV3NjQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-min-ln": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-min-ln/-/constants-float64-min-ln-0.0.8.tgz", - "integrity": "sha512-+FLeaQGpa7Pt53jU+hPL7GQI++BAsDy3MiYW8n97AvMDvgAecbq1UjbJFWYu91ZtdOk8S8mwNRrm4jo//Hy3/w==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-ninf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-ninf/-/constants-float64-ninf-0.0.8.tgz", - "integrity": "sha512-bn/uuzCne35OSLsQZJlNrkvU1/40spGTm22g1+ZI1LL19J8XJi/o4iupIHRXuLSTLFDBqMoJlUNphZlWQ4l8zw==", - "dev": true, - "requires": { - "@stdlib/number-ctor": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pi/-/constants-float64-pi-0.0.8.tgz", - "integrity": "sha512-MgIu0vc3fq+AcXPWGgP2dfNoeKRd1KHpRNL5S0m8olKRg+6cn5Ac+aQtRCmya3reUojDxytipBGPGHDPxUK5iw==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-pinf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-pinf/-/constants-float64-pinf-0.0.8.tgz", - "integrity": "sha512-I3R4rm2cemoMuiDph07eo5oWZ4ucUtpuK73qBJiJPDQKz8fSjSe4wJBAigq2AmWYdd7yJHsl5NJd8AgC6mP5Qw==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-smallest-normal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-normal/-/constants-float64-smallest-normal-0.0.8.tgz", - "integrity": "sha512-Qwxpn5NA3RXf+mQcffCWRcsHSPTUQkalsz0+JDpblDszuz2XROcXkOdDr5LKgTAUPIXsjOgZzTsuRONENhsSEg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-smallest-subnormal": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-smallest-subnormal/-/constants-float64-smallest-subnormal-0.0.8.tgz", - "integrity": "sha512-LCvJyC8FEsA3Qf18nGmq/J2yuW2jgSXTzT9zBND/x0Zk9GYXcPYqaZkv3pk297WZqBbZOnI0Ho13EBAL4NqRVA==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-sqrt-eps": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-eps/-/constants-float64-sqrt-eps-0.0.8.tgz", - "integrity": "sha512-3VjVQczBFNy74xABiTwN38Hdr2ApgWfaY04iI5eBufWjPw3M1bNVE5UMk6HSYJseEIP3PevcZxqJ3XehCgPZHA==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-sqrt-two": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two/-/constants-float64-sqrt-two-0.0.8.tgz", - "integrity": "sha512-OTZ1KE21bO26bD/Rp/ldf2GiYH913jkpYhkyvDWNROw8ZSQ+G+ntJvymuvsYtFnUHJgv7bjk1tUpaKXuTXpxYA==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-sqrt-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-sqrt-two-pi/-/constants-float64-sqrt-two-pi-0.0.8.tgz", - "integrity": "sha512-xSMg6UreLhgUUFhA0yhJWfyROJvOJ+gUtjcbj8GFlym18EjQ13x9x8gNgUocPNm4qvQVKWBDDXcbkc+fPTp+eg==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-float64-two-pi": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/constants-float64-two-pi/-/constants-float64-two-pi-0.0.8.tgz", - "integrity": "sha512-YxgFEytCkQDhdBZpjWOCtUBgp6PPuuQZP5dXlpSNGKBShEQ60Sr3xTpdQt6WzErr+ZeNBvxaw6BlY8Mw6oK12Q==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/constants-int32-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-int32-max/-/constants-int32-max-0.0.7.tgz", - "integrity": "sha512-um/tgiIotQy7jkN6b7GzaOMQT4PN/o7Z6FR0CJn0cHIZfWCNKyVObfaR68uDX1nDwYGfNrO7BkCbU4ccrtflDA==", - "dev": true - }, - "@stdlib/constants-uint16-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint16-max/-/constants-uint16-max-0.0.7.tgz", - "integrity": "sha512-7TPoku7SlskA67mAm7mykIAjeEnkQJemw1cnKZur0mT5W4ryvDR6iFfL9xBiByVnWYq/+ei7DHbOv6/2b2jizw==", - "dev": true - }, - "@stdlib/constants-uint32-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint32-max/-/constants-uint32-max-0.0.7.tgz", - "integrity": "sha512-8+NK0ewqc1vnEZNqzwFJgFSy3S543Eft7i8WyW/ygkofiqEiLAsujvYMHzPAB8/3D+PYvjTSe37StSwRwvQ6uw==", - "dev": true - }, - "@stdlib/constants-uint8-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/constants-uint8-max/-/constants-uint8-max-0.0.7.tgz", - "integrity": "sha512-fqV+xds4jgwFxwWu08b8xDuIoW6/D4/1dtEjZ1sXVeWR7nf0pjj1cHERq4kdkYxsvOGu+rjoR3MbjzpFc4fvSw==", - "dev": true - }, - "@stdlib/fs-exists": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-exists/-/fs-exists-0.0.8.tgz", - "integrity": "sha512-mZktcCxiLmycCJefm1+jbMTYkmhK6Jk1ShFmUVqJvs+Ps9/2EEQXfPbdEniLoVz4HeHLlcX90JWobUEghOOnAQ==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-cwd": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/fs-read-file": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-read-file/-/fs-read-file-0.0.8.tgz", - "integrity": "sha512-pIZID/G91+q7ep4x9ECNC45+JT2j0+jdz/ZQVjCHiEwXCwshZPEvxcPQWb9bXo6coOY+zJyX5TwBIpXBxomWFg==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/fs-resolve-parent-path": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/fs-resolve-parent-path/-/fs-resolve-parent-path-0.0.8.tgz", - "integrity": "sha512-ok1bTWsAziChibQE3u7EoXwbCQUDkFjjRAHSxh7WWE5JEYVJQg1F0o3bbjRr4D/wfYYPWLAt8AFIKBUDmWghpg==", - "dev": true, - "requires": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-exists": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-cwd": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-even": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-even/-/math-base-assert-is-even-0.0.7.tgz", - "integrity": "sha512-tKHutmKSPsJ41DVZBbdfSW6njZtTjqeAIpS4ZjKom4AJwvqJGRDjOzLOzi8+jeRn3bhjfABRPCd35EAkHUnNog==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-integer": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-infinite": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-infinite/-/math-base-assert-is-infinite-0.0.9.tgz", - "integrity": "sha512-JuPDdmxd+AtPWPHu9uaLvTsnEPaZODZk+zpagziNbDKy8DRiU1cy+t+QEjB5WizZt0A5MkuxDTjZ/8/sG5GaYQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-integer/-/math-base-assert-is-integer-0.0.7.tgz", - "integrity": "sha512-swIEKQJZOwzacYDiX5SSt5/nHd6PYJkLlVKZiVx/GCpflstQnseWA0TmudG7XU5HJnxDGV/w6UL02dEyBH7VEw==", - "dev": true, - "requires": { - "@stdlib/math-base-special-floor": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-nan": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nan/-/math-base-assert-is-nan-0.0.8.tgz", - "integrity": "sha512-m+gCVBxLFW8ZdAfdkATetYMvM7sPFoMKboacHjb1pe21jHQqVb+/4bhRSDg6S7HGX7/8/bSzEUm9zuF7vqK5rQ==", - "dev": true, - "requires": { - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-negative-zero": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-negative-zero/-/math-base-assert-is-negative-zero-0.0.8.tgz", - "integrity": "sha512-xajwAxn1SC0HWx9Fw8wQZ/RGTpG7Pf9ZA13rpnKvq/4yblCk8tT8Ws+zEwgbHCt5PQe45SEtUZOQ42k3YpX3DA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-nonnegative-integer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-nonnegative-integer/-/math-base-assert-is-nonnegative-integer-0.0.7.tgz", - "integrity": "sha512-G43o1iesRe86xm+JX8uf6bW4iNlyRvhasba4Q3IwqZBvnK9q916xzaqxFPaZmzBWhuXqg5jcaAB/j9xRm3MALA==", - "dev": true, - "requires": { - "@stdlib/math-base-special-floor": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-odd": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-odd/-/math-base-assert-is-odd-0.0.7.tgz", - "integrity": "sha512-ZjIIu1AX57ZnKDxJW67t/FUyMkDnZLCZgvWiDr7+nkfTfGB1uLckJtwkmnZqz0CGtkpTU3geELbvGQ+e60kLEA==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-even": "^0.0.x" - } - }, - "@stdlib/math-base-assert-is-positive-zero": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-assert-is-positive-zero/-/math-base-assert-is-positive-zero-0.0.8.tgz", - "integrity": "sha512-/9OtPelOyekHTk5hOvPjJl6LCY8CHQmib6TFKbRjqhqwjnqUGIO4bv80TSCKFddoEj/viIHXQfYHXXuQosMTVg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-napi-binary": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-binary/-/math-base-napi-binary-0.0.8.tgz", - "integrity": "sha512-B8d0HBPhfXefbdl/h0h5c+lM2sE+/U7Fb7hY/huVeoQtBtEx0Jbx/qKvPSVxMjmWCKfWlbPpbgKpN5GbFgLiAg==", - "dev": true, - "requires": { - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/complex-reim": "^0.0.x", - "@stdlib/complex-reimf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-napi-unary": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-napi-unary/-/math-base-napi-unary-0.0.8.tgz", - "integrity": "sha512-xKbGBxbgrEe7dxCDXJrooXPhXSDUl/QPqsN74Qa0+8Svsc4sbYVdU3yHSN5vDgrcWt3ZkH51j0vCSBIjvLL15g==", - "dev": true, - "requires": { - "@stdlib/complex-float32": "^0.0.x", - "@stdlib/complex-float64": "^0.0.x", - "@stdlib/complex-reim": "^0.0.x", - "@stdlib/complex-reimf": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-abs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-abs/-/math-base-special-abs-0.0.6.tgz", - "integrity": "sha512-FaaMUnYs2qIVN3kI5m/qNlBhDnjszhDOzEhxGEoQWR/k0XnxbCsTyjNesR2DkpiKuoAXAr9ojoDe2qBYdirWoQ==", - "dev": true, - "requires": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-acos": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-acos/-/math-base-special-acos-0.0.7.tgz", - "integrity": "sha512-SLxb4Od8nKPxgTqfDnGrhUquANVQFmdz5Ao/pjraelVQEoRLc/lFKGNZQkyQNxlRX/CQelA8Ea20rauSL/hoSg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-fourth-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" - } - }, - "@stdlib/math-base-special-asin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-asin/-/math-base-special-asin-0.0.7.tgz", - "integrity": "sha512-S0lAJy6jMLmVy4u3O5cnANq57W7ND8D/tnGZUm87yQqGAR4ZUXqLwH/RjB0fc9l/yhMqFGHP3+xWRjjD23M41Q==", - "dev": true, - "requires": { - "@stdlib/constants-float64-fourth-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" - } - }, - "@stdlib/math-base-special-beta": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-beta/-/math-base-special-beta-0.0.6.tgz", - "integrity": "sha512-t5O3R7bsvl7tK0jXmm+X6zYEomIZELiaboiZfJFX0gsiawVaogT/8jLuCjiGE7o3jB65PGSY7hYAChQ0Gl6CKw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" - } - }, - "@stdlib/math-base-special-betainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betainc/-/math-base-special-betainc-0.0.6.tgz", - "integrity": "sha512-xV/4zuikNN7zaU+XGmTRKV87kv0JkAqPIvX3PWD+dO8jy5Pmy+iaRkF99wFk8XjpDKj0fpK0yMf7W6i7kT12BA==", - "dev": true, - "requires": { - "@stdlib/math-base-special-kernel-betainc": "^0.0.x" - } - }, - "@stdlib/math-base-special-betaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaincinv/-/math-base-special-betaincinv-0.0.6.tgz", - "integrity": "sha512-Re3ArtbFKKf7dynIJDccz4ohifhD24zAnGRS3nYAO+DoYWfVxiit4K2j2Tg3bINXhsH0x/uDWeqIwpWJrlDo9Q==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-kernel-betaincinv": "^0.0.x" - } - }, - "@stdlib/math-base-special-betaln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-betaln/-/math-base-special-betaln-0.0.6.tgz", - "integrity": "sha512-KrHivIFThZ2NrJPbQbkNTgywPnWKrCXJ3Nisk3Dus6AedLb4gZILd1+X3zXVqugKPCUlv47J3CYB7RTVHsxVjA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x" - } - }, - "@stdlib/math-base-special-binomcoef": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoef/-/math-base-special-binomcoef-0.0.8.tgz", - "integrity": "sha512-N1eWKSA4PknbU0HwRhUOTQvAog79C0fOp+eg2Q7U8WH+mCDKMS9LErs0hsA6dRlRZu+5DzldZr5ae6RHxNzlhA==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-odd": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x" - } - }, - "@stdlib/math-base-special-binomcoefln": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-binomcoefln/-/math-base-special-binomcoefln-0.0.7.tgz", - "integrity": "sha512-mdEEefX9hRs2fyyX3fbXR5tN1Cogaszp+BLsKND2hJmhxy3zJzDRFSYimDrMmbEJMAbzXr26JHQw0feCiyevZQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-betaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x" - } - }, - "@stdlib/math-base-special-ceil": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ceil/-/math-base-special-ceil-0.0.8.tgz", - "integrity": "sha512-TP6DWHXreyjO3iZntIsMcHcVYhQEhaQavjYX5z9FiYt8WOEliGRmb9TBAl4SWrHqIq+RTP8IwOydkBpAFndIbA==", - "dev": true, - "requires": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-copysign": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-copysign/-/math-base-special-copysign-0.0.7.tgz", - "integrity": "sha512-7Br7oeuVJSBKG8BiSk/AIRFTBd2sbvHdV3HaqRj8tTZHX8BQomZ3Vj4Qsiz3kPyO4d6PpBLBTYlGTkSDlGOZJA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-high-word-abs-mask": "^0.0.x", - "@stdlib/constants-float64-high-word-sign-mask": "^0.0.x", - "@stdlib/math-base-napi-binary": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-cos": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-cos/-/math-base-special-cos-0.0.6.tgz", - "integrity": "sha512-dmBXZ5iRnC8u13EiZEfkjIzzOFiasvPM9MZldW6qK70aP1U+bmw1/Y27rwe4na+X6Yrkh+Vg/88NIjAOWccCXQ==", - "dev": true, - "requires": { - "@stdlib/math-base-special-kernel-cos": "^0.0.x", - "@stdlib/math-base-special-kernel-sin": "^0.0.x", - "@stdlib/math-base-special-rempio2": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-erfc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfc/-/math-base-special-erfc-0.0.6.tgz", - "integrity": "sha512-QLqfjP55VK9aW0VOq30lsi3ymDSvDBjUOI1fTRZmqMNizB38AM+ZlPkn9e9SNLYXRxp8BHZUEjOsEi6b5HnNIw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/number-float64-base-set-low-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-erfcinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-erfcinv/-/math-base-special-erfcinv-0.0.6.tgz", - "integrity": "sha512-OBXoR771SxlJarOARcvEIcIlMTCdEsR0wg20oHZO/vvLNwB8znMCC2ZGC76jzqBVlo41V2p34L2FPjLJfwJeXQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x" - } - }, - "@stdlib/math-base-special-exp": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-exp/-/math-base-special-exp-0.0.6.tgz", - "integrity": "sha512-oHhH7WlPIwoT/nY29p3eLn/Zh1oAOLsZvr3kf5Lb/ntenkpgB7wMjynsiGKyBupNR49esB4/FaBbGqhYmKgwaQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" - } - }, - "@stdlib/math-base-special-expm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-expm1/-/math-base-special-expm1-0.0.6.tgz", - "integrity": "sha512-q6csQF1XZD5ikudP8laJwPh390VnqkEkL7Nv39GSa4JKuQUt+EAxc+Y1HEWEw+Io06eTLl36SYEZy7Pz/NL1PA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-half-ln-two": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-factorial": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-factorial/-/math-base-special-factorial-0.0.6.tgz", - "integrity": "sha512-FU3CpQ3bhAGhw9fP6yNI+U0i1qEtAvT3Xhu6yAGMPDsfB2tdi8YLipiqFPKiS6i3ub7srknYkLFKq6M9n1tHNw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x" - } - }, - "@stdlib/math-base-special-floor": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-floor/-/math-base-special-floor-0.0.8.tgz", - "integrity": "sha512-VwpaiU0QhQKB8p+r9p9mNzhrjU5ZVBnUcLjKNCDADiGNvO5ACI/I+W++8kxBz5XSp5PAQhaFCH4MpRM1tSkd/w==", - "dev": true, - "requires": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-gamma": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma/-/math-base-special-gamma-0.0.6.tgz", - "integrity": "sha512-UqxLakbDrCsobOFzp0VC/OCTLimgnZPJOyrUJ4Vw3UAObmkqrH+Lxh3cYZgX/AMLAcWdN/MSPdRK9QMAp5vHYQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-eulergamma": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-negative-zero": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x" - } - }, - "@stdlib/math-base-special-gamma-delta-ratio": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-delta-ratio/-/math-base-special-gamma-delta-ratio-0.0.6.tgz", - "integrity": "sha512-d4so1qxVsPZF1cBtprdFOjyQIUxawiMI/rl+L8LTlGPaJvo9b/pChVkLl1eS2r/EuPvTD0YwzDoNWXWVpyi9qA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-factorial": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x" - } - }, - "@stdlib/math-base-special-gamma-lanczos-sum": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum/-/math-base-special-gamma-lanczos-sum-0.0.7.tgz", - "integrity": "sha512-Exmay1SmzBCwscGOZZYeQwaOQvjUlYWR8UI0WPSeWRLa9Myhhj+Cu98pHuKsvNaktDKyeWGgW/QhFPudRyIoVw==", - "dev": true - }, - "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled/-/math-base-special-gamma-lanczos-sum-expg-scaled-0.0.7.tgz", - "integrity": "sha512-zjdpS8owElpxosiEs78XawbJ/+pvMsUdEN7ThLiGpTToSqffb/L9FGlD3uD/LiXHgiqs4CwsU1xBaX8cI6tn2A==", - "dev": true - }, - "@stdlib/math-base-special-gamma1pm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gamma1pm1/-/math-base-special-gamma1pm1-0.0.6.tgz", - "integrity": "sha512-MAyGncYTJjdSAUCjezMq9ah+hEc4A3yiyTmBMtJ60xkFzRiMOgI+KZV8Yb3brtRWtMayGmRsarqbroXeAnzJKQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x" - } - }, - "@stdlib/math-base-special-gammainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammainc/-/math-base-special-gammainc-0.0.6.tgz", - "integrity": "sha512-KZ5Fz/DVyTTeuEckXxU6OKouAzjEHPBTIyDi8ttoeYV1CEtaBkdI/7azrw/27lPrxFGChX9+T7b5bInyBoCSeg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-max-ln": "^0.0.x", - "@stdlib/constants-float64-min-ln": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-eps": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-two-pi": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-erfc": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.0.x", - "@stdlib/math-base-special-gamma1pm1": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-powm1": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-continued-fraction": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x", - "@stdlib/math-base-tools-sum-series": "^0.0.x" - } - }, - "@stdlib/math-base-special-gammaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaincinv/-/math-base-special-gammaincinv-0.0.6.tgz", - "integrity": "sha512-4FIUriC46apqk+CaoPtcW6B1bu71RMnez/cxCJ8o+wpU4O6sAgzYweVqf8Z9EITkrILwAgtXIRo9qb/FmMiBiQ==", - "dev": true, - "requires": { - "@stdlib/constants-float32-max": "^0.0.x", - "@stdlib/constants-float32-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-ln-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/constants-float64-sqrt-two-pi": "^0.0.x", - "@stdlib/constants-float64-two-pi": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-erfcinv": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gammainc": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x", - "debug": "^2.6.9" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "@stdlib/math-base-special-gammaln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-gammaln/-/math-base-special-gammaln-0.0.6.tgz", - "integrity": "sha512-qrFAPEcwHcTsDBUJkqDY5VmhW6NU8UcN7n14zo1SO/cguks8bmFRe7kqxmKMzy5xI2Xff/NmgYpLcAIc+gC9Hw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-sinpi": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" - } - }, - "@stdlib/math-base-special-kernel-betainc": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betainc/-/math-base-special-kernel-betainc-0.0.6.tgz", - "integrity": "sha512-tvmVgDIrffI3ySspU+b8XwUmzBXf7ggbf3PRX1Gq4unOJteV6b+Kw1f979FuWzV4iDKzTAqkex6xGeNlWavZtQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-e": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-gamma-lanczos-g": "^0.0.x", - "@stdlib/constants-float64-half-pi": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-max-ln": "^0.0.x", - "@stdlib/constants-float64-min-ln": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/constants-int32-max": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-beta": "^0.0.x", - "@stdlib/math-base-special-binomcoef": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-factorial": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma": "^0.0.x", - "@stdlib/math-base-special-gamma-delta-ratio": "^0.0.x", - "@stdlib/math-base-special-gamma-lanczos-sum-expg-scaled": "^0.0.x", - "@stdlib/math-base-special-gammainc": "^0.0.x", - "@stdlib/math-base-special-gammaln": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-maxabs": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-minabs": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-continued-fraction": "^0.0.x", - "@stdlib/math-base-tools-sum-series": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/math-base-special-kernel-betaincinv": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-betaincinv/-/math-base-special-kernel-betaincinv-0.0.6.tgz", - "integrity": "sha512-3qAYsk7QgbvKQr1vAUHiEddEBLXvMZd0H+HBHnLs19vXmklJOlxIPJjCpVSH0XnAT8iM6F7Qtb7ph88J0RYLdg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/constants-float64-half-pi": "^0.0.x", - "@stdlib/constants-float64-max": "^0.0.x", - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-smallest-subnormal": "^0.0.x", - "@stdlib/constants-float64-sqrt-two": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-acos": "^0.0.x", - "@stdlib/math-base-special-asin": "^0.0.x", - "@stdlib/math-base-special-beta": "^0.0.x", - "@stdlib/math-base-special-betainc": "^0.0.x", - "@stdlib/math-base-special-cos": "^0.0.x", - "@stdlib/math-base-special-erfcinv": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-gamma-delta-ratio": "^0.0.x", - "@stdlib/math-base-special-gammaincinv": "^0.0.x", - "@stdlib/math-base-special-kernel-betainc": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x", - "@stdlib/math-base-special-signum": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/math-base-tools-evalpoly": "^0.0.x" - } - }, - "@stdlib/math-base-special-kernel-cos": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-cos/-/math-base-special-kernel-cos-0.0.7.tgz", - "integrity": "sha512-u3u7xKJtEjfYMSVokJuX+09wNqLpVEaSnHTDVyWl2zkUzHVt0hZ/okd1T7hTZ444pIA10d9niI3OWXWiYryBrw==", - "dev": true - }, - "@stdlib/math-base-special-kernel-sin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-kernel-sin/-/math-base-special-kernel-sin-0.0.7.tgz", - "integrity": "sha512-fhTxDb9klS2F4an7W7iyDcc2Nh/MzE7U4dAtxsVXviHiVNYc///wPkg9hHXqYe/c6q7FxnanXCGW9FOTWfhe/Q==", - "dev": true - }, - "@stdlib/math-base-special-ldexp": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ldexp/-/math-base-special-ldexp-0.0.8.tgz", - "integrity": "sha512-VTzu2kdgzQT3ebHGtCegKDpTA3RtsUVhb7V3IjAu/dHFLlXPXh5MEuxK/gV4vCpGBW0MKPTO73vwBjo6RT4xUg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-max-base2-exponent": "^0.0.x", - "@stdlib/constants-float64-max-base2-exponent-subnormal": "^0.0.x", - "@stdlib/constants-float64-min-base2-exponent-subnormal": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/number-float64-base-exponent": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-normalize": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x" - } - }, - "@stdlib/math-base-special-ln": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-ln/-/math-base-special-ln-0.0.6.tgz", - "integrity": "sha512-WswUUVL/PLCglfp8yDD1CjkaEofzaNkDnTkQgCEMFuEqlKQEeMS3D8Z5skThILZtT/EF6YupmBezQKXTEqTFiQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-log1p": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-log1p/-/math-base-special-log1p-0.0.6.tgz", - "integrity": "sha512-/azhtpBdJ2DJBRunAyPe/+Hr2YhWh21WJ7Lytc/uxaUvHCLVjPRZBjZW3lcjpweHIECd1+m4jBb2RYYqHGWjfQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-max": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-max/-/math-base-special-max-0.0.7.tgz", - "integrity": "sha512-BCvHfLflabBPBv7Ueoe48AmdDZLsp0eOfwkA84+WHvr/MthXUf6Ptz6GqDkEjKNQNMN+reSluyq3uCB2HLrr3Q==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-positive-zero": "^0.0.x" - } - }, - "@stdlib/math-base-special-maxabs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-maxabs/-/math-base-special-maxabs-0.0.6.tgz", - "integrity": "sha512-AbTCAyrX5CULvQ9te4YBqJlcfTuTj31TlGtF8NEm8v+SWt5Bbu2DSfGrwND/9ppWZcOVhRZm1RnCUwDfzRbEKQ==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-max": "^0.0.x" - } - }, - "@stdlib/math-base-special-min": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-min/-/math-base-special-min-0.0.7.tgz", - "integrity": "sha512-xaQeSHElt75MkOhqQ+6TWjbf5I5PmlnGyWY5QZRdrr9YWuWsOVuxW75VPHwNFQ1YmnD5d6TtB6pbCE9FKEBzQA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-negative-zero": "^0.0.x" - } - }, - "@stdlib/math-base-special-minabs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-minabs/-/math-base-special-minabs-0.0.6.tgz", - "integrity": "sha512-yLAbgqNAl48bgMvXc/iQLDgg0Ao4GnSEBwq72somqCFY3MWYTkEXXbkgtpJdSjSj196IgN2lTwPnxPXun3IH/Q==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-min": "^0.0.x" - } - }, - "@stdlib/math-base-special-pow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-pow/-/math-base-special-pow-0.0.7.tgz", - "integrity": "sha512-sOew6OWapY6uesIg/i4eOveORzE0MfA7XtFcNgkpdsLJ4A4AkSZTz4zMmDxX2C22vI30aHR47O2ro3UZHFWCzw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-high-word-abs-mask": "^0.0.x", - "@stdlib/constants-float64-high-word-significand-mask": "^0.0.x", - "@stdlib/constants-float64-ln-two": "^0.0.x", - "@stdlib/constants-float64-ninf": "^0.0.x", - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-integer": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-odd": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-sqrt": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-high-word": "^0.0.x", - "@stdlib/number-float64-base-set-low-word": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/number-uint32-base-to-int32": "^0.0.x" - } - }, - "@stdlib/math-base-special-powm1": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-powm1/-/math-base-special-powm1-0.0.6.tgz", - "integrity": "sha512-cOfqg4QXRcgra/uv0azCwQArsl9+KOQo5YQoLGOWc7IVHibVW3s2DPXLh1JaEAeSu+/H1W9/970O6Uo86TwGgQ==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-expm1": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-trunc": "^0.0.x" - } - }, - "@stdlib/math-base-special-rempio2": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-rempio2/-/math-base-special-rempio2-0.0.6.tgz", - "integrity": "sha512-0cSuSZwkTiPWxDdIZggyNdp3WSPqmY/oWd0tEZ47gpg3rIOwShiq0wyncX6v1MVEMJeSg5M9rhxb8WZlgD6RWw==", - "dev": true, - "requires": { - "@stdlib/array-base-zeros": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-ldexp": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x", - "@stdlib/number-float64-base-from-words": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x", - "@stdlib/number-float64-base-get-low-word": "^0.0.x", - "@stdlib/types": "^0.0.x" - } - }, - "@stdlib/math-base-special-round": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-round/-/math-base-special-round-0.0.7.tgz", - "integrity": "sha512-uFPWDru18ouUFD5/TQzm3fNzds/IlQbpQXjUBjIDpxN9PizneZLZSNNYg6ECq+FQv8WK1CQmyj10bu2zLReqGQ==", - "dev": true - }, - "@stdlib/math-base-special-roundn": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-roundn/-/math-base-special-roundn-0.0.6.tgz", - "integrity": "sha512-lNpL3AMQBQfXrxDKaQzzEGWFHgYsTKPDVXbUfmfBM+RQAxSNT4gS04us5tjnax3u4n9LpANPEiHAG4Olxc/RMA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-max-base10-exponent": "^0.0.x", - "@stdlib/constants-float64-max-safe-integer": "^0.0.x", - "@stdlib/constants-float64-min-base10-exponent": "^0.0.x", - "@stdlib/constants-float64-min-base10-exponent-subnormal": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-pow": "^0.0.x", - "@stdlib/math-base-special-round": "^0.0.x" - } - }, - "@stdlib/math-base-special-signum": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-signum/-/math-base-special-signum-0.0.8.tgz", - "integrity": "sha512-+N65a4Dgsq342kSX77aHIf+mQJt10sZe0Y5vmfwR/LRmRGW2g+exBIH7goZKLxagV5MdyDuoyjEwEuzVJAdryg==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-sin": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sin/-/math-base-special-sin-0.0.6.tgz", - "integrity": "sha512-gymfzwJ/ROkLDWD/gBIjFDjsWweXgH7zV24qlsQ/z4XUG2jET9yFqzO5wIFnMzrQsTcRGkiXb9Q69pIoGxx1ww==", - "dev": true, - "requires": { - "@stdlib/math-base-special-kernel-cos": "^0.0.x", - "@stdlib/math-base-special-kernel-sin": "^0.0.x", - "@stdlib/math-base-special-rempio2": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" - } - }, - "@stdlib/math-base-special-sinpi": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sinpi/-/math-base-special-sinpi-0.0.6.tgz", - "integrity": "sha512-g1uvvnolfkqJTozdrm/OtxEaTpz2nDwe9PeT/M1zm/J+MR6V9paoJCUAz4MfAwsz6VKRgA5FH+8BkCIsItl0Mg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pi": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/math-base-special-copysign": "^0.0.x", - "@stdlib/math-base-special-cos": "^0.0.x", - "@stdlib/math-base-special-sin": "^0.0.x" - } - }, - "@stdlib/math-base-special-sqrt": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-sqrt/-/math-base-special-sqrt-0.0.8.tgz", - "integrity": "sha512-obYr15u/c76VEeAAXhvyUgVsxJb357CTgerLoFJqMj0diKXdjisLIWSlU+UZHKerYH9gnzZPN24gwwaTLJDmaw==", - "dev": true, - "requires": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-special-trunc": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-special-trunc/-/math-base-special-trunc-0.0.8.tgz", - "integrity": "sha512-nSio+gKcZARQWH9a/mKYPjT5v1uNW2PztaToGY2Qt53ij8iWx4cNEBgR3J9ewXgAuoPTjJ0eHcfc6JeyFlBITQ==", - "dev": true, - "requires": { - "@stdlib/math-base-napi-unary": "^0.0.x", - "@stdlib/math-base-special-ceil": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/math-base-tools-continued-fraction": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-continued-fraction/-/math-base-tools-continued-fraction-0.0.6.tgz", - "integrity": "sha512-eKIZIbkS5glfPIzPsK7037EPNsLPxm7lG2Eww0TmV+kvCXsDMpus4wUpJv0g1QbjVAXQizyBky8izbWk3ChlUw==", - "dev": true, - "requires": { - "@stdlib/assert-has-generator-support": "^0.0.x", - "@stdlib/constants-float32-smallest-normal": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x" - } - }, - "@stdlib/math-base-tools-evalpoly": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-evalpoly/-/math-base-tools-evalpoly-0.0.7.tgz", - "integrity": "sha512-Ktc3h4nr6V2I++vUQ1lbuONwoI7BccLeYbqXsu9PhUfNZsgzK4z4mc1GPpVGkKk21352DJLJC2rC4/O7wPo17g==", - "dev": true, - "requires": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/math-base-tools-sum-series": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/math-base-tools-sum-series/-/math-base-tools-sum-series-0.0.6.tgz", - "integrity": "sha512-9YT53LEPPC9Us2wRbGWzoCgm/U7NyXgubgmioIJ16hwwj5X69dYgOppzGGgq4/VJsgVMRLJH3sSu/51joWDjfg==", - "dev": true, - "requires": { - "@stdlib/assert-has-generator-support": "^0.0.x", - "@stdlib/constants-float64-eps": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x" - } - }, - "@stdlib/number-ctor": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-ctor/-/number-ctor-0.0.7.tgz", - "integrity": "sha512-kXNwKIfnb10Ro3RTclhAYqbE3DtIXax+qpu0z1/tZpI2vkmTfYDQLno2QJrzJsZZgdeFtXIws+edONN9kM34ow==", - "dev": true - }, - "@stdlib/number-float64-base-exponent": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-exponent/-/number-float64-base-exponent-0.0.6.tgz", - "integrity": "sha512-wLXsG+cvynmapoffmj5hVNDH7BuHIGspBcTCdjPaD+tnqPDIm03qV5Z9YBhDh91BdOCuPZQ8Ovu2WBpX+ySeGg==", - "dev": true, - "requires": { - "@stdlib/constants-float64-exponent-bias": "^0.0.x", - "@stdlib/constants-float64-high-word-exponent-mask": "^0.0.x", - "@stdlib/number-float64-base-get-high-word": "^0.0.x" - } - }, - "@stdlib/number-float64-base-from-words": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-from-words/-/number-float64-base-from-words-0.0.6.tgz", - "integrity": "sha512-r0elnekypCN831aw9Gp8+08br8HHAqvqtc5uXaxEh3QYIgBD/QM5qSb3b7WSAQ0ZxJJKdoykupODWWBkWQTijg==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-get-high-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-high-word/-/number-float64-base-get-high-word-0.0.6.tgz", - "integrity": "sha512-jSFSYkgiG/IzDurbwrDKtWiaZeSEJK8iJIsNtbPG1vOIdQMRyw+t0bf3Kf3vuJu/+bnSTvYZLqpCO6wzT/ve9g==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-get-low-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-get-low-word/-/number-float64-base-get-low-word-0.0.6.tgz", - "integrity": "sha512-N2h2QuhmuEA/TOq6W/B1oAHesX5IYtH46Fvo/tLzlodSsFq292kKWGlq9N6AhlVVIJOGibBQN+EHrAPGcNn2wA==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-normalize": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-normalize/-/number-float64-base-normalize-0.0.9.tgz", - "integrity": "sha512-+rm7RQJEj8zHkqYFE2a6DgNQSB5oKE/IydHAajgZl40YB91BoYRYf/ozs5/tTwfy2Fc04+tIpSfFtzDr4ZY19Q==", - "dev": true, - "requires": { - "@stdlib/constants-float64-smallest-normal": "^0.0.x", - "@stdlib/math-base-assert-is-infinite": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-abs": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-set-high-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-high-word/-/number-float64-base-set-high-word-0.0.6.tgz", - "integrity": "sha512-Hqds3oALktHGDV5fNRjjwGBnb1ydOhQFrglRXrsAtJojq8KzIAQVGtYkkFtfmG+xadPNIW+PI95OBK3SgIoQDA==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-set-low-word": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-set-low-word/-/number-float64-base-set-low-word-0.0.6.tgz", - "integrity": "sha512-8CMrWsL93rHELNAcKstKQpGH2XVIELm7BSut3ye0Ffa3ATTxuOfn2zXzS7yvlu/Lqi/47h5prpjRNsKQuLpp2Q==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/number-float64-base-to-words": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-float64-base-to-float32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-float32/-/number-float64-base-to-float32-0.0.7.tgz", - "integrity": "sha512-PNUSi6+cqfFiu4vgFljUKMFY2O9PxI6+T+vqtIoh8cflf+PjSGj3v4QIlstK9+6qU40eGR5SHZyLTWdzmNqLTQ==", - "dev": true, - "requires": { - "@stdlib/array-float32": "^0.0.x" - } - }, - "@stdlib/number-float64-base-to-words": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-float64-base-to-words/-/number-float64-base-to-words-0.0.7.tgz", - "integrity": "sha512-7wsYuq+2MGp9rAkTnQ985rah7EJI9TfgHrYSSd4UIu4qIjoYmWIKEhIDgu7/69PfGrls18C3PxKg1pD/v7DQTg==", - "dev": true, - "requires": { - "@stdlib/array-float64": "^0.0.x", - "@stdlib/array-uint32": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/os-byte-order": "^0.0.x", - "@stdlib/os-float-word-order": "^0.0.x", - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/number-uint32-base-to-int32": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/number-uint32-base-to-int32/-/number-uint32-base-to-int32-0.0.7.tgz", - "integrity": "sha512-KoDNJFtd/lzQQPR6HB3TPiC9DgQGXkBKHYeiYZVUaCW4uGu2IM5KtVOnnI2wkXPGQYpSuUiU9MGf9EywY+YHcA==", - "dev": true - }, - "@stdlib/os-byte-order": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/os-byte-order/-/os-byte-order-0.0.7.tgz", - "integrity": "sha512-rRJWjFM9lOSBiIX4zcay7BZsqYBLoE32Oz/Qfim8cv1cN1viS5D4d3DskRJcffw7zXDnG3oZAOw5yZS0FnlyUg==", - "dev": true, - "requires": { - "@stdlib/assert-is-big-endian": "^0.0.x", - "@stdlib/assert-is-little-endian": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/os-float-word-order": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/os-float-word-order/-/os-float-word-order-0.0.7.tgz", - "integrity": "sha512-gXIcIZf+ENKP7E41bKflfXmPi+AIfjXW/oU+m8NbP3DQasqHaZa0z5758qvnbO8L1lRJb/MzLOkIY8Bx/0cWEA==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/os-byte-order": "^0.0.x", - "@stdlib/utils-library-manifest": "^0.0.x" - } - }, - "@stdlib/process-cwd": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/process-cwd/-/process-cwd-0.0.8.tgz", - "integrity": "sha512-GHINpJgSlKEo9ODDWTHp0/Zc/9C/qL92h5Mc0QlIFBXAoUjy6xT4FB2U16wCNZMG3eVOzt5+SjmCwvGH0Wbg3Q==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/process-read-stdin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/process-read-stdin/-/process-read-stdin-0.0.7.tgz", - "integrity": "sha512-nep9QZ5iDGrRtrZM2+pYAvyCiYG4HfO0/9+19BiLJepjgYq4GKeumPAQo22+1xawYDL7Zu62uWzYszaVZcXuyw==", - "dev": true, - "requires": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/buffer-ctor": "^0.0.x", - "@stdlib/buffer-from-string": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/utils-next-tick": "^0.0.x" - } - }, - "@stdlib/regexp-eol": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-eol/-/regexp-eol-0.0.7.tgz", - "integrity": "sha512-BTMpRWrmlnf1XCdTxOrb8o6caO2lmu/c80XSyhYCi1DoizVIZnqxOaN5yUJNCr50g28vQ47PpsT3Yo7J3SdlRA==", - "dev": true, - "requires": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-boolean": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/regexp-extended-length-path": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-extended-length-path/-/regexp-extended-length-path-0.0.7.tgz", - "integrity": "sha512-z6uqzMWq3WPDKbl4MIZJoNA5ZsYLQI9G3j2TIvhU8X2hnhlku8p4mvK9F+QmoVvgPxKliwNnx/DAl7ltutSDKw==", - "dev": true, - "requires": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/regexp-function-name": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-function-name/-/regexp-function-name-0.0.7.tgz", - "integrity": "sha512-MaiyFUUqkAUpUoz/9F6AMBuMQQfA9ssQfK16PugehLQh4ZtOXV1LhdY8e5Md7SuYl9IrvFVg1gSAVDysrv5ZMg==", - "dev": true, - "requires": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/regexp-regexp": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/regexp-regexp/-/regexp-regexp-0.0.8.tgz", - "integrity": "sha512-S5PZICPd/XRcn1dncVojxIDzJsHtEleuJHHD7ji3o981uPHR7zI2Iy9a1eV2u7+ABeUswbI1Yuix6fXJfcwV1w==", - "dev": true, - "requires": { - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/stats-base-dists-beta-quantile": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-beta-quantile/-/stats-base-dists-beta-quantile-0.0.7.tgz", - "integrity": "sha512-K15aNEiAT9YznlvEUkM7P+6dyMiRprVArybocMvEKmXaKjTamPMKLaTLGfKPKlEtRajJYqWQZzEA9ibT9tQOdA==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-special-betaincinv": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/stats-base-dists-binomial-cdf": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-cdf/-/stats-base-dists-binomial-cdf-0.0.7.tgz", - "integrity": "sha512-lHf38UyG6lVPJjkbjY/UhIGHO4aHEZm1yn+PSJZZUyvYZuMzSQ94hVcMcZjFHv2Nn3lNwEVXbRzjaxys8EoZfw==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/math-base-special-betainc": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/stats-base-dists-binomial-pmf": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-binomial-pmf/-/stats-base-dists-binomial-pmf-0.0.7.tgz", - "integrity": "sha512-IHB//+mk9jNYNpaaI1Nz6mJkg1QnRV/HdzmKBM/G3nI7TcIvXJbDinIE8a5j6jq0tj6ac66Xxq5E6+6NVOcRkA==", - "dev": true, - "requires": { - "@stdlib/constants-float64-pinf": "^0.0.x", - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/math-base-assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/math-base-special-binomcoefln": "^0.0.x", - "@stdlib/math-base-special-exp": "^0.0.x", - "@stdlib/math-base-special-ln": "^0.0.x", - "@stdlib/math-base-special-log1p": "^0.0.x", - "@stdlib/stats-base-dists-degenerate-pmf": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/stats-base-dists-degenerate-pmf": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/stats-base-dists-degenerate-pmf/-/stats-base-dists-degenerate-pmf-0.0.8.tgz", - "integrity": "sha512-RJybhanXnMpI5bYYXOGujLYo1ZZBbD3UyqVIofJZwUqOkDYd8AV+J/Sl8RWkiA/um8blgQO+PhQGs3yFZs/ZkQ==", - "dev": true, - "requires": { - "@stdlib/math-base-assert-is-nan": "^0.0.x", - "@stdlib/utils-constant-function": "^0.0.x", - "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x" - } - }, - "@stdlib/stats-binomial-test": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/stats-binomial-test/-/stats-binomial-test-0.0.7.tgz", - "integrity": "sha512-I+bLc7jOeuV0hauMBEjXS+ey/QE93fSJn099e4okqkEyDVuc6E+2tbWRaL+wsINlgaOjlwP/o1gA7UM0RHqquA==", - "dev": true, - "requires": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-is-boolean": "^0.0.x", - "@stdlib/assert-is-nan": "^0.0.x", - "@stdlib/assert-is-nonnegative-integer": "^0.0.x", - "@stdlib/assert-is-number": "^0.0.x", - "@stdlib/assert-is-number-array": "^0.0.x", - "@stdlib/assert-is-plain-object": "^0.0.x", - "@stdlib/assert-is-positive-integer": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/math-base-special-ceil": "^0.0.x", - "@stdlib/math-base-special-floor": "^0.0.x", - "@stdlib/math-base-special-roundn": "^0.0.x", - "@stdlib/stats-base-dists-beta-quantile": "^0.0.x", - "@stdlib/stats-base-dists-binomial-cdf": "^0.0.x", - "@stdlib/stats-base-dists-binomial-pmf": "^0.0.x", - "@stdlib/utils-define-read-only-property": "^0.0.x" - } - }, - "@stdlib/streams-node-stdin": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/streams-node-stdin/-/streams-node-stdin-0.0.7.tgz", - "integrity": "sha512-gg4lgrjuoG3V/L29wNs32uADMCqepIcmoOFHJCTAhVe0GtHDLybUVnLljaPfdvmpPZmTvmusPQtIcscbyWvAyg==", - "dev": true - }, - "@stdlib/string-base-format-interpolate": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-interpolate/-/string-base-format-interpolate-0.0.4.tgz", - "integrity": "sha512-8FC8+/ey+P5hf1B50oXpXzRzoAgKI1rikpyKZ98Xmjd5rcbSq3NWYi8TqOF8mUHm9hVZ2CXWoNCtEe2wvMQPMg==", - "dev": true - }, - "@stdlib/string-base-format-tokenize": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/@stdlib/string-base-format-tokenize/-/string-base-format-tokenize-0.0.4.tgz", - "integrity": "sha512-+vMIkheqAhDeT/iF5hIQo95IMkt5IzC68eR3CxW1fhc48NMkKFE2UfN73ET8fmLuOanLo/5pO2E90c2G7PExow==", - "dev": true - }, - "@stdlib/string-format": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@stdlib/string-format/-/string-format-0.0.3.tgz", - "integrity": "sha512-1jiElUQXlI/tTkgRuzJi9jUz/EjrO9kzS8VWHD3g7gdc3ZpxlA5G9JrIiPXGw/qmZTi0H1pXl6KmX+xWQEQJAg==", - "dev": true, - "requires": { - "@stdlib/string-base-format-interpolate": "^0.0.x", - "@stdlib/string-base-format-tokenize": "^0.0.x" - } - }, - "@stdlib/string-lowercase": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/string-lowercase/-/string-lowercase-0.0.9.tgz", - "integrity": "sha512-tXFFjbhIlDak4jbQyV1DhYiSTO8b1ozS2g/LELnsKUjIXECDKxGFyWYcz10KuyAWmFotHnCJdIm8/blm2CfDIA==", - "dev": true, - "requires": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - } - }, - "@stdlib/string-replace": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@stdlib/string-replace/-/string-replace-0.0.11.tgz", - "integrity": "sha512-F0MY4f9mRE5MSKpAUfL4HLbJMCbG6iUTtHAWnNeAXIvUX1XYIw/eItkA58R9kNvnr1l5B08bavnjrgTJGIKFFQ==", - "dev": true, - "requires": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/assert-is-regexp": "^0.0.x", - "@stdlib/assert-is-regexp-string": "^0.0.x", - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-format": "^0.0.x", - "@stdlib/utils-escape-regexp-string": "^0.0.x", - "@stdlib/utils-regexp-from-string": "^0.0.x" - } - }, - "@stdlib/types": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/@stdlib/types/-/types-0.0.14.tgz", - "integrity": "sha512-AP3EI9/il/xkwUazcoY+SbjtxHRrheXgSbWZdEGD+rWpEgj6n2i63hp6hTOpAB5NipE0tJwinQlDGOuQ1lCaCw==", - "dev": true - }, - "@stdlib/utils-constant-function": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-constant-function/-/utils-constant-function-0.0.8.tgz", - "integrity": "sha512-GZNs2F/BmvTtUigAC3ig26++EOmoHMRpKZQE+DEMTTFPImOylXdvbi2HsZsDtbv2s/Fi016BqWNU/4fpnqPWsg==", - "dev": true - }, - "@stdlib/utils-constructor-name": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-constructor-name/-/utils-constructor-name-0.0.8.tgz", - "integrity": "sha512-GXpyNZwjN8u3tyYjL2GgGfrsxwvfogUC3gg7L7NRZ1i86B6xmgfnJUYHYOUnSfB+R531ET7NUZlK52GxL7P82Q==", - "dev": true, - "requires": { - "@stdlib/assert-is-buffer": "^0.0.x", - "@stdlib/regexp-function-name": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/utils-convert-path": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-convert-path/-/utils-convert-path-0.0.8.tgz", - "integrity": "sha512-GNd8uIswrcJCctljMbmjtE4P4oOjhoUIfMvdkqfSrRLRY+ZqPB2xM+yI0MQFfUq/0Rnk/xtESlGSVLz9ZDtXfA==", - "dev": true, - "requires": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x", - "@stdlib/process-read-stdin": "^0.0.x", - "@stdlib/regexp-eol": "^0.0.x", - "@stdlib/regexp-extended-length-path": "^0.0.x", - "@stdlib/streams-node-stdin": "^0.0.x", - "@stdlib/string-lowercase": "^0.0.x", - "@stdlib/string-replace": "^0.0.x" - } - }, - "@stdlib/utils-define-nonenumerable-read-only-property": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-nonenumerable-read-only-property/-/utils-define-nonenumerable-read-only-property-0.0.7.tgz", - "integrity": "sha512-c7dnHDYuS4Xn3XBRWIQBPcROTtP/4lkcFyq0FrQzjXUjimfMgHF7cuFIIob6qUTnU8SOzY9p0ydRR2QJreWE6g==", - "dev": true, - "requires": { - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x" - } - }, - "@stdlib/utils-define-property": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-property/-/utils-define-property-0.0.9.tgz", - "integrity": "sha512-pIzVvHJvVfU/Lt45WwUAcodlvSPDDSD4pIPc9WmIYi4vnEBA9U7yHtiNz2aTvfGmBMTaLYTVVFIXwkFp+QotMA==", - "dev": true, - "requires": { - "@stdlib/types": "^0.0.x" - } - }, - "@stdlib/utils-define-read-only-property": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-define-read-only-property/-/utils-define-read-only-property-0.0.8.tgz", - "integrity": "sha512-luKlGCarho88e/WXvQzkSFF7ZFN6Q3Uszo4EfcXVYPGJfP448YMAsEwnXzUWkzCGfKPKubr03w94p87JrYrgSQ==", - "dev": true, - "requires": { - "@stdlib/types": "^0.0.x", - "@stdlib/utils-define-property": "^0.0.x" - } - }, - "@stdlib/utils-escape-regexp-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-escape-regexp-string/-/utils-escape-regexp-string-0.0.9.tgz", - "integrity": "sha512-E+9+UDzf2mlMLgb+zYrrPy2FpzbXh189dzBJY6OG+XZqEJAXcjWs7DURO5oGffkG39EG5KXeaQwDXUavcMDCIw==", - "dev": true, - "requires": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - } - }, - "@stdlib/utils-eval": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-eval/-/utils-eval-0.0.8.tgz", - "integrity": "sha512-eJae8XdBRcHKQQuuW96VmfmXauZHICrLqNERtWgtJW75i0lEE0Le2jYk32O+UVETAFT8rzxMxfBxMckKfdJNaQ==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-read-file": "^0.0.x" - } - }, - "@stdlib/utils-get-prototype-of": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-get-prototype-of/-/utils-get-prototype-of-0.0.7.tgz", - "integrity": "sha512-fCUk9lrBO2ELrq+/OPJws1/hquI4FtwG0SzVRH6UJmJfwb1zoEFnjcwyDAy+HWNVmo3xeRLsrz6XjHrJwer9pg==", - "dev": true, - "requires": { - "@stdlib/assert-is-function": "^0.0.x", - "@stdlib/utils-native-class": "^0.0.x" - } - }, - "@stdlib/utils-global": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@stdlib/utils-global/-/utils-global-0.0.7.tgz", - "integrity": "sha512-BBNYBdDUz1X8Lhfw9nnnXczMv9GztzGpQ88J/6hnY7PHJ71av5d41YlijWeM9dhvWjnH9I7HNE3LL7R07yw0kA==", - "dev": true, - "requires": { - "@stdlib/assert-is-boolean": "^0.0.x" - } - }, - "@stdlib/utils-library-manifest": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-library-manifest/-/utils-library-manifest-0.0.8.tgz", - "integrity": "sha512-IOQSp8skSRQn9wOyMRUX9Hi0j/P5v5TvD8DJWTqtE8Lhr8kVVluMBjHfvheoeKHxfWAbNHSVpkpFY/Bdh/SHgQ==", - "dev": true, - "requires": { - "@stdlib/cli-ctor": "^0.0.x", - "@stdlib/fs-resolve-parent-path": "^0.0.x", - "@stdlib/utils-convert-path": "^0.0.x", - "debug": "^2.6.9", - "resolve": "^1.1.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - } - } - }, - "@stdlib/utils-native-class": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-native-class/-/utils-native-class-0.0.8.tgz", - "integrity": "sha512-0Zl9me2V9rSrBw/N8o8/9XjmPUy8zEeoMM0sJmH3N6C9StDsYTjXIAMPGzYhMEWaWHvGeYyNteFK2yDOVGtC3w==", - "dev": true, - "requires": { - "@stdlib/assert-has-own-property": "^0.0.x", - "@stdlib/assert-has-tostringtag-support": "^0.0.x" - } - }, - "@stdlib/utils-next-tick": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-next-tick/-/utils-next-tick-0.0.8.tgz", - "integrity": "sha512-l+hPl7+CgLPxk/gcWOXRxX/lNyfqcFCqhzzV/ZMvFCYLY/wI9lcWO4xTQNMALY2rp+kiV+qiAiO9zcO+hewwUg==", - "dev": true - }, - "@stdlib/utils-noop": { - "version": "0.0.13", - "resolved": "https://registry.npmjs.org/@stdlib/utils-noop/-/utils-noop-0.0.13.tgz", - "integrity": "sha512-JRWHGWYWP5QK7SQ2cOYiL8NETw8P33LriZh1p9S2xC4e0rBoaY849h1A2IL2y1+x3s29KNjSaBWMrMUIV5HCSw==", - "dev": true - }, - "@stdlib/utils-regexp-from-string": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@stdlib/utils-regexp-from-string/-/utils-regexp-from-string-0.0.9.tgz", - "integrity": "sha512-3rN0Mcyiarl7V6dXRjFAUMacRwe0/sYX7ThKYurf0mZkMW9tjTP+ygak9xmL9AL0QQZtbrFFwWBrDO+38Vnavw==", - "dev": true, - "requires": { - "@stdlib/assert-is-string": "^0.0.x", - "@stdlib/regexp-regexp": "^0.0.x", - "@stdlib/string-format": "^0.0.x" - } - }, - "@stdlib/utils-type-of": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@stdlib/utils-type-of/-/utils-type-of-0.0.8.tgz", - "integrity": "sha512-b4xqdy3AnnB7NdmBBpoiI67X4vIRxvirjg3a8BfhM5jPr2k0njby1jAbG9dUxJvgAV6o32S4kjUgfIdjEYpTNQ==", - "dev": true, - "requires": { - "@stdlib/utils-constructor-name": "^0.0.x", - "@stdlib/utils-global": "^0.0.x" - } - }, - "@szmarczak/http-timer": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-5.0.1.tgz", - "integrity": "sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==", - "dev": true, - "requires": { - "defer-to-connect": "^2.0.1" - } - }, - "@typechain/ethers-v5": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz", - "integrity": "sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw==", - "dev": true, - "requires": { - "ethers": "^5.0.2" - } - }, - "@types/bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==", - "dev": true - }, - "@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "dev": true - }, - "@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 - }, - "@types/mkdirp": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz", - "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "18.11.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", - "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", - "dev": true - }, - "@types/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", - "dev": true, - "requires": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", - "dev": true - }, - "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true - }, - "@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/sinon": { - "version": "10.0.13", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", - "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", - "dev": true, - "requires": { - "@types/sinonjs__fake-timers": "*" - } - }, - "@types/sinon-chai": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.9.tgz", - "integrity": "sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ==", - "dev": true, - "requires": { - "@types/chai": "*", - "@types/sinon": "*" - } - }, - "@types/sinonjs__fake-timers": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", - "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", - "dev": true - }, - "@types/underscore": { - "version": "1.11.4", - "resolved": "https://registry.npmjs.org/@types/underscore/-/underscore-1.11.4.tgz", - "integrity": "sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg==", - "dev": true - }, - "@types/web3": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/@types/web3/-/web3-1.0.19.tgz", - "integrity": "sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A==", - "dev": true, - "requires": { - "@types/bn.js": "*", - "@types/underscore": "*" - } - }, - "@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true - }, - "adm-zip": { - "version": "0.4.16", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", - "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", - "dev": true - }, - "aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", - "dev": true - }, - "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, - "requires": { - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-align": { - "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, - "requires": { - "string-width": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "ansi-colors": { - "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 - }, - "ansi-escapes": { - "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, - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, - "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, - "requires": { - "color-convert": "^1.9.0" - } - }, - "antlr4": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/antlr4/-/antlr4-4.13.2.tgz", - "integrity": "sha512-QiVbZhyy4xAZ17UPEuG3YTOt8ZaoeOR1CvEAqrEsDBsOqINslaB147i9xqljZqoyf5S+EUlGStaj+t22LT9MOg==", - "dev": true - }, - "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, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "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 - }, - "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true - }, - "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 - }, - "ast-parents": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/ast-parents/-/ast-parents-0.0.1.tgz", - "integrity": "sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA==", - "dev": true - }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "at-least-node": { - "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 - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true - }, - "aws4": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz", - "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==", - "dev": true - }, - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dev": true, - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - }, - "dependencies": { - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - } - } - }, - "bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", - "dev": true - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", - "dev": true - }, - "boxen": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", - "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^6.2.0", - "chalk": "^4.1.0", - "cli-boxes": "^2.2.1", - "string-width": "^4.2.2", - "type-fest": "^0.20.2", - "widest-line": "^3.1.0", - "wrap-ansi": "^7.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "type-fest": { - "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 - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", - "dev": true - }, - "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 - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dev": true, - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dev": true, - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "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 - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", - "dev": true - }, - "busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dev": true, - "requires": { - "streamsearch": "^1.1.0" - } - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true - }, - "cacheable-lookup": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", - "integrity": "sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==", - "dev": true - }, - "cacheable-request": { - "version": "10.2.14", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-10.2.14.tgz", - "integrity": "sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==", - "dev": true, - "requires": { - "@types/http-cache-semantics": "^4.0.2", - "get-stream": "^6.0.1", - "http-cache-semantics": "^4.1.1", - "keyv": "^4.5.3", - "mimic-response": "^4.0.0", - "normalize-url": "^8.0.0", - "responselike": "^3.0.0" - } - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, - "chai": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.7.tgz", - "integrity": "sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - } - }, - "chalk": { - "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, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "dev": true - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "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 - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true - }, - "cliui": { - "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, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", - "dev": true - }, - "color-convert": { - "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, - "requires": { - "color-name": "1.1.3" - } - }, - "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 - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "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 - }, - "command-line-args": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-4.0.7.tgz", - "integrity": "sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA==", - "dev": true, - "requires": { - "array-back": "^2.0.0", - "find-replace": "^1.0.3", - "typical": "^2.6.1" - } - }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dev": true, - "requires": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, - "cosmiconfig": { - "version": "8.3.6", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", - "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", - "dev": true, - "requires": { - "import-fresh": "^3.3.0", - "js-yaml": "^4.1.0", - "parse-json": "^5.2.0", - "path-type": "^4.0.0" - }, - "dependencies": { - "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 - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "requires": { - "mimic-response": "^3.1.0" - }, - "dependencies": { - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true - } - } - }, - "deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "deep-extend": { - "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 - }, - "defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "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 - } - } - }, - "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 - }, - "encode-utf8": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz", - "integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==", - "dev": true - }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "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 - }, - "eth-ens-namehash": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", - "dev": true, - "requires": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" - }, - "dependencies": { - "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==", - "dev": true - } - } - }, - "ethereum-bloom-filters": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", - "integrity": "sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA==", - "dev": true, - "requires": { - "js-sha3": "^0.8.0" - } - }, - "ethereum-cryptography": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.1.2.tgz", - "integrity": "sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ==", - "dev": true, - "requires": { - "@noble/hashes": "1.1.2", - "@noble/secp256k1": "1.6.3", - "@scure/bip32": "1.1.0", - "@scure/bip39": "1.1.0" - } - }, - "ethereum-waffle": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/ethereum-waffle/-/ethereum-waffle-3.4.4.tgz", - "integrity": "sha512-PA9+jCjw4WC3Oc5ocSMBj5sXvueWQeAbvCA+hUlb6oFgwwKyq5ka3bWQ7QZcjzIX+TdFkxP4IbFmoY2D8Dkj9Q==", - "dev": true, - "requires": { - "@ethereum-waffle/chai": "^3.4.4", - "@ethereum-waffle/compiler": "^3.4.4", - "@ethereum-waffle/mock-contract": "^3.4.4", - "@ethereum-waffle/provider": "^3.4.4", - "ethers": "^5.0.1" - } - }, - "ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "dev": true, - "requires": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "ethjs-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, - "requires": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" - }, - "dependencies": { - "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 - } - } - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true - }, - "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 - }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz", - "integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==", - "dev": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-replace": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", - "integrity": "sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA==", - "dev": true, - "requires": { - "array-back": "^1.0.4", - "test-value": "^2.1.0" - }, - "dependencies": { - "array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "requires": { - "typical": "^2.6.0" - } - } - } - }, - "find-up": { - "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, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "dev": true, - "requires": { - "micromatch": "^4.0.2" - } - }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "fmix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fmix/-/fmix-0.1.0.tgz", - "integrity": "sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==", - "dev": true, - "requires": { - "imul": "^1.0.0" - } - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true - }, - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "form-data-encoder": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-2.1.4.tgz", - "integrity": "sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==", - "dev": true - }, - "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 - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "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 - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "ganache-core": { - "version": "2.13.2", - "resolved": "https://registry.npmjs.org/ganache-core/-/ganache-core-2.13.2.tgz", - "integrity": "sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw==", - "dev": true, - "requires": { - "abstract-leveldown": "3.0.0", - "async": "2.6.2", - "bip39": "2.5.0", - "cachedown": "1.0.0", - "clone": "2.1.2", - "debug": "3.2.6", - "encoding-down": "5.0.4", - "eth-sig-util": "3.0.0", - "ethereumjs-abi": "0.6.8", - "ethereumjs-account": "3.0.0", - "ethereumjs-block": "2.2.2", - "ethereumjs-common": "1.5.0", - "ethereumjs-tx": "2.1.2", - "ethereumjs-util": "6.2.1", - "ethereumjs-vm": "4.2.0", - "ethereumjs-wallet": "0.6.5", - "heap": "0.2.6", - "keccak": "3.0.1", - "level-sublevel": "6.6.4", - "levelup": "3.1.1", - "lodash": "4.17.20", - "lru-cache": "5.1.1", - "merkle-patricia-tree": "3.0.0", - "patch-package": "6.2.2", - "seedrandom": "3.0.1", - "source-map-support": "0.5.12", - "tmp": "0.1.0", - "web3": "1.2.11", - "web3-provider-engine": "14.2.1", - "websocket": "1.0.32" - }, - "dependencies": { - "@ethersproject/abi": { - "version": "5.0.0-beta.153", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/address": ">=5.0.0-beta.128", - "@ethersproject/bignumber": ">=5.0.0-beta.130", - "@ethersproject/bytes": ">=5.0.0-beta.129", - "@ethersproject/constants": ">=5.0.0-beta.128", - "@ethersproject/hash": ">=5.0.0-beta.128", - "@ethersproject/keccak256": ">=5.0.0-beta.127", - "@ethersproject/logger": ">=5.0.0-beta.129", - "@ethersproject/properties": ">=5.0.0-beta.131", - "@ethersproject/strings": ">=5.0.0-beta.130" - } - }, - "@ethersproject/abstract-provider": { - "version": "5.0.8", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/networks": "^5.0.7", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/transactions": "^5.0.9", - "@ethersproject/web": "^5.0.12" - } - }, - "@ethersproject/abstract-signer": { - "version": "5.0.10", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/abstract-provider": "^5.0.8", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7" - } - }, - "@ethersproject/address": { - "version": "5.0.9", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/rlp": "^5.0.7" - } - }, - "@ethersproject/base64": { - "version": "5.0.7", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9" - } - }, - "@ethersproject/bignumber": { - "version": "5.0.13", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "bn.js": "^4.4.0" - } - }, - "@ethersproject/bytes": { - "version": "5.0.9", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/logger": "^5.0.8" - } - }, - "@ethersproject/constants": { - "version": "5.0.8", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bignumber": "^5.0.13" - } - }, - "@ethersproject/hash": { - "version": "5.0.10", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/abstract-signer": "^5.0.10", - "@ethersproject/address": "^5.0.9", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/strings": "^5.0.8" - } - }, - "@ethersproject/keccak256": { - "version": "5.0.7", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9", - "js-sha3": "0.5.7" - } - }, - "@ethersproject/logger": { - "version": "5.0.8", - "dev": true, - "optional": true - }, - "@ethersproject/networks": { - "version": "5.0.7", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/logger": "^5.0.8" - } - }, - "@ethersproject/properties": { - "version": "5.0.7", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/logger": "^5.0.8" - } - }, - "@ethersproject/rlp": { - "version": "5.0.7", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8" - } - }, - "@ethersproject/signing-key": { - "version": "5.0.8", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "elliptic": "6.5.3" - } - }, - "@ethersproject/strings": { - "version": "5.0.8", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/constants": "^5.0.8", - "@ethersproject/logger": "^5.0.8" - } - }, - "@ethersproject/transactions": { - "version": "5.0.9", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/address": "^5.0.9", - "@ethersproject/bignumber": "^5.0.13", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/constants": "^5.0.8", - "@ethersproject/keccak256": "^5.0.7", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/rlp": "^5.0.7", - "@ethersproject/signing-key": "^5.0.8" - } - }, - "@ethersproject/web": { - "version": "5.0.12", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/base64": "^5.0.7", - "@ethersproject/bytes": "^5.0.9", - "@ethersproject/logger": "^5.0.8", - "@ethersproject/properties": "^5.0.7", - "@ethersproject/strings": "^5.0.8" - } - }, - "@sindresorhus/is": { - "version": "0.14.0", - "dev": true, - "optional": true - }, - "@szmarczak/http-timer": { - "version": "1.1.2", - "dev": true, - "optional": true, - "requires": { - "defer-to-connect": "^1.0.1" - } - }, - "@types/bn.js": { - "version": "4.11.6", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "14.14.20", - "dev": true - }, - "@types/pbkdf2": { - "version": "3.1.0", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/secp256k1": { - "version": "4.0.1", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@yarnpkg/lockfile": { - "version": "1.1.0", - "dev": true - }, - "abstract-leveldown": { - "version": "3.0.0", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "accepts": { - "version": "1.3.7", - "dev": true, - "optional": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "aes-js": { - "version": "3.1.2", - "dev": true, - "optional": true - }, - "ajv": { - "version": "6.12.6", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-styles": { - "version": "3.2.1", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "arr-diff": { - "version": "4.0.0", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "dev": true - }, - "array-flatten": { - "version": "1.1.1", - "dev": true, - "optional": true - }, - "array-unique": { - "version": "0.3.2", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "asn1.js": { - "version": "5.4.1", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "dev": true - }, - "async": { - "version": "2.6.2", - "dev": true, - "requires": { - "lodash": "^4.17.11" - } - }, - "async-eventemitter": { - "version": "0.2.4", - "dev": true, - "requires": { - "async": "^2.4.0" - } - }, - "async-limiter": { - "version": "1.0.1", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "dev": true - }, - "atob": { - "version": "2.1.2", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "dev": true - }, - "babel-code-frame": { - "version": "6.26.0", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "dev": true - } - } - }, - "babel-core": { - "version": "6.26.3", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "json5": { - "version": "0.5.1", - "dev": true - }, - "ms": { - "version": "2.0.0", - "dev": true - }, - "slash": { - "version": "1.0.0", - "dev": true - } - } - }, - "babel-generator": { - "version": "6.26.1", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - }, - "dependencies": { - "jsesc": { - "version": "1.3.0", - "dev": true - } - } - }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-messages": { - "version": "6.23.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "dev": true - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "dev": true - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "dev": true - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "dev": true, - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "dev": true, - "requires": { - "regenerator-transform": "^0.10.0" - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-preset-env": { - "version": "1.7.0", - "dev": true, - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "dev": true - } - } - }, - "babel-register": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - }, - "dependencies": { - "source-map-support": { - "version": "0.4.18", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "globals": { - "version": "9.18.0", - "dev": true - }, - "ms": { - "version": "2.0.0", - "dev": true - } - } - }, - "babel-types": { - "version": "6.26.0", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - }, - "dependencies": { - "to-fast-properties": { - "version": "1.0.3", - "dev": true - } - } - }, - "babelify": { - "version": "7.3.0", - "dev": true, - "requires": { - "babel-core": "^6.0.14", - "object-assign": "^4.0.0" - } - }, - "babylon": { - "version": "6.18.0", - "dev": true - }, - "backoff": { - "version": "2.5.0", - "dev": true, - "requires": { - "precond": "0.2" - } - }, - "balanced-match": { - "version": "1.0.0", - "dev": true - }, - "base": { - "version": "0.11.2", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "base-x": { - "version": "3.0.8", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "base64-js": { - "version": "1.5.1", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - }, - "dependencies": { - "tweetnacl": { - "version": "0.14.5", - "dev": true - } - } - }, - "bignumber.js": { - "version": "9.0.1", - "dev": true, - "optional": true - }, - "bip39": { - "version": "2.5.0", - "dev": true, - "requires": { - "create-hash": "^1.1.0", - "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" - } - }, - "blakejs": { - "version": "1.1.0", - "dev": true - }, - "bluebird": { - "version": "3.7.2", - "dev": true, - "optional": true - }, - "bn.js": { - "version": "4.11.9", - "dev": true - }, - "body-parser": { - "version": "1.19.0", - "dev": true, - "optional": true, - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "dev": true, - "optional": true - }, - "qs": { - "version": "6.7.0", - "dev": true, - "optional": true - } - } - }, - "brace-expansion": { - "version": "1.1.11", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "dev": true, - "optional": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "dev": true, - "optional": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "dev": true, - "optional": true - } - } - }, - "browserify-sign": { - "version": "4.2.1", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "dev": true, - "optional": true - }, - "readable-stream": { - "version": "3.6.0", - "dev": true, - "optional": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "browserslist": { - "version": "3.2.8", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - } - }, - "bs58": { - "version": "4.0.1", - "dev": true, - "requires": { - "base-x": "^3.0.2" - } - }, - "bs58check": { - "version": "2.1.2", - "dev": true, - "requires": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "buffer": { - "version": "5.7.1", - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-from": { - "version": "1.1.1", - "dev": true - }, - "buffer-to-arraybuffer": { - "version": "0.0.5", - "dev": true, - "optional": true - }, - "buffer-xor": { - "version": "1.0.3", - "dev": true - }, - "bufferutil": { - "version": "4.0.3", - "dev": true, - "requires": { - "node-gyp-build": "^4.2.0" - } - }, - "bytes": { - "version": "3.1.0", - "dev": true, - "optional": true - }, - "bytewise": { - "version": "1.1.0", - "dev": true, - "requires": { - "bytewise-core": "^1.2.2", - "typewise": "^1.0.3" - } - }, - "bytewise-core": { - "version": "1.2.3", - "dev": true, - "requires": { - "typewise-core": "^1.2" - } - }, - "cache-base": { - "version": "1.0.1", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "cacheable-request": { - "version": "6.1.0", - "dev": true, - "optional": true, - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^3.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^4.1.0", - "responselike": "^1.0.2" - }, - "dependencies": { - "lowercase-keys": { - "version": "2.0.0", - "dev": true, - "optional": true - } - } - }, - "cachedown": { - "version": "1.0.0", - "dev": true, - "requires": { - "abstract-leveldown": "^2.4.1", - "lru-cache": "^3.2.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "lru-cache": { - "version": "3.2.0", - "dev": true, - "requires": { - "pseudomap": "^1.0.1" - } - } - } - }, - "call-bind": { - "version": "1.0.2", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "caniuse-lite": { - "version": "1.0.30001174", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "dev": true - }, - "chalk": { - "version": "2.4.2", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "checkpoint-store": { - "version": "1.1.0", - "dev": true, - "requires": { - "functional-red-black-tree": "^1.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "dev": true, - "optional": true - }, - "ci-info": { - "version": "2.0.0", - "dev": true - }, - "cids": { - "version": "0.7.5", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.5.0", - "class-is": "^1.1.0", - "multibase": "~0.6.0", - "multicodec": "^1.0.0", - "multihashes": "~0.4.15" - }, - "dependencies": { - "multicodec": { - "version": "1.0.4", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.6.0", - "varint": "^5.0.0" - } - } - } - }, - "cipher-base": { - "version": "1.0.4", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-is": { - "version": "1.1.0", - "dev": true, - "optional": true - }, - "class-utils": { - "version": "0.3.6", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "dev": true - } - } - }, - "clone": { - "version": "2.1.2", - "dev": true - }, - "clone-response": { - "version": "1.0.2", - "dev": true, - "optional": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "collection-visit": { - "version": "1.0.0", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "component-emitter": { - "version": "1.3.0", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "content-disposition": { - "version": "0.5.3", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "dev": true, - "optional": true - } - } - }, - "content-hash": { - "version": "2.5.2", - "dev": true, - "optional": true, - "requires": { - "cids": "^0.7.1", - "multicodec": "^0.5.5", - "multihashes": "^0.4.15" - } - }, - "content-type": { - "version": "1.0.4", - "dev": true, - "optional": true - }, - "convert-source-map": { - "version": "1.7.0", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "dev": true - } - } - }, - "cookie": { - "version": "0.4.0", - "dev": true, - "optional": true - }, - "cookie-signature": { - "version": "1.0.6", - "dev": true, - "optional": true - }, - "cookiejar": { - "version": "2.1.2", - "dev": true, - "optional": true - }, - "copy-descriptor": { - "version": "0.1.1", - "dev": true - }, - "core-js": { - "version": "2.6.12", - "dev": true - }, - "core-js-pure": { - "version": "3.8.2", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "dev": true - }, - "cors": { - "version": "2.8.5", - "dev": true, - "optional": true, - "requires": { - "object-assign": "^4", - "vary": "^1" - } - }, - "create-ecdh": { - "version": "4.0.4", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - } - }, - "create-hash": { - "version": "1.2.0", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-fetch": { - "version": "2.2.3", - "dev": true, - "requires": { - "node-fetch": "2.1.2", - "whatwg-fetch": "2.0.4" - } - }, - "crypto-browserify": { - "version": "3.12.0", - "dev": true, - "optional": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "d": { - "version": "1.0.1", - "dev": true, - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "dashdash": { - "version": "1.14.1", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "3.2.6", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "dev": true - }, - "decompress-response": { - "version": "3.3.0", - "dev": true, - "optional": true, - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-equal": { - "version": "1.1.1", - "dev": true, - "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - } - }, - "defer-to-connect": { - "version": "1.1.3", - "dev": true, - "optional": true - }, - "deferred-leveldown": { - "version": "4.0.2", - "dev": true, - "requires": { - "abstract-leveldown": "~5.0.0", - "inherits": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "define-properties": { - "version": "1.1.3", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - } - }, - "defined": { - "version": "1.0.0", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "dev": true - }, - "depd": { - "version": "1.1.2", - "dev": true, - "optional": true - }, - "des.js": { - "version": "1.0.1", - "dev": true, - "optional": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "dev": true, - "optional": true - }, - "detect-indent": { - "version": "4.0.0", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "diffie-hellman": { - "version": "5.0.3", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - } - }, - "dom-walk": { - "version": "0.1.2", - "dev": true - }, - "dotignore": { - "version": "0.1.2", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "duplexer3": { - "version": "0.1.4", - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "dev": true, - "optional": true - }, - "electron-to-chromium": { - "version": "1.3.636", - "dev": true - }, - "elliptic": { - "version": "6.5.3", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, - "encodeurl": { - "version": "1.0.2", - "dev": true, - "optional": true - }, - "encoding": { - "version": "0.1.13", - "dev": true, - "requires": { - "iconv-lite": "^0.6.2" - }, - "dependencies": { - "iconv-lite": { - "version": "0.6.2", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - } - } - }, - "encoding-down": { - "version": "5.0.4", - "dev": true, - "requires": { - "abstract-leveldown": "^5.0.0", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "end-of-stream": { - "version": "1.4.4", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "errno": { - "version": "0.1.8", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "es-abstract": { - "version": "1.18.0-next.1", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "es5-ext": { - "version": "0.10.53", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "dev": true, - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "escape-html": { - "version": "1.0.3", - "dev": true, - "optional": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "dev": true - }, - "etag": { - "version": "1.8.1", - "dev": true, - "optional": true - }, - "eth-block-tracker": { - "version": "3.0.1", - "dev": true, - "requires": { - "eth-query": "^2.1.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.3", - "ethjs-util": "^0.1.3", - "json-rpc-engine": "^3.6.0", - "pify": "^2.3.0", - "tape": "^4.6.3" - }, - "dependencies": { - "ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "pify": { - "version": "2.3.0", - "dev": true - } - } - }, - "eth-ens-namehash": { - "version": "2.0.8", - "dev": true, - "optional": true, - "requires": { - "idna-uts46-hx": "^2.3.1", - "js-sha3": "^0.5.7" - } - }, - "eth-json-rpc-infura": { - "version": "3.2.1", - "dev": true, - "requires": { - "cross-fetch": "^2.1.1", - "eth-json-rpc-middleware": "^1.5.0", - "json-rpc-engine": "^3.4.0", - "json-rpc-error": "^2.0.0" - } - }, - "eth-json-rpc-middleware": { - "version": "1.6.0", - "dev": true, - "requires": { - "async": "^2.5.0", - "eth-query": "^2.1.2", - "eth-tx-summary": "^3.1.2", - "ethereumjs-block": "^1.6.0", - "ethereumjs-tx": "^1.3.3", - "ethereumjs-util": "^5.1.2", - "ethereumjs-vm": "^2.1.0", - "fetch-ponyfill": "^4.0.0", - "json-rpc-engine": "^3.6.0", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "tape": "^4.6.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "dev": true - } - } - }, - "ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "isarray": { - "version": "0.0.1", - "dev": true - }, - "level-codec": { - "version": "7.0.1", - "dev": true - }, - "level-errors": { - "version": "1.0.5", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-ws": { - "version": "0.0.0", - "dev": true, - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "1.3.9", - "dev": true, - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "1.4.1", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "dev": true - } - } - }, - "object-keys": { - "version": "0.4.0", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - }, - "semver": { - "version": "5.4.1", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "dev": true - } - } - }, - "eth-lib": { - "version": "0.1.29", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "nano-json-stream-parser": "^0.1.2", - "servify": "^0.1.12", - "ws": "^3.0.0", - "xhr-request-promise": "^0.1.2" - } - }, - "eth-query": { - "version": "2.1.2", - "dev": true, - "requires": { - "json-rpc-random-id": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "eth-sig-util": { - "version": "3.0.0", - "dev": true, - "requires": { - "buffer": "^5.2.1", - "elliptic": "^6.4.0", - "ethereumjs-abi": "0.6.5", - "ethereumjs-util": "^5.1.1", - "tweetnacl": "^1.0.0", - "tweetnacl-util": "^0.15.0" - }, - "dependencies": { - "ethereumjs-abi": { - "version": "0.6.5", - "dev": true, - "requires": { - "bn.js": "^4.10.0", - "ethereumjs-util": "^4.3.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "4.5.1", - "dev": true, - "requires": { - "bn.js": "^4.8.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.0.0" - } - } - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "eth-tx-summary": { - "version": "3.2.4", - "dev": true, - "requires": { - "async": "^2.1.2", - "clone": "^2.0.0", - "concat-stream": "^1.5.1", - "end-of-stream": "^1.1.0", - "eth-query": "^2.0.2", - "ethereumjs-block": "^1.4.1", - "ethereumjs-tx": "^1.1.1", - "ethereumjs-util": "^5.0.1", - "ethereumjs-vm": "^2.6.0", - "through2": "^2.0.3" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "dev": true - } - } - }, - "ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "isarray": { - "version": "0.0.1", - "dev": true - }, - "level-codec": { - "version": "7.0.1", - "dev": true - }, - "level-errors": { - "version": "1.0.5", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-ws": { - "version": "0.0.0", - "dev": true, - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "1.3.9", - "dev": true, - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "1.4.1", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "dev": true - } - } - }, - "object-keys": { - "version": "0.4.0", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - }, - "semver": { - "version": "5.4.1", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "dev": true - } - } - }, - "ethashjs": { - "version": "0.0.8", - "dev": true, - "requires": { - "async": "^2.1.2", - "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.0.2", - "miller-rabin": "^4.0.0" - }, - "dependencies": { - "bn.js": { - "version": "5.1.3", - "dev": true - }, - "buffer-xor": { - "version": "2.0.2", - "dev": true, - "requires": { - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-util": { - "version": "7.0.7", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.4" - } - } - } - }, - "ethereum-bloom-filters": { - "version": "1.0.7", - "dev": true, - "optional": true, - "requires": { - "js-sha3": "^0.8.0" - }, - "dependencies": { - "js-sha3": { - "version": "0.8.0", - "dev": true, - "optional": true - } - } - }, - "ethereum-common": { - "version": "0.0.18", - "dev": true - }, - "ethereum-cryptography": { - "version": "0.1.3", - "dev": true, - "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "ethereumjs-abi": { - "version": "0.6.8", - "dev": true, - "requires": { - "bn.js": "^4.11.8", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-account": { - "version": "3.0.0", - "dev": true, - "requires": { - "ethereumjs-util": "^6.0.0", - "rlp": "^2.2.1", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "dev": true - }, - "level-codec": { - "version": "7.0.1", - "dev": true - }, - "level-errors": { - "version": "1.0.5", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-ws": { - "version": "0.0.0", - "dev": true, - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "1.3.9", - "dev": true, - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "1.4.1", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "dev": true - } - } - }, - "object-keys": { - "version": "0.4.0", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - }, - "semver": { - "version": "5.4.1", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "dev": true - } - } - }, - "ethereumjs-blockchain": { - "version": "4.0.4", - "dev": true, - "requires": { - "async": "^2.6.1", - "ethashjs": "~0.0.7", - "ethereumjs-block": "~2.2.2", - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.1.0", - "flow-stoplight": "^1.0.0", - "level-mem": "^3.0.1", - "lru-cache": "^5.1.1", - "rlp": "^2.2.2", - "semaphore": "^1.1.0" - } - }, - "ethereumjs-common": { - "version": "1.5.0", - "dev": true - }, - "ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - }, - "ethereumjs-vm": { - "version": "4.2.0", - "dev": true, - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "core-js-pure": "^3.0.1", - "ethereumjs-account": "^3.0.0", - "ethereumjs-block": "^2.2.2", - "ethereumjs-blockchain": "^4.0.3", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.2", - "ethereumjs-util": "^6.2.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1", - "util.promisify": "^1.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "isarray": { - "version": "0.0.1", - "dev": true - }, - "level-codec": { - "version": "7.0.1", - "dev": true - }, - "level-errors": { - "version": "1.0.5", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-ws": { - "version": "0.0.0", - "dev": true, - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "1.3.9", - "dev": true, - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "1.4.1", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "dev": true - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "object-keys": { - "version": "0.4.0", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - }, - "semver": { - "version": "5.4.1", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "dev": true - } - } - }, - "ethereumjs-wallet": { - "version": "0.6.5", - "dev": true, - "optional": true, - "requires": { - "aes-js": "^3.1.1", - "bs58check": "^2.1.2", - "ethereum-cryptography": "^0.1.3", - "ethereumjs-util": "^6.0.0", - "randombytes": "^2.0.6", - "safe-buffer": "^5.1.2", - "scryptsy": "^1.2.1", - "utf8": "^3.0.0", - "uuid": "^3.3.2" - } - }, - "ethjs-unit": { - "version": "0.1.6", - "dev": true, - "optional": true, - "requires": { - "bn.js": "4.11.6", - "number-to-bn": "1.7.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "dev": true, - "optional": true - } - } - }, - "ethjs-util": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, - "eventemitter3": { - "version": "4.0.4", - "dev": true, - "optional": true - }, - "events": { - "version": "3.2.0", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "expand-brackets": { - "version": "2.1.4", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "dev": true - }, - "ms": { - "version": "2.0.0", - "dev": true - } - } - }, - "express": { - "version": "4.17.1", - "dev": true, - "optional": true, - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "dev": true, - "optional": true - }, - "qs": { - "version": "6.7.0", - "dev": true, - "optional": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true, - "optional": true - } - } - }, - "ext": { - "version": "1.4.0", - "dev": true, - "requires": { - "type": "^2.0.0" - }, - "dependencies": { - "type": { - "version": "2.1.0", - "dev": true - } - } - }, - "extend": { - "version": "3.0.2", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "extglob": { - "version": "2.0.4", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "dev": true - } - } - }, - "extsprintf": { - "version": "1.3.0", - "dev": true - }, - "fake-merkle-patricia-tree": { - "version": "1.0.1", - "dev": true, - "requires": { - "checkpoint-store": "^1.1.0" - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "dev": true - }, - "fetch-ponyfill": { - "version": "4.1.0", - "dev": true, - "requires": { - "node-fetch": "~1.7.1" - }, - "dependencies": { - "is-stream": { - "version": "1.1.0", - "dev": true - }, - "node-fetch": { - "version": "1.7.3", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - } - } - }, - "finalhandler": { - "version": "1.1.2", - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "dev": true, - "optional": true - } - } - }, - "find-yarn-workspace-root": { - "version": "1.2.1", - "dev": true, - "requires": { - "fs-extra": "^4.0.3", - "micromatch": "^3.1.4" - }, - "dependencies": { - "braces": { - "version": "2.3.2", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fs-extra": { - "version": "4.0.3", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-extendable": { - "version": "0.1.1", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, - "flow-stoplight": { - "version": "1.0.0", - "dev": true - }, - "for-each": { - "version": "0.3.3", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } - }, - "for-in": { - "version": "1.0.2", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "forwarded": { - "version": "0.1.2", - "dev": true, - "optional": true - }, - "fragment-cache": { - "version": "0.2.1", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "dev": true, - "optional": true - }, - "fs-extra": { - "version": "7.0.1", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "dev": true - }, - "get-intrinsic": { - "version": "1.0.2", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "get-stream": { - "version": "5.2.0", - "dev": true, - "optional": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "global": { - "version": "4.4.0", - "dev": true, - "requires": { - "min-document": "^2.19.0", - "process": "^0.11.10" - } - }, - "got": { - "version": "9.6.0", - "dev": true, - "optional": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - }, - "dependencies": { - "get-stream": { - "version": "4.1.0", - "dev": true, - "optional": true, - "requires": { - "pump": "^3.0.0" - } - } - } - }, - "graceful-fs": { - "version": "4.2.4", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "dev": true - } - } - }, - "has-flag": { - "version": "3.0.0", - "dev": true - }, - "has-symbol-support-x": { - "version": "1.4.2", - "dev": true, - "optional": true - }, - "has-symbols": { - "version": "1.0.1", - "dev": true - }, - "has-to-string-tag-x": { - "version": "1.4.1", - "dev": true, - "optional": true, - "requires": { - "has-symbol-support-x": "^1.4.1" - } - }, - "has-value": { - "version": "1.0.0", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.1.0", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "hash.js": { - "version": "1.1.7", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "heap": { - "version": "0.2.6", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "home-or-tmp": { - "version": "2.0.0", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "http-cache-semantics": { - "version": "4.1.0", - "dev": true, - "optional": true - }, - "http-errors": { - "version": "1.7.2", - "dev": true, - "optional": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "dev": true, - "optional": true - } - } - }, - "http-https": { - "version": "1.0.0", - "dev": true, - "optional": true - }, - "http-signature": { - "version": "1.2.0", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "idna-uts46-hx": { - "version": "2.3.1", - "dev": true, - "optional": true, - "requires": { - "punycode": "2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.0", - "dev": true, - "optional": true - } - } - }, - "ieee754": { - "version": "1.2.1", - "dev": true - }, - "immediate": { - "version": "3.2.3", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "dev": true - }, - "invariant": { - "version": "2.2.4", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "ipaddr.js": { - "version": "1.9.1", - "dev": true, - "optional": true - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-arguments": { - "version": "1.1.0", - "dev": true, - "requires": { - "call-bind": "^1.0.0" - } - }, - "is-callable": { - "version": "1.2.2", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-date-object": { - "version": "1.0.2", - "dev": true - }, - "is-descriptor": { - "version": "1.0.2", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-extendable": { - "version": "1.0.1", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "is-finite": { - "version": "1.1.0", - "dev": true - }, - "is-fn": { - "version": "1.0.0", - "dev": true - }, - "is-function": { - "version": "1.0.2", - "dev": true - }, - "is-hex-prefixed": { - "version": "1.0.0", - "dev": true - }, - "is-negative-zero": { - "version": "2.0.1", - "dev": true - }, - "is-object": { - "version": "1.0.2", - "dev": true, - "optional": true - }, - "is-plain-obj": { - "version": "1.1.0", - "dev": true, - "optional": true - }, - "is-plain-object": { - "version": "2.0.4", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-regex": { - "version": "1.1.1", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-retry-allowed": { - "version": "1.2.0", - "dev": true, - "optional": true - }, - "is-symbol": { - "version": "1.0.3", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "dev": true - }, - "isurl": { - "version": "1.0.0", - "dev": true, - "optional": true, - "requires": { - "has-to-string-tag-x": "^1.2.0", - "is-object": "^1.0.1" - } - }, - "js-sha3": { - "version": "0.5.7", - "dev": true, - "optional": true - }, - "js-tokens": { - "version": "4.0.0", - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "dev": true - }, - "json-buffer": { - "version": "3.0.0", - "dev": true, - "optional": true - }, - "json-rpc-engine": { - "version": "3.8.0", - "dev": true, - "requires": { - "async": "^2.0.1", - "babel-preset-env": "^1.7.0", - "babelify": "^7.3.0", - "json-rpc-error": "^2.0.0", - "promise-to-callback": "^1.0.0", - "safe-event-emitter": "^1.0.1" - } - }, - "json-rpc-error": { - "version": "2.0.0", - "dev": true, - "requires": { - "inherits": "^2.0.1" - } - }, - "json-rpc-random-id": { - "version": "1.0.1", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "dev": true, - "requires": { - "jsonify": "~0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsonify": { - "version": "0.0.0", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "keccak": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "keyv": { - "version": "3.1.0", - "dev": true, - "optional": true, - "requires": { - "json-buffer": "3.0.0" - } - }, - "kind-of": { - "version": "6.0.3", - "dev": true - }, - "klaw-sync": { - "version": "6.0.0", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11" - } - }, - "level-codec": { - "version": "9.0.2", - "dev": true, - "requires": { - "buffer": "^5.6.0" - } - }, - "level-errors": { - "version": "2.0.1", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "2.0.3", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.5", - "xtend": "^4.0.0" - } - }, - "level-mem": { - "version": "3.0.1", - "dev": true, - "requires": { - "level-packager": "~4.0.0", - "memdown": "~3.0.0" - }, - "dependencies": { - "abstract-leveldown": { - "version": "5.0.0", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "3.0.0", - "dev": true, - "requires": { - "abstract-leveldown": "~5.0.0", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - } - } - }, - "level-packager": { - "version": "4.0.1", - "dev": true, - "requires": { - "encoding-down": "~5.0.0", - "levelup": "^3.0.0" - } - }, - "level-post": { - "version": "1.0.7", - "dev": true, - "requires": { - "ltgt": "^2.1.2" - } - }, - "level-sublevel": { - "version": "6.6.4", - "dev": true, - "requires": { - "bytewise": "~1.1.0", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0", - "level-iterator-stream": "^2.0.3", - "ltgt": "~2.1.1", - "pull-defer": "^0.2.2", - "pull-level": "^2.0.3", - "pull-stream": "^3.6.8", - "typewiselite": "~1.0.0", - "xtend": "~4.0.0" - } - }, - "level-ws": { - "version": "1.0.0", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.2.8", - "xtend": "^4.0.1" - } - }, - "levelup": { - "version": "3.1.1", - "dev": true, - "requires": { - "deferred-leveldown": "~4.0.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~3.0.0", - "xtend": "~4.0.0" - }, - "dependencies": { - "level-iterator-stream": { - "version": "3.0.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "xtend": "^4.0.0" - } - } - } - }, - "lodash": { - "version": "4.17.20", - "dev": true - }, - "looper": { - "version": "2.0.0", - "dev": true - }, - "loose-envify": { - "version": "1.4.0", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "lru-cache": { - "version": "5.1.1", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "ltgt": { - "version": "2.1.3", - "dev": true - }, - "map-cache": { - "version": "0.2.2", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "media-typer": { - "version": "0.3.0", - "dev": true, - "optional": true - }, - "merge-descriptors": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "merkle-patricia-tree": { - "version": "3.0.0", - "dev": true, - "requires": { - "async": "^2.6.1", - "ethereumjs-util": "^5.2.0", - "level-mem": "^3.0.1", - "level-ws": "^1.0.0", - "readable-stream": "^3.0.6", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "readable-stream": { - "version": "3.6.0", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - } - } - }, - "methods": { - "version": "1.1.2", - "dev": true, - "optional": true - }, - "miller-rabin": { - "version": "4.0.1", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - } - }, - "mime": { - "version": "1.6.0", - "dev": true, - "optional": true - }, - "mime-db": { - "version": "1.45.0", - "dev": true - }, - "mime-types": { - "version": "2.1.28", - "dev": true, - "requires": { - "mime-db": "1.45.0" - } - }, - "mimic-response": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "min-document": { - "version": "2.19.0", - "dev": true, - "requires": { - "dom-walk": "^0.1.0" - } - }, - "minimalistic-assert": { - "version": "1.0.1", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "dev": true - }, - "minizlib": { - "version": "1.3.3", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - }, - "dependencies": { - "minipass": { - "version": "2.9.0", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - } - } - }, - "mixin-deep": { - "version": "1.3.2", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - } - }, - "mkdirp": { - "version": "0.5.5", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "mkdirp-promise": { - "version": "5.0.1", - "dev": true, - "optional": true, - "requires": { - "mkdirp": "*" - } - }, - "mock-fs": { - "version": "4.13.0", - "dev": true, - "optional": true - }, - "ms": { - "version": "2.1.3", - "dev": true - }, - "multibase": { - "version": "0.6.1", - "dev": true, - "optional": true, - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - }, - "multicodec": { - "version": "0.5.7", - "dev": true, - "optional": true, - "requires": { - "varint": "^5.0.0" - } - }, - "multihashes": { - "version": "0.4.21", - "dev": true, - "optional": true, - "requires": { - "buffer": "^5.5.0", - "multibase": "^0.7.0", - "varint": "^5.0.0" - }, - "dependencies": { - "multibase": { - "version": "0.7.0", - "dev": true, - "optional": true, - "requires": { - "base-x": "^3.0.8", - "buffer": "^5.5.0" - } - } - } - }, - "nano-json-stream-parser": { - "version": "0.1.2", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "negotiator": { - "version": "0.6.2", - "dev": true, - "optional": true - }, - "next-tick": { - "version": "1.0.0", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "dev": true - }, - "node-addon-api": { - "version": "2.0.2", - "bundled": true, - "dev": true - }, - "node-fetch": { - "version": "2.1.2", - "dev": true - }, - "node-gyp-build": { - "version": "4.2.3", - "bundled": true, - "dev": true - }, - "normalize-url": { - "version": "4.5.0", - "dev": true, - "optional": true - }, - "number-to-bn": { - "version": "1.7.0", - "dev": true, - "optional": true, - "requires": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.6", - "dev": true, - "optional": true - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "dev": true - } - } - }, - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-inspect": { - "version": "1.9.0", - "dev": true - }, - "object-is": { - "version": "1.1.4", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "object-keys": { - "version": "1.1.1", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.2", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.1", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, - "object.pick": { - "version": "1.3.0", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "oboe": { - "version": "2.1.4", - "dev": true, - "optional": true, - "requires": { - "http-https": "^1.0.0" - } - }, - "on-finished": { - "version": "2.3.0", - "dev": true, - "optional": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "dev": true - }, - "p-cancelable": { - "version": "1.1.0", - "dev": true, - "optional": true - }, - "p-timeout": { - "version": "1.2.1", - "dev": true, - "optional": true, - "requires": { - "p-finally": "^1.0.0" - }, - "dependencies": { - "p-finally": { - "version": "1.0.0", - "dev": true, - "optional": true - } - } - }, - "parse-asn1": { - "version": "5.1.6", - "dev": true, - "optional": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-headers": { - "version": "2.0.3", - "dev": true - }, - "parseurl": { - "version": "1.3.3", - "dev": true, - "optional": true - }, - "pascalcase": { - "version": "0.1.1", - "dev": true - }, - "patch-package": { - "version": "6.2.2", - "dev": true, - "requires": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^1.2.1", - "fs-extra": "^7.0.1", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.0", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "path-key": { - "version": "2.0.1", - "dev": true - }, - "semver": { - "version": "5.7.1", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "dev": true - }, - "slash": { - "version": "2.0.0", - "dev": true - }, - "tmp": { - "version": "0.0.33", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "which": { - "version": "1.3.1", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "path-is-absolute": { - "version": "1.0.1", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "dev": true - }, - "path-to-regexp": { - "version": "0.1.7", - "dev": true, - "optional": true - }, - "pbkdf2": { - "version": "3.1.1", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "dev": true - }, - "precond": { - "version": "0.2.3", - "dev": true - }, - "prepend-http": { - "version": "2.0.0", - "dev": true, - "optional": true - }, - "private": { - "version": "0.1.8", - "dev": true - }, - "process": { - "version": "0.11.10", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "dev": true - }, - "promise-to-callback": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" - } - }, - "proxy-addr": { - "version": "2.0.6", - "dev": true, - "optional": true, - "requires": { - "forwarded": "~0.1.2", - "ipaddr.js": "1.9.1" - } - }, - "prr": { - "version": "1.0.1", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "dev": true - }, - "psl": { - "version": "1.8.0", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "pull-cat": { - "version": "1.1.11", - "dev": true - }, - "pull-defer": { - "version": "0.2.3", - "dev": true - }, - "pull-level": { - "version": "2.0.4", - "dev": true, - "requires": { - "level-post": "^1.0.7", - "pull-cat": "^1.1.9", - "pull-live": "^1.0.1", - "pull-pushable": "^2.0.0", - "pull-stream": "^3.4.0", - "pull-window": "^2.1.4", - "stream-to-pull-stream": "^1.7.1" - } - }, - "pull-live": { - "version": "1.0.1", - "dev": true, - "requires": { - "pull-cat": "^1.1.9", - "pull-stream": "^3.4.0" - } - }, - "pull-pushable": { - "version": "2.2.0", - "dev": true - }, - "pull-stream": { - "version": "3.6.14", - "dev": true - }, - "pull-window": { - "version": "2.1.4", - "dev": true, - "requires": { - "looper": "^2.0.0" - } - }, - "pump": { - "version": "3.0.0", - "dev": true, - "optional": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "punycode": { - "version": "2.1.1", - "dev": true - }, - "qs": { - "version": "6.5.2", - "dev": true - }, - "query-string": { - "version": "5.1.1", - "dev": true, - "optional": true, - "requires": { - "decode-uri-component": "^0.2.0", - "object-assign": "^4.1.0", - "strict-uri-encode": "^1.0.0" - } - }, - "randombytes": { - "version": "2.1.0", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "dev": true, - "optional": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "dev": true, - "optional": true - }, - "raw-body": { - "version": "2.4.0", - "dev": true, - "optional": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "readable-stream": { - "version": "2.3.7", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "dev": true - } - } - }, - "regenerate": { - "version": "1.4.2", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "dev": true - }, - "regenerator-transform": { - "version": "0.10.1", - "dev": true, - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - }, - "regex-not": { - "version": "1.0.2", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexp.prototype.flags": { - "version": "1.3.0", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } - } - }, - "regexpu-core": { - "version": "2.0.0", - "dev": true, - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "dev": true - }, - "regjsparser": { - "version": "0.1.5", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "dev": true - } - } - }, - "repeat-element": { - "version": "1.1.3", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.2", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "resolve-url": { - "version": "0.2.1", - "dev": true - }, - "responselike": { - "version": "1.0.2", - "dev": true, - "optional": true, - "requires": { - "lowercase-keys": "^1.0.0" - } - }, - "resumer": { - "version": "0.0.0", - "dev": true, - "requires": { - "through": "~2.3.4" - } - }, - "ret": { - "version": "0.1.15", - "dev": true - }, - "rimraf": { - "version": "2.6.3", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.6", - "dev": true, - "requires": { - "bn.js": "^4.11.1" - } - }, - "rustbn.js": { - "version": "0.2.0", - "dev": true - }, - "safe-buffer": { - "version": "5.2.1", - "dev": true - }, - "safe-event-emitter": { - "version": "1.0.1", - "dev": true, - "requires": { - "events": "^3.0.0" - } - }, - "safe-regex": { - "version": "1.1.0", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "dev": true - }, - "scrypt-js": { - "version": "3.0.1", - "dev": true - }, - "scryptsy": { - "version": "1.2.1", - "dev": true, - "optional": true, - "requires": { - "pbkdf2": "^3.0.3" - } - }, - "secp256k1": { - "version": "4.0.2", - "dev": true, - "requires": { - "elliptic": "^6.5.2", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "seedrandom": { - "version": "3.0.1", - "dev": true - }, - "semaphore": { - "version": "1.1.0", - "dev": true - }, - "send": { - "version": "0.17.1", - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "dev": true, - "optional": true - } - } - }, - "ms": { - "version": "2.1.1", - "dev": true, - "optional": true - } - } - }, - "serve-static": { - "version": "1.14.1", - "dev": true, - "optional": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "servify": { - "version": "0.1.12", - "dev": true, - "optional": true, - "requires": { - "body-parser": "^1.16.0", - "cors": "^2.8.1", - "express": "^4.14.0", - "request": "^2.79.0", - "xhr": "^2.3.3" - } - }, - "set-immediate-shim": { - "version": "1.0.1", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "dev": true - } - } - }, - "setimmediate": { - "version": "1.0.5", - "dev": true - }, - "setprototypeof": { - "version": "1.1.1", - "dev": true, - "optional": true - }, - "sha.js": { - "version": "2.4.11", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "simple-concat": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "simple-get": { - "version": "2.8.1", - "dev": true, - "optional": true, - "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, - "snapdragon": { - "version": "0.8.2", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "dev": true - }, - "ms": { - "version": "2.0.0", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.12", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sshpk": { - "version": "1.16.1", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "dependencies": { - "tweetnacl": { - "version": "0.14.5", - "dev": true - } - } - }, - "static-extend": { - "version": "0.1.2", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "dev": true - } - } - }, - "statuses": { - "version": "1.5.0", - "dev": true, - "optional": true - }, - "stream-to-pull-stream": { - "version": "1.7.3", - "dev": true, - "requires": { - "looper": "^3.0.0", - "pull-stream": "^3.2.3" - }, - "dependencies": { - "looper": { - "version": "3.0.0", - "dev": true - } - } - }, - "strict-uri-encode": { - "version": "1.1.0", - "dev": true, - "optional": true - }, - "string_decoder": { - "version": "1.1.1", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "dev": true - } - } - }, - "string.prototype.trim": { - "version": "1.2.3", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1" - } - }, - "string.prototype.trimend": { - "version": "1.0.3", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "string.prototype.trimstart": { - "version": "1.0.3", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3" - } - }, - "strip-hex-prefix": { - "version": "1.0.0", - "dev": true, - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, - "supports-color": { - "version": "5.5.0", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "swarm-js": { - "version": "0.1.40", - "dev": true, - "optional": true, - "requires": { - "bluebird": "^3.5.0", - "buffer": "^5.0.5", - "eth-lib": "^0.1.26", - "fs-extra": "^4.0.2", - "got": "^7.1.0", - "mime-types": "^2.1.16", - "mkdirp-promise": "^5.0.1", - "mock-fs": "^4.1.0", - "setimmediate": "^1.0.5", - "tar": "^4.0.2", - "xhr-request": "^1.0.1" - }, - "dependencies": { - "fs-extra": { - "version": "4.0.3", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "get-stream": { - "version": "3.0.0", - "dev": true, - "optional": true - }, - "got": { - "version": "7.1.0", - "dev": true, - "optional": true, - "requires": { - "decompress-response": "^3.2.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-plain-obj": "^1.1.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "isurl": "^1.0.0-alpha5", - "lowercase-keys": "^1.0.0", - "p-cancelable": "^0.3.0", - "p-timeout": "^1.1.1", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "url-parse-lax": "^1.0.0", - "url-to-options": "^1.0.1" - } - }, - "is-stream": { - "version": "1.1.0", - "dev": true, - "optional": true - }, - "p-cancelable": { - "version": "0.3.0", - "dev": true, - "optional": true - }, - "prepend-http": { - "version": "1.0.4", - "dev": true, - "optional": true - }, - "url-parse-lax": { - "version": "1.0.0", - "dev": true, - "optional": true, - "requires": { - "prepend-http": "^1.0.1" - } - } - } - }, - "tape": { - "version": "4.13.3", - "dev": true, - "requires": { - "deep-equal": "~1.1.1", - "defined": "~1.0.0", - "dotignore": "~0.1.2", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.6", - "has": "~1.0.3", - "inherits": "~2.0.4", - "is-regex": "~1.0.5", - "minimist": "~1.2.5", - "object-inspect": "~1.7.0", - "resolve": "~1.17.0", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.2.1", - "through": "~2.3.8" - }, - "dependencies": { - "glob": { - "version": "7.1.6", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "is-regex": { - "version": "1.0.5", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "object-inspect": { - "version": "1.7.0", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } - } - }, - "tar": { - "version": "4.4.13", - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "dependencies": { - "fs-minipass": { - "version": "1.2.7", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "minipass": { - "version": "2.9.0", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - } - } - }, - "through": { - "version": "2.3.8", - "dev": true - }, - "through2": { - "version": "2.0.5", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timed-out": { - "version": "4.0.1", - "dev": true, - "optional": true - }, - "tmp": { - "version": "0.1.0", - "dev": true, - "requires": { - "rimraf": "^2.6.3" - } - }, - "to-object-path": { - "version": "0.3.0", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "dev": true - }, - "kind-of": { - "version": "3.2.2", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-readable-stream": { - "version": "1.0.0", - "dev": true, - "optional": true - }, - "to-regex": { - "version": "3.0.2", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "toidentifier": { - "version": "1.0.0", - "dev": true, - "optional": true - }, - "tough-cookie": { - "version": "2.5.0", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "trim-right": { - "version": "1.0.1", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "1.0.3", - "dev": true - }, - "tweetnacl-util": { - "version": "0.15.1", - "dev": true - }, - "type": { - "version": "1.2.0", - "dev": true - }, - "type-is": { - "version": "1.6.18", - "dev": true, - "optional": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "typedarray": { - "version": "0.0.6", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "typewise": { - "version": "1.0.3", - "dev": true, - "requires": { - "typewise-core": "^1.2.0" - } - }, - "typewise-core": { - "version": "1.2.0", - "dev": true - }, - "typewiselite": { - "version": "1.0.0", - "dev": true - }, - "ultron": { - "version": "1.1.1", - "dev": true, - "optional": true - }, - "underscore": { - "version": "1.9.1", - "dev": true, - "optional": true - }, - "union-value": { - "version": "1.0.1", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "0.1.1", - "dev": true - } - } - }, - "universalify": { - "version": "0.1.2", - "dev": true - }, - "unorm": { - "version": "1.6.0", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "dev": true, - "optional": true - }, - "unset-value": { - "version": "1.0.0", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "dev": true - } - } - }, - "uri-js": { - "version": "4.4.1", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "dev": true - }, - "url-parse-lax": { - "version": "3.0.0", - "dev": true, - "optional": true, - "requires": { - "prepend-http": "^2.0.0" - } - }, - "url-set-query": { - "version": "1.0.0", - "dev": true, - "optional": true - }, - "url-to-options": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "use": { - "version": "3.1.1", - "dev": true - }, - "utf-8-validate": { - "version": "5.0.4", - "dev": true, - "requires": { - "node-gyp-build": "^4.2.0" - } - }, - "utf8": { - "version": "3.0.0", - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "dev": true - }, - "util.promisify": { - "version": "1.1.1", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "for-each": "^0.3.3", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.1" - } - }, - "utils-merge": { - "version": "1.0.1", - "dev": true, - "optional": true - }, - "uuid": { - "version": "3.4.0", - "dev": true - }, - "varint": { - "version": "5.0.2", - "dev": true, - "optional": true - }, - "vary": { - "version": "1.1.2", - "dev": true, - "optional": true - }, - "verror": { - "version": "1.10.0", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "web3": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "web3-bzz": "1.2.11", - "web3-core": "1.2.11", - "web3-eth": "1.2.11", - "web3-eth-personal": "1.2.11", - "web3-net": "1.2.11", - "web3-shh": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-bzz": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@types/node": "^12.12.6", - "got": "9.6.0", - "swarm-js": "^0.1.40", - "underscore": "1.9.1" - }, - "dependencies": { - "@types/node": { - "version": "12.19.12", - "dev": true, - "optional": true - } - } - }, - "web3-core": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@types/bn.js": "^4.11.5", - "@types/node": "^12.12.6", - "bignumber.js": "^9.0.0", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-requestmanager": "1.2.11", - "web3-utils": "1.2.11" - }, - "dependencies": { - "@types/node": { - "version": "12.19.12", - "dev": true, - "optional": true - } - } - }, - "web3-core-helpers": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "underscore": "1.9.1", - "web3-eth-iban": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-core-method": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/transactions": "^5.0.0-beta.135", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-core-promievent": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "eventemitter3": "4.0.4" - } - }, - "web3-core-requestmanager": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "web3-providers-http": "1.2.11", - "web3-providers-ipc": "1.2.11", - "web3-providers-ws": "1.2.11" - } - }, - "web3-core-subscriptions": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "eventemitter3": "4.0.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11" - } - }, - "web3-eth": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-eth-accounts": "1.2.11", - "web3-eth-contract": "1.2.11", - "web3-eth-ens": "1.2.11", - "web3-eth-iban": "1.2.11", - "web3-eth-personal": "1.2.11", - "web3-net": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-eth-abi": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@ethersproject/abi": "5.0.0-beta.153", - "underscore": "1.9.1", - "web3-utils": "1.2.11" - } - }, - "web3-eth-accounts": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "crypto-browserify": "3.12.0", - "eth-lib": "0.2.8", - "ethereumjs-common": "^1.3.2", - "ethereumjs-tx": "^2.1.1", - "scrypt-js": "^3.0.1", - "underscore": "1.9.1", - "uuid": "3.3.2", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-utils": "1.2.11" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.8", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - }, - "uuid": { - "version": "3.3.2", - "dev": true, - "optional": true - } - } - }, - "web3-eth-contract": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@types/bn.js": "^4.11.5", - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-eth-ens": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "content-hash": "^2.5.2", - "eth-ens-namehash": "2.0.8", - "underscore": "1.9.1", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-promievent": "1.2.11", - "web3-eth-abi": "1.2.11", - "web3-eth-contract": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-eth-iban": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.9", - "web3-utils": "1.2.11" - } - }, - "web3-eth-personal": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "@types/node": "^12.12.6", - "web3-core": "1.2.11", - "web3-core-helpers": "1.2.11", - "web3-core-method": "1.2.11", - "web3-net": "1.2.11", - "web3-utils": "1.2.11" - }, - "dependencies": { - "@types/node": { - "version": "12.19.12", - "dev": true, - "optional": true - } - } - }, - "web3-net": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "web3-core": "1.2.11", - "web3-core-method": "1.2.11", - "web3-utils": "1.2.11" - } - }, - "web3-provider-engine": { - "version": "14.2.1", - "dev": true, - "requires": { - "async": "^2.5.0", - "backoff": "^2.5.0", - "clone": "^2.0.0", - "cross-fetch": "^2.1.0", - "eth-block-tracker": "^3.0.0", - "eth-json-rpc-infura": "^3.1.0", - "eth-sig-util": "3.0.0", - "ethereumjs-block": "^1.2.2", - "ethereumjs-tx": "^1.2.0", - "ethereumjs-util": "^5.1.5", - "ethereumjs-vm": "^2.3.4", - "json-rpc-error": "^2.0.0", - "json-stable-stringify": "^1.0.1", - "promise-to-callback": "^1.0.0", - "readable-stream": "^2.2.9", - "request": "^2.85.0", - "semaphore": "^1.0.3", - "ws": "^5.1.1", - "xhr": "^2.2.0", - "xtend": "^4.0.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.6.3", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - }, - "deferred-leveldown": { - "version": "1.2.2", - "dev": true, - "requires": { - "abstract-leveldown": "~2.6.0" - } - }, - "eth-sig-util": { - "version": "1.4.2", - "dev": true, - "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git", - "ethereumjs-util": "^5.1.1" - } - }, - "ethereumjs-account": { - "version": "2.0.5", - "dev": true, - "requires": { - "ethereumjs-util": "^5.0.0", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-block": { - "version": "1.7.1", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereum-common": "0.2.0", - "ethereumjs-tx": "^1.2.2", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereum-common": { - "version": "0.2.0", - "dev": true - } - } - }, - "ethereumjs-tx": { - "version": "1.3.7", - "dev": true, - "requires": { - "ethereum-common": "^0.0.18", - "ethereumjs-util": "^5.0.0" - } - }, - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, - "ethereumjs-vm": { - "version": "2.6.0", - "dev": true, - "requires": { - "async": "^2.1.2", - "async-eventemitter": "^0.2.2", - "ethereumjs-account": "^2.0.3", - "ethereumjs-block": "~2.2.0", - "ethereumjs-common": "^1.1.0", - "ethereumjs-util": "^6.0.0", - "fake-merkle-patricia-tree": "^1.0.1", - "functional-red-black-tree": "^1.0.1", - "merkle-patricia-tree": "^2.3.2", - "rustbn.js": "~0.2.0", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "ethereumjs-block": { - "version": "2.2.2", - "dev": true, - "requires": { - "async": "^2.0.1", - "ethereumjs-common": "^1.5.0", - "ethereumjs-tx": "^2.1.1", - "ethereumjs-util": "^5.0.0", - "merkle-patricia-tree": "^2.1.2" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, - "ethereumjs-tx": { - "version": "2.1.2", - "dev": true, - "requires": { - "ethereumjs-common": "^1.5.0", - "ethereumjs-util": "^6.0.0" - } - }, - "ethereumjs-util": { - "version": "6.2.1", - "dev": true, - "requires": { - "@types/bn.js": "^4.11.3", - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "0.1.6", - "rlp": "^2.2.3" - } - } - } - }, - "isarray": { - "version": "0.0.1", - "dev": true - }, - "level-codec": { - "version": "7.0.1", - "dev": true - }, - "level-errors": { - "version": "1.0.5", - "dev": true, - "requires": { - "errno": "~0.1.1" - } - }, - "level-iterator-stream": { - "version": "1.3.1", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "level-errors": "^1.0.3", - "readable-stream": "^1.0.33", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.1.14", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - } - } - }, - "level-ws": { - "version": "0.0.0", - "dev": true, - "requires": { - "readable-stream": "~1.0.15", - "xtend": "~2.1.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "xtend": { - "version": "2.1.2", - "dev": true, - "requires": { - "object-keys": "~0.4.0" - } - } - } - }, - "levelup": { - "version": "1.3.9", - "dev": true, - "requires": { - "deferred-leveldown": "~1.2.1", - "level-codec": "~7.0.0", - "level-errors": "~1.0.3", - "level-iterator-stream": "~1.3.0", - "prr": "~1.0.1", - "semver": "~5.4.1", - "xtend": "~4.0.0" - } - }, - "ltgt": { - "version": "2.2.1", - "dev": true - }, - "memdown": { - "version": "1.4.1", - "dev": true, - "requires": { - "abstract-leveldown": "~2.7.1", - "functional-red-black-tree": "^1.0.1", - "immediate": "^3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.1.1" - }, - "dependencies": { - "abstract-leveldown": { - "version": "2.7.2", - "dev": true, - "requires": { - "xtend": "~4.0.0" - } - } - } - }, - "merkle-patricia-tree": { - "version": "2.3.2", - "dev": true, - "requires": { - "async": "^1.4.2", - "ethereumjs-util": "^5.0.0", - "level-ws": "0.0.0", - "levelup": "^1.2.1", - "memdown": "^1.0.0", - "readable-stream": "^2.0.0", - "rlp": "^2.0.0", - "semaphore": ">=1.0.1" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "dev": true - } - } - }, - "object-keys": { - "version": "0.4.0", - "dev": true - }, - "safe-buffer": { - "version": "5.1.2", - "dev": true - }, - "semver": { - "version": "5.4.1", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "dev": true - }, - "ws": { - "version": "5.2.2", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - } - } - }, - "web3-providers-http": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "web3-core-helpers": "1.2.11", - "xhr2-cookies": "1.1.0" - } - }, - "web3-providers-ipc": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "oboe": "2.1.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11" - } - }, - "web3-providers-ws": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "eventemitter3": "4.0.4", - "underscore": "1.9.1", - "web3-core-helpers": "1.2.11", - "websocket": "^1.0.31" - } - }, - "web3-shh": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "web3-core": "1.2.11", - "web3-core-method": "1.2.11", - "web3-core-subscriptions": "1.2.11", - "web3-net": "1.2.11" - } - }, - "web3-utils": { - "version": "1.2.11", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.9", - "eth-lib": "0.2.8", - "ethereum-bloom-filters": "^1.0.6", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "underscore": "1.9.1", - "utf8": "3.0.0" - }, - "dependencies": { - "eth-lib": { - "version": "0.2.8", - "dev": true, - "optional": true, - "requires": { - "bn.js": "^4.11.6", - "elliptic": "^6.4.0", - "xhr-request-promise": "^0.1.2" - } - } - } - }, - "websocket": { - "version": "1.0.32", - "dev": true, - "requires": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "dev": true - } - } - }, - "whatwg-fetch": { - "version": "2.0.4", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "dev": true - }, - "ws": { - "version": "3.3.3", - "dev": true, - "optional": true, - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "dev": true, - "optional": true - } - } - }, - "xhr": { - "version": "2.6.0", - "dev": true, - "requires": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } - }, - "xhr-request": { - "version": "1.1.0", - "dev": true, - "optional": true, - "requires": { - "buffer-to-arraybuffer": "^0.0.5", - "object-assign": "^4.1.1", - "query-string": "^5.0.1", - "simple-get": "^2.7.0", - "timed-out": "^4.0.1", - "url-set-query": "^1.0.0", - "xhr": "^2.0.4" - } - }, - "xhr-request-promise": { - "version": "0.1.3", - "dev": true, - "optional": true, - "requires": { - "xhr-request": "^1.1.0" - } - }, - "xhr2-cookies": { - "version": "1.1.0", - "dev": true, - "optional": true, - "requires": { - "cookiejar": "^2.1.1" - } - }, - "xtend": { - "version": "4.0.2", - "dev": true - }, - "yaeti": { - "version": "0.0.6", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "dev": true - } - } - }, - "get-caller-file": { - "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 - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", - "dev": true - }, - "get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "got": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/got/-/got-12.6.1.tgz", - "integrity": "sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==", - "dev": true, - "requires": { - "@sindresorhus/is": "^5.2.0", - "@szmarczak/http-timer": "^5.0.1", - "cacheable-lookup": "^7.0.0", - "cacheable-request": "^10.2.8", - "decompress-response": "^6.0.0", - "form-data-encoder": "^2.1.2", - "get-stream": "^6.0.1", - "http2-wrapper": "^2.1.10", - "lowercase-keys": "^3.0.0", - "p-cancelable": "^3.0.0", - "responselike": "^3.0.0" - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "hardhat": { - "version": "2.24.2", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.24.2.tgz", - "integrity": "sha512-oYt+tcN2379Z3kqIhvVw6IFgWqTm/ixcrTvyAuQdE2RbD+kknwF7hDfUeggy0akrw6xdgCtXvnw9DFrxAB70hA==", - "dev": true, - "requires": { - "@ethereumjs/util": "^9.1.0", - "@ethersproject/abi": "^5.1.2", - "@nomicfoundation/edr": "^0.11.0", - "@nomicfoundation/solidity-analyzer": "^0.1.0", - "@sentry/node": "^5.18.1", - "@types/bn.js": "^5.1.0", - "@types/lru-cache": "^5.1.0", - "adm-zip": "^0.4.16", - "aggregate-error": "^3.0.0", - "ansi-escapes": "^4.3.0", - "boxen": "^5.1.2", - "chokidar": "^4.0.0", - "ci-info": "^2.0.0", - "debug": "^4.1.1", - "enquirer": "^2.3.0", - "env-paths": "^2.2.0", - "ethereum-cryptography": "^1.0.3", - "find-up": "^5.0.0", - "fp-ts": "1.19.3", - "fs-extra": "^7.0.1", - "immutable": "^4.0.0-rc.12", - "io-ts": "1.10.4", - "json-stream-stringify": "^3.1.4", - "keccak": "^3.0.2", - "lodash": "^4.17.11", - "micro-eth-signer": "^0.14.0", - "mnemonist": "^0.38.0", - "mocha": "^10.0.0", - "p-map": "^4.0.0", - "picocolors": "^1.1.0", - "raw-body": "^2.4.1", - "resolve": "1.17.0", - "semver": "^6.3.0", - "solc": "0.8.26", - "source-map-support": "^0.5.13", - "stacktrace-parser": "^0.1.10", - "tinyglobby": "^0.2.6", - "tsort": "0.0.1", - "undici": "^5.14.0", - "uuid": "^8.3.2", - "ws": "^7.4.6" - }, - "dependencies": { - "chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "requires": { - "readdirp": "^4.0.1" - } - }, - "commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "solc": { - "version": "0.8.26", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", - "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", - "dev": true, - "requires": { - "command-exists": "^1.2.8", - "commander": "^8.1.0", - "follow-redirects": "^1.12.1", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "dependencies": { - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - } - } - } - } - }, - "hardhat-deploy": { - "version": "0.11.34", - "resolved": "https://registry.npmjs.org/hardhat-deploy/-/hardhat-deploy-0.11.34.tgz", - "integrity": "sha512-N6xcwD8LSMV/IyfEr8TfR2YRbOh9Q4QvitR9MKZRTXQmgQiiMGjX+2efMjKgNMxwCVlmpfnE1tyDxOJOOUseLQ==", - "dev": true, - "requires": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/contracts": "^5.7.0", - "@ethersproject/providers": "^5.7.2", - "@ethersproject/solidity": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wallet": "^5.7.0", - "@types/qs": "^6.9.7", - "axios": "^0.21.1", - "chalk": "^4.1.2", - "chokidar": "^3.5.2", - "debug": "^4.3.2", - "enquirer": "^2.3.6", - "ethers": "^5.5.3", - "form-data": "^4.0.0", - "fs-extra": "^10.0.0", - "match-all": "^1.2.6", - "murmur-128": "^0.2.1", - "qs": "^6.9.4", - "zksync-web3": "^0.14.3" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "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, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - } - } - }, - "hardhat-deploy-ethers": { - "version": "0.3.0-beta.13", - "resolved": "https://registry.npmjs.org/hardhat-deploy-ethers/-/hardhat-deploy-ethers-0.3.0-beta.13.tgz", - "integrity": "sha512-PdWVcKB9coqWV1L7JTpfXRCI91Cgwsm7KLmBcwZ8f0COSm1xtABHZTyz3fvF6p42cTnz1VM0QnfDvMFlIRkSNw==", - "dev": true, - "requires": {} - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "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 - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, - "http-errors": { - "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, - "requires": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "http2-wrapper": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz", - "integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==", - "dev": true, - "requires": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.2.0" - } - }, - "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, - "requires": { - "agent-base": "6", - "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "idna-uts46-hx": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz", - "integrity": "sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA==", - "dev": true, - "requires": { - "punycode": "2.1.0" - } - }, - "ignore": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", - "dev": true - }, - "immutable": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.2.2.tgz", - "integrity": "sha512-fTMKDwtbvO5tldky9QZ2fMX7slR0mYpY5nbnFWYp0fOzDhHqhgIw9KoYgxLWsoNTS9ZHGauHj18DTyEw6BK3Og==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imul": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/imul/-/imul-1.0.1.tgz", - "integrity": "sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==", - "dev": true - }, - "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 - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", - "dev": true - }, - "io-ts": { - "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, - "requires": { - "fp-ts": "^1.0.0" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "is-binary-path": { - "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, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-hex-prefixed": { - "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 - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-obj": { - "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 - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "is-unicode-supported": { - "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 - }, - "is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "requires": { - "is-docker": "^2.0.0" - } - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "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 - }, - "json-stringify-safe": { - "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 - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", - "dev": true, - "requires": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0", - "readable-stream": "^3.6.0" - } - }, - "keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "requires": { - "json-buffer": "3.0.1" - } - }, - "klaw": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.9" - } - }, - "klaw-sync": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", - "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11" - } - }, - "latest-version": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-7.0.0.tgz", - "integrity": "sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==", - "dev": true, - "requires": { - "package-json": "^8.1.0" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - } - } - }, - "locate-path": { - "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, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==", - "dev": true - }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true - }, - "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, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "dev": true, - "requires": { - "get-func-name": "^2.0.0" - } - }, - "lowercase-keys": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", - "integrity": "sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==", - "dev": true - }, - "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 - }, - "match-all": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", - "integrity": "sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ==", - "dev": true - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", - "dev": true - }, - "micro-eth-signer": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/micro-eth-signer/-/micro-eth-signer-0.14.0.tgz", - "integrity": "sha512-5PLLzHiVYPWClEvZIXXFu5yutzpadb73rnQCpUqIHu3No3coFuWQNfE5tkBQJ7djuLYl6aRLaS0MgWJYGoqiBw==", - "dev": true, - "requires": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "micro-packed": "~0.7.2" - }, - "dependencies": { - "@noble/hashes": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.2.tgz", - "integrity": "sha512-biZ0NUSxyjLLqo6KxEJ1b+C2NAx0wtDoFvCaXHGgUkeHzf3Xc1xKumFKREuT7f7DARNZ/slvYUwFG6B0f2b6hQ==", - "dev": true - } - } - }, - "micro-packed": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/micro-packed/-/micro-packed-0.7.3.tgz", - "integrity": "sha512-2Milxs+WNC00TRlem41oRswvw31146GiSaoCT7s3Xi2gMUglW5QBeqlQaZeHr5tJx9nm3i57LNXPqxOOaWtTYg==", - "dev": true, - "requires": { - "@scure/base": "~1.2.5" - }, - "dependencies": { - "@scure/base": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", - "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", - "dev": true - } - } - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, - "mimic-response": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", - "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "dev": true - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "mnemonist": { - "version": "0.38.5", - "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", - "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", - "dev": true, - "requires": { - "obliterator": "^2.0.0" - } - }, - "mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", - "dev": true, - "requires": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "dependencies": { - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "murmur-128": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/murmur-128/-/murmur-128-0.2.1.tgz", - "integrity": "sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg==", - "dev": true, - "requires": { - "encode-utf8": "^1.0.2", - "fmix": "^0.1.0", - "imul": "^1.0.0" - } - }, - "nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", - "dev": true - }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.1.tgz", - "integrity": "sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==", - "dev": true - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", - "dev": true - }, - "number-to-bn": { - "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, - "requires": { - "bn.js": "4.11.6", - "strip-hex-prefix": "1.0.0" - }, - "dependencies": { - "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 - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, - "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", - "dev": true - }, - "obliterator": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", - "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", - "dev": true - }, - "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, - "requires": { - "wrappy": "1" - } - }, - "open": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", - "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", - "dev": true, - "requires": { - "is-docker": "^2.0.0", - "is-wsl": "^2.1.1" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", - "dev": true - }, - "p-cancelable": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-3.0.0.tgz", - "integrity": "sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==", - "dev": true - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "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, - "requires": { - "p-limit": "^3.0.2" - } - }, - "p-map": { - "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, - "requires": { - "aggregate-error": "^3.0.0" - } - }, - "package-json": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-8.1.1.tgz", - "integrity": "sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==", - "dev": true, - "requires": { - "got": "^12.1.0", - "registry-auth-token": "^5.0.1", - "registry-url": "^6.0.0", - "semver": "^7.3.7" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "patch-package": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-6.5.1.tgz", - "integrity": "sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==", - "dev": true, - "requires": { - "@yarnpkg/lockfile": "^1.1.0", - "chalk": "^4.1.2", - "cross-spawn": "^6.0.5", - "find-yarn-workspace-root": "^2.0.0", - "fs-extra": "^9.0.0", - "is-ci": "^2.0.0", - "klaw-sync": "^6.0.0", - "minimist": "^1.2.6", - "open": "^7.4.2", - "rimraf": "^2.6.3", - "semver": "^5.6.0", - "slash": "^2.0.0", - "tmp": "^0.0.33", - "yaml": "^1.10.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "fs-extra": { - "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, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - } - } - }, - "path-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true - }, - "path-exists": { - "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 - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true - }, - "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 - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, - "picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true - }, - "postinstall-postinstall": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz", - "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==", - "dev": true - }, - "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true - }, - "prettier-plugin-solidity": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.4.2.tgz", - "integrity": "sha512-VVD/4XlDjSzyPWWCPW8JEleFa8JNKFYac5kNlMjVXemQyQZKfpekPMhFZSePuXB6L+RixlFvWe20iacGjFYrLw==", - "dev": true, - "requires": { - "@solidity-parser/parser": "^0.19.0", - "semver": "^7.6.3" - } - }, - "proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true - }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "punycode": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz", - "integrity": "sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==", - "dev": true - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", - "dev": true - }, - "quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dev": true, - "requires": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true - } - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - } - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "registry-auth-token": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.3.tgz", - "integrity": "sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA==", - "dev": true, - "requires": { - "@pnpm/npm-conf": "^2.1.0" - } - }, - "registry-url": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", - "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", - "dev": true, - "requires": { - "rc": "1.2.8" - } - }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - } - } - }, - "require-directory": { - "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 - }, - "require-from-string": { - "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 - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==", - "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "responselike": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", - "integrity": "sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==", - "dev": true, - "requires": { - "lowercase-keys": "^3.0.0" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dev": true, - "requires": { - "bn.js": "^5.2.0" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", - "dev": true - }, - "secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "dev": true, - "requires": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - } - }, - "semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true - }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", - "dev": true - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - } - } - }, - "solc": { - "version": "0.6.12", - "resolved": "https://registry.npmjs.org/solc/-/solc-0.6.12.tgz", - "integrity": "sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g==", - "dev": true, - "requires": { - "command-exists": "^1.2.8", - "commander": "3.0.2", - "fs-extra": "^0.30.0", - "js-sha3": "0.8.0", - "memorystream": "^0.3.1", - "require-from-string": "^2.0.0", - "semver": "^5.5.0", - "tmp": "0.0.33" - }, - "dependencies": { - "fs-extra": { - "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^2.1.0", - "klaw": "^1.0.0", - "path-is-absolute": "^1.0.0", - "rimraf": "^2.2.8" - } - }, - "jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "solhint": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/solhint/-/solhint-5.0.5.tgz", - "integrity": "sha512-WrnG6T+/UduuzSWsSOAbfq1ywLUDwNea3Gd5hg6PS+pLUm8lz2ECNr0beX609clBxmDeZ3676AiA9nPDljmbJQ==", - "dev": true, - "requires": { - "@solidity-parser/parser": "^0.19.0", - "ajv": "^6.12.6", - "antlr4": "^4.13.1-patch-1", - "ast-parents": "^0.0.1", - "chalk": "^4.1.2", - "commander": "^10.0.0", - "cosmiconfig": "^8.0.0", - "fast-diff": "^1.2.0", - "glob": "^8.0.3", - "ignore": "^5.2.4", - "js-yaml": "^4.1.0", - "latest-version": "^7.0.0", - "lodash": "^4.17.21", - "pluralize": "^8.0.0", - "prettier": "^2.8.3", - "semver": "^7.5.2", - "strip-ansi": "^6.0.1", - "table": "^6.8.1", - "text-table": "^0.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "dev": true - }, - "glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "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, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", - "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", - "dev": true - }, - "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "dependencies": { - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - } - } - }, - "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, - "requires": { - "type-fest": "^0.7.1" - }, - "dependencies": { - "type-fest": { - "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 - } - } - }, - "statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true - }, - "streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-hex-prefix": { - "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, - "requires": { - "is-hex-prefixed": "1.0.0" - } - }, - "strip-json-comments": { - "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 - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "table": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", - "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "dependencies": { - "ajv": { - "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, - "requires": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "test-value": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", - "dev": true, - "requires": { - "array-back": "^1.0.3", - "typical": "^2.6.0" - }, - "dependencies": { - "array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "requires": { - "typical": "^2.6.0" - } - } - } - }, - "testrpc": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/testrpc/-/testrpc-0.0.1.tgz", - "integrity": "sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA==", - "dev": true - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "tinyglobby": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", - "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", - "dev": true, - "requires": { - "fdir": "^6.4.4", - "picomatch": "^4.0.2" - }, - "dependencies": { - "fdir": { - "version": "6.4.5", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.5.tgz", - "integrity": "sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==", - "dev": true, - "requires": {} - }, - "picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true - } - } - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "to-regex-range": { - "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, - "requires": { - "is-number": "^7.0.0" - } - }, - "toidentifier": { - "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 - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, - "ts-essentials": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-1.0.4.tgz", - "integrity": "sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==", - "dev": true - }, - "ts-generator": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ts-generator/-/ts-generator-0.1.1.tgz", - "integrity": "sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ==", - "dev": true, - "requires": { - "@types/mkdirp": "^0.5.2", - "@types/prettier": "^2.1.1", - "@types/resolve": "^0.0.8", - "chalk": "^2.4.1", - "glob": "^7.1.2", - "mkdirp": "^0.5.1", - "prettier": "^2.1.2", - "resolve": "^1.8.1", - "ts-essentials": "^1.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsort": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-fest": { - "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 - }, - "typechain": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/typechain/-/typechain-3.0.0.tgz", - "integrity": "sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==", - "dev": true, - "requires": { - "command-line-args": "^4.0.7", - "debug": "^4.1.1", - "fs-extra": "^7.0.0", - "js-sha3": "^0.8.0", - "lodash": "^4.17.15", - "ts-essentials": "^6.0.3", - "ts-generator": "^0.1.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "ts-essentials": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.7.tgz", - "integrity": "sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==", - "dev": true, - "requires": {} - } - } - }, - "typescript": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", - "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", - "dev": true, - "peer": true - }, - "typical": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==", - "dev": true - }, - "undici": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.14.0.tgz", - "integrity": "sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==", - "dev": true, - "requires": { - "busboy": "^1.6.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", - "dev": true - } - } - }, - "utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "web3-utils": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.8.1.tgz", - "integrity": "sha512-LgnM9p6V7rHHUGfpMZod+NST8cRfGzJ1BTXAyNo7A9cJX9LczBfSRxJp+U/GInYe9mby40t3v22AJdlELibnsQ==", - "dev": true, - "requires": { - "bn.js": "^5.2.1", - "ethereum-bloom-filters": "^1.0.6", - "ethereumjs-util": "^7.1.0", - "ethjs-unit": "0.1.6", - "number-to-bn": "1.7.0", - "randombytes": "^2.1.0", - "utf8": "3.0.0" - }, - "dependencies": { - "ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dev": true, - "requires": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dev": true, - "requires": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - } - } - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==", - "dev": true - }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==", - "dev": true - }, - "workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true - }, - "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, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "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 - }, - "ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "dev": true, - "requires": {} - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true - }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "is-fullwidth-code-point": { - "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 - }, - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } - } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - } - }, - "yocto-queue": { - "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 - }, - "zksync-web3": { - "version": "0.14.3", - "resolved": "https://registry.npmjs.org/zksync-web3/-/zksync-web3-0.14.3.tgz", - "integrity": "sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ==", - "dev": true, - "requires": {} } } } diff --git a/package.json b/package.json index cb36df8..8d972d4 100644 --- a/package.json +++ b/package.json @@ -4,29 +4,31 @@ "scripts": { "test": "npm run lint && hardhat test", "fuzz": "hardhat compile && fuzzing/fuzz.sh", - "start": "hardhat node --export deployment-localhost.json", + "start": "concurrently --names \"hardhat,deployment\" --prefix \"[{time} {name}]\" \"hardhat node\" \"sleep 2 && npm run mine && npm run deploy -- --network localhost\"", "compile": "hardhat compile", - "format": "prettier --write contracts/*.sol contracts/**/*.sol test/**/*.js", - "format:check": "prettier --check contracts/*.sol contracts/**/*.sol test/**/*.js", + "format": "prettier --write test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol ", + "format:check": "prettier --check test/**/*.js --plugin=prettier-plugin-solidity contracts/**/*.sol", "lint": "solhint contracts/**.sol", - "deploy": "hardhat deploy", + "deploy": "hardhat ignition deploy ignition/modules/marketplace.js", + "mine": "hardhat run scripts/mine.js --network localhost", "verify": "npm run verify:marketplace && npm run verify:state_changes", "verify:marketplace": "certoraRun certora/confs/Marketplace.conf", - "verify:state_changes": "certoraRun certora/confs/StateChanges.conf" + "verify:state_changes": "certoraRun certora/confs/StateChanges.conf", + "coverage": "hardhat coverage", + "gas:report": "REPORT_GAS=true hardhat test" }, "devDependencies": { - "@nomiclabs/hardhat-ethers": "^2.2.1", - "@nomiclabs/hardhat-waffle": "^2.0.3", "@openzeppelin/contracts": "^5.3.0", - "@stdlib/stats-binomial-test": "^0.0.7", - "chai": "^4.3.7", - "ethereum-waffle": "^3.4.4", - "ethers": "^5.7.2", - "hardhat": "^2.24.2", - "hardhat-deploy": "^0.11.34", - "hardhat-deploy-ethers": "^0.3.0-beta.13", - "prettier": "^2.8.2", - "prettier-plugin-solidity": "^1.4.2", - "solhint": "^5.0.5" + "@nomicfoundation/hardhat-chai-matchers": "^2.0.8", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.11", + "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "@stdlib/stats-binomial-test": "^0.2.2", + "chai": "^4.5.0", + "ethers": "6.14.4", + "hardhat": "^2.24.3", + "prettier": "^3.5.3", + "prettier-plugin-solidity": "^1.4.3", + "solhint": "^5.1.0", + "concurrently": "^9.1.2" } } diff --git a/scripts/mine.js b/scripts/mine.js new file mode 100644 index 0000000..08b52ef --- /dev/null +++ b/scripts/mine.js @@ -0,0 +1,7 @@ +const { mine } = require("@nomicfoundation/hardhat-network-helpers") + +async function main() { + await mine(256) +} + +main().catch(console.error) diff --git a/test/Endian.test.js b/test/Endian.test.js index 8d328c8..02a3be2 100644 --- a/test/Endian.test.js +++ b/test/Endian.test.js @@ -1,5 +1,5 @@ const { expect } = require("chai") -const { ethers } = require("hardhat") +const EndianModule = require("../ignition/modules/endian") describe("Endian", function () { const big = @@ -10,8 +10,8 @@ describe("Endian", function () { let endian beforeEach(async function () { - let Endian = await ethers.getContractFactory("TestEndian") - endian = await Endian.deploy() + const { testEndian } = await ignition.deploy(EndianModule) + endian = testEndian }) it("converts from little endian to big endian", async function () { diff --git a/test/Marketplace.test.js b/test/Marketplace.test.js index 9904a40..153f9a1 100644 --- a/test/Marketplace.test.js +++ b/test/Marketplace.test.js @@ -1,6 +1,5 @@ -const { ethers } = require("hardhat") -const { AddressZero } = ethers.constants -const { BigNumber } = ethers +const { ethers, ignition } = require("hardhat") +const { ZeroAddress } = ethers const { expect } = require("chai") const { exampleConfiguration, @@ -22,41 +21,34 @@ const { waitUntilFailed, waitUntilSlotFailed, patchOverloads, + littleEndianToBigInt, } = require("./marketplace") const { maxPrice, pricePerSlotPerSecond, - payoutForDuration, + calculatePartialPayout, + calculateBalance, } = require("./price") const { collateralPerSlot } = require("./collateral") const { - snapshot, - revert, ensureMinimumBlockHeight, advanceTime, advanceTimeTo, currentTime, + snapshot, + revert, setNextBlockTimestamp, } = require("./evm") -const { arrayify } = require("ethers/lib/utils") +const { getBytes } = require("ethers") +const MarketplaceModule = require("../ignition/modules/marketplace") +const { assertDeploymentRejectedWithCustomError } = require("./helpers") -const ACCOUNT_STARTING_BALANCE = 1_000_000_000_000_000 +const ACCOUNT_STARTING_BALANCE = 1_000_000_000_000_000n describe("Marketplace constructor", function () { - let Marketplace, token, verifier, config - beforeEach(async function () { await snapshot() await ensureMinimumBlockHeight(256) - - const TestToken = await ethers.getContractFactory("TestToken") - token = await TestToken.deploy() - - const TestVerifier = await ethers.getContractFactory("TestVerifier") - verifier = await TestVerifier.deploy() - - Marketplace = await ethers.getContractFactory("TestMarketplace") - config = exampleConfiguration() }) afterEach(async function () { @@ -65,30 +57,49 @@ describe("Marketplace constructor", function () { function testPercentageOverflow(property, expectedError) { it(`should reject for ${property} overflowing percentage values`, async () => { + const config = exampleConfiguration() config.collateral[property] = 101 - await expect( - Marketplace.deploy(config, token.address, verifier.address) - ).to.be.revertedWith(expectedError) + const promise = ignition.deploy(MarketplaceModule, { + parameters: { + Marketplace: { + configuration: config, + }, + }, + }) + + assertDeploymentRejectedWithCustomError(expectedError, promise) }) } testPercentageOverflow( "repairRewardPercentage", - "Marketplace_RepairRewardPercentageTooHigh" + "Marketplace_RepairRewardPercentageTooHigh", ) testPercentageOverflow( "slashPercentage", - "Marketplace_SlashPercentageTooHigh" + "Marketplace_SlashPercentageTooHigh", ) it("should reject when total slash percentage exceeds 100%", async () => { + const config = exampleConfiguration() config.collateral.slashPercentage = 1 config.collateral.maxNumberOfSlashes = 101 - await expect( - Marketplace.deploy(config, token.address, verifier.address) - ).to.be.revertedWith("Marketplace_MaximumSlashingTooHigh") + const expectedError = "Marketplace_MaximumSlashingTooHigh" + + const promise = ignition.deploy(MarketplaceModule, { + parameters: { + Marketplace: { + configuration: config, + }, + }, + }) + + assertDeploymentRejectedWithCustomError( + "Marketplace_MaximumSlashingTooHigh", + promise, + ) }) }) @@ -98,7 +109,6 @@ describe("Marketplace", function () { let marketplace let token - let verifier let client, clientWithdrawRecipient, host, @@ -115,6 +125,7 @@ describe("Marketplace", function () { beforeEach(async function () { await snapshot() + await ensureMinimumBlockHeight(256) ;[ client, @@ -128,8 +139,20 @@ describe("Marketplace", function () { ] = await ethers.getSigners() host = host1 - const TestToken = await ethers.getContractFactory("TestToken") - token = await TestToken.deploy() + const { testMarketplace, token: _token } = await ignition.deploy( + MarketplaceModule, + { + parameters: { + Marketplace: { + configuration: config, + }, + }, + }, + ) + + marketplace = testMarketplace + token = _token + for (let account of [ client, clientWithdrawRecipient, @@ -143,15 +166,6 @@ describe("Marketplace", function () { await token.mint(account.address, ACCOUNT_STARTING_BALANCE) } - const TestVerifier = await ethers.getContractFactory("TestVerifier") - verifier = await TestVerifier.deploy() - - const Marketplace = await ethers.getContractFactory("TestMarketplace") - marketplace = await Marketplace.deploy( - config, - token.address, - verifier.address - ) patchOverloads(marketplace) request = await exampleRequest() @@ -179,7 +193,7 @@ describe("Marketplace", function () { }) it("emits event when storage is requested", async function () { - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) const now = await currentTime() await setNextBlockTimestamp(now) const expectedExpiry = now + request.expiry @@ -189,7 +203,7 @@ describe("Marketplace", function () { }) it("allows retrieval of request details", async function () { - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) const id = requestId(request) expect(await marketplace.getRequest(id)).to.be.request(request) @@ -197,110 +211,143 @@ describe("Marketplace", function () { it("rejects request with invalid client address", async function () { let invalid = { ...request, client: host.address } - await token.approve(marketplace.address, maxPrice(invalid)) - await expect(marketplace.requestStorage(invalid)).to.be.revertedWith( - "Marketplace_InvalidClientAddress" + await token.approve(await marketplace.getAddress(), maxPrice(invalid)) + await expect( + marketplace.requestStorage(invalid), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InvalidClientAddress", ) }) it("rejects request with duration exceeding limit", async function () { request.ask.duration = config.requestDurationLimit + 1 - await token.approve(marketplace.address, collateralPerSlot(request)) - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_DurationExceedsLimit" + await token.approve( + await marketplace.getAddress(), + collateralPerSlot(request), + ) + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_DurationExceedsLimit", ) }) it("rejects request with insufficient payment", async function () { let insufficient = maxPrice(request) - 1 - await token.approve(marketplace.address, insufficient) - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "ERC20InsufficientAllowance" - ) + await token.approve(await marketplace.getAddress(), insufficient) + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError(token, "ERC20InsufficientAllowance") }) it("rejects request when expiry out of bounds", async function () { - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) request.expiry = request.ask.duration + 1 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InvalidExpiry" - ) + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidExpiry") request.expiry = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InvalidExpiry" - ) + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidExpiry") }) it("is rejected with insufficient slots ", async function () { request.ask.slots = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InsufficientSlots" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InsufficientSlots", ) }) it("is rejected when maxSlotLoss exceeds slots", async function () { request.ask.maxSlotLoss = request.ask.slots + 1 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InvalidMaxSlotLoss" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InvalidMaxSlotLoss", ) }) it("rejects resubmission of request", async function () { - await token.approve(marketplace.address, maxPrice(request) * 2) + await token.approve(await marketplace.getAddress(), maxPrice(request) * 2) await marketplace.requestStorage(request) - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_RequestAlreadyExists" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_RequestAlreadyExists", ) }) it("is rejected when insufficient duration", async function () { request.ask.duration = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, // request.expiry has to be > 0 and // request.expiry < request.ask.duration // so request.ask.duration will trigger "Marketplace_InvalidExpiry" - "Marketplace_InvalidExpiry" + "Marketplace_InvalidExpiry", ) }) it("is rejected when insufficient proofProbability", async function () { request.ask.proofProbability = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InsufficientProofProbability" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InsufficientProofProbability", ) }) it("is rejected when insufficient collateral", async function () { request.ask.collateralPerByte = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InsufficientCollateral" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InsufficientCollateral", ) }) it("is rejected when insufficient reward", async function () { request.ask.pricePerBytePerSecond = 0 - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InsufficientReward" + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InsufficientReward", ) }) it("is rejected when cid is missing", async function () { - request.content.cid = [] - await expect(marketplace.requestStorage(request)).to.be.revertedWith( - "Marketplace_InvalidCid" - ) + request.content.cid = Buffer.from("") + await expect( + marketplace.requestStorage(request), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidCid") }) }) describe("filling a slot with collateral", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) - await token.approve(marketplace.address, collateralPerSlot(request)) + await token.approve( + await marketplace.getAddress(), + collateralPerSlot(request), + ) }) it("emits event when slot is filled", async function () { @@ -311,10 +358,12 @@ describe("Marketplace", function () { }) it("allows retrieval of host that filled slot", async function () { - expect(await marketplace.getHost(slotId(slot))).to.equal(AddressZero) + expect(await marketplace.getHost(slotId(slot))).to.equal(ZeroAddress) await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) - expect(await marketplace.getHost(slotId(slot))).to.equal(host.address) + expect(await marketplace.getHost(slotId(slot))).to.equal( + await host.getAddress(), + ) }) it("gives discount on the collateral for repaired slot", async function () { @@ -322,7 +371,7 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) await marketplace.freeSlot(slotId(slot)) expect(await marketplace.slotState(slotId(slot))).to.equal( - SlotState.Repair + SlotState.Repair, ) // We need to advance the time to next period, because filling slot @@ -335,22 +384,22 @@ describe("Marketplace", function () { const discountedCollateral = collateral - Math.round( - (collateral * config.collateral.repairRewardPercentage) / 100 + (collateral * config.collateral.repairRewardPercentage) / 100, ) - await token.approve(marketplace.address, discountedCollateral) + await token.approve(await marketplace.getAddress(), discountedCollateral) await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) const endBalance = await token.balanceOf(host.address) expect(startBalance - endBalance).to.equal(discountedCollateral) expect(await marketplace.slotState(slotId(slot))).to.equal( - SlotState.Filled + SlotState.Filled, ) }) it("fails to retrieve a request of an empty slot", async function () { - expect(marketplace.getActiveSlot(slotId(slot))).to.be.revertedWith( - "Marketplace_SlotIsFree" - ) + expect( + marketplace.getActiveSlot(slotId(slot)), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotIsFree") }) it("allows retrieval of request of a filled slot", async function () { @@ -364,103 +413,115 @@ describe("Marketplace", function () { it("is rejected when proof is incorrect", async function () { await marketplace.reserveSlot(slot.request, slot.index) await expect( - marketplace.fillSlot(slot.request, slot.index, invalidProof()) - ).to.be.revertedWith("Proofs_InvalidProof") + marketplace.fillSlot(slot.request, slot.index, invalidProof()), + ).to.be.revertedWithCustomError(marketplace, "Proofs_InvalidProof") }) it("is rejected when slot already filled", async function () { await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) await expect( - marketplace.fillSlot(slot.request, slot.index, proof) - ).to.be.revertedWith("Marketplace_SlotNotFree") + marketplace.fillSlot(slot.request, slot.index, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotNotFree") }) it("is rejected when request is unknown", async function () { let unknown = await exampleRequest() await expect( - marketplace.fillSlot(requestId(unknown), 0, proof) - ).to.be.revertedWith("Marketplace_UnknownRequest") + marketplace.fillSlot(requestId(unknown), 0, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_UnknownRequest") }) it("is rejected when request is cancelled", async function () { switchAccount(client) let expired = { ...request, expiry: hours(1) + 1 } - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(expired) await waitUntilCancelled(marketplace, expired) switchAccount(host) await marketplace.reserveSlot(requestId(expired), slot.index) await expect( - marketplace.fillSlot(requestId(expired), slot.index, proof) - ).to.be.revertedWith("Marketplace_SlotNotFree") + marketplace.fillSlot(requestId(expired), slot.index, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotNotFree") }) it("is rejected when request is finished", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFinished(marketplace, slot.request) await expect( - marketplace.fillSlot(slot.request, slot.index, proof) - ).to.be.revertedWith("Marketplace_SlotNotFree") + marketplace.fillSlot(slot.request, slot.index, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotNotFree") }) it("is rejected when request is failed", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFailed(marketplace, request) await expect( - marketplace.fillSlot(slot.request, slot.index, proof) - ).to.be.revertedWith("Marketplace_ReservationRequired") + marketplace.fillSlot(slot.request, slot.index, proof), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_ReservationRequired", + ) }) it("is rejected when slot index not in range", async function () { const invalid = request.ask.slots await expect( - marketplace.fillSlot(slot.request, invalid, proof) - ).to.be.revertedWith("Marketplace_InvalidSlot") + marketplace.fillSlot(slot.request, invalid, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidSlot") }) it("fails when all slots are already filled", async function () { const lastSlot = request.ask.slots - 1 await token.approve( - marketplace.address, - collateralPerSlot(request) * lastSlot + await marketplace.getAddress(), + collateralPerSlot(request) * lastSlot, + ) + await token.approve( + await marketplace.getAddress(), + maxPrice(request) * lastSlot, ) - await token.approve(marketplace.address, maxPrice(request) * lastSlot) for (let i = 0; i <= lastSlot; i++) { await marketplace.reserveSlot(slot.request, i) await marketplace.fillSlot(slot.request, i, proof) } await expect( - marketplace.fillSlot(slot.request, lastSlot, proof) - ).to.be.revertedWith("Marketplace_SlotNotFree") + marketplace.fillSlot(slot.request, lastSlot, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotNotFree") }) it("fails if slot is not reserved first", async function () { await expect( - marketplace.fillSlot(slot.request, slot.index, proof) - ).to.be.revertedWith("Marketplace_ReservationRequired") + marketplace.fillSlot(slot.request, slot.index, proof), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_ReservationRequired", + ) }) }) describe("filling slot without collateral", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) }) it("is rejected when approved collateral is insufficient", async function () { let insufficient = collateralPerSlot(request) - 1 - await token.approve(marketplace.address, insufficient) + await token.approve(await marketplace.getAddress(), insufficient) await marketplace.reserveSlot(slot.request, slot.index) await expect( - marketplace.fillSlot(slot.request, slot.index, proof) - ).to.be.revertedWith("ERC20InsufficientAllowance") + marketplace.fillSlot(slot.request, slot.index, proof), + ).to.be.revertedWithCustomError(token, "ERC20InsufficientAllowance") }) it("collects only requested collateral and not more", async function () { - await token.approve(marketplace.address, collateralPerSlot(request) * 2) + await token.approve( + await marketplace.getAddress(), + collateralPerSlot(request) * 2, + ) const startBalance = await token.balanceOf(host.address) await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) @@ -472,11 +533,11 @@ describe("Marketplace", function () { describe("submitting proofs when slot is filled", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) await advanceTime(config.proofs.period) @@ -489,26 +550,29 @@ describe("Marketplace", function () { it("reverts when somebody other then host submit the proof", async function () { switchAccount(host2) await expect( - marketplace.submitProof(slotId(slot), proof) - ).to.be.revertedWith("Marketplace_ProofNotSubmittedByHost") + marketplace.submitProof(slotId(slot), proof), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_ProofNotSubmittedByHost", + ) }) it("converts first 31 bytes of challenge to field element", async function () { - let challenge = arrayify(await marketplace.getChallenge(slotId(slot))) + let challenge = getBytes(await marketplace.getChallenge(slotId(slot))) let truncated = challenge.slice(0, 31) let littleEndian = new Uint8Array(truncated).reverse() - let expected = BigNumber.from(littleEndian) + let expected = littleEndianToBigInt(littleEndian) expect(await marketplace.challengeToFieldElement(challenge)).to.equal( - expected + expected, ) }) it("converts merkle root to field element", async function () { let merkleRoot = request.content.merkleRoot let littleEndian = new Uint8Array(merkleRoot).reverse() - let expected = BigNumber.from(littleEndian) + let expected = littleEndianToBigInt(littleEndian) expect(await marketplace.merkleRootToFieldElement(merkleRoot)).to.equal( - expected + expected, ) }) }) @@ -517,29 +581,27 @@ describe("Marketplace", function () { var requestTime beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) requestTime = await currentTime() switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("sets the request end time to now + duration", async function () { await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) - await expect( - (await marketplace.requestEnd(requestId(request))).toNumber() - ).to.equal(requestTime + request.ask.duration) + expect(await marketplace.requestEnd(requestId(request))).to.equal( + requestTime + request.ask.duration, + ) }) it("sets request end time to the past once failed", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFailed(marketplace, request) const now = await currentTime() - await expect(await marketplace.requestEnd(requestId(request))).to.be.eq( - now - 1 - ) + expect(await marketplace.requestEnd(requestId(request))).to.be.eq(now - 1) }) it("sets request end time to the past once cancelled", async function () { @@ -547,18 +609,14 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilCancelled(marketplace, request) const now = await currentTime() - await expect(await marketplace.requestEnd(requestId(request))).to.be.eq( - now - 1 - ) + expect(await marketplace.requestEnd(requestId(request))).to.be.eq(now - 1) }) it("checks that request end time is in the past once finished", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFinished(marketplace, requestId(request)) const now = await currentTime() - await expect(await marketplace.requestEnd(requestId(request))).to.be.eq( - now - 1 - ) + expect(await marketplace.requestEnd(requestId(request))).to.be.eq(now - 1) }) }) @@ -573,26 +631,27 @@ describe("Marketplace", function () { ;({ periodOf, periodEnd } = periodic(period)) switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) - collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + const collateral = collateralPerSlot(request) + await token.approve(await marketplace.getAddress(), collateral) }) it("fails to free slot when slot not filled", async function () { slot.index = 5 let nonExistentId = slotId(slot) - await expect(marketplace.freeSlot(nonExistentId)).to.be.revertedWith( - "Marketplace_SlotIsFree" - ) + await expect( + marketplace.freeSlot(nonExistentId), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotIsFree") }) it("can only be freed by the host occupying the slot", async function () { await waitUntilStarted(marketplace, request, proof, token) switchAccount(client) - await expect(marketplace.freeSlot(id)).to.be.revertedWith( - "Marketplace_InvalidSlotHost" + await expect(marketplace.freeSlot(id)).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InvalidSlotHost", ) }) @@ -612,7 +671,7 @@ describe("Marketplace", function () { // Make a reservation from another host switchAccount(host2) collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, slot.index) // Switch host and free the slot @@ -627,7 +686,7 @@ describe("Marketplace", function () { await marketplace.reserveSlot(slot.request, slot.index) let currPeriod = periodOf(await currentTime()) await advanceTimeTo(periodEnd(currPeriod) + 1) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.fillSlot(slot.request, slot.index, proof) }) }) @@ -635,11 +694,11 @@ describe("Marketplace", function () { describe("paying out a slot", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("finished request pays out reward based on time hosted", async function () { @@ -652,8 +711,9 @@ describe("Marketplace", function () { marketplace, request, proof, - token + token, ) + await waitUntilFinished(marketplace, requestId(request)) const startBalanceHost = await token.balanceOf(host.address) @@ -663,7 +723,7 @@ describe("Marketplace", function () { expect(expectedPayouts[slot.index]).to.be.lt(maxPrice(request)) const collateral = collateralPerSlot(request) expect(endBalanceHost - startBalanceHost).to.equal( - expectedPayouts[slot.index] + collateral + expectedPayouts[slot.index] + collateral, ) }) @@ -673,27 +733,27 @@ describe("Marketplace", function () { const startBalanceHost = await token.balanceOf(host.address) const startBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) const collateralToBeReturned = await marketplace.currentCollateral( - slotId(slot) + slotId(slot), ) await marketplace.freeSlot( slotId(slot), hostRewardRecipient.address, - hostCollateralRecipient.address + hostCollateralRecipient.address, ) const endBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) const endBalanceHost = await token.balanceOf(host.address) expect(endBalanceHost).to.equal(startBalanceHost) expect(endBalanceCollateral - startBalanceCollateral).to.equal( - collateralPerSlot(request) + collateralPerSlot(request), ) expect(collateralToBeReturned).to.equal(collateralPerSlot(request)) }) @@ -704,18 +764,18 @@ describe("Marketplace", function () { const startBalanceHost = await token.balanceOf(host.address) const startBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) await marketplace.freeSlot( slotId(slot), hostRewardRecipient.address, - hostCollateralRecipient.address + hostCollateralRecipient.address, ) const endBalanceHost = await token.balanceOf(host.address) const endBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) expect(endBalanceHost).to.equal(startBalanceHost) @@ -723,11 +783,11 @@ describe("Marketplace", function () { }) it("pays the host when contract was cancelled", async function () { + const startBalance = await token.balanceOf(host.address) + // Lets advance the time more into the expiry window const filledAt = (await currentTime()) + Math.floor(request.expiry / 3) - const expiresAt = ( - await marketplace.requestExpiry(requestId(request)) - ).toNumber() + const expiresAt = await marketplace.requestExpiry(requestId(request)) await marketplace.reserveSlot(slot.request, slot.index) await setNextBlockTimestamp(filledAt) @@ -735,20 +795,21 @@ describe("Marketplace", function () { await waitUntilCancelled(marketplace, request) await marketplace.freeSlot(slotId(slot)) - const expectedPartialPayout = - (expiresAt - filledAt) * pricePerSlotPerSecond(request) - const endBalance = await token.balanceOf(host.address) - expect(endBalance - ACCOUNT_STARTING_BALANCE).to.be.equal( - expectedPartialPayout + const expectedPartialPayout = calculatePartialPayout( + request, + expiresAt, + filledAt, ) + + const endBalance = await token.balanceOf(host.address) + + expect(endBalance - startBalance).to.be.equal(expectedPartialPayout) }) it("pays to host reward address when contract was cancelled, and returns collateral to host address", async function () { // Lets advance the time more into the expiry window const filledAt = (await currentTime()) + Math.floor(request.expiry / 3) - const expiresAt = ( - await marketplace.requestExpiry(requestId(request)) - ).toNumber() + const expiresAt = await marketplace.requestExpiry(requestId(request)) await marketplace.reserveSlot(slot.request, slot.index) await setNextBlockTimestamp(filledAt) @@ -756,40 +817,43 @@ describe("Marketplace", function () { await waitUntilCancelled(marketplace, request) const startBalanceHost = await token.balanceOf(host.address) const startBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) const startBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) const collateralToBeReturned = await marketplace.currentCollateral( - slotId(slot) + slotId(slot), ) await marketplace.freeSlot( slotId(slot), hostRewardRecipient.address, - hostCollateralRecipient.address + hostCollateralRecipient.address, ) - const expectedPartialPayout = - (expiresAt - filledAt) * pricePerSlotPerSecond(request) + const expectedPartialPayout = calculatePartialPayout( + request, + expiresAt, + filledAt, + ) const endBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) expect(endBalanceReward - startBalanceReward).to.be.equal( - expectedPartialPayout + expectedPartialPayout, ) const endBalanceHost = await token.balanceOf(host.address) expect(endBalanceHost).to.be.equal(startBalanceHost) const endBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) expect(endBalanceCollateral - startBalanceCollateral).to.be.equal( - collateralPerSlot(request) + collateralPerSlot(request), ) expect(collateralToBeReturned).to.be.equal(collateralPerSlot(request)) @@ -800,18 +864,18 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) const startBalanceHost = await token.balanceOf(host.address) const startBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) const startBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) await marketplace.freeSlot(slotId(slot)) const endBalanceHost = await token.balanceOf(host.address) const endBalanceReward = await token.balanceOf( - hostRewardRecipient.address + hostRewardRecipient.address, ) const endBalanceCollateral = await token.balanceOf( - hostCollateralRecipient.address + hostCollateralRecipient.address, ) expect(endBalanceHost).to.equal(startBalanceHost) expect(endBalanceReward).to.equal(startBalanceReward) @@ -822,9 +886,9 @@ describe("Marketplace", function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFinished(marketplace, requestId(request)) await marketplace.freeSlot(slotId(slot)) - await expect(marketplace.freeSlot(slotId(slot))).to.be.revertedWith( - "Marketplace_AlreadyPaid" - ) + await expect( + marketplace.freeSlot(slotId(slot)), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_AlreadyPaid") }) it("cannot be filled again", async function () { @@ -839,18 +903,18 @@ describe("Marketplace", function () { describe("fulfilling a request", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("emits event when all slots are filled", async function () { const lastSlot = request.ask.slots - 1 await token.approve( - marketplace.address, - collateralPerSlot(request) * lastSlot + await marketplace.getAddress(), + collateralPerSlot(request) * lastSlot, ) for (let i = 0; i < lastSlot; i++) { await marketplace.reserveSlot(slot.request, i) @@ -858,7 +922,7 @@ describe("Marketplace", function () { } const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, lastSlot) await expect(marketplace.fillSlot(slot.request, lastSlot, proof)) .to.emit(marketplace, "RequestFulfilled") @@ -867,35 +931,35 @@ describe("Marketplace", function () { it("sets state when all slots are filled", async function () { const slots = request.ask.slots const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral * slots) + await token.approve(await marketplace.getAddress(), collateral * slots) for (let i = 0; i < slots; i++) { await marketplace.reserveSlot(slot.request, i) await marketplace.fillSlot(slot.request, i, proof) } - await expect(await marketplace.requestState(slot.request)).to.equal( - RequestState.Started + expect(await marketplace.requestState(slot.request)).to.equal( + RequestState.Started, ) }) it("fails when all slots are already filled", async function () { const lastSlot = request.ask.slots - 1 await token.approve( - marketplace.address, - collateralPerSlot(request) * (lastSlot + 1) + await marketplace.getAddress(), + collateralPerSlot(request) * (lastSlot + 1), ) for (let i = 0; i <= lastSlot; i++) { await marketplace.reserveSlot(slot.request, i) await marketplace.fillSlot(slot.request, i, proof) } await expect( - marketplace.fillSlot(slot.request, lastSlot, proof) - ).to.be.revertedWith("Marketplace_SlotNotFree") + marketplace.fillSlot(slot.request, lastSlot, proof), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_SlotNotFree") }) }) describe("withdrawing funds", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) // wait a bit, so that there are funds for the client to withdraw @@ -903,29 +967,38 @@ describe("Marketplace", function () { switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("rejects withdraw when request not yet timed out", async function () { switchAccount(client) await expect( - marketplace.withdrawFunds(slot.request, clientWithdrawRecipient.address) - ).to.be.revertedWith("Marketplace_InvalidState") + marketplace.withdrawFunds( + slot.request, + clientWithdrawRecipient.address, + ), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidState") }) it("rejects withdraw when wrong account used", async function () { await waitUntilCancelled(marketplace, request) await expect( - marketplace.withdrawFunds(slot.request, clientWithdrawRecipient.address) - ).to.be.revertedWith("Marketplace_InvalidClientAddress") + marketplace.withdrawFunds( + slot.request, + clientWithdrawRecipient.address, + ), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_InvalidClientAddress", + ) }) it("rejects withdraw when in wrong state", async function () { // fill all slots, should change state to RequestState.Started const lastSlot = request.ask.slots - 1 await token.approve( - marketplace.address, - collateralPerSlot(request) * (lastSlot + 1) + await marketplace.getAddress(), + collateralPerSlot(request) * (lastSlot + 1), ) for (let i = 0; i <= lastSlot; i++) { await marketplace.reserveSlot(slot.request, i) @@ -934,8 +1007,11 @@ describe("Marketplace", function () { await waitUntilCancelled(marketplace, request) switchAccount(client) await expect( - marketplace.withdrawFunds(slot.request, clientWithdrawRecipient.address) - ).to.be.revertedWith("Marketplace_InvalidState") + marketplace.withdrawFunds( + slot.request, + clientWithdrawRecipient.address, + ), + ).to.be.revertedWithCustomError(marketplace, "Marketplace_InvalidState") }) it("rejects withdraw when already withdrawn", async function () { @@ -945,18 +1021,27 @@ describe("Marketplace", function () { switchAccount(client) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) await expect( - marketplace.withdrawFunds(slot.request, clientWithdrawRecipient.address) - ).to.be.revertedWith("Marketplace_NothingToWithdraw") + marketplace.withdrawFunds( + slot.request, + clientWithdrawRecipient.address, + ), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_NothingToWithdraw", + ) }) it("emits event once request is cancelled", async function () { await waitUntilCancelled(marketplace, request) switchAccount(client) await expect( - marketplace.withdrawFunds(slot.request, clientWithdrawRecipient.address) + marketplace.withdrawFunds( + slot.request, + clientWithdrawRecipient.address, + ), ) .to.emit(marketplace, "RequestCancelled") .withArgs(requestId(request)) @@ -969,16 +1054,16 @@ describe("Marketplace", function () { switchAccount(client) const startBalanceClient = await token.balanceOf(client.address) const startBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) const endBalanceClient = await token.balanceOf(client.address) const endBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) expect(endBalanceClient).to.equal(startBalanceClient) @@ -988,7 +1073,7 @@ describe("Marketplace", function () { // at the time of expiry and hence the user would get the full "expiry window" reward back. expect(endBalancePayout - startBalancePayout).to.be.gt(0) expect(endBalancePayout - startBalancePayout).to.be.lte( - request.expiry * pricePerSlotPerSecond(request) + request.expiry * pricePerSlotPerSecond(request), ) }) @@ -997,15 +1082,15 @@ describe("Marketplace", function () { switchAccount(client) const startBalanceClient = await token.balanceOf(client.address) const startBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) const endBalanceClient = await token.balanceOf(client.address) const endBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) expect(endBalanceClient).to.equal(startBalanceClient) expect(endBalancePayout - startBalancePayout).to.equal(maxPrice(request)) @@ -1019,16 +1104,16 @@ describe("Marketplace", function () { const startBalanceClient = await token.balanceOf(client.address) const startBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) const endBalanceClient = await token.balanceOf(client.address) const endBalancePayout = await token.balanceOf( - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) expect(endBalanceClient).to.equal(startBalanceClient) @@ -1036,49 +1121,54 @@ describe("Marketplace", function () { }) it("withdraws to the client payout address for cancelled requests lowered by hosts payout", async function () { + const startBalance = await token.balanceOf(host.address) + // Lets advance the time more into the expiry window const filledAt = (await currentTime()) + Math.floor(request.expiry / 3) - const expiresAt = ( - await marketplace.requestExpiry(requestId(request)) - ).toNumber() + const expiresAt = await marketplace.requestExpiry(requestId(request)) await marketplace.reserveSlot(slot.request, slot.index) await setNextBlockTimestamp(filledAt) await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilCancelled(marketplace, request) - const expectedPartialhostRewardRecipient = - (expiresAt - filledAt) * pricePerSlotPerSecond(request) + + const expectedPartialhostRewardRecipient = calculatePartialPayout( + request, + expiresAt, + filledAt, + ) switchAccount(client) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) const endBalance = await token.balanceOf(clientWithdrawRecipient.address) - expect(endBalance - ACCOUNT_STARTING_BALANCE).to.equal( - maxPrice(request) - expectedPartialhostRewardRecipient + expect(endBalance - startBalance).to.equal( + maxPrice(request) - expectedPartialhostRewardRecipient, ) }) it("when slot is freed and not repaired, client will get refunded the freed slot's funds", async function () { + const startBalance = await token.balanceOf(host.address) const payouts = await waitUntilStarted(marketplace, request, proof, token) await expect(marketplace.freeSlot(slotId(slot))).to.emit( marketplace, - "SlotFreed" + "SlotFreed", ) await waitUntilFinished(marketplace, requestId(request)) switchAccount(client) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) const endBalance = await token.balanceOf(clientWithdrawRecipient.address) - expect(endBalance - ACCOUNT_STARTING_BALANCE).to.equal( + expect(endBalance - startBalance).to.equal( maxPrice(request) - payouts.reduce((a, b) => a + b, 0) + // This is the amount that user gets refunded for filling period in expiry window - payouts[slot.index] // This is the refunded amount for the freed slot + payouts[slot.index], // This is the refunded amount for the freed slot ) }) }) @@ -1088,11 +1178,11 @@ describe("Marketplace", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("is 'New' initially", async function () { @@ -1109,7 +1199,7 @@ describe("Marketplace", function () { switchAccount(client) await marketplace.withdrawFunds( slot.request, - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) expect(await marketplace.requestState(slot.request)).to.equal(Cancelled) }) @@ -1127,8 +1217,8 @@ describe("Marketplace", function () { it("does not change to 'Failed' before it is started", async function () { await token.approve( - marketplace.address, - collateralPerSlot(request) * (request.ask.maxSlotLoss + 1) + await marketplace.getAddress(), + collateralPerSlot(request) * (request.ask.maxSlotLoss + 1), ) for (let i = 0; i <= request.ask.maxSlotLoss; i++) { await marketplace.reserveSlot(slot.request, i) @@ -1166,11 +1256,11 @@ describe("Marketplace", function () { ;({ periodOf, periodEnd } = periodic(period)) switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) async function waitUntilProofIsRequired(id) { @@ -1243,11 +1333,11 @@ describe("Marketplace", function () { describe("slot probability", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("calculates correctly the slot probability", async function () { @@ -1259,7 +1349,7 @@ describe("Marketplace", function () { // 4 * (256 - 64) / 256 const expectedProbability = 3 expect(await marketplace.slotProbability(slotId(slot))).to.equal( - expectedProbability + expectedProbability, ) }) }) @@ -1272,11 +1362,11 @@ describe("Marketplace", function () { ;({ periodOf, periodEnd } = periodic(period)) switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) async function waitUntilProofWillBeRequired(id) { @@ -1309,9 +1399,9 @@ describe("Marketplace", function () { await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilProofWillBeRequired(id) - await expect(await marketplace.willProofBeRequired(id)).to.be.true + expect(await marketplace.willProofBeRequired(id)).to.be.true await waitUntilCancelled(marketplace, request) - await expect(await marketplace.willProofBeRequired(id)).to.be.false + expect(await marketplace.willProofBeRequired(id)).to.be.false }) it("does not require proofs once cancelled", async function () { @@ -1319,9 +1409,9 @@ describe("Marketplace", function () { await marketplace.reserveSlot(slot.request, slot.index) await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilProofIsRequired(id) - await expect(await marketplace.isProofRequired(id)).to.be.true + expect(await marketplace.isProofRequired(id)).to.be.true await waitUntilCancelled(marketplace, request) - await expect(await marketplace.isProofRequired(id)).to.be.false + expect(await marketplace.isProofRequired(id)).to.be.false }) it("does not provide challenges once cancelled", async function () { @@ -1330,10 +1420,10 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilProofIsRequired(id) const challenge1 = await marketplace.getChallenge(id) - expect(BigNumber.from(challenge1).gt(0)) + expect(challenge1 > 0) await waitUntilCancelled(marketplace, request) const challenge2 = await marketplace.getChallenge(id) - expect(BigNumber.from(challenge2).isZero()) + expect(challenge2 == 0) }) it("does not provide pointer once cancelled", async function () { @@ -1342,10 +1432,10 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilProofIsRequired(id) const challenge1 = await marketplace.getChallenge(id) - expect(BigNumber.from(challenge1).gt(0)) + expect(challenge1 > 0) await waitUntilCancelled(marketplace, request) const challenge2 = await marketplace.getChallenge(id) - expect(BigNumber.from(challenge2).isZero()) + expect(challenge2 == 0) }) }) @@ -1357,11 +1447,11 @@ describe("Marketplace", function () { ;({ periodOf, periodEnd } = periodic(period)) switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) async function waitUntilProofIsRequired(id) { @@ -1382,8 +1472,11 @@ describe("Marketplace", function () { await waitUntilCancelled(marketplace, request) let missedPeriod = periodOf(await currentTime()) await expect( - marketplace.markProofAsMissing(slotId(slot), missedPeriod) - ).to.be.revertedWith("Marketplace_SlotNotAcceptingProofs") + marketplace.markProofAsMissing(slotId(slot), missedPeriod), + ).to.be.revertedWithCustomError( + marketplace, + "Marketplace_SlotNotAcceptingProofs", + ) }) describe("slashing when missing proofs", function () { @@ -1400,14 +1493,10 @@ describe("Marketplace", function () { const collateral = collateralPerSlot(request) const expectedBalance = Math.round( - (collateral * (100 - slashPercentage)) / 100 + (collateral * (100 - slashPercentage)) / 100, ) - expect( - BigNumber.from(expectedBalance).eq( - await marketplace.getSlotCollateral(id) - ) - ) + expect(expectedBalance == (await marketplace.getSlotCollateral(id))) }) it("rewards validator when marking proof as missing", async function () { @@ -1431,11 +1520,11 @@ describe("Marketplace", function () { const slashedAmount = (collateral * slashPercentage) / 100 const expectedReward = Math.round( - (slashedAmount * validatorRewardPercentage) / 100 + (slashedAmount * validatorRewardPercentage) / 100, ) - expect(endBalance.toNumber()).to.equal( - startBalance.toNumber() + expectedReward + expect(endBalance).to.equal( + calculateBalance(startBalance, expectedReward), ) }) }) @@ -1451,7 +1540,7 @@ describe("Marketplace", function () { await waitUntilStarted(marketplace, request, proof, token) while ((await marketplace.slotState(slotId(slot))) === SlotState.Filled) { expect(await marketplace.getSlotCollateral(slotId(slot))).to.be.gt( - minimum + minimum, ) await waitUntilProofIsRequired(slotId(slot)) const missedPeriod = periodOf(await currentTime()) @@ -1459,10 +1548,10 @@ describe("Marketplace", function () { await marketplace.markProofAsMissing(slotId(slot), missedPeriod) } expect(await marketplace.slotState(slotId(slot))).to.equal( - SlotState.Repair + SlotState.Repair, ) expect(await marketplace.getSlotCollateral(slotId(slot))).to.be.lte( - minimum + minimum, ) }) @@ -1478,23 +1567,23 @@ describe("Marketplace", function () { let missedProofs = 0 while ((await marketplace.slotState(slotId(slot))) === SlotState.Filled) { expect(await marketplace.getSlotCollateral(slotId(slot))).to.be.gt( - minimum + minimum, ) await waitUntilProofIsRequired(slotId(slot)) const missedPeriod = periodOf(await currentTime()) await advanceTime(period + 1) expect(await marketplace.missingProofs(slotId(slot))).to.equal( - missedProofs + missedProofs, ) await marketplace.markProofAsMissing(slotId(slot), missedPeriod) missedProofs += 1 } expect(await marketplace.slotState(slotId(slot))).to.equal( - SlotState.Repair + SlotState.Repair, ) expect(await marketplace.missingProofs(slotId(slot))).to.equal(0) expect(await marketplace.getSlotCollateral(slotId(slot))).to.be.lte( - minimum + minimum, ) }) }) @@ -1503,9 +1592,9 @@ describe("Marketplace", function () { beforeEach(async function () { switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) }) it("adds request to list when requesting storage", async function () { @@ -1524,7 +1613,7 @@ describe("Marketplace", function () { await waitUntilCancelled(marketplace, request) await marketplace.withdrawFunds( requestId(request), - clientWithdrawRecipient.address + clientWithdrawRecipient.address, ) expect(await marketplace.myRequests()).to.deep.equal([]) }) @@ -1552,11 +1641,11 @@ describe("Marketplace", function () { describe("list of active slots", function () { beforeEach(async function () { switchAccount(client) - await token.approve(marketplace.address, maxPrice(request)) + await token.approve(await marketplace.getAddress(), maxPrice(request)) await marketplace.requestStorage(request) switchAccount(host) const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) }) it("adds slot to list when filling slot", async function () { @@ -1564,13 +1653,11 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) let slot1 = { ...slot, index: slot.index + 1 } const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, slot1.index) await marketplace.fillSlot(slot.request, slot1.index, proof) - expect(await marketplace.mySlots()).to.have.members([ - slotId(slot), - slotId(slot1), - ]) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.have.members([slotId(slot), slotId(slot1)]) }) it("removes slot from list when slot is freed", async function () { @@ -1578,12 +1665,13 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) let slot1 = { ...slot, index: slot.index + 1 } const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, slot1.index) await marketplace.fillSlot(slot.request, slot1.index, proof) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.freeSlot(slotId(slot)) - expect(await marketplace.mySlots()).to.have.members([slotId(slot1)]) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.have.members([slotId(slot1)]) }) it("keeps slots when cancelled", async function () { @@ -1592,21 +1680,20 @@ describe("Marketplace", function () { let slot1 = { ...slot, index: slot.index + 1 } const collateral = collateralPerSlot(request) - await token.approve(marketplace.address, collateral) + await token.approve(await marketplace.getAddress(), collateral) await marketplace.reserveSlot(slot.request, slot1.index) await marketplace.fillSlot(slot.request, slot1.index, proof) await waitUntilCancelled(marketplace, request) - expect(await marketplace.mySlots()).to.have.members([ - slotId(slot), - slotId(slot1), - ]) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.have.members([slotId(slot), slotId(slot1)]) }) it("removes slot when finished slot is freed", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilFinished(marketplace, requestId(request)) await marketplace.freeSlot(slotId(slot)) - expect(await marketplace.mySlots()).to.not.contain(slotId(slot)) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.not.contain(slotId(slot)) }) it("removes slot when cancelled slot is freed", async function () { @@ -1614,14 +1701,16 @@ describe("Marketplace", function () { await marketplace.fillSlot(slot.request, slot.index, proof) await waitUntilCancelled(marketplace, request) await marketplace.freeSlot(slotId(slot)) - expect(await marketplace.mySlots()).to.not.contain(slotId(slot)) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.not.contain(slotId(slot)) }) it("removes slot when failed slot is freed", async function () { await waitUntilStarted(marketplace, request, proof, token) await waitUntilSlotFailed(marketplace, request, slot) await marketplace.freeSlot(slotId(slot)) - expect(await marketplace.mySlots()).to.not.contain(slotId(slot)) + const slots = Array.from(await marketplace.mySlots()) + expect(slots).to.not.contain(slotId(slot)) }) }) }) diff --git a/test/Periods.test.js b/test/Periods.test.js index f265b68..c99e8af 100644 --- a/test/Periods.test.js +++ b/test/Periods.test.js @@ -1,16 +1,32 @@ const { expect } = require("chai") -const { ethers } = require("hardhat") +const PeriodsModule = require("../ignition/modules/periods") +const { assertDeploymentRejectedWithCustomError } = require("./helpers") describe("Periods", function () { it("should revert when secondsPerPeriod is 0", async function () { - const PeriodsContract = await ethers.getContractFactory("Periods") - await expect(PeriodsContract.deploy(0)).to.be.revertedWith( - "Periods_InvalidSecondsPerPeriod" + const promise = ignition.deploy(PeriodsModule, { + parameters: { + Periods: { + secondsPerPeriod: 0, + }, + }, + }) + + assertDeploymentRejectedWithCustomError( + "Periods_InvalidSecondsPerPeriod", + promise, ) }) it("should not revert when secondsPerPeriod more than 0", async function () { - const PeriodsContract = await ethers.getContractFactory("Periods") - await expect(PeriodsContract.deploy(10)).not.to.be.reverted + const promise = ignition.deploy(PeriodsModule, { + parameters: { + Periods: { + secondsPerPeriod: 10, + }, + }, + }) + + await expect(promise).not.to.be.rejected }) }) diff --git a/test/Proofs.test.js b/test/Proofs.test.js index ce1a937..b06423d 100644 --- a/test/Proofs.test.js +++ b/test/Proofs.test.js @@ -1,20 +1,21 @@ const { expect } = require("chai") -const { ethers, deployments } = require("hardhat") -const { hexlify, randomBytes } = ethers.utils +const { ethers } = require("hardhat") +const { hexlify, randomBytes } = ethers const { snapshot, revert, - mine, ensureMinimumBlockHeight, currentTime, advanceTime, advanceTimeTo, + mine, } = require("./evm") const { periodic } = require("./time") const { loadProof, loadPublicInput } = require("../verifier/verifier") const { SlotState } = require("./requests") const binomialTest = require("@stdlib/stats-binomial-test") const { exampleProof } = require("./examples") +const ProofsModule = require("../ignition/modules/proofs") describe("Proofs", function () { const slotId = hexlify(randomBytes(32)) @@ -30,13 +31,22 @@ describe("Proofs", function () { beforeEach(async function () { await snapshot() await ensureMinimumBlockHeight(256) - const Proofs = await ethers.getContractFactory("TestProofs") - await deployments.fixture(["Verifier"]) - const verifier = await deployments.get("Groth16Verifier") - proofs = await Proofs.deploy( - { period, timeout, downtime, zkeyHash: "", downtimeProduct }, - verifier.address - ) + + const { testProofs } = await ignition.deploy(ProofsModule, { + parameters: { + Proofs: { + configuration: { + period, + timeout, + downtime, + zkeyHash: "", + downtimeProduct, + }, + }, + }, + }) + + proofs = testProofs }) afterEach(async function () { @@ -113,7 +123,7 @@ describe("Proofs", function () { let previous = await proofs.getPointer(slotId) await mine() let current = await proofs.getPointer(slotId) - expect(current).to.equal((previous + 1) % 256) + expect(current).to.equal((previous + 1n) % 256n) } }) }) @@ -202,15 +212,15 @@ describe("Proofs", function () { it("fails proof submission when proof is incorrect", async function () { let invalid = exampleProof() await expect( - proofs.proofReceived(slotId, invalid, pubSignals) - ).to.be.revertedWith("Proofs_InvalidProof") + proofs.proofReceived(slotId, invalid, pubSignals), + ).to.be.revertedWithCustomError(proofs, "Proofs_InvalidProof") }) it("fails proof submission when public input is incorrect", async function () { let invalid = [1, 2, 3] await expect( - proofs.proofReceived(slotId, proof, invalid) - ).to.be.revertedWith("Proofs_InvalidProof") + proofs.proofReceived(slotId, proof, invalid), + ).to.be.revertedWithCustomError(proofs, "Proofs_InvalidProof") }) it("emits an event when proof was submitted", async function () { @@ -222,8 +232,8 @@ describe("Proofs", function () { it("fails proof submission when already submitted", async function () { await proofs.proofReceived(slotId, proof, pubSignals) await expect( - proofs.proofReceived(slotId, proof, pubSignals) - ).to.be.revertedWith("Proofs_ProofAlreadySubmitted") + proofs.proofReceived(slotId, proof, pubSignals), + ).to.be.revertedWithCustomError(proofs, "Proofs_ProofAlreadySubmitted") }) it("marks a proof as missing", async function () { @@ -239,8 +249,8 @@ describe("Proofs", function () { await waitUntilProofIsRequired(slotId) let currentPeriod = periodOf(await currentTime()) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) - ).to.be.revertedWith("Proofs_PeriodNotEnded") + proofs.markProofAsMissing(slotId, currentPeriod), + ).to.be.revertedWithCustomError(proofs, "Proofs_PeriodNotEnded") }) it("does not mark a proof as missing after timeout", async function () { @@ -248,8 +258,8 @@ describe("Proofs", function () { let currentPeriod = periodOf(await currentTime()) await advanceTimeTo(periodEnd(currentPeriod) + timeout + 1) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) - ).to.be.revertedWith("Proofs_ValidationTimedOut") + proofs.markProofAsMissing(slotId, currentPeriod), + ).to.be.revertedWithCustomError(proofs, "Proofs_ValidationTimedOut") }) it("does not mark a received proof as missing", async function () { @@ -258,8 +268,8 @@ describe("Proofs", function () { await proofs.proofReceived(slotId, proof, pubSignals) await advanceTimeTo(periodEnd(receivedPeriod) + 1) await expect( - proofs.markProofAsMissing(slotId, receivedPeriod) - ).to.be.revertedWith("Proofs_ProofNotMissing") + proofs.markProofAsMissing(slotId, receivedPeriod), + ).to.be.revertedWithCustomError(proofs, "Proofs_ProofNotMissing") }) it("does not mark proof as missing when not required", async function () { @@ -269,8 +279,8 @@ describe("Proofs", function () { let currentPeriod = periodOf(await currentTime()) await advanceTimeTo(periodEnd(currentPeriod) + 1) await expect( - proofs.markProofAsMissing(slotId, currentPeriod) - ).to.be.revertedWith("Proofs_ProofNotRequired") + proofs.markProofAsMissing(slotId, currentPeriod), + ).to.be.revertedWithCustomError(proofs, "Proofs_ProofNotRequired") }) it("does not mark proof as missing twice", async function () { @@ -279,8 +289,11 @@ describe("Proofs", function () { await advanceTimeTo(periodEnd(missedPeriod) + 1) await proofs.markProofAsMissing(slotId, missedPeriod) await expect( - proofs.markProofAsMissing(slotId, missedPeriod) - ).to.be.revertedWith("Proofs_ProofAlreadyMarkedMissing") + proofs.markProofAsMissing(slotId, missedPeriod), + ).to.be.revertedWithCustomError( + proofs, + "Proofs_ProofAlreadyMarkedMissing", + ) }) it("requires no proofs when slot is finished", async function () { diff --git a/test/SlotReservations.test.js b/test/SlotReservations.test.js index cc91bad..5817888 100644 --- a/test/SlotReservations.test.js +++ b/test/SlotReservations.test.js @@ -3,6 +3,7 @@ const { ethers } = require("hardhat") const { exampleRequest, exampleConfiguration } = require("./examples") const { requestId, slotId } = require("./ids") const { SlotState } = require("./requests") +const SlotReservationsModule = require("../ignition/modules/slot-reservations") describe("SlotReservations", function () { let reservations @@ -15,10 +16,18 @@ describe("SlotReservations", function () { const config = exampleConfiguration() beforeEach(async function () { - let SlotReservations = await ethers.getContractFactory( - "TestSlotReservations" + const { testSlotReservations } = await ignition.deploy( + SlotReservationsModule, + { + parameters: { + SlotReservations: { + configuration: config.reservations, + }, + }, + }, ) - reservations = await SlotReservations.deploy(config.reservations) + + reservations = testSlotReservations ;[provider, address1, address2, address3] = await ethers.getSigners() request = await exampleRequest() @@ -76,8 +85,11 @@ describe("SlotReservations", function () { it("cannot reserve a slot more than once", async function () { await reservations.reserveSlot(reqId, slotIndex) - await expect(reservations.reserveSlot(reqId, slotIndex)).to.be.revertedWith( - "SlotReservations_ReservationNotAllowed" + await expect( + reservations.reserveSlot(reqId, slotIndex), + ).to.be.revertedWithCustomError( + reservations, + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(1) }) @@ -95,8 +107,11 @@ describe("SlotReservations", function () { switchAccount(address3) await reservations.reserveSlot(reqId, slotIndex) switchAccount(provider) - await expect(reservations.reserveSlot(reqId, slotIndex)).to.be.revertedWith( - "SlotReservations_ReservationNotAllowed" + await expect( + reservations.reserveSlot(reqId, slotIndex), + ).to.be.revertedWithCustomError( + reservations, + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(3) expect(await reservations.contains(id, provider.address)).to.be.false @@ -115,8 +130,11 @@ describe("SlotReservations", function () { it("cannot reserve a slot if not free or not in repair", async function () { await reservations.setSlotState(id, SlotState.Filled) - await expect(reservations.reserveSlot(reqId, slotIndex)).to.be.revertedWith( - "SlotReservations_ReservationNotAllowed" + await expect( + reservations.reserveSlot(reqId, slotIndex), + ).to.be.revertedWithCustomError( + reservations, + "SlotReservations_ReservationNotAllowed", ) expect(await reservations.length(id)).to.equal(0) }) @@ -139,7 +157,7 @@ describe("SlotReservations", function () { it("should not emit an event when reservations are not full", async function () { await expect(reservations.reserveSlot(reqId, slotIndex)).to.not.emit( reservations, - "SlotReservationsFull" + "SlotReservationsFull", ) }) }) diff --git a/test/Vault.tests.js b/test/Vault.tests.js index f91c612..f6c5f7f 100644 --- a/test/Vault.tests.js +++ b/test/Vault.tests.js @@ -1,6 +1,6 @@ const { expect } = require("chai") const { ethers } = require("hardhat") -const { randomBytes, hexlify } = ethers.utils +const { randomBytes, hexlify } = ethers const { currentTime, advanceTimeTo, @@ -11,6 +11,7 @@ const { revert, } = require("./evm") const { FundStatus } = require("./vault") +const VaultModule = require("../ignition/modules/vault") describe("Vault", function () { const fund = randomBytes(32) @@ -22,12 +23,16 @@ describe("Vault", function () { beforeEach(async function () { await snapshot() - const TestToken = await ethers.getContractFactory("TestToken") - token = await TestToken.deploy() - const Vault = await ethers.getContractFactory("Vault") - vault = await Vault.deploy(token.address) + + const { vault: _vault, token: _token } = await ignition.deploy( + VaultModule, + {}, + ) + vault = _vault + token = _token ;[controller, holder, holder2, holder3] = await ethers.getSigners() - await token.mint(controller.address, 1_000_000) + const tx = await token.mint(await controller.getAddress(), 1_000_000) + await tx.wait() }) afterEach(async function () { @@ -39,7 +44,7 @@ describe("Vault", function () { let discriminator beforeEach(async function () { - address = holder.address + address = await holder.getAddress() discriminator = hexlify(randomBytes(12)) }) @@ -55,7 +60,10 @@ describe("Vault", function () { let account beforeEach(async function () { - account = await vault.encodeAccountId(holder.address, randomBytes(12)) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) }) it("does not have any balances", async function () { @@ -76,7 +84,10 @@ describe("Vault", function () { it("does not allow a lock with expiry past maximum", async function () { let maximum = (await currentTime()) + 100 const locking = vault.lock(fund, maximum + 1, maximum) - await expect(locking).to.be.revertedWith("InvalidExpiry") + await expect(locking).to.be.revertedWithCustomError( + vault, + "VaultInvalidExpiry", + ) }) describe("fund is not locked", function () { @@ -93,7 +104,10 @@ describe("Vault", function () { const beginning = (await currentTime()) + 10 expiry = beginning + 80 maximum = beginning + 100 - account = await vault.encodeAccountId(holder.address, randomBytes(12)) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) await setAutomine(false) await setNextBlockTimestamp(beginning) await vault.lock(fund, expiry, maximum) @@ -105,9 +119,9 @@ describe("Vault", function () { }) it("cannot set lock when already locked", async function () { - await expect(vault.lock(fund, expiry, maximum)).to.be.revertedWith( - "AlreadyLocked" - ) + await expect( + vault.lock(fund, expiry, maximum), + ).to.be.revertedWithCustomError(vault, "VaultFundAlreadyLocked") }) it("can extend a lock expiry up to its maximum", async function () { @@ -119,16 +133,22 @@ describe("Vault", function () { it("cannot extend a lock past its maximum", async function () { const extending = vault.extendLock(fund, maximum + 1) - await expect(extending).to.be.revertedWith("InvalidExpiry") + await expect(extending).to.be.revertedWithCustomError( + vault, + "VaultInvalidExpiry", + ) }) it("cannot move expiry to an earlier time", async function () { const extending = vault.extendLock(fund, expiry - 1) - await expect(extending).to.be.revertedWith("InvalidExpiry") + await expect(extending).to.be.revertedWithCustomError( + vault, + "VaultInvalidExpiry", + ) }) it("does not delete lock when no tokens remain", async function () { - await token.connect(controller).approve(vault.address, 30) + await token.connect(controller).approve(await vault.getAddress(), 30) await vault.deposit(fund, account, 30) await vault.burnAccount(fund, account) expect(await vault.getFundStatus(fund)).to.equal(FundStatus.Locked) @@ -142,33 +162,45 @@ describe("Vault", function () { let account beforeEach(async function () { - account = await vault.encodeAccountId(holder.address, randomBytes(12)) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) await setAutomine(true) }) it("accepts deposits of tokens", async function () { - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account, amount) const balance = await vault.getBalance(fund, account) expect(balance).to.equal(amount) }) it("keeps custody of tokens that are deposited", async function () { - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account, amount) - expect(await token.balanceOf(vault.address)).to.equal(amount) + expect(await token.balanceOf(await vault.getAddress())).to.equal(amount) }) it("deposit fails when tokens cannot be transferred", async function () { - await token.connect(controller).approve(vault.address, amount - 1) + await token + .connect(controller) + .approve(await vault.getAddress(), amount - 1) const depositing = vault.deposit(fund, account, amount) - await expect(depositing).to.be.revertedWith( - "ERC20InsufficientAllowance" + await expect(depositing).to.be.revertedWithCustomError( + token, + "ERC20InsufficientAllowance", ) }) it("adds multiple deposits to the balance", async function () { - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account, amount / 2) await vault.deposit(fund, account, amount / 2) const balance = await vault.getBalance(fund, account) @@ -176,10 +208,10 @@ describe("Vault", function () { }) it("separates deposits from different accounts with the same holder", async function () { - const address = holder.address + const address = await holder.getAddress() const account1 = await vault.encodeAccountId(address, randomBytes(12)) const account2 = await vault.encodeAccountId(address, randomBytes(12)) - await token.connect(controller).approve(vault.address, 3) + await token.connect(controller).approve(await vault.getAddress(), 3) await vault.deposit(fund, account1, 1) await vault.deposit(fund, account2, 2) expect(await vault.getBalance(fund, account1)).to.equal(1) @@ -191,7 +223,7 @@ describe("Vault", function () { const fund2 = randomBytes(32) await vault.lock(fund1, expiry, maximum) await vault.lock(fund2, expiry, maximum) - await token.connect(controller).approve(vault.address, 3) + await token.connect(controller).approve(await vault.getAddress(), 3) await vault.deposit(fund1, account, 1) await vault.deposit(fund2, account, 2) expect(await vault.getBalance(fund1, account)).to.equal(1) @@ -205,10 +237,10 @@ describe("Vault", function () { const vault2 = vault.connect(controller2) await vault1.lock(fund, expiry, maximum) await vault2.lock(fund, expiry, maximum) - await token.mint(controller1.address, 1000) - await token.mint(controller2.address, 1000) - await token.connect(controller1).approve(vault.address, 1) - await token.connect(controller2).approve(vault.address, 2) + await token.mint(await controller1.getAddress(), 1000) + await token.mint(await controller2.getAddress(), 1000) + await token.connect(controller1).approve(await vault.getAddress(), 1) + await token.connect(controller2).approve(await vault.getAddress(), 2) await vault1.deposit(fund, account, 1) await vault2.deposit(fund, account, 2) expect(await vault1.getBalance(fund, account)).to.equal(1) @@ -222,9 +254,17 @@ describe("Vault", function () { let account, account2 beforeEach(async function () { - account = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - await token.connect(controller).approve(vault.address, amount) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account, amount) }) @@ -256,9 +296,9 @@ describe("Vault", function () { it("cannot designate more than the undesignated balance", async function () { await setAutomine(true) await vault.designate(fund, account, amount) - await expect(vault.designate(fund, account, 1)).to.be.revertedWith( - "InsufficientBalance" - ) + await expect( + vault.designate(fund, account, 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) it("cannot designate tokens that are flowing", async function () { @@ -266,7 +306,10 @@ describe("Vault", function () { setAutomine(true) await vault.designate(fund, account, 500) const designating = vault.designate(fund, account, 1) - await expect(designating).to.be.revertedWith("InsufficientBalance") + await expect(designating).to.be.revertedWithCustomError( + vault, + "VaultInsufficientBalance", + ) }) }) @@ -276,10 +319,21 @@ describe("Vault", function () { let account1, account2, account3 beforeEach(async function () { - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - account3 = await vault.encodeAccountId(holder3.address, randomBytes(12)) - await token.connect(controller).approve(vault.address, amount) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + account3 = await vault.encodeAccountId( + await holder3.getAddress(), + randomBytes(12), + ) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account1, amount) }) @@ -314,16 +368,16 @@ describe("Vault", function () { it("does not transfer more than the balance", async function () { await setAutomine(true) await expect( - vault.transfer(fund, account1, account2, amount + 1) - ).to.be.revertedWith("InsufficientBalance") + vault.transfer(fund, account1, account2, amount + 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) it("does not transfer designated tokens", async function () { await setAutomine(true) await vault.designate(fund, account1, 1) await expect( - vault.transfer(fund, account1, account2, amount) - ).to.be.revertedWith("InsufficientBalance") + vault.transfer(fund, account1, account2, amount), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) it("does not transfer tokens that are flowing", async function () { @@ -331,8 +385,8 @@ describe("Vault", function () { setAutomine(true) await vault.transfer(fund, account1, account2, 500) await expect( - vault.transfer(fund, account1, account2, 1) - ).to.be.revertedWith("InsufficientBalance") + vault.transfer(fund, account1, account2, 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) }) @@ -342,10 +396,21 @@ describe("Vault", function () { let account1, account2, account3 beforeEach(async function () { - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - account3 = await vault.encodeAccountId(holder3.address, randomBytes(12)) - await token.connect(controller).approve(vault.address, deposit) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + account3 = await vault.encodeAccountId( + await holder3.getAddress(), + randomBytes(12), + ) + await token + .connect(controller) + .approve(await vault.getAddress(), deposit) await vault.deposit(fund, account1, deposit) }) @@ -355,7 +420,7 @@ describe("Vault", function () { it("moves tokens over time", async function () { await vault.flow(fund, account1, account2, 2) - mine() + await mine() const start = await currentTime() await advanceTimeTo(start + 2) expect(await getBalance(account1)).to.equal(deposit - 4) @@ -464,16 +529,16 @@ describe("Vault", function () { it("rejects flow when insufficient available tokens", async function () { setAutomine(true) await expect( - vault.flow(fund, account1, account2, 11) - ).to.be.revertedWith("InsufficientBalance") + vault.flow(fund, account1, account2, 11), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) it("rejects total flows exceeding available tokens", async function () { await vault.flow(fund, account1, account2, 10) setAutomine(true) await expect( - vault.flow(fund, account1, account2, 1) - ).to.be.revertedWith("InsufficientBalance") + vault.flow(fund, account1, account2, 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) it("cannot flow designated tokens", async function () { @@ -481,8 +546,8 @@ describe("Vault", function () { await vault.flow(fund, account1, account2, 5) setAutomine(true) await expect( - vault.flow(fund, account1, account2, 1) - ).to.be.revertedWith("InsufficientBalance") + vault.flow(fund, account1, account2, 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) }) @@ -493,11 +558,22 @@ describe("Vault", function () { let account1, account2, account3 beforeEach(async function () { - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - account3 = await vault.encodeAccountId(holder3.address, randomBytes(12)) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + account3 = await vault.encodeAccountId( + await holder3.getAddress(), + randomBytes(12), + ) await setAutomine(true) - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account1, amount) }) @@ -511,7 +587,7 @@ describe("Vault", function () { it("burns a number of designated tokens", async function () { await vault.burnDesignated(fund, account1, 10) expect(await vault.getDesignatedBalance(fund, account1)).to.equal( - designated - 10 + designated - 10, ) expect(await vault.getBalance(fund, account1)).to.equal(amount - 10) }) @@ -520,7 +596,7 @@ describe("Vault", function () { await vault.burnDesignated(fund, account1, designated) expect(await vault.getDesignatedBalance(fund, account1)).to.equal(0) expect(await vault.getBalance(fund, account1)).to.equal( - amount - designated + amount - designated, ) }) @@ -539,8 +615,8 @@ describe("Vault", function () { it("cannot burn more than all designated tokens", async function () { await expect( - vault.burnDesignated(fund, account1, designated + 1) - ).to.be.revertedWith("InsufficientBalance") + vault.burnDesignated(fund, account1, designated + 1), + ).to.be.revertedWithCustomError(vault, "VaultInsufficientBalance") }) }) @@ -566,8 +642,8 @@ describe("Vault", function () { it("does not burn tokens from other accounts with the same holder", async function () { const account1a = await vault.encodeAccountId( - holder.address, - randomBytes(12) + await holder.getAddress(), + randomBytes(12), ) await vault.transfer(fund, account1, account1a, 10) await vault.burnAccount(fund, account1) @@ -577,9 +653,15 @@ describe("Vault", function () { it("cannot burn tokens that are flowing", async function () { await vault.flow(fund, account1, account2, 5) const burning1 = vault.burnAccount(fund, account1) - await expect(burning1).to.be.revertedWith("FlowNotZero") + await expect(burning1).to.be.revertedWithCustomError( + vault, + "VaultFlowNotZero", + ) const burning2 = vault.burnAccount(fund, account2) - await expect(burning2).to.be.revertedWith("FlowNotZero") + await expect(burning2).to.be.revertedWithCustomError( + vault, + "VaultFlowNotZero", + ) }) it("can burn tokens that are no longer flowing", async function () { @@ -596,10 +678,19 @@ describe("Vault", function () { let account1, account2, account3 beforeEach(async function () { - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - account3 = await vault.encodeAccountId(holder3.address, randomBytes(12)) - await token.approve(vault.address, deposit) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + account3 = await vault.encodeAccountId( + await holder3.getAddress(), + randomBytes(12), + ) + await token.approve(await vault.getAddress(), deposit) await vault.deposit(fund, account1, deposit) }) @@ -630,25 +721,42 @@ describe("Vault", function () { let account1, account2 beforeEach(async function () { - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) await setAutomine(true) - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account1, amount) }) it("does not allow withdrawal before lock expires", async function () { await setNextBlockTimestamp(expiry - 1) const withdrawing = vault.withdraw(fund, account1) - await expect(withdrawing).to.be.revertedWith("FundNotUnlocked") + await expect(withdrawing).to.be.revertedWithCustomError( + vault, + "VaultFundNotUnlocked", + ) }) it("disallows withdrawal for everyone in the fund", async function () { await vault.transfer(fund, account1, account2, amount / 2) let withdrawing1 = vault.withdraw(fund, account1) let withdrawing2 = vault.withdraw(fund, account2) - await expect(withdrawing1).to.be.revertedWith("FundNotUnlocked") - await expect(withdrawing2).to.be.revertedWith("FundNotUnlocked") + await expect(withdrawing1).to.be.revertedWithCustomError( + vault, + "VaultFundNotUnlocked", + ) + await expect(withdrawing2).to.be.revertedWithCustomError( + vault, + "VaultFundNotUnlocked", + ) }) }) }) @@ -662,9 +770,18 @@ describe("Vault", function () { const beginning = (await currentTime()) + 10 expiry = beginning + 80 maximum = beginning + 100 - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) - account3 = await vault.encodeAccountId(holder3.address, randomBytes(12)) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) + account3 = await vault.encodeAccountId( + await holder3.getAddress(), + randomBytes(12), + ) await setAutomine(false) await setNextBlockTimestamp(beginning) await vault.lock(fund, expiry, maximum) @@ -690,16 +807,22 @@ describe("Vault", function () { it("cannot set lock when lock expired", async function () { await expire() const locking = vault.lock(fund, expiry, maximum) - await expect(locking).to.be.revertedWith("AlreadyLocked") + await expect(locking).to.be.revertedWithCustomError( + vault, + "VaultFundAlreadyLocked", + ) }) it("cannot set lock when no tokens remain", async function () { - await token.connect(controller).approve(vault.address, 30) + await token.connect(controller).approve(await vault.getAddress(), 30) await vault.deposit(fund, account1, 30) await expire() await vault.withdraw(fund, account1) const locking = vault.lock(fund, expiry, maximum) - await expect(locking).to.be.revertedWith("AlreadyLocked") + await expect(locking).to.be.revertedWithCustomError( + vault, + "VaultFundAlreadyLocked", + ) }) }) @@ -707,7 +830,9 @@ describe("Vault", function () { const deposit = 1000 beforeEach(async function () { - await token.connect(controller).approve(vault.address, deposit) + await token + .connect(controller) + .approve(await vault.getAddress(), deposit) await vault.deposit(fund, account1, deposit) }) @@ -736,13 +861,19 @@ describe("Vault", function () { }) it("allows flowing tokens to be withdrawn", async function () { - const balance1Before = await token.balanceOf(holder.address) - const balance2Before = await token.balanceOf(holder2.address) + const balance1Before = await token.balanceOf( + await holder.getAddress(), + ) + const balance2Before = await token.balanceOf( + await holder2.getAddress(), + ) await vault.withdraw(fund, account1) await vault.withdraw(fund, account2) await mine() - const balance1After = await token.balanceOf(holder.address) - const balance2After = await token.balanceOf(holder2.address) + const balance1After = await token.balanceOf(await holder.getAddress()) + const balance2After = await token.balanceOf( + await holder2.getAddress(), + ) expect(balance1After - balance1Before).to.equal(deposit - total) expect(balance2After - balance2Before).to.equal(total) }) @@ -771,13 +902,13 @@ describe("Vault", function () { }) it("allows frozen flows to be withdrawn", async function () { - balance1Before = await token.balanceOf(holder.address) - balance2Before = await token.balanceOf(holder2.address) + balance1Before = await token.balanceOf(await holder.getAddress()) + balance2Before = await token.balanceOf(await holder2.getAddress()) await vault.withdraw(fund, account1) await vault.withdraw(fund, account2) await mine() - balance1After = await token.balanceOf(holder.address) - balance2After = await token.balanceOf(holder2.address) + balance1After = await token.balanceOf(await holder.getAddress()) + balance2After = await token.balanceOf(await holder2.getAddress()) expect(balance1After - balance1Before).to.equal(deposit - total) expect(balance2After - balance2Before).to.equal(total) }) @@ -789,27 +920,31 @@ describe("Vault", function () { beforeEach(async function () { setAutomine(true) - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account1, amount) - await token.connect(controller).approve(vault.address, amount) + await token + .connect(controller) + .approve(await vault.getAddress(), amount) await vault.deposit(fund, account2, amount) }) it("allows controller to withdraw for a recipient", async function () { await expire() - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after - before).to.equal(amount) }) it("allows account holder to withdraw for itself", async function () { await expire() - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault .connect(holder) - .withdrawByRecipient(controller.address, fund, account1) - const after = await token.balanceOf(holder.address) + .withdrawByRecipient(await controller.getAddress(), fund, account1) + const after = await token.balanceOf(await holder.getAddress()) expect(after - before).to.equal(amount) }) @@ -818,8 +953,8 @@ describe("Vault", function () { await expect( vault .connect(holder2) - .withdrawByRecipient(controller.address, fund, account1) - ).to.be.revertedWith("OnlyAccountHolder") + .withdrawByRecipient(await controller.getAddress(), fund, account1), + ).to.be.revertedWithCustomError(vault, "VaultOnlyAccountHolder") }) it("empties the balance when withdrawing", async function () { @@ -830,8 +965,8 @@ describe("Vault", function () { it("does not withdraw other accounts from the same holder", async function () { const account1a = await vault.encodeAccountId( - holder.address, - randomBytes(12) + await holder.getAddress(), + randomBytes(12), ) await vault.transfer(fund, account1, account1a, 10) await expire() @@ -842,9 +977,9 @@ describe("Vault", function () { it("allows designated tokens to be withdrawn", async function () { await vault.designate(fund, account1, 10) await expire() - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after - before).to.equal(amount) }) @@ -852,45 +987,45 @@ describe("Vault", function () { await vault.designate(fund, account1, 10) await expire() await vault.withdraw(fund, account1) - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after).to.equal(before) }) it("can withdraw funds that were transfered in", async function () { await vault.transfer(fund, account1, account3, amount) await expire() - const before = await token.balanceOf(holder3.address) + const before = await token.balanceOf(await holder3.getAddress()) await vault.withdraw(fund, account3) - const after = await token.balanceOf(holder3.address) + const after = await token.balanceOf(await holder3.getAddress()) expect(after - before).to.equal(amount) }) it("cannot withdraw funds that were transfered out", async function () { await vault.transfer(fund, account1, account3, amount) await expire() - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after).to.equal(before) }) it("cannot withdraw more than once", async function () { await expire() await vault.withdraw(fund, account1) - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after).to.equal(before) }) it("cannot withdraw burned tokens", async function () { await vault.burnAccount(fund, account1) await expire() - const before = await token.balanceOf(holder.address) + const before = await token.balanceOf(await holder.getAddress()) await vault.withdraw(fund, account1) - const after = await token.balanceOf(holder.address) + const after = await token.balanceOf(await holder.getAddress()) expect(after).to.equal(before) }) }) @@ -913,8 +1048,11 @@ describe("Vault", function () { beforeEach(async function () { expiry = (await currentTime()) + 100 - account = await vault.encodeAccountId(holder.address, randomBytes(12)) - await token.connect(controller).approve(vault.address, amount) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + await token.connect(controller).approve(await vault.getAddress(), amount) await vault.lock(fund, expiry, expiry) await vault.deposit(fund, account, amount) await vault.freezeFund(fund) @@ -922,12 +1060,18 @@ describe("Vault", function () { it("does not allow setting a lock", async function () { const locking = vault.lock(fund, expiry, expiry) - await expect(locking).to.be.revertedWith("FundAlreadyLocked") + await expect(locking).to.be.revertedWithCustomError( + vault, + "VaultFundAlreadyLocked", + ) }) it("does not allow withdrawal", async function () { const withdrawing = vault.withdraw(fund, account) - await expect(withdrawing).to.be.revertedWith("FundNotUnlocked") + await expect(withdrawing).to.be.revertedWithCustomError( + vault, + "VaultFundNotUnlocked", + ) }) it("unlocks when the lock expires", async function () { @@ -942,56 +1086,65 @@ describe("Vault", function () { let account, account2 beforeEach(async function () { - account = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) + account = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) }) it("does not allow extending of lock", async function () { await expect( - vault.extendLock(fund, (await currentTime()) + 1) - ).to.be.revertedWith("FundNotLocked") + vault.extendLock(fund, (await currentTime()) + 1), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow depositing of tokens", async function () { const amount = 1000 - await token.connect(controller).approve(vault.address, amount) - await expect(vault.deposit(fund, account, amount)).to.be.revertedWith( - "FundNotLocked" - ) + await token.connect(controller).approve(await vault.getAddress(), amount) + await expect( + vault.deposit(fund, account, amount), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow designating tokens", async function () { - await expect(vault.designate(fund, account, 0)).to.be.revertedWith( - "FundNotLocked" - ) + await expect( + vault.designate(fund, account, 0), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow transfer of tokens", async function () { await expect( - vault.transfer(fund, account, account2, 0) - ).to.be.revertedWith("FundNotLocked") + vault.transfer(fund, account, account2, 0), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow new token flows to start", async function () { - await expect(vault.flow(fund, account, account2, 0)).to.be.revertedWith( - "FundNotLocked" - ) + await expect( + vault.flow(fund, account, account2, 0), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow burning of designated tokens", async function () { - await expect(vault.burnDesignated(fund, account, 1)).to.be.revertedWith( - "FundNotLocked" - ) + await expect( + vault.burnDesignated(fund, account, 1), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow burning of accounts", async function () { - await expect(vault.burnAccount(fund, account)).to.be.revertedWith( - "FundNotLocked" - ) + await expect( + vault.burnAccount(fund, account), + ).to.be.revertedWithCustomError(vault, "VaultFundNotLocked") }) it("does not allow freezing of a fund", async function () { - await expect(vault.freezeFund(fund)).to.be.revertedWith("FundNotLocked") + await expect(vault.freezeFund(fund)).to.be.revertedWithCustomError( + vault, + "VaultFundNotLocked", + ) }) } @@ -1014,28 +1167,30 @@ describe("Vault", function () { }) it("does not allow pause to be called by others", async function () { - await expect(vault.connect(other).pause()).to.be.revertedWith( - "UnauthorizedAccount" + await expect(vault.connect(other).pause()).to.be.revertedWithCustomError( + vault, + "OwnableUnauthorizedAccount", ) }) it("does not allow unpause to be called by others", async function () { await vault.connect(owner).pause() - await expect(vault.connect(other).unpause()).to.be.revertedWith( - "UnauthorizedAccount" - ) + await expect( + vault.connect(other).unpause(), + ).to.be.revertedWithCustomError(vault, "OwnableUnauthorizedAccount") }) it("allows the ownership to change", async function () { await vault.connect(owner).pause() - await vault.connect(owner).transferOwnership(owner2.address) + await vault.connect(owner).transferOwnership(await owner2.getAddress()) await expect(vault.connect(owner2).unpause()).not.to.be.reverted }) it("allows the ownership to be renounced", async function () { await vault.connect(owner).renounceOwnership() - await expect(vault.connect(owner).pause()).to.be.revertedWith( - "UnauthorizedAccount" + await expect(vault.connect(owner).pause()).to.be.revertedWithCustomError( + vault, + "OwnableUnauthorizedAccount", ) }) @@ -1047,10 +1202,16 @@ describe("Vault", function () { beforeEach(async function () { expiry = (await currentTime()) + 80 maximum = (await currentTime()) + 100 - account1 = await vault.encodeAccountId(holder.address, randomBytes(12)) - account2 = await vault.encodeAccountId(holder2.address, randomBytes(12)) + account1 = await vault.encodeAccountId( + await holder.getAddress(), + randomBytes(12), + ) + account2 = await vault.encodeAccountId( + await holder2.getAddress(), + randomBytes(12), + ) await vault.lock(fund, expiry, maximum) - await token.approve(vault.address, 1000) + await token.approve(await vault.getAddress(), 1000) await vault.deposit(fund, account1, 1000) await vault.designate(fund, account1, 100) await vault.connect(owner).pause() @@ -1061,70 +1222,73 @@ describe("Vault", function () { await expect( vault .connect(holder) - .withdrawByRecipient(controller.address, fund, account1) + .withdrawByRecipient(await controller.getAddress(), fund, account1), ).not.to.be.reverted }) it("does not allow funds to be locked", async function () { const fund = randomBytes(32) const expiry = (await currentTime()) + 100 - await expect(vault.lock(fund, expiry, expiry)).to.be.revertedWith( - "EnforcedPause" - ) + await expect( + vault.lock(fund, expiry, expiry), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow extending of lock", async function () { - await expect(vault.extendLock(fund, maximum)).to.be.revertedWith( - "EnforcedPause" - ) + await expect( + vault.extendLock(fund, maximum), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow depositing of tokens", async function () { - await token.approve(vault.address, 100) - await expect(vault.deposit(fund, account1, 100)).to.be.revertedWith( - "EnforcedPause" - ) + await token.approve(await vault.getAddress(), 100) + await expect( + vault.deposit(fund, account1, 100), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow designating tokens", async function () { - await expect(vault.designate(fund, account1, 10)).to.be.revertedWith( - "EnforcedPause" - ) + await expect( + vault.designate(fund, account1, 10), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow transfer of tokens", async function () { await expect( - vault.transfer(fund, account1, account2, 10) - ).to.be.revertedWith("EnforcedPause") + vault.transfer(fund, account1, account2, 10), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow new token flows to start", async function () { await expect( - vault.flow(fund, account1, account2, 1) - ).to.be.revertedWith("EnforcedPause") + vault.flow(fund, account1, account2, 1), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow burning of designated tokens", async function () { await expect( - vault.burnDesignated(fund, account1, 10) - ).to.be.revertedWith("EnforcedPause") + vault.burnDesignated(fund, account1, 10), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow burning of accounts", async function () { - await expect(vault.burnAccount(fund, account1)).to.be.revertedWith( - "EnforcedPause" - ) + await expect( + vault.burnAccount(fund, account1), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) it("does not allow freezing of funds", async function () { - await expect(vault.freezeFund(fund)).to.be.revertedWith("EnforcedPause") + await expect(vault.freezeFund(fund)).to.be.revertedWithCustomError( + vault, + "EnforcedPause", + ) }) it("does not allow a controller to withdraw for a recipient", async function () { await advanceTimeTo(expiry) - await expect(vault.withdraw(fund, account1)).to.be.revertedWith( - "EnforcedPause" - ) + await expect( + vault.withdraw(fund, account1), + ).to.be.revertedWithCustomError(vault, "EnforcedPause") }) }) }) @@ -1134,18 +1298,18 @@ describe("Vault", function () { // bug discovered and reported by Aleksander and Jochen from Certora async function reproduceBug() { const account1 = await vault.encodeAccountId( - holder.address, - randomBytes(12) + await holder.getAddress(), + randomBytes(12), ) const account2 = await vault.encodeAccountId( holder.address, - randomBytes(12) + randomBytes(12), ) const expiry1 = (await currentTime()) + 10 const expiry2 = (await currentTime()) + 20 // store tokens in fund - await token.connect(controller).approve(vault.address, 100) + await token.connect(controller).approve(await vault.getAddress(), 100) await vault.lock(fund, expiry1, expiry1) await vault.deposit(fund, account1, 100) @@ -1167,7 +1331,10 @@ describe("Vault", function () { } // bug is fixed by no longer allowing reuse of fund ids - await expect(reproduceBug()).to.be.revertedWith("VaultFundAlreadyLocked") + await expect(reproduceBug()).to.be.revertedWithCustomError( + vault, + "VaultFundAlreadyLocked", + ) }) }) }) diff --git a/test/evm.js b/test/evm.js index 026b6f5..a0fd93c 100644 --- a/test/evm.js +++ b/test/evm.js @@ -1,23 +1,27 @@ -const { ethers } = require("hardhat") +const { + time, + mine, + takeSnapshot, +} = require("@nomicfoundation/hardhat-network-helpers") +const hre = require("hardhat") +const provider = hre.network.provider -let snapshots = [] +const snapshots = [] async function snapshot() { - const id = await ethers.provider.send("evm_snapshot") + const snapshot = await takeSnapshot() const time = await currentTime() - const automine = await ethers.provider.send("hardhat_getAutomine") - snapshots.push({ id, time, automine }) + const automine = await provider.send("hardhat_getAutomine") + snapshots.push({ snapshot, automine, time }) } async function revert() { - const { id, time, automine } = snapshots.pop() - await ethers.provider.send("evm_revert", [id]) - - const current = await currentTime() - const nextTime = Math.max(time + 1, current + 1) - - await ethers.provider.send("evm_setNextBlockTimestamp", [nextTime]) - await ethers.provider.send("evm_setAutomine", [automine]) + const { snapshot, time, automine } = snapshots.pop() + if (snapshot) { + await snapshot.restore() + await setNextBlockTimestamp(time) + await provider.send("evm_setAutomine", [automine]) + } } /** @@ -26,38 +30,33 @@ async function revert() { * When automine mode is disabled, transactions that revert are silently ignored! */ async function setAutomine(enabled) { - await ethers.provider.send("evm_setAutomine", [enabled]) -} - -async function mine() { - await ethers.provider.send("evm_mine") + await provider.send("evm_setAutomine", [enabled]) } async function ensureMinimumBlockHeight(height) { - while ((await ethers.provider.getBlockNumber()) < height) { + while ((await time.latestBlock()) < height) { await mine() } } +async function setNextBlockTimestamp(timestamp) { + return time.setNextBlockTimestamp(timestamp) +} + async function currentTime() { - let block = await ethers.provider.getBlock("latest") - return block.timestamp + return time.latest() } async function advanceTime(seconds) { - await ethers.provider.send("evm_increaseTime", [seconds]) + await time.increase(seconds) await mine() } async function advanceTimeTo(timestamp) { - await setNextBlockTimestamp(timestamp) + await time.setNextBlockTimestamp(timestamp) await mine() } -async function setNextBlockTimestamp(timestamp) { - await ethers.provider.send("evm_setNextBlockTimestamp", [timestamp]) -} - module.exports = { snapshot, revert, diff --git a/test/examples.js b/test/examples.js index 85503af..98d2fb8 100644 --- a/test/examples.js +++ b/test/examples.js @@ -1,6 +1,5 @@ -const { ethers } = require("hardhat") const { hours } = require("./time") -const { hexlify, randomBytes } = ethers.utils +const { hexlify, randomBytes } = require("hardhat").ethers const exampleConfiguration = () => ({ collateral: { @@ -36,7 +35,7 @@ const exampleRequest = async () => { }, content: { cid: Buffer.from("zb2rhheVmk3bLks5MgzTqyznLu1zqGH5jrfTA1eAZXrjx7Vob"), - merkleRoot: Array.from(randomBytes(32)), + merkleRoot: randomBytes(32), }, expiry: hours(1), nonce: hexlify(randomBytes(32)), diff --git a/test/helpers.js b/test/helpers.js new file mode 100644 index 0000000..69607aa --- /dev/null +++ b/test/helpers.js @@ -0,0 +1,15 @@ +module.exports = { + assertDeploymentRejectedWithCustomError: async function ( + customError, + deploymentPromise, + ) { + const error = await expect(deploymentPromise).to.be.rejected + + expect(error) + .to.have.property("message") + .that.contains( + customError, + `Expected error ${expectedError}, but got ${error.message}`, + ) + }, +} diff --git a/test/ids.js b/test/ids.js index 4547565..36ed65c 100644 --- a/test/ids.js +++ b/test/ids.js @@ -1,12 +1,11 @@ -const { ethers } = require("hardhat") -const { keccak256, defaultAbiCoder } = ethers.utils +const { keccak256, AbiCoder } = require("hardhat").ethers function requestId(request) { const Ask = "tuple(uint256, uint256, uint256, uint64, uint64, uint64, int64)" const Content = "tuple(bytes, bytes32)" const Request = "tuple(address, " + Ask + ", " + Content + ", uint64, bytes32)" - return keccak256(defaultAbiCoder.encode([Request], requestToArray(request))) + return keccak256(new AbiCoder().encode([Request], requestToArray(request))) } function askToArray(ask) { @@ -40,7 +39,7 @@ function requestToArray(request) { function slotId(slot) { const types = "tuple(bytes32, uint256)" const values = [slot.request, slot.index] - const encoding = defaultAbiCoder.encode([types], [values]) + const encoding = new AbiCoder().encode([types], [values]) return keccak256(encoding) } diff --git a/test/marketplace.js b/test/marketplace.js index cff1436..df9ca8a 100644 --- a/test/marketplace.js +++ b/test/marketplace.js @@ -4,16 +4,16 @@ const { payoutForDuration } = require("./price") const { collateralPerSlot } = require("./collateral") async function waitUntilCancelled(contract, request) { - const expiry = (await contract.requestExpiry(requestId(request))).toNumber() + const expiry = await contract.requestExpiry(requestId(request)) // We do +1, because the expiry check in contract is done as `>` and not `>=`. - await advanceTimeTo(expiry + 1) + return advanceTimeTo(expiry + 1n) } async function waitUntilSlotsFilled(contract, request, proof, token, slots) { let collateral = collateralPerSlot(request) - await token.approve(contract.address, collateral * slots.length) + await token.approve(await contract.getAddress(), collateral * slots.length) - let requestEnd = (await contract.requestEnd(requestId(request))).toNumber() + let requestEnd = await contract.requestEnd(requestId(request)) const payouts = [] for (let slotIndex of slots) { await contract.reserveSlot(requestId(request), slotIndex) @@ -22,7 +22,7 @@ async function waitUntilSlotsFilled(contract, request, proof, token, slots) { payouts[slotIndex] = payoutForDuration( request, await currentTime(), - requestEnd + requestEnd, ) } @@ -35,14 +35,14 @@ async function waitUntilStarted(contract, request, proof, token) { request, proof, token, - Array.from({ length: request.ask.slots }, (_, i) => i) + Array.from({ length: request.ask.slots }, (_, i) => i), ) } async function waitUntilFinished(contract, requestId) { - const end = (await contract.requestEnd(requestId)).toNumber() + const end = await contract.requestEnd(requestId) // We do +1, because the end check in contract is done as `>` and not `>=`. - await advanceTimeTo(end + 1) + await advanceTimeTo(end + 1n) } async function waitUntilFailed(contract, request) { @@ -72,7 +72,7 @@ function patchOverloads(contract) { if (logicalXor(rewardRecipient, collateralRecipient)) { // XOR, if exactly one is truthy throw new Error( - "Invalid freeSlot overload, you must specify both `rewardRecipient` and `collateralRecipient` or neither." + "Invalid freeSlot overload, you must specify both `rewardRecipient` and `collateralRecipient` or neither.", ) } @@ -96,6 +96,11 @@ function patchOverloads(contract) { } } +function littleEndianToBigInt(littleEndian) { + const buffer = Buffer.from(littleEndian) + return BigInt(`0x${buffer.toString("hex")}`) +} + module.exports = { waitUntilCancelled, waitUntilStarted, @@ -104,4 +109,5 @@ module.exports = { waitUntilFailed, waitUntilSlotFailed, patchOverloads, + littleEndianToBigInt, } diff --git a/test/price.js b/test/price.js index b4e0593..5d28e78 100644 --- a/test/price.js +++ b/test/price.js @@ -9,7 +9,21 @@ function maxPrice(request) { } function payoutForDuration(request, start, end) { - return (end - start) * pricePerSlotPerSecond(request) + return (Number(end) - Number(start)) * pricePerSlotPerSecond(request) } -module.exports = { maxPrice, pricePerSlotPerSecond, payoutForDuration } +function calculatePartialPayout(request, expiresAt, filledAt) { + return (Number(expiresAt) - Number(filledAt)) * pricePerSlotPerSecond(request) +} + +function calculateBalance(balance, reward) { + return BigInt(balance) + BigInt(reward) +} + +module.exports = { + maxPrice, + pricePerSlotPerSecond, + payoutForDuration, + calculatePartialPayout, + calculateBalance, +} diff --git a/test/requests.js b/test/requests.js index 53a18d7..bee33c2 100644 --- a/test/requests.js +++ b/test/requests.js @@ -1,5 +1,4 @@ const { Assertion } = require("chai") -const { currentTime } = require("./evm") const RequestState = { New: 0, @@ -10,13 +9,13 @@ const RequestState = { } const SlotState = { - Free: 0, - Filled: 1, - Finished: 2, - Failed: 3, - Paid: 4, - Cancelled: 5, - Repair: 6, + Free: 0n, + Filled: 1n, + Finished: 2n, + Failed: 3n, + Paid: 4n, + Cancelled: 5n, + Repair: 6n, } function enableRequestAssertions() { @@ -29,21 +28,21 @@ function enableRequestAssertions() { "expected request #{this} to have client #{exp} but got #{act}", "expected request #{this} to not have client #{act}, expected #{exp}", request.client, // expected - actual.client // actual + actual.client, // actual ) this.assert( actual.expiry == request.expiry, "expected request #{this} to have expiry #{exp} but got #{act}", "expected request #{this} to not have expiry #{act}, expected #{exp}", request.expiry, // expected - actual.expiry // actual + actual.expiry, // actual ) this.assert( actual.nonce === request.nonce, "expected request #{this} to have nonce #{exp} but got #{act}", "expected request #{this} to not have nonce #{act}, expected #{exp}", request.nonce, // expected - actual.nonce // actual + actual.nonce, // actual ) }) } diff --git a/verifier/networks/localhost/example-proof/proof.json b/verifier/networks/localhost/example-proof/proof.json new file mode 100644 index 0000000..0d99b1f --- /dev/null +++ b/verifier/networks/localhost/example-proof/proof.json @@ -0,0 +1,28 @@ +{ + "pi_a": [ + "6534256117371673392078914918983405561950705741555607896616281548993166767050", + "4683704071819826577549511087725295557628226569657977399743888281350488008160", + "1" + ], + "pi_b": [ + [ + "5214601005301447749408976517903523691026761713935248596363525026084207179898", + "12928862018496028019248584699701543976607635004280021323367162829172676142063" + ], + [ + "6802359022534661924490571652741723715650845080843101596088257121470226373081", + "13026065833109947056007317243769626467054545801812125911606045634450472294131" + ], + [ + "1", + "0" + ] + ], + "pi_c": [ + "4064922718155280187684708354118623661512911161238889435233679092743470899962", + "16109406845320108508342512724551388830826795687369147885401665396548555026064", + "1" + ], + "protocol": "groth16", + "curve": "bn128" +} \ No newline at end of file diff --git a/verifier/networks/localhost/example-proof/public.json b/verifier/networks/localhost/example-proof/public.json new file mode 100644 index 0000000..36b2e34 --- /dev/null +++ b/verifier/networks/localhost/example-proof/public.json @@ -0,0 +1,5 @@ +[ + "10941033813", + "16074246370508166450132968585287196391860062495017081813239200574579640171677", + "3" +] \ No newline at end of file diff --git a/verifier/networks/localhost/proof_main.circom b/verifier/networks/localhost/proof_main.circom new file mode 100644 index 0000000..1018d4b --- /dev/null +++ b/verifier/networks/localhost/proof_main.circom @@ -0,0 +1,4 @@ +pragma circom 2.0.0; +include "sample_cells.circom"; +// SampleAndProven( maxDepth, maxLog2NSlots, blockTreeDepth, nFieldElemsPerCell, nSamples ) +component main {public [entropy,dataSetRoot,slotIndex]} = SampleAndProve(32, 8, 5, 67, 5); diff --git a/verifier/networks/localhost/proof_main.r1cs b/verifier/networks/localhost/proof_main.r1cs new file mode 100644 index 0000000..8b58ffa Binary files /dev/null and b/verifier/networks/localhost/proof_main.r1cs differ diff --git a/verifier/networks/localhost/proof_main.wasm b/verifier/networks/localhost/proof_main.wasm new file mode 100644 index 0000000..f908d4f Binary files /dev/null and b/verifier/networks/localhost/proof_main.wasm differ diff --git a/verifier/networks/localhost/proof_main.zkey b/verifier/networks/localhost/proof_main.zkey new file mode 100644 index 0000000..5451ad0 Binary files /dev/null and b/verifier/networks/localhost/proof_main.zkey differ diff --git a/verifier/networks/localhost/proof_main_verification_key.json b/verifier/networks/localhost/proof_main_verification_key.json new file mode 100644 index 0000000..5f995ae --- /dev/null +++ b/verifier/networks/localhost/proof_main_verification_key.json @@ -0,0 +1,104 @@ +{ + "protocol": "groth16", + "curve": "bn128", + "nPublic": 3, + "vk_alpha_1": [ + "20491192805390485299153009773594534940189261866228447918068658471970481763042", + "9383485363053290200918347156157836566562967994039712273449902621266178545958", + "1" + ], + "vk_beta_2": [ + [ + "6375614351688725206403948262868962793625744043794305715222011528459656738731", + "4252822878758300859123897981450591353533073413197771768651442665752259397132" + ], + [ + "10505242626370262277552901082094356697409835680220590971873171140371331206856", + "21847035105528745403288232691147584728191162732299865338377159692350059136679" + ], + [ + "1", + "0" + ] + ], + "vk_gamma_2": [ + [ + "10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634" + ], + [ + "8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531" + ], + [ + "1", + "0" + ] + ], + "vk_delta_2": [ + [ + "3431611495862121747865613070227194870328323956412989443038622984801922101560", + "1839332345901382467668376261123176838724068493614256702976446713083234015641" + ], + [ + "4267694917739299737209021244200092851467599237028086467255985366439671917679", + "14005704598922119245150389324584568926199987543485693236347173598336567030859" + ], + [ + "1", + "0" + ] + ], + "vk_alphabeta_12": [ + [ + [ + "2029413683389138792403550203267699914886160938906632433982220835551125967885", + "21072700047562757817161031222997517981543347628379360635925549008442030252106" + ], + [ + "5940354580057074848093997050200682056184807770593307860589430076672439820312", + "12156638873931618554171829126792193045421052652279363021382169897324752428276" + ], + [ + "7898200236362823042373859371574133993780991612861777490112507062703164551277", + "7074218545237549455313236346927434013100842096812539264420499035217050630853" + ] + ], + [ + [ + "7077479683546002997211712695946002074877511277312570035766170199895071832130", + "10093483419865920389913245021038182291233451549023025229112148274109565435465" + ], + [ + "4595479056700221319381530156280926371456704509942304414423590385166031118820", + "19831328484489333784475432780421641293929726139240675179672856274388269393268" + ], + [ + "11934129596455521040620786944827826205713621633706285934057045369193958244500", + "8037395052364110730298837004334506829870972346962140206007064471173334027475" + ] + ] + ], + "IC": [ + [ + "11919420103024546168896650006162652130022732573970705849225139177428442519914", + "17747753383929265689844293401689552935018333420134132157824903795680624926572", + "1" + ], + [ + "13158415194355348546090070151711085027834066488127676886518524272551654481129", + "18831701962118195025265682681702066674741422770850028135520336928884612556978", + "1" + ], + [ + "20882269691461568155321689204947751047717828445545223718893788782534717197527", + "11996193054822748526485644723594571195813487505803351159052936325857690315211", + "1" + ], + [ + "18155166643053044822201627105588517913195535693446564472247126736722594445000", + "13816319482622393060406816684195314200198627617641073470088058848129378231754", + "1" + ] + ] +} \ No newline at end of file diff --git a/verifier/networks/localhost/zkey_hash.json b/verifier/networks/localhost/zkey_hash.json new file mode 100644 index 0000000..c9a88f8 --- /dev/null +++ b/verifier/networks/localhost/zkey_hash.json @@ -0,0 +1 @@ +"65dfa139e1c6dae5f50102cca2a856b759723c6ec6029343c2c6e926b855a6ca"