From ebc2b573375aeed11e2285745c6ea4a16985b21a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 10 Apr 2023 16:59:36 +0200 Subject: [PATCH 001/198] Adding cross-chain Polygon module This commit is a continuation of tBTC expansion to L2s and sidechains. Here we expand tBTC to Polygon. In the deployment scripts we pull a generic L2TBTC from the tbtc-v2/solidity project and then deploy it on the Polygon network. 'PolygonTBTC' will become a canonical tBTC token with a minting authority delegated to 'PolygonWormholeGateway'. 'PolygonWormholeGateway' is a smart contract wrapping and unwrapping Wormhole-specific tBTC representation into the canonical 'PolygonTBTC' token. --- cross-chain/polygon/.eslintignore | 8 + cross-chain/polygon/.eslintrc | 19 + cross-chain/polygon/.gitignore | 14 + cross-chain/polygon/.mocharc.json | 3 + cross-chain/polygon/.prettierignore | 9 + cross-chain/polygon/.prettierrc.js | 11 + cross-chain/polygon/.solhint.json | 7 + cross-chain/polygon/.solhintignore | 2 + cross-chain/polygon/.tsconfig-eslint.json | 1 + cross-chain/polygon/README.adoc | 49 + .../contracts/test/PolygonTBTCUpgraded.sol | 18 + .../test/PolygonWormholeGatewayUpgraded.sol | 18 + .../00_resolve_arbitrum_wormhole_gateway.ts | 28 + .../00_resolve_polygon_token_bridge.ts | 24 + .../00_resolve_polygon_wormhole_tbtc.ts | 24 + .../01_deploy_polygon_tbtc_token.ts | 43 + .../02_deploy_polygon_wormhole_gateway.ts | 71 + ...11_authorize_wormhole_gateway_as_minter.ts | 22 + ...update_self_in_wormhole_gateway_mapping.ts | 27 + ...th_arbitrum_in_wormhole_gateway_mapping.ts | 43 + .../21_transfer_polygon_tbtc_ownership.ts | 15 + ...sfer_polygon_wormhole_gateway_ownership.ts | 19 + .../23_transfer_proxy_admin_ownership.ts | 27 + .../polygon/external/goerli/TokenBridge.json | 3 + .../polygon/external/mainnet/TokenBridge.json | 3 + .../mumbai/ArbitrumWormholeGateway.json | 3 + .../external/mumbai/PolygonTokenBridge.json | 3 + .../external/mumbai/PolygonWormholeTBTC.json | 4 + .../polygon/ArbitrumWormholeGateway.json | 3 + .../external/polygon/PolygonTokenBridge.json | 3 + .../external/polygon/PolygonWormholeTBTC.json | 4 + cross-chain/polygon/hardhat.config.ts | 131 + cross-chain/polygon/package.json | 77 + cross-chain/polygon/slither.config.json | 5 + .../polygon/test/PolygonTBTC.Upgrade.test.ts | 67 + .../PolygonWormholeGateway.Upgrade.test.ts | 83 + cross-chain/polygon/tsconfig.export.json | 8 + cross-chain/polygon/tsconfig.json | 11 + cross-chain/polygon/yarn.lock | 12825 ++++++++++++++++ 39 files changed, 13735 insertions(+) create mode 100644 cross-chain/polygon/.eslintignore create mode 100644 cross-chain/polygon/.eslintrc create mode 100644 cross-chain/polygon/.gitignore create mode 100644 cross-chain/polygon/.mocharc.json create mode 100644 cross-chain/polygon/.prettierignore create mode 100644 cross-chain/polygon/.prettierrc.js create mode 100644 cross-chain/polygon/.solhint.json create mode 100644 cross-chain/polygon/.solhintignore create mode 120000 cross-chain/polygon/.tsconfig-eslint.json create mode 100644 cross-chain/polygon/README.adoc create mode 100644 cross-chain/polygon/contracts/test/PolygonTBTCUpgraded.sol create mode 100644 cross-chain/polygon/contracts/test/PolygonWormholeGatewayUpgraded.sol create mode 100644 cross-chain/polygon/deploy_sidechain/00_resolve_arbitrum_wormhole_gateway.ts create mode 100644 cross-chain/polygon/deploy_sidechain/00_resolve_polygon_token_bridge.ts create mode 100644 cross-chain/polygon/deploy_sidechain/00_resolve_polygon_wormhole_tbtc.ts create mode 100644 cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts create mode 100644 cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts create mode 100644 cross-chain/polygon/deploy_sidechain/11_authorize_wormhole_gateway_as_minter.ts create mode 100644 cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/polygon/deploy_sidechain/21_transfer_polygon_tbtc_ownership.ts create mode 100644 cross-chain/polygon/deploy_sidechain/22_transfer_polygon_wormhole_gateway_ownership.ts create mode 100644 cross-chain/polygon/deploy_sidechain/23_transfer_proxy_admin_ownership.ts create mode 100644 cross-chain/polygon/external/goerli/TokenBridge.json create mode 100644 cross-chain/polygon/external/mainnet/TokenBridge.json create mode 100644 cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json create mode 100644 cross-chain/polygon/external/mumbai/PolygonTokenBridge.json create mode 100644 cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json create mode 100644 cross-chain/polygon/external/polygon/ArbitrumWormholeGateway.json create mode 100644 cross-chain/polygon/external/polygon/PolygonTokenBridge.json create mode 100644 cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json create mode 100644 cross-chain/polygon/hardhat.config.ts create mode 100644 cross-chain/polygon/package.json create mode 100644 cross-chain/polygon/slither.config.json create mode 100644 cross-chain/polygon/test/PolygonTBTC.Upgrade.test.ts create mode 100644 cross-chain/polygon/test/PolygonWormholeGateway.Upgrade.test.ts create mode 100644 cross-chain/polygon/tsconfig.export.json create mode 100644 cross-chain/polygon/tsconfig.json create mode 100644 cross-chain/polygon/yarn.lock diff --git a/cross-chain/polygon/.eslintignore b/cross-chain/polygon/.eslintignore new file mode 100644 index 000000000..6604016c5 --- /dev/null +++ b/cross-chain/polygon/.eslintignore @@ -0,0 +1,8 @@ +artifacts/ +build/ +cache/ +deployments/ +export/ +hardhat-dependency-compiler/ +typechain/ +export.json diff --git a/cross-chain/polygon/.eslintrc b/cross-chain/polygon/.eslintrc new file mode 100644 index 000000000..ff7d92fbd --- /dev/null +++ b/cross-chain/polygon/.eslintrc @@ -0,0 +1,19 @@ +{ + "root": true, + "extends": ["@thesis-co"], + "parserOptions": { + "ecmaVersion": 2017, + "sourceType": "module" + }, + "env": { + "es6": true, + "mocha": true + }, + "rules": { + "new-cap": "off", + "no-promise-executor-return": "off", + "import/no-extraneous-dependencies": "off", + "@typescript-eslint/no-use-before-define": "off", + "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }] + } +} diff --git a/cross-chain/polygon/.gitignore b/cross-chain/polygon/.gitignore new file mode 100644 index 000000000..702b559a6 --- /dev/null +++ b/cross-chain/polygon/.gitignore @@ -0,0 +1,14 @@ +# Hardhat +/artifacts/ +/build/ +/cache/ +/export/ +/external/npm +/typechain/ +/export.json +/deployments/* +!/deployments/mainnet/ +!/deployments/polygon/ + +# OZ +/.openzeppelin/unknown-*.json diff --git a/cross-chain/polygon/.mocharc.json b/cross-chain/polygon/.mocharc.json new file mode 100644 index 000000000..bf101bf08 --- /dev/null +++ b/cross-chain/polygon/.mocharc.json @@ -0,0 +1,3 @@ +{ + "require": "ts-node/register/files" +} diff --git a/cross-chain/polygon/.prettierignore b/cross-chain/polygon/.prettierignore new file mode 100644 index 000000000..6d3a1b378 --- /dev/null +++ b/cross-chain/polygon/.prettierignore @@ -0,0 +1,9 @@ +.openzeppelin/ +artifacts/ +build/ +cache/ +deployments/ +export/ +hardhat-dependency-compiler/ +typechain/ +export.json diff --git a/cross-chain/polygon/.prettierrc.js b/cross-chain/polygon/.prettierrc.js new file mode 100644 index 000000000..49faa7bb9 --- /dev/null +++ b/cross-chain/polygon/.prettierrc.js @@ -0,0 +1,11 @@ +module.exports = { + ...require("@thesis-co/prettier-config"), + overrides: [ + { + files: "*.sol", + options: { + tabWidth: 4, + }, + }, + ], +} diff --git a/cross-chain/polygon/.solhint.json b/cross-chain/polygon/.solhint.json new file mode 100644 index 000000000..474c9ec09 --- /dev/null +++ b/cross-chain/polygon/.solhint.json @@ -0,0 +1,7 @@ +{ + "extends": "keep", + "plugins": [], + "rules": { + "func-visibility": ["error", { "ignoreConstructors": true }] + } +} diff --git a/cross-chain/polygon/.solhintignore b/cross-chain/polygon/.solhintignore new file mode 100644 index 000000000..ef4020b60 --- /dev/null +++ b/cross-chain/polygon/.solhintignore @@ -0,0 +1,2 @@ +hardhat-dependency-compiler/ +node_modules/ diff --git a/cross-chain/polygon/.tsconfig-eslint.json b/cross-chain/polygon/.tsconfig-eslint.json new file mode 120000 index 000000000..e14426659 --- /dev/null +++ b/cross-chain/polygon/.tsconfig-eslint.json @@ -0,0 +1 @@ +node_modules/@thesis-co/eslint-config/.tsconfig-eslint.json \ No newline at end of file diff --git a/cross-chain/polygon/README.adoc b/cross-chain/polygon/README.adoc new file mode 100644 index 000000000..831c24273 --- /dev/null +++ b/cross-chain/polygon/README.adoc @@ -0,0 +1,49 @@ +:toc: macro + += Threshold cross-chain - Polygon + +This package brings Bitcoin to Ethereum Polygon. For more details please +see link:https://github.com/keep-network/tbtc-v2/blob/main/docs/rfc/rfc-8.adoc[RFC 8: Cross-chain Tokenized Threshold BTC] + +== How it works? + +``` ++----------------------------+ +---------------------------------------------------------------------------+ +| Ethereum | | Polygon | +| | | | +| +----------------------+ | | +----------------------+ +-------------------------+ +--------------+ | +| | Wormhole TokenBridge |--|---------|--| Wormhole TokenBridge |--| PolygonWormholeGateway |--| PolygonTBTC | | +| +----------------------+ | | +----------------------+ +-------------------------+ +--------------+ | +| | | | ++----------------------------+ +---------------------------------------------------------------------------+ +``` + +- `PolygonTBTC` canonical tBTC token on Polygon with a minting authority +delegated to `PolygonWormholeGateway`. +- `PolygonWormholeGateway` is a smart contract wrapping and unwrapping +Wormhole-specific tBTC representation into the canonical `PolygonTBTC` token. + +=== Deploy contracts + +To deploy all contracts on the given network, please run: +``` +yarn deploy --network +``` + +Supported networks: +- `hardhat` - for local development +- `mumbai` - testing network +- `polygon` - mainnet + +Currently, this module does not deploy any contracts on L1. All the existing +Wormhole contract addresses that are used in this module are stored under +`external/` dir. + +If contracts haven't been built yet or changes occurred, `deploy` task will build +the contracts before running the deployment script. This command produces +an `export.json` file containing contract deployment info. Note that for the +chains other than `hardhat` the following environment variables are needed: + +- `PARENTCHAIN_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://opt-goerli.g.alchemy.com/v2/` +- `PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>` +- `POLYGONSCAN_API_KEY` - Polygon Etherscan API key diff --git a/cross-chain/polygon/contracts/test/PolygonTBTCUpgraded.sol b/cross-chain/polygon/contracts/test/PolygonTBTCUpgraded.sol new file mode 100644 index 000000000..a9e20e074 --- /dev/null +++ b/cross-chain/polygon/contracts/test/PolygonTBTCUpgraded.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.17; + +import "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol"; + +/// @notice Canonical tBTC Token on Polygon - upgraded version. +/// @dev This contract is intended solely for testing purposes. As it currently +/// stands in the implementation of L2TBTC.sol, there are no reserved +/// storage gap slots available, thereby limiting the upgradability to a +/// child contract only. +contract PolygonTBTCUpgraded is L2TBTC { + string public newVar; + + function initializeV2(string memory _newVar) public { + newVar = _newVar; + } +} diff --git a/cross-chain/polygon/contracts/test/PolygonWormholeGatewayUpgraded.sol b/cross-chain/polygon/contracts/test/PolygonWormholeGatewayUpgraded.sol new file mode 100644 index 000000000..1039c5a98 --- /dev/null +++ b/cross-chain/polygon/contracts/test/PolygonWormholeGatewayUpgraded.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-3.0-only + +pragma solidity ^0.8.17; + +import "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol"; + +/// @notice Wormhole gateway for L2 Polygon - upgraded version. +/// @dev This contract is intended solely for testing purposes. As it currently +/// stands in the implementation of L2WormholeGateway.sol, there are no +/// reserved storage gap slots available, thereby limiting the upgradability +/// to a child contract only. +contract PolygonWormholeGatewayUpgraded is L2WormholeGateway { + string public newVar; + + function initializeV2(string memory _newVar) public { + newVar = _newVar; + } +} diff --git a/cross-chain/polygon/deploy_sidechain/00_resolve_arbitrum_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/00_resolve_arbitrum_wormhole_gateway.ts new file mode 100644 index 000000000..b5bae6abc --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/00_resolve_arbitrum_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const ArbitrumWormholeGateway = await deployments.getOrNull( + "ArbitrumWormholeGateway" + ) + + if ( + ArbitrumWormholeGateway && + helpers.address.isValid(ArbitrumWormholeGateway.address) + ) { + log( + `using existing ArbitrumWormholeGateway at ${ArbitrumWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake ArbitrumWormholeGateway for hardhat network") + } else { + throw new Error("deployed ArbitrumWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["ArbitrumWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_token_bridge.ts b/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_token_bridge.ts new file mode 100644 index 000000000..ed2737710 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_token_bridge.ts @@ -0,0 +1,24 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const PolygonTokenBridge = await deployments.getOrNull("PolygonTokenBridge") + + if ( + PolygonTokenBridge && + helpers.address.isValid(PolygonTokenBridge.address) + ) { + log(`using existing Polygon TokenBridge at ${PolygonTokenBridge.address}`) + } else if (hre.network.name === "hardhat") { + log("using fake Polygon TokenBridge for hardhat network") + } else { + throw new Error("deployed Polygon TokenBridge contract not found") + } +} + +export default func + +func.tags = ["PolygonTokenBridge"] diff --git a/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_wormhole_tbtc.ts b/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_wormhole_tbtc.ts new file mode 100644 index 000000000..4cda97d92 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/00_resolve_polygon_wormhole_tbtc.ts @@ -0,0 +1,24 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const PolygonWormholeTBTC = await deployments.getOrNull("PolygonWormholeTBTC") + + if ( + PolygonWormholeTBTC && + helpers.address.isValid(PolygonWormholeTBTC.address) + ) { + log(`using existing Polygon WormholeTBTC at ${PolygonWormholeTBTC.address}`) + } else if (hre.network.name === "hardhat") { + log("using fake Polygon WormholeTBTC for hardhat network") + } else { + throw new Error("deployed Polygon WormholeTBTC contract not found") + } +} + +export default func + +func.tags = ["PolygonWormholeTBTC"] diff --git a/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts b/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts new file mode 100644 index 000000000..39576c7dc --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts @@ -0,0 +1,43 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, getNamedAccounts, helpers } = hre + const { deployer } = await getNamedAccounts() + + const [, proxyDeployment] = await helpers.upgrades.deployProxy( + "PolygonTBTC", + { + contractName: "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:L2TBTC", + initializerArgs: ["Polygon tBTC v2", "tBTC"], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + } + ) + + // TODO: Investigate the possibility of adding Tenderly verification for the + // sidechain and upgradable proxy. + + // Contracts can be verified on Polygonscan in a similar way as we + // do it on L1 Etherscan + if (hre.network.tags.polygonscan) { + // Polygonscan might not include the recently added proxy transaction right + // after deployment. We need to wait some time so that transaction is + // visible on Polygonscan. + await new Promise((resolve) => setTimeout(resolve, 10000)) + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["PolygonTBTC"] diff --git a/cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts new file mode 100644 index 000000000..04aeed96f --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts @@ -0,0 +1,71 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, getNamedAccounts, helpers, deployments } = hre + const { log } = deployments + const { deployer } = await getNamedAccounts() + + // These are the fake random addresses for local development purposes only. + const fakeTokenBridge = "0x0af5DC16568EFF2d480a43A77E6C409e497FcFb9" + const fakeWormholeTBTC = "0xe1F0b28a3518cCeC430d0d86Ea1725e6256b0296" + + const polygonTokenBridge = await deployments.getOrNull("PolygonTokenBridge") + const polygonWormholeTBTC = await deployments.getOrNull("PolygonWormholeTBTC") + + const polygonTBTC = await deployments.get("PolygonTBTC") + + let polygonTokenBridgeAddress = polygonTokenBridge?.address + if (!polygonTokenBridgeAddress && hre.network.name === "hardhat") { + polygonTokenBridgeAddress = fakeTokenBridge + log(`fake Polygon TokenBridge address ${polygonTokenBridgeAddress}`) + } + + let polygonWormholeTBTCAddress = polygonWormholeTBTC?.address + if (!polygonWormholeTBTCAddress && hre.network.name === "hardhat") { + polygonWormholeTBTCAddress = fakeWormholeTBTC + log(`fake Polygon WormholeTBTC address ${polygonWormholeTBTCAddress}`) + } + + const [, proxyDeployment] = await helpers.upgrades.deployProxy( + "PolygonWormholeGateway", + { + contractName: + "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", + initializerArgs: [ + polygonTokenBridgeAddress, + polygonWormholeTBTCAddress, + polygonTBTC.address, + ], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + } + ) + + // TODO: Investigate the possibility of adding Tenderly verification for the + // sidechain and upgradable proxy. + + // Contracts can be verified on Polygonscan in a similar way as we + // do it on L1 Etherscan + if (hre.network.tags.polygonscan) { + // Polygonscan might not include the recently added proxy transaction right + // after deployment. We need to wait some time so that transaction is + // visible on Polygonscan. + await new Promise((resolve) => setTimeout(resolve, 10000)) + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["PolygonWormholeGateway"] +func.dependencies = ["PolygonTokenBridge", "PolygonWormholeTBTC"] diff --git a/cross-chain/polygon/deploy_sidechain/11_authorize_wormhole_gateway_as_minter.ts b/cross-chain/polygon/deploy_sidechain/11_authorize_wormhole_gateway_as_minter.ts new file mode 100644 index 000000000..44a7365a2 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/11_authorize_wormhole_gateway_as_minter.ts @@ -0,0 +1,22 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() + + const polygonWormholeGateway = await deployments.get("PolygonWormholeGateway") + + await execute( + "PolygonTBTC", + { from: deployer, log: true, waitConfirmations: 1 }, + "addMinter", + polygonWormholeGateway.address + ) +} + +export default func + +func.tags = ["AuthorizeWormholeGateway"] +func.dependencies = ["PolygonTBTC", "PolygonWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..ad174c13e --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts @@ -0,0 +1,27 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Polygon Testnet (Mumbai) and Mainnet + const wormholeChainID = 5 + + const polygonWormholeGateway = await deployments.get("PolygonWormholeGateway") + + await execute( + "PolygonWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + wormholeChainID, + ethers.utils.hexZeroPad(polygonWormholeGateway.address, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["PolygonWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..a8a3ac616 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts @@ -0,0 +1,43 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake ArbitrumWormholeGateway for local development purposes only. + const fakeArbitrumWormholeGateway = + "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Arbitrum Goerli and Mainnet + const arbitrumWormholeChainID = 23 + + // TODO: Add Optimism mapping + + const arbitrumWormholeGateway = await deployments.getOrNull( + "ArbitrumWormholeGateway" + ) + + let arbitrumWormholeGatewayAddress = arbitrumWormholeGateway?.address + if (!arbitrumWormholeGatewayAddress && hre.network.name === "hardhat") { + arbitrumWormholeGatewayAddress = fakeArbitrumWormholeGateway + log( + `fake ArbitrumWormholeGateway address ${arbitrumWormholeGatewayAddress}` + ) + } + + await execute( + "PolygonWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + arbitrumWormholeChainID, + ethers.utils.hexZeroPad(arbitrumWormholeGatewayAddress, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["PolygonWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/21_transfer_polygon_tbtc_ownership.ts b/cross-chain/polygon/deploy_sidechain/21_transfer_polygon_tbtc_ownership.ts new file mode 100644 index 000000000..608428d73 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/21_transfer_polygon_tbtc_ownership.ts @@ -0,0 +1,15 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, helpers } = hre + const { deployer, governance } = await getNamedAccounts() + + await helpers.ownable.transferOwnership("PolygonTBTC", governance, deployer) +} + +export default func + +func.tags = ["TransferPolygonTBTCOwnership"] +func.dependencies = ["PolygonTBTC", "AuthorizeWormholeGateway"] +func.runAtTheEnd = true diff --git a/cross-chain/polygon/deploy_sidechain/22_transfer_polygon_wormhole_gateway_ownership.ts b/cross-chain/polygon/deploy_sidechain/22_transfer_polygon_wormhole_gateway_ownership.ts new file mode 100644 index 000000000..353e101b2 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/22_transfer_polygon_wormhole_gateway_ownership.ts @@ -0,0 +1,19 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, helpers } = hre + const { deployer, governance } = await getNamedAccounts() + + await helpers.ownable.transferOwnership( + "PolygonWormholeGateway", + governance, + deployer + ) +} + +export default func + +func.tags = ["TransferPolygonWormholeGatewayOwnership"] +func.dependencies = ["PolygonWormholeGateway"] +func.runAtTheEnd = true diff --git a/cross-chain/polygon/deploy_sidechain/23_transfer_proxy_admin_ownership.ts b/cross-chain/polygon/deploy_sidechain/23_transfer_proxy_admin_ownership.ts new file mode 100644 index 000000000..d89db673e --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/23_transfer_proxy_admin_ownership.ts @@ -0,0 +1,27 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => { + const { helpers, upgrades, deployments } = hre + const { governance, deployer } = await helpers.signers.getNamedSigners() + const { log } = deployments + + const proxyAdmin = await upgrades.admin.getInstance() + const currentOwner = await proxyAdmin.owner() + + // The `@openzeppelin/hardhat-upgrades` plugin deploys a single ProxyAdmin + // per network. We don't want to transfer the ownership if the owner is already + // set to the desired address. + if (!helpers.address.equal(currentOwner, governance.address)) { + log(`transferring ownership of ProxyAdmin to ${governance.address}`) + await ( + await proxyAdmin.connect(deployer).transferOwnership(governance.address) + ).wait() + } +} + +export default func + +func.tags = ["TransferProxyAdminOwnership"] +func.dependencies = ["PolygonTBTC", "PolygonWormholeGateway"] +func.runAtTheEnd = true diff --git a/cross-chain/polygon/external/goerli/TokenBridge.json b/cross-chain/polygon/external/goerli/TokenBridge.json new file mode 100644 index 000000000..99dc89ed5 --- /dev/null +++ b/cross-chain/polygon/external/goerli/TokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0xF890982f9310df57d00f659cf4fd87e65adEd8d7" +} diff --git a/cross-chain/polygon/external/mainnet/TokenBridge.json b/cross-chain/polygon/external/mainnet/TokenBridge.json new file mode 100644 index 000000000..984412777 --- /dev/null +++ b/cross-chain/polygon/external/mainnet/TokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0x3ee18B2214AFF97000D974cf647E7C347E8fa585" +} diff --git a/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json b/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json new file mode 100644 index 000000000..74c39592d --- /dev/null +++ b/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0xe3e0511EEbD87F08FbaE4486419cb5dFB06e1343" +} diff --git a/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json b/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json new file mode 100644 index 000000000..1101a8259 --- /dev/null +++ b/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE" +} diff --git a/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json b/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json new file mode 100644 index 000000000..64f4bd593 --- /dev/null +++ b/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json @@ -0,0 +1,4 @@ +{ + "address": "0x1111111111111111111111111111111111111111", + "memo": "TODO: needs attestation" +} diff --git a/cross-chain/polygon/external/polygon/ArbitrumWormholeGateway.json b/cross-chain/polygon/external/polygon/ArbitrumWormholeGateway.json new file mode 100644 index 000000000..ffd563462 --- /dev/null +++ b/cross-chain/polygon/external/polygon/ArbitrumWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "0x1293a54e160D1cd7075487898d65266081A15458" +} diff --git a/cross-chain/polygon/external/polygon/PolygonTokenBridge.json b/cross-chain/polygon/external/polygon/PolygonTokenBridge.json new file mode 100644 index 000000000..4558b0d5d --- /dev/null +++ b/cross-chain/polygon/external/polygon/PolygonTokenBridge.json @@ -0,0 +1,3 @@ +{ + "address": "0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b" +} diff --git a/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json b/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json new file mode 100644 index 000000000..64f4bd593 --- /dev/null +++ b/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json @@ -0,0 +1,4 @@ +{ + "address": "0x1111111111111111111111111111111111111111", + "memo": "TODO: needs attestation" +} diff --git a/cross-chain/polygon/hardhat.config.ts b/cross-chain/polygon/hardhat.config.ts new file mode 100644 index 000000000..77b469ecf --- /dev/null +++ b/cross-chain/polygon/hardhat.config.ts @@ -0,0 +1,131 @@ +import type { HardhatUserConfig } from "hardhat/config" + +import "@nomiclabs/hardhat-etherscan" +import "@keep-network/hardhat-helpers" +import "@nomiclabs/hardhat-waffle" +import "hardhat-gas-reporter" +import "hardhat-contract-sizer" +import "hardhat-deploy" +import "@typechain/hardhat" +import "hardhat-dependency-compiler" + +const config: HardhatUserConfig = { + solidity: { + compilers: [ + { + version: "0.8.17", + settings: { + optimizer: { + enabled: true, + runs: 1000, + }, + }, + }, + ], + }, + + paths: { + artifacts: "./build", + }, + + networks: { + hardhat: { + deploy: [ + // "deploy_parentchain", + "deploy_sidechain", + ], + }, + goerli: { + url: process.env.PARENTCHAIN_API_URL || "", + chainId: 5, + deploy: ["deploy_parentchain"], + accounts: process.env.PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS + ? process.env.PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["etherscan"], + }, + mainnet: { + url: process.env.PARENTCHAIN_API_URL || "", + chainId: 1, + deploy: ["deploy_parentchain"], + accounts: process.env.PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS + ? process.env.PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["etherscan"], + }, + mumbai: { + url: process.env.SIDECHAIN_API_URL || "", + chainId: 80001, + deploy: ["deploy_sidechain"], + accounts: process.env.SIDECHAIN_ACCOUNTS_PRIVATE_KEYS + ? process.env.SIDECHAIN_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["polygonscan"], + // companionNetworks: { + // parentchain: "goerli", + // }, + }, + polygon: { + url: process.env.SIDECHAIN_API_URL || "", + chainId: 137, + deploy: ["deploy_sidechain"], + accounts: process.env.SIDECHAIN_ACCOUNTS_PRIVATE_KEYS + ? process.env.SIDECHAIN_ACCOUNTS_PRIVATE_KEYS.split(",") + : undefined, + tags: ["polygonscan"], + // companionNetworks: { + // parentchain: "mainnet", + // }, + }, + }, + + external: { + deployments: { + goerli: ["./external/goerli"], + mainnet: ["./external/mainnet"], + mumbai: ["./external/mumbai"], + polygon: ["./external/polygon"], + }, + }, + + deploymentArtifactsExport: { + goerli: "artifacts/parentchain", + mainnet: "artifacts/parentchain", + mumbai: "artifacts/sidechain", + polygon: "artifacts/sidechain", + }, + + etherscan: { + apiKey: { + goerli: process.env.ETHERSCAN_API_KEY, + mainnet: process.env.ETHERSCAN_API_KEY, + polygonMumbai: process.env.POLYGONSCAN_API_KEY, + polygon: process.env.POLYGONSCAN_API_KEY, + }, + }, + + namedAccounts: { + deployer: { + default: 1, + goerli: 0, + mumbai: 0, + mainnet: "0x123694886DBf5Ac94DDA07135349534536D14cAf", + polygon: "0x123694886DBf5Ac94DDA07135349534536D14cAf", + }, + governance: { + default: 2, + goerli: 0, + mumbai: 0, + mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", + polygon: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", + }, + }, + mocha: { + timeout: 60_000, + }, + typechain: { + outDir: "typechain", + }, +} + +export default config diff --git a/cross-chain/polygon/package.json b/cross-chain/polygon/package.json new file mode 100644 index 000000000..b88c9f9f4 --- /dev/null +++ b/cross-chain/polygon/package.json @@ -0,0 +1,77 @@ +{ + "name": "@keep-network/tbtc-v2-polygon", + "version": "1.0.0-dev", + "description": "tBTC v2 on Polygon", + "license": "GPL-3.0-only", + "files": [ + "artifacts/", + "build/contracts/", + "contracts/", + "!contracts/hardhat-dependency-compiler", + "!**/test/", + "parentchain/", + "sidechain/", + "export/", + "tasks/", + "export.json" + ], + "scripts": { + "build": "hardhat compile", + "clean": "hardhat clean && rm -rf cache/ export/ external/npm typechain/ export.json", + "deploy": "hardhat deploy --export export.json", + "format": "npm run lint", + "format:fix": "npm run lint:fix", + "lint": "npm run lint:eslint && npm run lint:sol && npm run lint:config", + "lint:fix": "npm run lint:fix:eslint && npm run lint:fix:sol && npm run lint:config:fix", + "lint:eslint": "eslint .", + "lint:fix:eslint": "eslint . --fix", + "lint:sol": "solhint 'contracts/**/*.sol' && prettier --check '**/*.sol'", + "lint:fix:sol": "solhint 'contracts/**/*.sol' --fix && prettier --write '**/*.sol'", + "lint:config": "prettier --check '**/*.@(json|yaml)'", + "lint:config:fix": "prettier --write '**/*.@(json|yaml)'", + "prepack": "tsc -p tsconfig.export.json && hardhat export-artifacts export/artifacts", + "export-artifacts:goerli": "yarn hardhat export-deployment-artifacts --network mumbai", + "export-artifacts:mainnet": "yarn hardhat export-deployment-artifacts --network polygon", + "prepublishOnly": "npm run export-artifacts:$npm_config_network", + "test": "hardhat test" + }, + "dependencies": { + "@keep-network/tbtc-v2": "development", + "@openzeppelin/contracts": "^4.8.1", + "@openzeppelin/contracts-upgradeable": "^4.8.1" + }, + "devDependencies": { + "@keep-network/hardhat-helpers": "^0.6.0-pre.20", + "@nomiclabs/hardhat-ethers": "^2.0.6", + "@nomiclabs/hardhat-etherscan": "^3.1.0", + "@nomiclabs/hardhat-waffle": "2.0.3", + "@openzeppelin/hardhat-upgrades": "^1.20.0", + "@thesis-co/eslint-config": "github:thesis/eslint-config", + "@typechain/ethers-v5": "^8.0.5", + "@typechain/hardhat": "^4.0.0", + "@types/chai": "^4.3.0", + "@types/chai-as-promised": "^7.1.1", + "@types/mocha": "^9.1.0", + "@types/node": "^18.11.18", + "chai": "4.3.4", + "eslint": "^7.32.0", + "ethereum-waffle": "3.4.0", + "ethers": "^5.5.3", + "hardhat": "^2.10.0", + "hardhat-contract-sizer": "^2.5.0", + "hardhat-dependency-compiler": "^1.1.2", + "hardhat-deploy": "^0.11.11", + "hardhat-gas-reporter": "^1.0.8", + "prettier": "^2.5.1", + "prettier-plugin-sh": "^0.8.1", + "prettier-plugin-solidity": "^1.0.0-beta.19", + "solhint": "3.3.6", + "solhint-config-keep": "github:keep-network/solhint-config-keep", + "ts-node": "^10.4.0", + "typechain": "^6.1.0", + "typescript": "^4.5.4" + }, + "engines": { + "node": ">=14" + } +} diff --git a/cross-chain/polygon/slither.config.json b/cross-chain/polygon/slither.config.json new file mode 100644 index 000000000..c1495a7e4 --- /dev/null +++ b/cross-chain/polygon/slither.config.json @@ -0,0 +1,5 @@ +{ + "detectors_to_exclude": "assembly,naming-convention,solc-version,timestamp,too-many-digits,similar-names", + "hardhat_artifacts_directory": "build", + "filter_paths": "contracts/test|node_modules" +} diff --git a/cross-chain/polygon/test/PolygonTBTC.Upgrade.test.ts b/cross-chain/polygon/test/PolygonTBTC.Upgrade.test.ts new file mode 100644 index 000000000..8b675fef8 --- /dev/null +++ b/cross-chain/polygon/test/PolygonTBTC.Upgrade.test.ts @@ -0,0 +1,67 @@ +import { deployments, helpers } from "hardhat" +import { expect } from "chai" + +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" + +import type { PolygonTBTC, PolygonTBTCUpgraded } from "../typechain" + +describe("PolygonTBTC - Upgrade", async () => { + let governance: SignerWithAddress + let polygonTBTC: PolygonTBTC + + before(async () => { + await deployments.fixture() + ;({ governance } = await helpers.signers.getNamedSigners()) + + polygonTBTC = (await helpers.contracts.getContract( + "PolygonTBTC" + )) as PolygonTBTC + }) + + describe("when a new contract is valid", () => { + let polygonTBTCUpgraded: PolygonTBTCUpgraded + + before(async () => { + const [upgradedContract] = await helpers.upgrades.upgradeProxy( + "PolygonTBTC", + "PolygonTBTCUpgraded", + { + proxyOpts: { + call: { + fn: "initializeV2", + args: ["Hello darkness my old friend"], + }, + }, + factoryOpts: { + signer: governance, + }, + } + ) + polygonTBTCUpgraded = upgradedContract as PolygonTBTCUpgraded + }) + + it("new instance should have the same address as the old one", async () => { + expect(polygonTBTCUpgraded.address).equal(polygonTBTC.address) + }) + + it("should initialize new variable", async () => { + expect(await polygonTBTCUpgraded.newVar()).to.be.equal( + "Hello darkness my old friend" + ) + }) + + it("should not update already set name", async () => { + expect(await polygonTBTCUpgraded.name()).to.be.equal("Polygon tBTC v2") + }) + + it("should not update already set symbol", async () => { + expect(await polygonTBTCUpgraded.symbol()).to.be.equal("tBTC") + }) + + it("should revert when V1's initializer is called", async () => { + await expect( + polygonTBTCUpgraded.initialize("PolygonTBTCv2", "PolTBTCv2") + ).to.be.revertedWith("Initializable: contract is already initialized") + }) + }) +}) diff --git a/cross-chain/polygon/test/PolygonWormholeGateway.Upgrade.test.ts b/cross-chain/polygon/test/PolygonWormholeGateway.Upgrade.test.ts new file mode 100644 index 000000000..b3f4762cd --- /dev/null +++ b/cross-chain/polygon/test/PolygonWormholeGateway.Upgrade.test.ts @@ -0,0 +1,83 @@ +import { ethers, deployments, helpers } from "hardhat" +import { expect } from "chai" + +import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" + +import type { + PolygonTBTC, + PolygonWormholeGateway, + PolygonWormholeGatewayUpgraded, +} from "../typechain" + +const ZERO_ADDRESS = ethers.constants.AddressZero + +describe("PolygonWormholeGatewayUpgraded - Upgrade", async () => { + let governance: SignerWithAddress + let polygonWormholeGateway: PolygonWormholeGateway + + before(async () => { + await deployments.fixture() + ;({ governance } = await helpers.signers.getNamedSigners()) + + polygonWormholeGateway = (await helpers.contracts.getContract( + "PolygonWormholeGateway" + )) as PolygonWormholeGateway + }) + + describe("when a new contract is valid", () => { + let polygonWormholeGatewayUpgraded: PolygonWormholeGatewayUpgraded + let PolygonTBTC: PolygonTBTC + + before(async () => { + PolygonTBTC = (await helpers.contracts.getContract( + "PolygonTBTC" + )) as PolygonTBTC + + const [upgradedContract] = await helpers.upgrades.upgradeProxy( + "PolygonWormholeGateway", + "PolygonWormholeGatewayUpgraded", + { + proxyOpts: { + call: { + fn: "initializeV2", + args: ["Hello darkness my old friend"], + }, + }, + factoryOpts: { + signer: governance, + }, + } + ) + polygonWormholeGatewayUpgraded = + upgradedContract as PolygonWormholeGatewayUpgraded + }) + + it("new instance should have the same address as the old one", async () => { + expect(polygonWormholeGatewayUpgraded.address).equal( + polygonWormholeGateway.address + ) + }) + + it("should initialize new variable", async () => { + expect(await polygonWormholeGatewayUpgraded.newVar()).to.be.equal( + "Hello darkness my old friend" + ) + }) + + it("should not update already set variable", async () => { + expect(await polygonWormholeGatewayUpgraded.tbtc()).to.be.equal( + PolygonTBTC.address + ) + }) + + it("should revert when V1's initializer is called", async () => { + await expect( + polygonWormholeGatewayUpgraded.initialize( + ZERO_ADDRESS, + ZERO_ADDRESS, + ZERO_ADDRESS + ) + ).to.be.revertedWith("Initializable: contract is already initialized") + }) + }) +}) diff --git a/cross-chain/polygon/tsconfig.export.json b/cross-chain/polygon/tsconfig.export.json new file mode 100644 index 000000000..7832a5ea3 --- /dev/null +++ b/cross-chain/polygon/tsconfig.export.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["./test", "./typechain"], + "compilerOptions": { + "target": "es5", + "outDir": "export" + } +} diff --git a/cross-chain/polygon/tsconfig.json b/cross-chain/polygon/tsconfig.json new file mode 100644 index 000000000..dbf0d98ae --- /dev/null +++ b/cross-chain/polygon/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonJS", + "downlevelIteration": true, + "esModuleInterop": true, + "resolveJsonModule": true + }, + "files": ["./hardhat.config.ts"], + "include": ["./parentchain", "deploy_sidechain", "./test", "./typechain"] +} diff --git a/cross-chain/polygon/yarn.lock b/cross-chain/polygon/yarn.lock new file mode 100644 index 000000000..38639c333 --- /dev/null +++ b/cross-chain/polygon/yarn.lock @@ -0,0 +1,12825 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + +"@babel/code-frame@^7.0.0": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/helper-validator-identifier@^7.18.6": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/runtime@^7.20.7": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" + integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw== + dependencies: + regenerator-runtime "^0.13.11" + +"@celo/base@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/base/-/base-1.5.2.tgz#168ab5e4e30b374079d8d139fafc52ca6bfd4100" + integrity sha512-KGf6Dl9E6D01vAfkgkjL2sG+zqAjspAogILIpWstljWdG5ifyA75jihrnDEHaMCoQS0KxHvTdP1XYS/GS6BEyQ== + +"@celo/connect@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/connect/-/connect-1.5.2.tgz#09f0b03bda6f8a6d523fd010492f204cbe82aabd" + integrity sha512-IHsvYp1HizIPfPPeIHyvsmJytIf7HNtNWo9CqCbsqfNfmw53q6dFJu2p5X0qz/fUnR5840cUga8cEyuYZTfp+w== + dependencies: + "@celo/utils" "1.5.2" + "@types/debug" "^4.1.5" + "@types/utf8" "^2.1.6" + bignumber.js "^9.0.0" + debug "^4.1.1" + utf8 "3.0.0" + +"@celo/contractkit@^0.3.3": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@celo/contractkit/-/contractkit-0.3.8.tgz#aea543761a4921dddd1b1f906d23f8730cce15c7" + integrity sha512-lEXciI3tYnDKNdyazW6etR/ZFm0wrNlX1OxNgzv5D8HCPJcFSUF3Bi4fYtL/Ocx2oHNpK4k3eDZ6aj+ZbkRC+Q== + dependencies: + "@celo/utils" "0.1.11" + "@ledgerhq/hw-app-eth" "^5.11.0" + "@ledgerhq/hw-transport" "^5.11.0" + "@types/debug" "^4.1.5" + bignumber.js "^9.0.0" + cross-fetch "3.0.4" + debug "^4.1.1" + eth-lib "^0.2.8" + ethereumjs-util "^5.2.0" + fp-ts "2.1.1" + io-ts "2.0.1" + web3 "1.2.4" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-eth-abi "1.2.4" + web3-eth-contract "1.2.4" + web3-utils "1.2.4" + +"@celo/contractkit@^1.0.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/contractkit/-/contractkit-1.5.2.tgz#be15d570f3044a190dabb6bbe53d5081c78ea605" + integrity sha512-b0r5TlfYDEscxze1Ai2jyJayiVElA9jvEehMD6aOSNtVhfP8oirjFIIffRe0Wzw1MSDGkw+q1c4m0Yw5sEOlvA== + dependencies: + "@celo/base" "1.5.2" + "@celo/connect" "1.5.2" + "@celo/utils" "1.5.2" + "@celo/wallet-local" "1.5.2" + "@types/debug" "^4.1.5" + bignumber.js "^9.0.0" + cross-fetch "^3.0.6" + debug "^4.1.1" + fp-ts "2.1.1" + io-ts "2.0.1" + semver "^7.3.5" + web3 "1.3.6" + +"@celo/utils@0.1.11": + version "0.1.11" + resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-0.1.11.tgz#c35e3b385091fc6f0c0c355b73270f4a8559ad38" + integrity sha512-i3oK1guBxH89AEBaVA1d5CHnANehL36gPIcSpPBWiYZrKTGGVvbwNmVoaDwaKFXih0N22vXQAf2Rul8w5VzC3w== + dependencies: + "@umpirsky/country-list" "git://github.com/umpirsky/country-list#05fda51" + bigi "^1.1.0" + bignumber.js "^9.0.0" + bip32 "2.0.5" + bip39 "3.0.2" + bls12377js "https://github.com/celo-org/bls12377js#400bcaeec9e7620b040bfad833268f5289699cac" + bn.js "4.11.8" + buffer-reverse "^1.0.1" + country-data "^0.0.31" + crypto-js "^3.1.9-1" + elliptic "^6.4.1" + ethereumjs-util "^5.2.0" + futoin-hkdf "^1.0.3" + google-libphonenumber "^3.2.4" + keccak256 "^1.0.0" + lodash "^4.17.14" + numeral "^2.0.6" + web3-utils "1.2.4" + +"@celo/utils@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-1.5.2.tgz#ddb7f3b50c801225ab41d2355fbe010976329099" + integrity sha512-JyKjuVMbdkyFOb1TpQw6zqamPQWYg7I9hOnva3MeIcQ3ZrJIaNHx0/I+JXFjuu3YYBc1mG8nXp2uPJJTGrwzCQ== + dependencies: + "@celo/base" "1.5.2" + "@types/country-data" "^0.0.0" + "@types/elliptic" "^6.4.9" + "@types/ethereumjs-util" "^5.2.0" + "@types/google-libphonenumber" "^7.4.17" + "@types/lodash" "^4.14.170" + "@types/node" "^10.12.18" + "@types/randombytes" "^2.0.0" + bigi "^1.1.0" + bignumber.js "^9.0.0" + bip32 "2.0.5" + bip39 "https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2" + bls12377js "https://github.com/celo-org/bls12377js#cb38a4cfb643c778619d79b20ca3e5283a2122a6" + bn.js "4.11.8" + buffer-reverse "^1.0.1" + country-data "^0.0.31" + crypto-js "^3.1.9-1" + elliptic "^6.5.4" + ethereumjs-util "^5.2.0" + fp-ts "2.1.1" + google-libphonenumber "^3.2.15" + io-ts "2.0.1" + keccak256 "^1.0.0" + lodash "^4.17.21" + numeral "^2.0.6" + web3-eth-abi "1.3.6" + web3-utils "1.3.6" + +"@celo/wallet-base@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/wallet-base/-/wallet-base-1.5.2.tgz#ae8df425bf3c702277bb1b63a761a2ec8429e7aa" + integrity sha512-NYJu7OtSRFpGcvSMl2Wc8zN32S6oTkAzKqhH7rXisQ0I2q4yNwCzoquzPVYB0G2UVUFKuuxgsA5V+Zda/LQCyw== + dependencies: + "@celo/base" "1.5.2" + "@celo/connect" "1.5.2" + "@celo/utils" "1.5.2" + "@types/debug" "^4.1.5" + "@types/ethereumjs-util" "^5.2.0" + bignumber.js "^9.0.0" + debug "^4.1.1" + eth-lib "^0.2.8" + ethereumjs-util "^5.2.0" + +"@celo/wallet-local@1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@celo/wallet-local/-/wallet-local-1.5.2.tgz#66ea5fb763e19724309e3d56f312f1a342e12b91" + integrity sha512-Aas4SwqQc8ap0OFAOZc+jBR4cXr20V9AReHNEI8Y93R3g1+RlSEJ1Zmsu4vN+Rriz58YqgMnr+pihorw8QydFQ== + dependencies: + "@celo/connect" "1.5.2" + "@celo/utils" "1.5.2" + "@celo/wallet-base" "1.5.2" + "@types/ethereumjs-util" "^5.2.0" + eth-lib "^0.2.8" + ethereumjs-util "^5.2.0" + +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@ensdomains/ens@^0.4.4": + version "0.4.5" + resolved "https://registry.yarnpkg.com/@ensdomains/ens/-/ens-0.4.5.tgz#e0aebc005afdc066447c6e22feb4eda89a5edbfc" + integrity sha512-JSvpj1iNMFjK6K+uVl4unqMoa9rf5jopb8cya5UGBWz23Nw8hSNT7efgUx4BTlAPAgpNlEioUfeTyQ6J9ZvTVw== + 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" + +"@ensdomains/resolver@^0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" + integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== + +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" + integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== + +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^13.9.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + +"@ethereum-waffle/chai@^3.4.0": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/chai/-/chai-3.4.4.tgz#16c4cc877df31b035d6d92486dfdf983df9138ff" + integrity sha512-/K8czydBtXXkcM9X6q29EqEkc5dN3oYenyH2a9hF7rGAApAJUpH8QBtojxOY/xQ2up5W332jqgxwp0yPiYug1g== + dependencies: + "@ethereum-waffle/provider" "^3.4.4" + ethers "^5.5.2" + +"@ethereum-waffle/compiler@^3.4.0": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/compiler/-/compiler-3.4.4.tgz#d568ee0f6029e68b5c645506079fbf67d0dfcf19" + integrity sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ== + 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" + +"@ethereum-waffle/ens@^3.4.4": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/ens/-/ens-3.4.4.tgz#db97ea2c9decbb70b9205d53de2ccbd6f3182ba1" + integrity sha512-0m4NdwWxliy3heBYva1Wr4WbJKLnwXizmy5FfSSr5PMbjI7SIGCdCB59U7/ZzY773/hY3bLnzLwvG5mggVjJWg== + dependencies: + "@ensdomains/ens" "^0.4.4" + "@ensdomains/resolver" "^0.2.4" + ethers "^5.5.2" + +"@ethereum-waffle/mock-contract@^3.3.0": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/mock-contract/-/mock-contract-3.4.4.tgz#fc6ffa18813546f4950a69f5892d4dd54b2c685a" + integrity sha512-Mp0iB2YNWYGUV+VMl5tjPsaXKbKo8MDH9wSJ702l9EBjdxFf/vBvnMBAC1Fub1lLtmD0JHtp1pq+mWzg/xlLnA== + dependencies: + "@ethersproject/abi" "^5.5.0" + ethers "^5.5.2" + +"@ethereum-waffle/provider@^3.4.0", "@ethereum-waffle/provider@^3.4.4": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@ethereum-waffle/provider/-/provider-3.4.4.tgz#398fc1f7eb91cc2df7d011272eacba8af0c7fffb" + integrity sha512-GK8oKJAM8+PKy2nK08yDgl4A80mFuI8zBkE0C9GqTRYQqvuxIyXoLmJ5NZU9lIwyWVv5/KsoA11BgAv2jXE82g== + 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" + +"@ethersproject/abi@5.0.0-beta.153": + version "5.0.0-beta.153" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.0-beta.153.tgz#43a37172b33794e4562999f6e2d555b7599a8eee" + integrity sha512-aXweZ1Z7vMNzJdLpR1CZUAIgnwjrZeUSvN9syCwlBaEBUFJmFY+HHnfuTI5vIhVs/mRkfJVrbEyl51JZQqyjAg== + 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" + +"@ethersproject/abi@5.0.7": + version "5.0.7" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.0.7.tgz#79e52452bd3ca2956d0e1c964207a58ad1a0ee7b" + integrity sha512-Cqktk+hSIckwP/W8O47Eef60VwmoSC/L3lY0+dIBhQPCNn9E4V7rwmm2aFrNRRDJfFlGuZ1khkQUOc3oBX+niw== + dependencies: + "@ethersproject/address" "^5.0.4" + "@ethersproject/bignumber" "^5.0.7" + "@ethersproject/bytes" "^5.0.4" + "@ethersproject/constants" "^5.0.4" + "@ethersproject/hash" "^5.0.4" + "@ethersproject/keccak256" "^5.0.3" + "@ethersproject/logger" "^5.0.5" + "@ethersproject/properties" "^5.0.3" + "@ethersproject/strings" "^5.0.4" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.0-beta.146", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@5.7.0", "@ethersproject/address@>=5.0.0-beta.128", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" + integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@>=5.0.0-beta.130", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@>=5.0.0-beta.129", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@5.7.0", "@ethersproject/constants@>=5.0.0-beta.128", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/contracts@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" + integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + +"@ethersproject/hash@5.7.0", "@ethersproject/hash@>=5.0.0-beta.128", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" + integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" + integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/pbkdf2" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + aes-js "3.0.0" + scrypt-js "3.0.1" + +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@>=5.0.0-beta.127", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@5.7.0", "@ethersproject/logger@>=5.0.0-beta.129", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" + integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + +"@ethersproject/properties@5.7.0", "@ethersproject/properties@>=5.0.0-beta.131", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/providers@5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" + integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" + integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + hash.js "1.1.7" + +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/solidity@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" + integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/strings@5.7.0", "@ethersproject/strings@>=5.0.0-beta.130", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/units@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" + integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/wallet@5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" + integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/hdnode" "^5.7.0" + "@ethersproject/json-wallets" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wordlists" "^5.7.0" + +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" + integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== + dependencies: + "@humanwhocodes/object-schema" "^1.2.0" + debug "^4.1.1" + minimatch "^3.0.4" + +"@humanwhocodes/object-schema@^1.2.0": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@keep-network/bitcoin-spv-sol@3.4.0-solc-0.8": + version "3.4.0-solc-0.8" + resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" + integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== + +"@keep-network/ecdsa@2.1.0-dev.6": + version "2.1.0-dev.6" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.6.tgz#ccc690f784b6e802a5b80b2dfb7127d96e548a25" + integrity sha512-1D74OPVzzxxVcG8za/niuxmwEdDc5R6KNuHsUvsFkcHNJE1UgQNw+QdrI+k3M2so6YrO4L5lP7vTvIvBDbEMNQ== + dependencies: + "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@openzeppelin/contracts-upgradeable" "^4.6.0" + "@threshold-network/solidity-contracts" "1.3.0-dev.3" + +"@keep-network/hardhat-helpers@^0.6.0-pre.20": + version "0.6.0-pre.20" + resolved "https://registry.yarnpkg.com/@keep-network/hardhat-helpers/-/hardhat-helpers-0.6.0-pre.20.tgz#9634c9f013df653f7dfbf2c70307e1a5d0748d1e" + integrity sha512-Qz1waJM3nRo7mrm9+7RbsSL3CtL44i6WN/R6X6+2g9l9vWxWjQMeWW5lBKT6WAxBZYsFQ1opFTm5MxFlcUHB3Q== + +"@keep-network/keep-core@1.8.1-goerli.0": + version "1.8.1-goerli.0" + resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.1-goerli.0.tgz#238485aab51902021d42357bf59695225002f0ab" + integrity sha512-h3La/RqbyEZjBBPg8V+pcRFo3UpWZUF4CxWfXHZnUR4PnkZKnIDrTNFQPhpV2uYFZwrbJxTR9mzOq/DOAiXPwA== + dependencies: + "@openzeppelin/upgrades" "^2.7.2" + openzeppelin-solidity "2.4.0" + +"@keep-network/keep-core@>1.8.1-dev <1.8.1-goerli": + version "1.8.1-dev.0" + resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.1-dev.0.tgz#d95864b25800214de43d8840376a68336cb12055" + integrity sha512-gFXkgN4PYOYCZ14AskL7fZHEFW5mu3BDd+TJKBuKZc1q9CgRMOK+dxpJnSctxmSH1tV+Ln9v9yqlSkfPCoiBHw== + dependencies: + "@openzeppelin/upgrades" "^2.7.2" + openzeppelin-solidity "2.4.0" + +"@keep-network/keep-ecdsa@>1.9.0-dev <1.9.0-ropsten": + version "1.9.0-goerli.0" + resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-goerli.0.tgz#ce58b6639062bb4f73a257557aebb16447889e08" + integrity sha512-EA/oTcxmia5nznQ35ub9/5xBqBK4T+78oWYxASCc+THdPLalzriSAtQ517R4QnvkHi82NFhJjZH8WBoRXniddA== + dependencies: + "@keep-network/keep-core" "1.8.1-goerli.0" + "@keep-network/sortition-pools" "1.2.0-dev.1" + "@openzeppelin/upgrades" "^2.7.2" + openzeppelin-solidity "2.3.0" + +"@keep-network/random-beacon@2.1.0-dev.5": + version "2.1.0-dev.5" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.5.tgz#5ea1a76f57c8171fe3b12ecf4cfcefee38f954ac" + integrity sha512-v3Mqzwx69WqG5bi8qEO4b72PpDMbwl69f5PYHZ0vO3g2pzU1PpVq2nq/vzgdqW2xgztvnHFwOq+lOyN8hx0K3A== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.3" + +"@keep-network/sortition-pools@1.2.0-dev.1": + version "1.2.0-dev.1" + resolved "https://registry.yarnpkg.com/@keep-network/sortition-pools/-/sortition-pools-1.2.0-dev.1.tgz#2ee371f1dd1ff71f6d05c9ddc2a83a4a93ff56b3" + integrity sha512-CaOsvxNWHgXRFwPThDn3C/LiCwq9pL8ICLXXkysRSLw1Hx69wLnToaXYuwyXeIEy5pGqe5+288DBIqvJ3T4+jA== + dependencies: + "@openzeppelin/contracts" "^2.4.0" + +"@keep-network/sortition-pools@^2.0.0-pre.16": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@keep-network/sortition-pools/-/sortition-pools-2.0.0.tgz#04e29ec756d74e00d13505a3e2a7763b06d7a08d" + integrity sha512-82pDOKcDBvHBFblCt0ALVr6qC6mxk339ZqnCfYx1zIPaPhzkw1RKOv28AqPoqzhzcdqLIoPh8g9RS/M2Lplh1A== + dependencies: + "@openzeppelin/contracts" "^4.3.2" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + +"@keep-network/tbtc-v2@development": + version "1.2.0-dev.1" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.2.0-dev.1.tgz#4a1879e4979afbc06f0f9d9356c789ecc0ffea0e" + integrity sha512-cS4kta9XnPPtj5PW64Uso8c19VgEIukpPyCyJ8iXMyHKRmbfZsEw8I0aHmvkyZ2szdbcNJ2qcLL203uHAmyYAA== + dependencies: + "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" + "@keep-network/ecdsa" "2.1.0-dev.6" + "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/tbtc" "1.1.2-dev.1" + "@openzeppelin/contracts" "^4.8.1" + "@openzeppelin/contracts-upgradeable" "^4.8.1" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + +"@keep-network/tbtc@1.1.2-dev.1": + version "1.1.2-dev.1" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc/-/tbtc-1.1.2-dev.1.tgz#dd1e734c0fed50474c74d7170c8749127231d1f9" + integrity sha512-IRa0j1D7JBG8UpduaFxkaq2Ii6F61HhNMUBmxr7kAIZwj/yx8sYXWi921mn0L2Z+hAYNcwEUVhCM91VKQH29pQ== + dependencies: + "@celo/contractkit" "^1.0.2" + "@keep-network/keep-ecdsa" ">1.9.0-dev <1.9.0-ropsten" + "@summa-tx/bitcoin-spv-sol" "^3.1.0" + "@summa-tx/relay-sol" "^2.0.2" + openzeppelin-solidity "2.3.0" + +"@ledgerhq/cryptoassets@^5.53.0": + version "5.53.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets/-/cryptoassets-5.53.0.tgz#11dcc93211960c6fd6620392e4dd91896aaabe58" + integrity sha512-M3ibc3LRuHid5UtL7FI3IC6nMEppvly98QHFoSa7lJU0HDzQxY6zHec/SPM4uuJUC8sXoGVAiRJDkgny54damw== + dependencies: + invariant "2" + +"@ledgerhq/devices@^5.51.1": + version "5.51.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/devices/-/devices-5.51.1.tgz#d741a4a5d8f17c2f9d282fd27147e6fe1999edb7" + integrity sha512-4w+P0VkbjzEXC7kv8T1GJ/9AVaP9I6uasMZ/JcdwZBS3qwvKo5A5z9uGhP5c7TvItzcmPb44b5Mw2kT+WjUuAA== + dependencies: + "@ledgerhq/errors" "^5.50.0" + "@ledgerhq/logs" "^5.50.0" + rxjs "6" + semver "^7.3.5" + +"@ledgerhq/errors@^5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/errors/-/errors-5.50.0.tgz#e3a6834cb8c19346efca214c1af84ed28e69dad9" + integrity sha512-gu6aJ/BHuRlpU7kgVpy2vcYk6atjB4iauP2ymF7Gk0ez0Y/6VSMVSJvubeEQN+IV60+OBK0JgeIZG7OiHaw8ow== + +"@ledgerhq/hw-app-eth@^5.11.0": + version "5.53.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-5.53.0.tgz#5df2d7427db9f387099d0cc437e9730101d7c404" + integrity sha512-LKi/lDA9tW0GdoYP1ng0VY/PXNYjSrwZ1cj0R0MQ9z+knmFlPcVkGK2MEqE8W8cXrC0tjsUXITMcngvpk5yfKA== + dependencies: + "@ledgerhq/cryptoassets" "^5.53.0" + "@ledgerhq/errors" "^5.50.0" + "@ledgerhq/hw-transport" "^5.51.1" + "@ledgerhq/logs" "^5.50.0" + bignumber.js "^9.0.1" + ethers "^5.2.0" + +"@ledgerhq/hw-transport@^5.11.0", "@ledgerhq/hw-transport@^5.51.1": + version "5.51.1" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-5.51.1.tgz#8dd14a8e58cbee4df0c29eaeef983a79f5f22578" + integrity sha512-6wDYdbWrw9VwHIcoDnqWBaDFyviyjZWv6H9vz9Vyhe4Qd7TIFmbTl/eWs6hZvtZBza9K8y7zD8ChHwRI4s9tSw== + dependencies: + "@ledgerhq/devices" "^5.51.1" + "@ledgerhq/errors" "^5.50.0" + events "^3.3.0" + +"@ledgerhq/logs@^5.50.0": + version "5.50.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/logs/-/logs-5.50.0.tgz#29c6419e8379d496ab6d0426eadf3c4d100cd186" + integrity sha512-swKHYCOZUGyVt4ge0u8a7AwNcA//h4nx5wIi0sruGye1IJ5Cva0GyK9L2/WdX+kWVTKp92ZiEo1df31lrWGPgA== + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@morgan-stanley/ts-mocking-bird@^0.6.2": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@morgan-stanley/ts-mocking-bird/-/ts-mocking-bird-0.6.4.tgz#2e4b60d42957bab3b50b67dbf14c3da2f62a39f7" + integrity sha512-57VJIflP8eR2xXa9cD1LUawh+Gh+BVQfVu0n6GALyg/AqV/Nz25kDRvws3i9kIe1PTrbsZZOYpsYp6bXPd6nVA== + dependencies: + lodash "^4.17.16" + uuid "^7.0.3" + +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@nomicfoundation/ethereumjs-block@4.2.2", "@nomicfoundation/ethereumjs-block@^4.0.0": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.2.2.tgz#f317078c810a54381c682d0c12e1e81acfc11599" + integrity sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg== + dependencies: + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-trie" "5.0.5" + "@nomicfoundation/ethereumjs-tx" "4.1.2" + "@nomicfoundation/ethereumjs-util" "8.0.6" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-blockchain@6.2.2", "@nomicfoundation/ethereumjs-blockchain@^6.0.0": + version "6.2.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.2.2.tgz#9f79dd2b3dc73f5d5a220f7d8a734330c4c26320" + integrity sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg== + dependencies: + "@nomicfoundation/ethereumjs-block" "4.2.2" + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-ethash" "2.0.5" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-trie" "5.0.5" + "@nomicfoundation/ethereumjs-util" "8.0.6" + abstract-level "^1.0.3" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + level "^8.0.0" + lru-cache "^5.1.1" + memory-level "^1.0.0" + +"@nomicfoundation/ethereumjs-common@3.1.2", "@nomicfoundation/ethereumjs-common@^3.0.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.1.2.tgz#041086da66ed40f2bf2a2116a1f2f0fcf33fb80d" + integrity sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA== + dependencies: + "@nomicfoundation/ethereumjs-util" "8.0.6" + crc-32 "^1.2.0" + +"@nomicfoundation/ethereumjs-ethash@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.5.tgz#0c605812f6f4589a9f6d597db537bbf3b86469db" + integrity sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ== + dependencies: + "@nomicfoundation/ethereumjs-block" "4.2.2" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-util" "8.0.6" + abstract-level "^1.0.3" + bigint-crypto-utils "^3.0.23" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-evm@1.3.2", "@nomicfoundation/ethereumjs-evm@^1.0.0": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.3.2.tgz#f9d6bafd5c23d07ab75b8649d589af1a43b60bfc" + integrity sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw== + dependencies: + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-util" "8.0.6" + "@types/async-eventemitter" "^0.2.1" + async-eventemitter "^0.2.4" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/ethereumjs-rlp@4.0.3", "@nomicfoundation/ethereumjs-rlp@^4.0.0": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.3.tgz#8d9147fbd0d49e8f4c5ce729d226694a8fe03eb8" + integrity sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA== + +"@nomicfoundation/ethereumjs-statemanager@1.0.5", "@nomicfoundation/ethereumjs-statemanager@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.5.tgz#951cc9ff2c421d40233d2e9d0fe033db2391ee44" + integrity sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA== + dependencies: + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-trie" "5.0.5" + "@nomicfoundation/ethereumjs-util" "8.0.6" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + functional-red-black-tree "^1.0.1" + +"@nomicfoundation/ethereumjs-trie@5.0.5", "@nomicfoundation/ethereumjs-trie@^5.0.0": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.5.tgz#bf31c9306dcbba2007fad668e96109ddb147040c" + integrity sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-util" "8.0.6" + ethereum-cryptography "0.1.3" + readable-stream "^3.6.0" + +"@nomicfoundation/ethereumjs-tx@4.1.2", "@nomicfoundation/ethereumjs-tx@^4.0.0": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.1.2.tgz#8659fad7f9094b7eb82aa6cc3c8097cb1c42ff31" + integrity sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ== + dependencies: + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-util" "8.0.6" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@8.0.6", "@nomicfoundation/ethereumjs-util@^8.0.0": + version "8.0.6" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.6.tgz#dbce5d258b017b37aa58b3a7c330ad59d10ccf0b" + integrity sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-vm@^6.0.0": + version "6.4.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.4.2.tgz#af1cf62e6c0054bc2b7febc8556d032433d1b18c" + integrity sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g== + dependencies: + "@nomicfoundation/ethereumjs-block" "4.2.2" + "@nomicfoundation/ethereumjs-blockchain" "6.2.2" + "@nomicfoundation/ethereumjs-common" "3.1.2" + "@nomicfoundation/ethereumjs-evm" "1.3.2" + "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@nomicfoundation/ethereumjs-statemanager" "1.0.5" + "@nomicfoundation/ethereumjs-trie" "5.0.5" + "@nomicfoundation/ethereumjs-tx" "4.1.2" + "@nomicfoundation/ethereumjs-util" "8.0.6" + "@types/async-eventemitter" "^0.2.1" + async-eventemitter "^0.2.4" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + functional-red-black-tree "^1.0.1" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.1.tgz#4c858096b1c17fe58a474fe81b46815f93645c15" + integrity sha512-KcTodaQw8ivDZyF+D76FokN/HdpgGpfjc/gFCImdLUyqB6eSWVaZPazMbeAjmfhx3R0zm/NYVzxwAokFKgrc0w== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.1.tgz#6e25ccdf6e2d22389c35553b64fe6f3fdaec432c" + integrity sha512-XhQG4BaJE6cIbjAVtzGOGbK3sn1BO9W29uhk9J8y8fZF1DYz0Doj8QDMfpMu+A6TjPDs61lbsmeYodIDnfveSA== + +"@nomicfoundation/solidity-analyzer-freebsd-x64@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-freebsd-x64/-/solidity-analyzer-freebsd-x64-0.1.1.tgz#0a224ea50317139caeebcdedd435c28a039d169c" + integrity sha512-GHF1VKRdHW3G8CndkwdaeLkVBi5A9u2jwtlS7SLhBc8b5U/GcoL39Q+1CSO3hYqePNP+eV5YI7Zgm0ea6kMHoA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.1.tgz#dfa085d9ffab9efb2e7b383aed3f557f7687ac2b" + integrity sha512-g4Cv2fO37ZsUENQ2vwPnZc2zRenHyAxHcyBjKcjaSmmkKrFr64yvzeNO8S3GBFCo90rfochLs99wFVGT/0owpg== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.1.tgz#c9e06b5d513dd3ab02a7ac069c160051675889a4" + integrity sha512-WJ3CE5Oek25OGE3WwzK7oaopY8xMw9Lhb0mlYuJl/maZVo+WtP36XoQTb7bW/i8aAdHW5Z+BqrHMux23pvxG3w== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.1.tgz#8d328d16839e52571f72f2998c81e46bf320f893" + integrity sha512-5WN7leSr5fkUBBjE4f3wKENUy9HQStu7HmWqbtknfXkkil+eNWiBV275IOlpXku7v3uLsXTOKpnnGHJYI2qsdA== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.1.tgz#9b49d0634b5976bb5ed1604a1e1b736f390959bb" + integrity sha512-KdYMkJOq0SYPQMmErv/63CwGwMm5XHenEna9X9aB8mQmhDBrYrlAOSsIPgFCUSL0hjxE3xHP65/EPXR/InD2+w== + +"@nomicfoundation/solidity-analyzer-win32-arm64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-arm64-msvc/-/solidity-analyzer-win32-arm64-msvc-0.1.1.tgz#e2867af7264ebbcc3131ef837878955dd6a3676f" + integrity sha512-VFZASBfl4qiBYwW5xeY20exWhmv6ww9sWu/krWSesv3q5hA0o1JuzmPHR4LPN6SUZj5vcqci0O6JOL8BPw+APg== + +"@nomicfoundation/solidity-analyzer-win32-ia32-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-ia32-msvc/-/solidity-analyzer-win32-ia32-msvc-0.1.1.tgz#0685f78608dd516c8cdfb4896ed451317e559585" + integrity sha512-JnFkYuyCSA70j6Si6cS1A9Gh1aHTEb8kOTBApp/c7NRTFGNMH8eaInKlyuuiIbvYFhlXW4LicqyYuWNNq9hkpQ== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.1": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.1.tgz#c9a44f7108646f083b82e851486e0f6aeb785836" + integrity sha512-HrVJr6+WjIXGnw3Q9u6KQcbZCtk0caVWhCdFADySvRyUxJ8PnzlaP+MhwNE8oyT8OZ6ejHBRrrgjSqDCFXGirw== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.1.tgz#f5f4d36d3f66752f59a57e7208cd856f3ddf6f2d" + integrity sha512-1LMtXj1puAxyFusBgUIy5pZk3073cNXYnXUpuNKFghHbIit/xZgbk0AokpUADbNm3gyD6bFWl3LRFh3dhVdREg== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.1" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-freebsd-x64" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.1" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-arm64-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" + +"@nomiclabs/hardhat-ethers@^2.0.6": + version "2.2.2" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.2.tgz#812d48929c3bf8fe840ec29eab4b613693467679" + integrity sha512-NLDlDFL2us07C0jB/9wzvR0kuLivChJWCXTKcj3yqjZqMoYp7g7wwS157F70VHx/+9gHIBGzak5pKDwG8gEefA== + +"@nomiclabs/hardhat-etherscan@^3.1.0": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz#72e3d5bd5d0ceb695e097a7f6f5ff6fcbf062b9a" + integrity sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + fs-extra "^7.0.1" + lodash "^4.17.11" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" + +"@nomiclabs/hardhat-waffle@2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-waffle/-/hardhat-waffle-2.0.3.tgz#9c538a09c5ed89f68f5fd2dc3f78f16ed1d6e0b1" + integrity sha512-049PHSnI1CZq6+XTbrMbMv5NaL7cednTfPenx02k3cEh8wBMLa6ys++dBETJa6JjfwgA9nBhhHQ173LJv6k2Pg== + dependencies: + "@types/sinon-chai" "^3.2.3" + "@types/web3" "1.0.19" + +"@openzeppelin/contracts-upgradeable@^4.6.0", "@openzeppelin/contracts-upgradeable@^4.8.1": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.2.tgz#edef522bdbc46d478481391553bababdd2199e27" + integrity sha512-zIggnBwemUmmt9IS73qxi+tumALxCY4QEs3zLCII78k0Gfse2hAOdAkuAeLUzvWUpneMUfFE5sGHzEUSTvn4Ag== + +"@openzeppelin/contracts-upgradeable@~4.5.2": + version "4.5.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz#90d9e47bacfd8693bfad0ac8a394645575528d05" + integrity sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA== + +"@openzeppelin/contracts@^2.4.0": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" + integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== + +"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0", "@openzeppelin/contracts@^4.8.1": + version "4.8.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.2.tgz#d815ade0027b50beb9bcca67143c6bcc3e3923d6" + integrity sha512-kEUOgPQszC0fSYWpbh2kT94ltOJwj1qfT2DWo+zVttmGmf97JZ99LspePNaeeaLhCImaHVeBbjaQFZQn7+Zc5g== + +"@openzeppelin/contracts@~4.5.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.5.0.tgz#3fd75d57de172b3743cdfc1206883f56430409cc" + integrity sha512-fdkzKPYMjrRiPK6K4y64e6GzULR7R7RwxSigHS8DDp7aWDeoReqsQI+cxHV1UuhAqX69L1lAaWDxenfP+xiqzA== + +"@openzeppelin/hardhat-upgrades@^1.20.0": + version "1.22.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.22.1.tgz#93e2b3f870c57b00a1ae8a330a2cdd9c2d634eb8" + integrity sha512-MdoitCTLl4zwMU8MeE/bCj+7JMWBEvd38XqJkw36PkJrXlbv6FedDVCPoumMAhpmtymm0nTwTYYklYG+L6WiiQ== + dependencies: + "@openzeppelin/upgrades-core" "^1.20.0" + chalk "^4.1.0" + debug "^4.1.1" + proper-lockfile "^4.1.1" + +"@openzeppelin/upgrades-core@^1.20.0": + version "1.24.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.24.1.tgz#2b0c877f2a404d3384bacd4ce1e29bee14a14ea8" + integrity sha512-QhdIQDUykJ3vQauB6CheV7vk4zgn0e1iY+IDg7r1KqpA1m2bqIGjQCpzidW33K4bZc9zdJSPx2/Z6Um5KxCB7A== + dependencies: + cbor "^8.0.0" + chalk "^4.1.0" + compare-versions "^5.0.0" + debug "^4.1.1" + ethereumjs-util "^7.0.3" + proper-lockfile "^4.1.1" + solidity-ast "^0.4.15" + +"@openzeppelin/upgrades@^2.7.2": + version "2.8.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades/-/upgrades-2.8.0.tgz#8086ab9c99d9f8dac7205030b0f9e7e4a280c4a3" + integrity sha512-LzjTQPeljPsgHDPdZyH9cMCbIHZILgd2cpNcYEkdsC2IylBYRHShlbEDXJV9snnqg9JWfzPiKIqyj3XVliwtqQ== + dependencies: + "@types/cbor" "^2.0.0" + axios "^0.18.0" + bignumber.js "^7.2.0" + cbor "^4.1.5" + chalk "^2.4.1" + ethers "^4.0.20" + glob "^7.1.3" + lodash "^4.17.15" + semver "^5.5.1" + spinnies "^0.4.2" + truffle-flattener "^1.4.0" + web3 "1.2.2" + web3-eth "1.2.2" + web3-eth-contract "1.2.2" + web3-utils "1.2.2" + +"@resolver-engine/core@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.2.1.tgz#0d71803f6d3b8cb2e9ed481a1bf0ca5f5256d0c0" + integrity sha512-nsLQHmPJ77QuifqsIvqjaF5B9aHnDzJjp73Q1z6apY3e9nqYrx4Dtowhpsf7Jwftg/XzVDEMQC+OzUBNTS+S1A== + dependencies: + debug "^3.1.0" + request "^2.85.0" + +"@resolver-engine/core@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" + integrity sha512-eB8nEbKDJJBi5p5SrvrvILn4a0h42bKtbCTri3ZxCGt6UvoQyp7HnGOfki944bUjBSHKK3RvgfViHn+kqdXtnQ== + dependencies: + debug "^3.1.0" + is-url "^1.2.4" + request "^2.85.0" + +"@resolver-engine/fs@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.2.1.tgz#f98a308d77568cc02651d03636f46536b941b241" + integrity sha512-7kJInM1Qo2LJcKyDhuYzh9ZWd+mal/fynfL9BNjWOiTcOpX+jNfqb/UmGUqros5pceBITlWGqS4lU709yHFUbg== + dependencies: + "@resolver-engine/core" "^0.2.1" + debug "^3.1.0" + +"@resolver-engine/fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/fs/-/fs-0.3.3.tgz#fbf83fa0c4f60154a82c817d2fe3f3b0c049a973" + integrity sha512-wQ9RhPUcny02Wm0IuJwYMyAG8fXVeKdmhm8xizNByD4ryZlx6PP6kRen+t/haF43cMfmaV7T3Cx6ChOdHEhFUQ== + dependencies: + "@resolver-engine/core" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports-fs@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.2.2.tgz#5a81ef3285dbf0411ab3b15205080a1ad7622d9e" + integrity sha512-gFCgMvCwyppjwq0UzIjde/WI+yDs3oatJhozG9xdjJdewwtd7LiF0T5i9lrHAUtqrQbqoFE4E+ZMRVHWpWHpKQ== + dependencies: + "@resolver-engine/fs" "^0.2.1" + "@resolver-engine/imports" "^0.2.2" + debug "^3.1.0" + +"@resolver-engine/imports-fs@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports-fs/-/imports-fs-0.3.3.tgz#4085db4b8d3c03feb7a425fbfcf5325c0d1e6c1b" + integrity sha512-7Pjg/ZAZtxpeyCFlZR5zqYkz+Wdo84ugB5LApwriT8XFeQoLwGUj4tZFFvvCuxaNCcqZzCYbonJgmGObYBzyCA== + dependencies: + "@resolver-engine/fs" "^0.3.3" + "@resolver-engine/imports" "^0.3.3" + debug "^3.1.0" + +"@resolver-engine/imports@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.2.2.tgz#d3de55a1bb5f3beb7703fdde743298f321175843" + integrity sha512-u5/HUkvo8q34AA+hnxxqqXGfby5swnH0Myw91o3Sm2TETJlNKXibFGSKBavAH+wvWdBi4Z5gS2Odu0PowgVOUg== + dependencies: + "@resolver-engine/core" "^0.2.1" + debug "^3.1.0" + hosted-git-info "^2.6.0" + +"@resolver-engine/imports@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@resolver-engine/imports/-/imports-0.3.3.tgz#badfb513bb3ff3c1ee9fd56073e3144245588bcc" + integrity sha512-anHpS4wN4sRMwsAbMXhMfOD/y4a4Oo0Cw/5+rue7hSwGWsDOQaAU1ClK1OxjUC35/peazxEl8JaSRRS+Xb8t3Q== + 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" + +"@scure/base@~1.1.0": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" + integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sindresorhus/is@^0.14.0": + version "0.14.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" + integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== + +"@sindresorhus/is@^4.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + +"@solidity-parser/parser@^0.13.2": + version "0.13.2" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.13.2.tgz#b6c71d8ca0b382d90a7bbed241f9bc110af65cbe" + integrity sha512-RwHnpRnfrnD2MSPveYoPh8nhofEvX7fgjHk1Oq+NNvCcLx4r1js91CO9o+F/F3fBzOCyvm8kKRTriFICX/odWw== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@solidity-parser/parser@^0.14.0", "@solidity-parser/parser@^0.14.1": + version "0.14.5" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.5.tgz#87bc3cc7b068e08195c219c91cd8ddff5ef1a804" + integrity sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@solidity-parser/parser@^0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.16.0.tgz#1fb418c816ca1fc3a1e94b08bcfe623ec4e1add4" + integrity sha512-ESipEcHyRHg4Np4SqBCfcXwyxxna1DgFVz69bgpLV8vzl/NP1DtcKsJ4dJZXWQhY/Z4J2LeKBiOkOVZn9ct33Q== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@stablelib/binary@^0.7.2": + version "0.7.2" + resolved "https://registry.yarnpkg.com/@stablelib/binary/-/binary-0.7.2.tgz#1b3392170c8a8741c8b8f843ea294de71aeb2cf7" + integrity sha512-J7iGppeKR112ICTZTAoALcT3yBpTrd2Z/F0wwiOUZPVPTDFTQFWHZZdYzfal9+mY1uMUPRSEnNmDuXRZbtE8Xg== + dependencies: + "@stablelib/int" "^0.5.0" + +"@stablelib/blake2s@^0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@stablelib/blake2s/-/blake2s-0.10.4.tgz#8a708f28a9c78d4a1a9fbcc6ce8bacbda469f302" + integrity sha512-IasdklC7YfXXLmVbnsxqmd66+Ki+Ysbp0BtcrNxAtrGx/HRGjkUZbSTbEa7HxFhBWIstJRcE5ExgY+RCqAiULQ== + dependencies: + "@stablelib/binary" "^0.7.2" + "@stablelib/hash" "^0.5.0" + "@stablelib/wipe" "^0.5.0" + +"@stablelib/blake2xs@0.10.4": + version "0.10.4" + resolved "https://registry.yarnpkg.com/@stablelib/blake2xs/-/blake2xs-0.10.4.tgz#b3ae9e145cbf924a7f598412b586e4af24d10cb7" + integrity sha512-1N0S4cruso/StV9TmoujPGj3RU0Cy42wlZneBWLWby7m2ssnY57l/CsYQSm03TshOoYss4hqc5kwSy5pmWAdUA== + dependencies: + "@stablelib/blake2s" "^0.10.4" + "@stablelib/hash" "^0.5.0" + "@stablelib/wipe" "^0.5.0" + +"@stablelib/hash@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@stablelib/hash/-/hash-0.5.0.tgz#89fe9040a3d4383b1921c7d8a60948bc30846068" + integrity sha512-rlNEBTskjKVl9f4rpRgM2GV3IrZWfNJFY5Y/2tmQtA2ozEkPLoUp9J/uJnBRnOpCsuflPW2z+pwqPbEYOPCHwQ== + +"@stablelib/int@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@stablelib/int/-/int-0.5.0.tgz#cca9225951d55d2de48656755784788633660c2b" + integrity sha512-cuaPoxm3K14LiEICiA3iz0aeGurg75v+haZMV+xloVTw3CT25oMRJgQ6VxZ2p2cHy4kjhVI68kX4oaYrhnTm+g== + +"@stablelib/wipe@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@stablelib/wipe/-/wipe-0.5.0.tgz#a682d5f9448e950e099e537e6f72fc960275d151" + integrity sha512-SifvRV0rTTFR1qEF6G1hondGZyrmiM1laR8PPrO6TZwQG03hJduVbUX8uQk+Q6FdkND2Z9B8uLPyUAquQIk3iA== + +"@summa-tx/bitcoin-spv-sol@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@summa-tx/bitcoin-spv-sol/-/bitcoin-spv-sol-3.1.0.tgz#a2a5391f4430f7bbd87aa3a0bd403bf87a48b7d9" + integrity sha512-YIwxTNCTIsL+qgzcMhzQk9f0A7yQ6dimlLj4i3gGhWrnqBIg3ljBxJ/aj9JRQyIdNDoCPmqS2s8ZZIdyM+vaGQ== + +"@summa-tx/relay-sol@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@summa-tx/relay-sol/-/relay-sol-2.0.2.tgz#32078cf12c1fb7331cb64391bd90af2eb8827211" + integrity sha512-r5pNimQwpHklxrP+LAvNrhz4jdngVw8ret/98Ls1rLhleVCKKOFHpsRnh9zUzIDqlhIOOQwTZNe5wn7Ex63HNA== + dependencies: + "@celo/contractkit" "^0.3.3" + "@summa-tx/bitcoin-spv-sol" "^3.1.0" + bn.js "^5.1.1" + dotenv "^8.2.0" + +"@szmarczak/http-timer@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" + integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA== + dependencies: + defer-to-connect "^1.0.1" + +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" + +"@thesis-co/eslint-config@github:thesis/eslint-config": + version "0.5.0-pre" + resolved "https://codeload.github.com/thesis/eslint-config/tar.gz/495d98594315527450bba336c4319acebcaebb7f" + dependencies: + "@thesis-co/prettier-config" "github:thesis/prettier-config" + "@typescript-eslint/eslint-plugin" ">4.32.0" + "@typescript-eslint/parser" ">4.32.0" + eslint-config-airbnb "^19.0.0" + eslint-config-airbnb-typescript "^17.0.0" + eslint-config-prettier "^8.5.0" + eslint-plugin-import "^2.26.0" + eslint-plugin-jsx-a11y "^6.6.1" + eslint-plugin-no-only-tests "^3.1.0" + eslint-plugin-prettier "^4.2.1" + eslint-plugin-react "^7.31.11" + eslint-plugin-react-hooks "^4.3.0" + +"@thesis-co/prettier-config@github:thesis/prettier-config": + version "0.0.1" + resolved "https://codeload.github.com/thesis/prettier-config/tar.gz/a057ca0bab89fee9ee81ac580c446618c722d75d" + +"@thesis/solidity-contracts@github:thesis/solidity-contracts#4985bcf": + version "0.0.1" + resolved "https://codeload.github.com/thesis/solidity-contracts/tar.gz/4985bcfc28e36eed9838993b16710e1b500f9e85" + dependencies: + "@openzeppelin/contracts" "^4.1.0" + +"@threshold-network/solidity-contracts@1.3.0-dev.3": + version "1.3.0-dev.3" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.3.tgz#aa896b80a083ca8a7cb5219e3c9d1c47e3d86b03" + integrity sha512-BNm5+JKrFvg9hZ02Sp/A+vKs1PQB37rYdcZqLrLhvwDFzHFvL+XA2IXqvN1CznQTeehwnX3DtCcONTVP42i56A== + dependencies: + "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" + "@openzeppelin/contracts" "~4.5.0" + "@openzeppelin/contracts-upgradeable" "~4.5.2" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + +"@typechain/ethers-v5@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz#cd3ca1590240d587ca301f4c029b67bfccd08810" + integrity sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw== + dependencies: + ethers "^5.0.2" + +"@typechain/ethers-v5@^8.0.5": + version "8.0.5" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-8.0.5.tgz#d469420e9a73deb7fa076cde9edb45d713dd1b8c" + integrity sha512-ntpj4cS3v4WlDu+hSKSyj9A3o1tKtWC30RX1gobeYymZColeJiUemC1Kgfa0MWGmInm5CKxoHVhEvYVgPOZn1A== + dependencies: + lodash "^4.17.15" + ts-essentials "^7.0.1" + +"@typechain/hardhat@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-4.0.0.tgz#976d4dcc0d9237602d722801d30adc573c529981" + integrity sha512-SeEKtiHu4Io3LHhE8VV3orJbsj7dwJZX8pzSTv7WQR38P18vOLm2M52GrykVinMpkLK0uVc88ICT58emvfn74w== + dependencies: + fs-extra "^9.1.0" + +"@types/async-eventemitter@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@types/async-eventemitter/-/async-eventemitter-0.2.1.tgz#f8e6280e87e8c60b2b938624b0a3530fb3e24712" + integrity sha512-M2P4Ng26QbAeITiH7w1d7OxtldgfAe0wobpyJzVK/XOb0cUGKU2R4pfAhqcJBXAe2ife5ZOhSv4wk7p+ffURtg== + +"@types/bignumber.js@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@types/bignumber.js/-/bignumber.js-5.0.0.tgz#d9f1a378509f3010a3255e9cc822ad0eeb4ab969" + integrity sha512-0DH7aPGCClywOFaxxjE6UwpN2kQYe9LwuDQMv+zYA97j5GkOMo8e66LYT+a8JYU7jfmUFRZLa9KycxHDsKXJCA== + dependencies: + bignumber.js "*" + +"@types/bn.js@*", "@types/bn.js@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== + dependencies: + "@types/node" "*" + +"@types/bn.js@^4.11.3", "@types/bn.js@^4.11.4", "@types/bn.js@^4.11.5": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/cacheable-request@^6.0.1": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" + integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "^3.1.4" + "@types/node" "*" + "@types/responselike" "^1.0.0" + +"@types/cbor@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/cbor/-/cbor-2.0.0.tgz#c627afc2ee22f23f2337fecb34628a4f97c6afbb" + integrity sha512-yQH0JLcrHrH/GBIFFFq6DAsj9M4rmYsmSpGGGs67JrLGWPepYr2c1YugGjMd2Ib5pebluRAfNPJ4O1p80qX9HQ== + dependencies: + "@types/node" "*" + +"@types/chai-as-promised@^7.1.1": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.5.tgz#6e016811f6c7a64f2eed823191c3a6955094e255" + integrity sha512-jStwss93SITGBwt/niYrkf2C+/1KTeZCZl1LaeezTlqppAKeoQC7jxyqYuP72sxBGKCIbw7oHgbYssIRzT5FCQ== + dependencies: + "@types/chai" "*" + +"@types/chai@*", "@types/chai@^4.3.0": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.4.tgz#e913e8175db8307d78b4e8fa690408ba6b65dee4" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== + +"@types/concat-stream@^1.6.0": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@types/concat-stream/-/concat-stream-1.6.1.tgz#24bcfc101ecf68e886aaedce60dfd74b632a1b74" + integrity sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA== + dependencies: + "@types/node" "*" + +"@types/country-data@^0.0.0": + version "0.0.0" + resolved "https://registry.yarnpkg.com/@types/country-data/-/country-data-0.0.0.tgz#6f5563cae3d148780c5b6539803a29bd93f8f1a1" + integrity sha512-lIxCk6G7AwmUagQ4gIQGxUBnvAq664prFD9nSAz6dgd1XmBXBtZABV/op+QsJsIyaP1GZsf/iXhYKHX3azSRCw== + +"@types/debug@^4.1.5": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" + integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== + dependencies: + "@types/ms" "*" + +"@types/elliptic@^6.4.9": + version "6.4.14" + resolved "https://registry.yarnpkg.com/@types/elliptic/-/elliptic-6.4.14.tgz#7bbaad60567a588c1f08b10893453e6b9b4de48e" + integrity sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ== + dependencies: + "@types/bn.js" "*" + +"@types/ethereumjs-util@^5.2.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@types/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#f49fe8114789ec0871721392c09318c3eb56671b" + integrity sha512-qwQgQqXXTRv2h2AlJef+tMEszLFkCB9dWnrJYIdAwqjubERXEc/geB+S3apRw0yQyTVnsBf8r6BhlrE8vx+3WQ== + dependencies: + "@types/bn.js" "*" + "@types/node" "*" + +"@types/form-data@0.0.33": + version "0.0.33" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-0.0.33.tgz#c9ac85b2a5fd18435b8c85d9ecb50e6d6c893ff8" + integrity sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw== + dependencies: + "@types/node" "*" + +"@types/google-libphonenumber@^7.4.17": + version "7.4.23" + resolved "https://registry.yarnpkg.com/@types/google-libphonenumber/-/google-libphonenumber-7.4.23.tgz#c44c9125d45f042943694d605fd8d8d796cafc3b" + integrity sha512-C3ydakLTQa8HxtYf9ge4q6uT9krDX8smSIxmmW3oACFi5g5vv6T068PRExF7UyWbWpuYiDG8Nm24q2X5XhcZWw== + +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + +"@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/keyv@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + +"@types/lodash@^4.14.170": + version "4.14.192" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.192.tgz#5790406361a2852d332d41635d927f1600811285" + integrity sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A== + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/mkdirp@^0.5.2": + version "0.5.2" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" + integrity sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg== + dependencies: + "@types/node" "*" + +"@types/mocha@^9.1.0": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== + +"@types/ms@*": + version "0.7.31" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" + integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== + +"@types/node-fetch@^2.5.5": + version "2.6.3" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.3.tgz#175d977f5e24d93ad0f57602693c435c57ad7e80" + integrity sha512-ETTL1mOEdq/sxUtgtOhKjyB2Irra4cjxksvcMUR5Zr4n+PxVhsCD9WS46oPbHL3et9Zde7CNRr+WUNlcHvsX+w== + dependencies: + "@types/node" "*" + form-data "^3.0.0" + +"@types/node@*", "@types/node@^18.11.18": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== + +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== + +"@types/node@^10.0.3", "@types/node@^10.12.18", "@types/node@^10.3.2": + version "10.17.60" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" + integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== + +"@types/node@^12.11.7", "@types/node@^12.12.6", "@types/node@^12.6.1": + version "12.20.55" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" + integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== + +"@types/node@^8.0.0": + version "8.10.66" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3" + integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw== + +"@types/pbkdf2@^3.0.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1" + integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + dependencies: + "@types/node" "*" + +"@types/prettier@^2.1.1": + version "2.7.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" + integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + +"@types/qs@^6.2.31", "@types/qs@^6.9.7": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/randombytes@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" + integrity sha512-bz8PhAVlwN72vqefzxa14DKNT8jK/mV66CSjwdVQM/k3Th3EPKfUtdMniwZgMedQTFuywAsfjnZsg+pEnltaMA== + dependencies: + "@types/node" "*" + +"@types/resolve@^0.0.8": + version "0.0.8" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" + integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== + dependencies: + "@types/node" "*" + +"@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" + integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + dependencies: + "@types/node" "*" + +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + +"@types/sinon-chai@^3.2.3": + version "3.2.9" + resolved "https://registry.yarnpkg.com/@types/sinon-chai/-/sinon-chai-3.2.9.tgz#71feb938574bbadcb176c68e5ff1a6014c5e69d4" + integrity sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ== + dependencies: + "@types/chai" "*" + "@types/sinon" "*" + +"@types/sinon@*": + version "10.0.13" + resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-10.0.13.tgz#60a7a87a70d9372d0b7b38cc03e825f46981fb83" + integrity sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ== + dependencies: + "@types/sinonjs__fake-timers" "*" + +"@types/sinonjs__fake-timers@*": + version "8.1.2" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz#bf2e02a3dbd4aecaf95942ecd99b7402e03fad5e" + integrity sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA== + +"@types/underscore@*": + version "1.11.4" + resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.11.4.tgz#62e393f8bc4bd8a06154d110c7d042a93751def3" + integrity sha512-uO4CD2ELOjw8tasUrAhvnn2W4A0ZECOvMjCivJr4gA9pGgjv+qxKWY9GLTMVEK8ej85BxQOocUyE7hImmSQYcg== + +"@types/utf8@^2.1.6": + version "2.1.6" + resolved "https://registry.yarnpkg.com/@types/utf8/-/utf8-2.1.6.tgz#430cabb71a42d0a3613cce5621324fe4f5a25753" + integrity sha512-pRs2gYF5yoKYrgSaira0DJqVg2tFuF+Qjp838xS7K+mJyY2jJzjsrl6y17GbIa4uMRogMbxs+ghNCvKg6XyNrA== + +"@types/web3@1.0.19": + version "1.0.19" + resolved "https://registry.yarnpkg.com/@types/web3/-/web3-1.0.19.tgz#46b85d91d398ded9ab7c85a5dd57cb33ac558924" + integrity sha512-fhZ9DyvDYDwHZUp5/STa9XW2re0E8GxoioYJ4pEUZ13YHpApSagixj7IAdoYH5uAK+UalGq6Ml8LYzmgRA/q+A== + dependencies: + "@types/bn.js" "*" + "@types/underscore" "*" + +"@typescript-eslint/eslint-plugin@>4.32.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.0.tgz#52c8a7a4512f10e7249ca1e2e61f81c62c34365c" + integrity sha512-itag0qpN6q2UMM6Xgk6xoHa0D0/P+M17THnr4SVgqn9Rgam5k/He33MA7/D7QoJcdMxHFyX7U9imaBonAX/6qA== + dependencies: + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/type-utils" "5.57.0" + "@typescript-eslint/utils" "5.57.0" + debug "^4.3.4" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@>4.32.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.0.tgz#f675bf2cd1a838949fd0de5683834417b757e4fa" + integrity sha512-orrduvpWYkgLCyAdNtR1QIWovcNZlEm6yL8nwH/eTxWLd8gsP+25pdLHYzL2QdkqrieaDwLpytHqycncv0woUQ== + dependencies: + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/typescript-estree" "5.57.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz#79ccd3fa7bde0758059172d44239e871e087ea36" + integrity sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw== + dependencies: + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/visitor-keys" "5.57.0" + +"@typescript-eslint/type-utils@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.0.tgz#98e7531c4e927855d45bd362de922a619b4319f2" + integrity sha512-kxXoq9zOTbvqzLbdNKy1yFrxLC6GDJFE2Yuo3KqSwTmDOFjUGeWSakgoXT864WcK5/NAJkkONCiKb1ddsqhLXQ== + dependencies: + "@typescript-eslint/typescript-estree" "5.57.0" + "@typescript-eslint/utils" "5.57.0" + debug "^4.3.4" + tsutils "^3.21.0" + +"@typescript-eslint/types@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.0.tgz#727bfa2b64c73a4376264379cf1f447998eaa132" + integrity sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ== + +"@typescript-eslint/typescript-estree@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz#ebcd0ee3e1d6230e888d88cddf654252d41e2e40" + integrity sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw== + dependencies: + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/visitor-keys" "5.57.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.0.tgz#eab8f6563a2ac31f60f3e7024b91bf75f43ecef6" + integrity sha512-ps/4WohXV7C+LTSgAL5CApxvxbMkl9B9AUZRtnEFonpIxZDIT7wC1xfvuJONMidrkB9scs4zhtRyIwHh4+18kw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.57.0" + "@typescript-eslint/types" "5.57.0" + "@typescript-eslint/typescript-estree" "5.57.0" + eslint-scope "^5.1.1" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.57.0": + version "5.57.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz#e2b2f4174aff1d15eef887ce3d019ecc2d7a8ac1" + integrity sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g== + dependencies: + "@typescript-eslint/types" "5.57.0" + eslint-visitor-keys "^3.3.0" + +"@umpirsky/country-list@git://github.com/umpirsky/country-list#05fda51": + version "1.0.0" + resolved "git://github.com/umpirsky/country-list#05fda51cd97b3294e8175ffed06104c44b3c71d7" + +"@web3-js/scrypt-shim@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@web3-js/scrypt-shim/-/scrypt-shim-0.1.0.tgz#0bf7529ab6788311d3e07586f7d89107c3bea2cc" + integrity sha512-ZtZeWCc/s0nMcdx/+rZwY1EcuRdemOK9ag21ty9UsHkFxsNb/AaoucUz0iPuyGe0Ku+PFuRmWZG7Z7462p9xPw== + dependencies: + scryptsy "^2.1.0" + semver "^6.3.0" + +"@web3-js/websocket@^1.0.29": + version "1.0.30" + resolved "https://registry.yarnpkg.com/@web3-js/websocket/-/websocket-1.0.30.tgz#9ea15b7b582cf3bf3e8bc1f4d3d54c0731a87f87" + integrity sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA== + dependencies: + debug "^2.2.0" + es5-ext "^0.10.50" + nan "^2.14.0" + typedarray-to-buffer "^3.1.5" + yaeti "^0.0.6" + +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + +abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abstract-level/-/abstract-level-1.0.3.tgz#78a67d3d84da55ee15201486ab44c09560070741" + integrity sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA== + dependencies: + buffer "^6.0.3" + catering "^2.1.0" + is-buffer "^2.0.5" + level-supports "^4.0.0" + level-transcoder "^1.0.1" + module-error "^1.0.1" + queue-microtask "^1.2.3" + +abstract-leveldown@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-3.0.0.tgz#5cb89f958a44f526779d740d1440e743e0c30a57" + integrity sha512-KUWx9UWGQD12zsmLNj64/pndaz4iJh/Pj7nopgkfDG6RlCcbMZvT6+9l7dchK4idog2Is8VdC/PvNbFuFmalIQ== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^2.4.1, abstract-leveldown@~2.7.1: + version "2.7.2" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz#87a44d7ebebc341d59665204834c8b7e0932cc93" + integrity sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@^5.0.0, abstract-leveldown@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz#f7128e1f86ccabf7d2893077ce5d06d798e386c6" + integrity sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A== + dependencies: + xtend "~4.0.0" + +abstract-leveldown@~2.6.0: + version "2.6.3" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz#1c5e8c6a5ef965ae8c35dfb3a8770c476b82c4b8" + integrity sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA== + dependencies: + xtend "~4.0.0" + +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +acorn-jsx@^5.0.0, acorn-jsx@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^6.0.7: + version "6.4.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== + +acorn@^7.4.0: + version "7.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" + integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== + +acorn@^8.4.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +aes-js@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== + +aes-js@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.6.1, ajv@^6.9.1: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + 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" + +ajv@^8.0.1: + version "8.12.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-colors@^4.1.1: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== + +ansi-regex@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== + +ansi-regex@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4@4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" + integrity sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ== + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +any-promise@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + +anymatch@~3.1.1, anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +aria-query@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" + integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== + dependencies: + deep-equal "^2.0.5" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA== + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q== + +array-back@^1.0.3, array-back@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" + integrity sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw== + dependencies: + typical "^2.6.0" + +array-back@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" + integrity sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw== + dependencies: + typical "^2.6.1" + +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^4.0.1, array-back@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" + integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== + +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +array-includes@^3.1.5, array-includes@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array-uniq@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ== + +array.prototype.flat@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz#ffc6576a7ca3efc2f46a143b9d1dda9b4b3cf5e2" + integrity sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz#1aae7903c2100433cb8261cd4ed310aab5c4a183" + integrity sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + +array.prototype.reduce@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" + integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-array-method-boxes-properly "^1.0.0" + is-string "^1.0.7" + +array.prototype.tosorted@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz#ccf44738aa2b5ac56578ffda97c03fd3e23dd532" + integrity sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-shim-unscopables "^1.0.0" + get-intrinsic "^1.1.3" + +asap@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== + +asn1.js@^5.2.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" + integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + safer-buffer "^2.1.0" + +asn1@~0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" + integrity sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw== + +ast-parents@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" + integrity sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA== + +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +async-eventemitter@^0.2.2, async-eventemitter@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" + integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== + dependencies: + async "^2.4.0" + +async-limiter@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== + +async@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" + integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== + dependencies: + lodash "^4.17.11" + +async@^1.4.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w== + +async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1: + version "2.6.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" + integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== + dependencies: + lodash "^4.17.14" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA== + +aws4@^1.8.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" + integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== + +axe-core@^4.6.2: + version "4.6.3" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.6.3.tgz#fc0db6fdb65cc7a80ccf85286d91d64ababa3ece" + integrity sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg== + +axios@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3" + integrity sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g== + dependencies: + follow-redirects "1.5.10" + is-buffer "^2.0.2" + +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +axobject-query@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-3.1.1.tgz#3b6e5c6d4e43ca7ba51c5babf99d22a9c68485e1" + integrity sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg== + dependencies: + deep-equal "^2.0.5" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g== + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.0.14, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + 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" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + 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" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + integrity sha512-gCtfYORSG1fUMX4kKraymq607FWgMWg+j42IFPc18kFQEsmtaibP4UrqsXt8FlEJle25HUd4tsoDR7H2wDhe9Q== + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + integrity sha512-RL8n2NiEj+kKztlrVJM9JT1cXzzAdvWFh76xh/H1I4nKwunzE4INBXn8ieCZ+wh4zWszZk7NBS1s/8HR5jDkzQ== + dependencies: + 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@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + integrity sha512-bHkmjcC9lM1kmZcVpA5t2om2nzT/xiZpo6TJq7UlZ3wqKfzia4veeXbIhKvJXAMzhhEBd3cR1IElL5AenWEUpA== + dependencies: + 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@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + integrity sha512-qe5csbhbvq6ccry9G7tkXbzNtcDiH4r51rrPUbwwoTzZ18AqxWYRZT6AOmxrpxKnQBW0pYlBI/8vh73Z//78nQ== + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + integrity sha512-Oo6+e2iX+o9eVvJ9Y5eKL5iryeRdsIkwRYheCuhYdVHsdEQysbc2z2QkqCLIYnNxkT5Ss3ggrHdXiDI7Dhrn4Q== + 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" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + integrity sha512-WfgKFX6swFB1jS2vo+DwivRN4NB8XUdM3ij0Y1gnC21y1tdBoe6xjVnd7NSI6alv+gZXCtJqvrTeMW3fR/c0ng== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + integrity sha512-zAYl3tqerLItvG5cKYw7f1SpvIxS9zi7ohyGHaI9cgDUjAT6YcY9jIEH5CstetP5wHIVSceXwNS7Z5BpJg+rOw== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + integrity sha512-Op9IhEaxhbRT8MDXx2iNuMgciu2V8lDvYCNQbDGjdBNCjaMvyLf4wl4A3b8IgndCyQF8TwfgsQ8T3VD8aX1/pA== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + integrity sha512-VlPiWmqmGJp0x0oK27Out1D+71nVVCTSdlbhIVoaBAj2lUgrNjBCRR9+llO4lTSb2O4r7PJg+RobRkhBrf6ofg== + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + integrity sha512-RYqaPD0mQyQIFRu7Ho5wE2yvA/5jxqCIj/Lv4BXNq23mHYu/vxikOy2JueLiBxQknwapwrJeNCesvY0ZcfnlHg== + 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" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + integrity sha512-sLI+u7sXJh6+ToqDr57Bv973kCepItDhMou0xCP2YPVmR1jkHSCY+p1no8xErbV1Siz5QE8qKT1WIwybSWlqjw== + 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" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha512-n7pFrqQm44TCYvrCDb0MqabAF+JUBq+ijBvNMUxpkLjJaAu32faIexewMumrH5KLLJ1HDyT0PTEqRyAe/GwwuQ== + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha512-Bl3ZiA+LjqaMtNYopA9TYE9HP1tQ+E5dLxE0XrAzcIJeK2UqF0/EaqXwBn9esd4UmTfEab+P+UYQ1GnioFIb/w== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + integrity sha512-B1M5KBP29248dViEo1owyY32lk1ZSH2DaNNrXLGt8lyjjHm7pBqAdQ7VKUPR6EEDO323+OvT3MQXbCin8ooWdA== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + integrity sha512-4Zp4unmHgw30A1eWI5EpACji2qMocisdXhAftfhXoSV9j0Tvj6nRFE3tOmRY912E0FMRm/L5xWE7MGVT2FoLnw== + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + integrity sha512-Z/flU+T9ta0aIEKl1tGEmN/pZiI1uXmCiGFRegKacQfEJzp7iNsKloZmyJlQr+75FCJtiFfGIK03SiCvCt9cPQ== + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + integrity sha512-Gx9CH3Q/3GKbhs07Bszw5fPTlU+ygrOGfAhEt7W2JICwufpC4SuO0mG0+4NykPBSYPMJhqvVlDBU17qB1D+hMQ== + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + integrity sha512-7BgYJujNCg0Ti3x0c/DL3tStvnKS6ktIYOmo9wginv/dfZOrbSZ+qG4IRRHMBOzZ5Awb1skTiAsQXg/+IWkZYw== + dependencies: + 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@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + integrity sha512-PCqwwzODXW7JMrzu+yZIaYbPQSKjDTAsNNlK2l5Gg9g4rz2VzLnZsStvp/3c46GfXpwkyufb3NCyG9+50FF1Vg== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + integrity sha512-2+ujAT2UMBzYFm7tidUsYh+ZoIutxJ3pN9IYrF1/H6dCKtECfhmB8UkHVpyxDwkj0CYbQG35ykoz925TUnBc3A== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + integrity sha512-YiN6sFAQ5lML8JjCmr7uerS5Yc/EMbgg9G8ZNmk2E3nYX4ckHR01wrkeeMijEf5WHNK5TW0Sl0Uu3pv3EdOJWw== + 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" + +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + integrity sha512-5Dy7ZbRinGrNtmWpquZKZ3EGY8sDgIVB4CU8Om8q8tnMLrD/m94cKglVcHps0BCTdZ0TJeeAWOq2TK9MIY6cag== + 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" + +babel-plugin-transform-es2015-computed-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + integrity sha512-C/uAv4ktFP/Hmh01gMTvYvICrKze0XVX9f2PdIXuriCSvUmV9j+u+BB9f5fJK3+878yMK6dkdcq+Ymr9mrcLzw== + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + integrity sha512-aNv/GDAW0j/f4Uy1OEPZn1mqD+Nfy9viFGBfQ5bZyT35YqOiqx7/tXdyfZkJ1sC21NyEsBdfDY6PYmLHF4r5iA== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + integrity sha512-ossocTuPOssfxO2h+Z3/Ea1Vo1wWx31Uqy9vIiJusOP4TbF7tPs9U0sJ9pX9OJPf4lXRGj5+6Gkl/HHKiAP5ug== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + integrity sha512-DLuRwoygCoXx+YfxHLkVx5/NpeSbVwfoTeBykpJK7JhYWlL/O8hgAK/reforUnZDlxasOrVPPJVI/guE3dCwkw== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + integrity sha512-iFp5KIcorf11iBqu/y/a7DK3MN5di3pNCzto61FqCNnUX4qeBwcV1SLqe10oXNnCaxBUImX3SckX2/o1nsrTcg== + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + integrity sha512-tjFl0cwMPpDYyoqYA9li1/7mGFit39XiNX5DKC/uCNjBctMxyL1/PT/l4rSlbvBG1pOKI88STRdUsWXB3/Q9hQ== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + integrity sha512-LnIIdGWIKdw7zwckqx+eGjcS8/cl8D74A3BpJbGjKTFFNJSMrjN4bIh22HY1AlkUbeLG6X6OZj56BDvWD+OeFA== + dependencies: + 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@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" + integrity sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q== + dependencies: + 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@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + integrity sha512-ONFIPsq8y4bls5PPsAWYXH/21Hqv64TBxdje0FvU3MhIV6QM2j5YS7KvAzg/nTIVLot2D2fmFQrFWCbgHlFEjg== + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + integrity sha512-LpVbiT9CLsuAIp3IG0tfbVo81QIhn6pE8xBJ7XSeCtFlMltuar5VuBV6y6Q45tpui9QWcy5i0vLQfCfrnF7Kiw== + dependencies: + 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@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + integrity sha512-8G5hpZMecb53vpD3mjs64NhI1au24TAmokQ4B+TBFBjN9cVoGoOvotdrMMRmHvVZUEvqGUPWL514woru1ChZMA== + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + integrity sha512-8HxlW+BB5HqniD+nLkQ4xSAVq3bR/pcYW9IigY+2y0dI+Y7INFeTbfAQr+63T3E4UDsZGjyb+l9txUnABWxlOQ== + 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" + +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + integrity sha512-mDdocSfUVm1/7Jw/FIRNw9vPrBQNePy6wZJlR8HAUBLybNp1w/6lr6zZ2pjMShee65t/ybR5pT8ulkLzD1xwiw== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + integrity sha512-3Ghhi26r4l3d0Js933E5+IhHwk0A1yiutj9gwvzmFbVV0sPMYk2lekhOufHBswX7NCoSeF4Xrl3sCIuSIa+zOg== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + integrity sha512-CYP359ADryTo3pCsH0oxRo/0yn6UsEZLqYohHmvLQdfS9xkf+MbCzE3/Kolw9OYIY4ZMilH25z/5CbQbwDD+lQ== + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + integrity sha512-x8b9W0ngnKzDMHimVtTfn5ryimars1ByTqsfBDwAqLibmuuQY6pgBQi5z1ErIsUOWBdw1bW9FSz5RZUojM4apg== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + integrity sha512-fz6J2Sf4gYN6gWgRZaoFXmq93X+Li/8vf+fb0sGDVtdeWvxC9y5/bTD7bvfWMEq6zetGEHpWjtzRGSugt5kNqw== + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + integrity sha512-v61Dbbihf5XxnYjtBN04B/JBvsScY37R1cZT5r9permN1cp+b70DY3Ib3fIkgn1DI9U3tGgBJZVD8p/mE/4JbQ== + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + integrity sha512-LzXDmbMkklvNhprr20//RStKVcT8Cu+SQtX18eMHLhjHf2yFzwtQ0S2f0jQ+89rokoNdmwoSqYzAhq86FxlLSQ== + dependencies: + 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@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + integrity sha512-LS+dBkUGlNR15/5WHKe/8Neawx663qttS6AGqoOUhICc9d1KciBvtrQSuc0PI+CxQ2Q/S1aKuJ+u64GtLdcEZg== + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + integrity sha512-j3KtSpjyLSJxNoCDrhwiJad8kw0gJ9REGj8/CqL0HeRyLnvUNYV9zcqluL6QJSXh3nfsLEmSLvwRfGzrgR96Pw== + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-preset-env@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" + integrity sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg== + 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" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha512-veliHlHX06wjaeY8xNITbveXSiI+ASFnOqvne/LaIJIqOWi2Ogmj91KOugEz/hoh/fwMhXNBJPCv8Xaz5CyM4A== + 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" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha512-PCOcLFW7/eazGUKIoqH97sO9A2UYMahsn/yRQ7uOk37iutwjq7ODtcTNF+iFDSHNfkctqsLRjLP7URnOx0T1fg== + dependencies: + 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@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha512-iSxeXx7apsjCHe9c7n8VtRXGzI2Bk1rBSOJgCCjfyXb6v1aCqE1KSEpq/8SXuVN8Ka/Rh1WDTF0MDzkvTA4MIA== + 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" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g== + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babelify@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" + integrity sha512-vID8Fz6pPN5pJMdlUnNFSfrlcx5MUule4k9aKs/zbZPyXxMTcRrB0M4Tarw22L8afr8eYSWxDPYCob3TdrqtlA== + dependencies: + babel-core "^6.0.14" + object-assign "^4.0.0" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +backoff@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/backoff/-/backoff-2.5.0.tgz#f616eda9d3e4b66b8ca7fca79f695722c5f8e26f" + integrity sha512-wC5ihrnUXmR2douXmXLCe5O3zg3GKIyvRi/hi58a/XyRxVI+3/yM0PYueQOZXPXQ9pxBislYkw+sF9b7C/RuMA== + dependencies: + precond "0.2" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2, base-x@^3.0.8: + version "3.0.9" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== + dependencies: + safe-buffer "^5.0.1" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + 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" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w== + dependencies: + tweetnacl "^0.14.3" + +bech32@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +big-integer@^1.6.44: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + +bigi@^1.1.0: + version "1.4.2" + resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" + integrity sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw== + +bigint-crypto-utils@^3.0.23: + version "3.1.8" + resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.1.8.tgz#e2e0f40cf45488f9d7f0e32ff84152aa73819d5d" + integrity sha512-+VMV9Laq8pXLBKKKK49nOoq9bfR3j7NNQAtbA617a4nw9bVLo8rsqkKMBgM2AJWlNX9fEIyYaYX+d0laqYV4tw== + dependencies: + bigint-mod-arith "^3.1.0" + +bigint-mod-arith@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bigint-mod-arith/-/bigint-mod-arith-3.1.2.tgz#658e416bc593a463d97b59766226d0a3021a76b1" + integrity sha512-nx8J8bBeiRR+NlsROFH9jHswW5HO8mgfOSqW0AmjicMMvaONDa8AO+5ViKDUUNytBPWiwfvZP4/Bj4Y3lUfvgQ== + +bignumber.js@*, bignumber.js@^9.0.0, bignumber.js@^9.0.1: + version "9.1.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" + integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== + +bignumber.js@^7.2.0: + version "7.2.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" + integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +bindings@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bip32@2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.5.tgz#e3808a9e97a880dbafd0f5f09ca4a1e14ee275d2" + integrity sha512-zVY4VvJV+b2fS0/dcap/5XLlpqtgwyN8oRkuGgAS1uLOeEp0Yo6Tw2yUTozTtlrMJO3G8n4g/KX/XGFHW6Pq3g== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + +bip39@2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-2.5.0.tgz#51cbd5179460504a63ea3c000db3f787ca051235" + integrity sha512-xwIx/8JKoT2+IPJpFEfXoWdYwP7UVAoUxxLNfGCfVowaJE7yg1Y5B1BVPqlUNsBq5/nGwmFkwRJ8xDW4sX8OdA== + dependencies: + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + safe-buffer "^5.0.1" + unorm "^1.3.3" + +bip39@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.2.tgz#2baf42ff3071fc9ddd5103de92e8f80d9257ee32" + integrity sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +"bip39@https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2": + version "3.0.3" + resolved "https://github.com/bitcoinjs/bip39#d8ea080a18b40f301d4e2219a2991cd2417e83c2" + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bl@^1.0.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7" + integrity sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww== + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +"bls12377js@https://github.com/celo-org/bls12377js#400bcaeec9e7620b040bfad833268f5289699cac": + version "0.1.0" + resolved "https://github.com/celo-org/bls12377js#400bcaeec9e7620b040bfad833268f5289699cac" + dependencies: + "@stablelib/blake2xs" "0.10.4" + "@types/node" "^12.11.7" + big-integer "^1.6.44" + chai "^4.2.0" + mocha "^6.2.2" + ts-node "^8.4.1" + typescript "^3.6.4" + +"bls12377js@https://github.com/celo-org/bls12377js#cb38a4cfb643c778619d79b20ca3e5283a2122a6": + version "0.1.0" + resolved "https://github.com/celo-org/bls12377js#cb38a4cfb643c778619d79b20ca3e5283a2122a6" + dependencies: + "@stablelib/blake2xs" "0.10.4" + "@types/node" "^12.11.7" + big-integer "^1.6.44" + chai "^4.2.0" + mocha "^6.2.2" + ts-node "^8.4.1" + typescript "^3.6.4" + +bluebird@^3.5.0, bluebird@^3.5.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== + +bn.js@4.11.8: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^4.8.0: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +body-parser@^1.16.0: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + 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" + +braces@^3.0.2, braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.0.1, brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-level@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browser-level/-/browser-level-1.0.1.tgz#36e8c3183d0fe1c405239792faaab5f315871011" + integrity sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.1" + module-error "^1.0.2" + run-parallel-limit "^1.1.0" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" + integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== + dependencies: + bn.js "^5.0.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" + integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== + 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" + +browserslist@^3.2.6: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-alloc-unsafe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0" + integrity sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg== + +buffer-alloc@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec" + integrity sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow== + dependencies: + buffer-alloc-unsafe "^1.1.0" + buffer-fill "^1.0.0" + +buffer-crc32@~0.2.3: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== + +buffer-fill@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" + integrity sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ== + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-reverse@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-reverse/-/buffer-reverse-1.0.1.tgz#49283c8efa6f901bc01fa3304d06027971ae2f60" + integrity sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg== + +buffer-to-arraybuffer@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz#6064a40fa76eb43c723aba9ef8f6e1216d10511a" + integrity sha512-3dthu5CYiVB1DEJp61FtApNnNndTckcqe4pFcLdvHtrpG+kcyekCJKg4MRiDcFW7A6AODnXB9U4dwQiCW5kzJQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +buffer-xor@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-2.0.2.tgz#34f7c64f04c777a1f8aac5e661273bb9dd320289" + integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== + dependencies: + safe-buffer "^5.1.1" + +buffer@^5.0.5, buffer@^5.2.1, buffer@^5.5.0, buffer@^5.6.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bufferutil@^4.0.1: + version "4.0.7" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.7.tgz#60c0d19ba2c992dd8273d3f73772ffc894c153ad" + integrity sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw== + dependencies: + node-gyp-build "^4.3.0" + +busboy@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" + integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== + dependencies: + streamsearch "^1.1.0" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +bytewise-core@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/bytewise-core/-/bytewise-core-1.2.3.tgz#3fb410c7e91558eb1ab22a82834577aa6bd61d42" + integrity sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA== + dependencies: + typewise-core "^1.2" + +bytewise@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/bytewise/-/bytewise-1.1.0.tgz#1d13cbff717ae7158094aa881b35d081b387253e" + integrity sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ== + dependencies: + bytewise-core "^1.2.2" + typewise "^1.0.3" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + 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" + +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + +cacheable-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" + integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg== + 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" + +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + +cachedown@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cachedown/-/cachedown-1.0.0.tgz#d43f036e4510696b31246d7db31ebf0f7ac32d15" + integrity sha512-t+yVk82vQWCJF3PsWHMld+jhhjkkWjcAzz8NbFx1iULOXWl8Tm/FdM4smZNVw3MRr0X+lVTx9PKzvEn4Ng19RQ== + dependencies: + abstract-leveldown "^2.4.1" + lru-cache "^3.2.0" + +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ== + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A== + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30000844: + version "1.0.30001472" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001472.tgz#3f484885f2a2986c019dc416e65d9d62798cdd64" + integrity sha512-xWC/0+hHHQgj3/vrKYY0AAzeIUgr7L9wlELIcAvZdDUHlhL/kNxMdnQLOSOQfP8R51ZzPhmHdyMkI0MMpmxCfg== + +caseless@^0.12.0, caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== + +catering@^2.1.0, catering@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/catering/-/catering-2.1.1.tgz#66acba06ed5ee28d5286133982a927de9a04b510" + integrity sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w== + +cbor@^4.1.5: + version "4.3.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-4.3.0.tgz#0217c1cadd067d9112f44336dca07e72020bb804" + integrity sha512-CvzaxQlaJVa88sdtTWvLJ++MbdtPHtZOBBNjm7h3YKUHILMs9nQyD4AC6hvFZy7GBVB3I6bRibJcxeHydyT2IQ== + dependencies: + bignumber.js "^9.0.0" + commander "^3.0.0" + json-text-sequence "^0.1" + nofilter "^1.0.3" + +cbor@^8.0.0, cbor@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" + integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== + dependencies: + nofilter "^3.1.0" + +chai@4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" + integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.2" + deep-eql "^3.0.1" + get-func-name "^2.0.0" + pathval "^1.1.1" + type-detect "^4.0.5" + +chai@^4.2.0: + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + 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" + pathval "^1.1.1" + type-detect "^4.0.5" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== + 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" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +"charenc@>= 0.0.1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== + +check-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" + integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA== + +checkpoint-store@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" + integrity sha512-J/NdY2WvIx654cc6LWSq/IYFFCUf75fFTgwzFnmbqyORH4MwgiQCgswLLKBGzmsyTI5V7i5bp/So6sMbDWhedg== + dependencies: + functional-red-black-tree "^1.0.1" + +chokidar@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.3.0.tgz#12c0714668c55800f659e262d4962a97faf554a6" + integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.2.0" + optionalDependencies: + fsevents "~2.1.1" + +chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.2: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chownr@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cids@^0.7.1: + version "0.7.5" + resolved "https://registry.yarnpkg.com/cids/-/cids-0.7.5.tgz#60a08138a99bfb69b6be4ceb63bfef7a396b28b2" + integrity sha512-zT7mPeghoWAu+ppn8+BS1tQ5qGmbMfB4AregnQjA/qHY3GC1m1ptI9GkWNlgeu38r7CuRdXB47uY2XgAYt6QVA== + dependencies: + buffer "^5.5.0" + class-is "^1.1.0" + multibase "~0.6.0" + multicodec "^1.0.0" + multihashes "~0.4.15" + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +class-is@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/class-is/-/class-is-1.1.0.tgz#9d3c0fba0440d211d843cec3dedfa48055005825" + integrity sha512-rhjH9AG1fvabIDoGRVH587413LPjTZgmDF9fOFCbFJQV4yuocX1mHxxvXI4g3cGwbVY9wAYIoKlg1N79frJKQw== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +classic-level@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.2.0.tgz#2d52bdec8e7a27f534e67fdeb890abef3e643c27" + integrity sha512-qw5B31ANxSluWz9xBzklRWTUAJ1SXIdaVKTVS7HcTGKOAmExx65Wo5BUICW+YGORe2FOUaDghoI9ZDxj82QcFg== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.0" + module-error "^1.0.1" + napi-macros "~2.0.0" + node-gyp-build "^4.3.0" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== + dependencies: + restore-cursor "^2.0.0" + +cli-cursor@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-table3@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== + dependencies: + object-assign "^4.1.0" + string-width "^2.1.1" + optionalDependencies: + colors "^1.1.2" + +cli-table3@^0.6.0: + version "0.6.3" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" + integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w== + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clone-response@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + dependencies: + mimic-response "^1.0.0" + +clone@2.1.2, clone@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA== + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw== + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colors@1.4.0, colors@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +command-line-args@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" + integrity sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA== + dependencies: + array-back "^2.0.0" + find-replace "^1.0.3" + typical "^2.6.1" + +command-line-args@^5.1.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^6.1.0: + version "6.1.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" + integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== + dependencies: + array-back "^4.0.2" + chalk "^2.4.2" + table-layout "^1.0.2" + typical "^5.2.0" + +commander@2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== + +commander@3.0.2, commander@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== + +commander@^2.8.1: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +compare-versions@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-5.0.3.tgz#a9b34fea217472650ef4a2651d905f42c28ebfd7" + integrity sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +concat-stream@^1.5.1, concat-stream@^1.6.0, concat-stream@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +confusing-browser-globals@^1.0.10: + version "1.0.11" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" + integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-hash@^2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" + integrity sha512-FvIQKy0S1JaWV10sMsA7TRx8bpU+pqPkhbsfvOJAdjRXvYxEckAwQWGwtRjiaJfh+E0DvcWUGqcdjwMGFjsSdw== + dependencies: + cids "^0.7.1" + multicodec "^0.5.5" + multihashes "^0.4.15" + +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + +convert-source-map@^1.5.1: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +cookiejar@^2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" + integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw== + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw== + +core-js-pure@^3.0.1: + version "3.29.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.29.1.tgz#1be6ca2b8772f6b4df7fc4621743286e676c6162" + integrity sha512-4En6zYVi0i0XlXHVz/bi6l1XDjCqkKRq765NXuX+SnaIatlE96Odt5lMLjdxUiNI1v9OXI5DSLWYPlmTfkTktg== + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ== + +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +cors@^2.8.1: + version "2.8.5" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" + integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== + dependencies: + object-assign "^4" + vary "^1" + +cosmiconfig@^5.0.7: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" + +country-data@^0.0.31: + version "0.0.31" + resolved "https://registry.yarnpkg.com/country-data/-/country-data-0.0.31.tgz#80966b8e1d147fa6d6a589d32933f8793774956d" + integrity sha512-YqlY/i6ikZwoBFfdjK+hJTGaBdTgDpXLI15MCj2UsXZ2cPBb+Kx86AXmDH7PRGt0LUleck0cCgNdWeIhfbcxkQ== + dependencies: + currency-symbol-map "~2" + underscore ">1.4.4" + +crc-32@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== + +create-ecdh@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" + integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== + dependencies: + bn.js "^4.1.0" + elliptic "^6.5.3" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +cross-fetch@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.4.tgz#7bef7020207e684a7638ef5f2f698e24d9eb283c" + integrity sha512-MSHgpjQqgbT/94D4CyADeNoYh52zMkCX4pcJvPP5WqPsLFMKjr2TCMg381ox5qI0ii2dPwaLx/00477knXqXVw== + dependencies: + node-fetch "2.6.0" + whatwg-fetch "3.0.0" + +cross-fetch@^2.1.0, cross-fetch@^2.1.1: + version "2.2.6" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.6.tgz#2ef0bb39a24ac034787965c457368a28730e220a" + integrity sha512-9JZz+vXCmfKUZ68zAptS7k4Nu8e2qcibe7WVZYps7sAgk5R8GYTc+T1WR0v1rlP9HxgARmOX1UTIJZFytajpNA== + dependencies: + node-fetch "^2.6.7" + whatwg-fetch "^2.0.4" + +cross-fetch@^3.0.6: + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + dependencies: + node-fetch "2.6.7" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +"crypt@>= 0.0.1": + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== + +crypto-browserify@3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + 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" + +crypto-js@^3.1.9-1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b" + integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== + +currency-symbol-map@~2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/currency-symbol-map/-/currency-symbol-map-2.2.0.tgz#2b3c1872ff1ac2ce595d8273e58e1fff0272aea2" + integrity sha512-fPZJ3jqM68+AAgqQ7UaGbgHL/39rp6l7GyqS2k1HJPu/kpS8D07x/+Uup6a9tCUKIlOFcRrDCf1qxSt8jnI5BA== + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g== + dependencies: + assert-plus "^1.0.0" + +debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@4, debug@4.3.4, debug@^4.0.1, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^3.1.0, debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +decamelize@^1.1.1, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decode-uri-component@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + +decompress-response@^3.2.0, decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== + dependencies: + mimic-response "^1.0.0" + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" + integrity sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ== + dependencies: + file-type "^5.2.0" + is-stream "^1.1.0" + tar-stream "^1.5.2" + +decompress-tarbz2@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz#3082a5b880ea4043816349f378b56c516be1a39b" + integrity sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A== + dependencies: + decompress-tar "^4.1.0" + file-type "^6.1.0" + is-stream "^1.1.0" + seek-bzip "^1.0.5" + unbzip2-stream "^1.0.9" + +decompress-targz@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/decompress-targz/-/decompress-targz-4.1.1.tgz#c09bc35c4d11f3de09f2d2da53e9de23e7ce1eee" + integrity sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w== + dependencies: + decompress-tar "^4.1.1" + file-type "^5.2.0" + is-stream "^1.1.0" + +decompress-unzip@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" + integrity sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw== + dependencies: + file-type "^3.8.0" + get-stream "^2.2.0" + pify "^2.3.0" + yauzl "^2.4.2" + +decompress@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/decompress/-/decompress-4.2.1.tgz#007f55cc6a62c055afa37c07eb6a4ee1b773f118" + integrity sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ== + dependencies: + decompress-tar "^4.0.0" + decompress-tarbz2 "^4.0.0" + decompress-targz "^4.0.0" + decompress-unzip "^4.0.1" + graceful-fs "^4.1.10" + make-dir "^1.0.0" + pify "^2.3.0" + strip-dirs "^2.0.0" + +deep-eql@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" + integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== + dependencies: + type-detect "^4.0.0" + +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + +deep-equal@^2.0.5: + version "2.2.0" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.0.tgz#5caeace9c781028b9ff459f33b779346637c43e6" + integrity sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw== + dependencies: + call-bind "^1.0.2" + es-get-iterator "^1.1.2" + get-intrinsic "^1.1.3" + is-arguments "^1.1.1" + is-array-buffer "^3.0.1" + is-date-object "^1.0.5" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + isarray "^2.0.5" + object-is "^1.1.5" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.1" + which-typed-array "^1.1.9" + +deep-equal@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== + 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" + +deep-extend@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@^0.1.3, deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +defer-to-connect@^1.0.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" + integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== + +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + +deferred-leveldown@~1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz#3acd2e0b75d1669924bc0a4b642851131173e1eb" + integrity sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA== + dependencies: + abstract-leveldown "~2.6.0" + +deferred-leveldown@~4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz#0b0570087827bf480a23494b398f04c128c19a20" + integrity sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww== + dependencies: + abstract-leveldown "~5.0.0" + inherits "^2.0.3" + +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA== + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA== + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +defined@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf" + integrity sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +delimit-stream@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" + integrity sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +des.js@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha512-BDKtmHlOzwI7iRuEkhzsnPoi5ypEhWAJB5RvHWe1kMr06js3uK5B3734i3ui5Yd+wOJV1cpE4JnivPD283GU/A== + dependencies: + repeating "^2.0.0" + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +diff@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dom-walk@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" + integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== + +dotenv@^8.2.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" + integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== + +dotignore@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" + integrity sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw== + dependencies: + minimatch "^3.0.4" + +duplexer3@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" + integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw== + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +electron-to-chromium@^1.3.47: + version "1.4.342" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.342.tgz#3c7e199c3aa89c993df4b6f5223d6d26988f58e6" + integrity sha512-dTei3VResi5bINDENswBxhL+N0Mw5YnfWyTqO75KGsVldurEkhC9+CelJVAse8jycWyP8pv3VSj4BSyP8wTWJA== + +elliptic@6.3.3: + version "6.3.3" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" + integrity sha512-cIky9SO2H8W2eU1NOLySnhOYJnuEWCq9ZJeHvHd/lXzEL9vyraIMfilZSn57X3aVX+wkfYmqkch2LvmTzkjFpA== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + inherits "^2.0.1" + +elliptic@6.5.4, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2, elliptic@^6.5.3, elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +encode-utf8@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" + integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +encoding-down@5.0.4, encoding-down@~5.0.0: + version "5.0.4" + resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-5.0.4.tgz#1e477da8e9e9d0f7c8293d320044f8b2cd8e9614" + integrity sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw== + dependencies: + abstract-leveldown "^5.0.0" + inherits "^2.0.3" + level-codec "^9.0.0" + level-errors "^2.0.0" + xtend "^4.0.1" + +encoding@^0.1.11: + version "0.1.13" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== + dependencies: + iconv-lite "^0.6.2" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +enquirer@^2.3.0, enquirer@^2.3.5, enquirer@^2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" + integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== + dependencies: + ansi-colors "^4.1.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +errno@~0.1.1: + version "0.1.8" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" + integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0, error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.19.0, es-abstract@^1.20.4: + version "1.21.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" + integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== + dependencies: + array-buffer-byte-length "^1.0.0" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.0" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + +es-array-method-boxes-properly@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + +es-get-iterator@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" + integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + is-arguments "^1.1.1" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.7" + isarray "^2.0.5" + stop-iteration-iterator "^1.0.0" + +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es5-ext@^0.10.35, es5-ext@^0.10.50: + version "0.10.62" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" + integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== + dependencies: + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" + +es6-iterator@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-airbnb-base@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236" + integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig== + dependencies: + confusing-browser-globals "^1.0.10" + object.assign "^4.1.2" + object.entries "^1.1.5" + semver "^6.3.0" + +eslint-config-airbnb-typescript@^17.0.0: + version "17.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.0.0.tgz#360dbcf810b26bbcf2ff716198465775f1c49a07" + integrity sha512-elNiuzD0kPAPTXjFWg+lE24nMdHMtuxgYoD30OyMD6yrW1AhFZPAg27VX7d3tzOErw+dgJTNWfRSDqEcXb4V0g== + dependencies: + eslint-config-airbnb-base "^15.0.0" + +eslint-config-airbnb@^19.0.0: + version "19.0.4" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3" + integrity sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew== + dependencies: + eslint-config-airbnb-base "^15.0.0" + object.assign "^4.1.2" + object.entries "^1.1.5" + +eslint-config-prettier@^8.5.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== + +eslint-import-resolver-node@^0.3.7: + version "0.3.7" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7" + integrity sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA== + dependencies: + debug "^3.2.7" + is-core-module "^2.11.0" + resolve "^1.22.1" + +eslint-module-utils@^2.7.4: + version "2.7.4" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" + integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.26.0: + version "2.27.5" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz#876a6d03f52608a3e5bb439c2550588e51dd6c65" + integrity sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow== + dependencies: + array-includes "^3.1.6" + array.prototype.flat "^1.3.1" + array.prototype.flatmap "^1.3.1" + debug "^3.2.7" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.7" + eslint-module-utils "^2.7.4" + has "^1.0.3" + is-core-module "^2.11.0" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.6" + resolve "^1.22.1" + semver "^6.3.0" + tsconfig-paths "^3.14.1" + +eslint-plugin-jsx-a11y@^6.6.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz#fca5e02d115f48c9a597a6894d5bcec2f7a76976" + integrity sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA== + dependencies: + "@babel/runtime" "^7.20.7" + aria-query "^5.1.3" + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" + ast-types-flow "^0.0.7" + axe-core "^4.6.2" + axobject-query "^3.1.1" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.3.3" + language-tags "=1.0.5" + minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" + semver "^6.3.0" + +eslint-plugin-no-only-tests@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz#f38e4935c6c6c4842bf158b64aaa20c366fe171b" + integrity sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw== + +eslint-plugin-prettier@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-plugin-react-hooks@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" + integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== + +eslint-plugin-react@^7.31.11: + version "7.32.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.32.2.tgz#e71f21c7c265ebce01bcbc9d0955170c55571f10" + integrity sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg== + dependencies: + array-includes "^3.1.6" + array.prototype.flatmap "^1.3.1" + array.prototype.tosorted "^1.1.1" + doctrine "^2.1.0" + estraverse "^5.3.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.6" + object.fromentries "^2.0.6" + object.hasown "^1.1.2" + object.values "^1.1.6" + prop-types "^15.8.1" + resolve "^2.0.0-next.4" + semver "^6.3.0" + string.prototype.matchall "^4.0.8" + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== + +eslint@^5.6.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +eslint@^7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== + dependencies: + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + escape-string-regexp "^4.0.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.1.2" + globals "^13.6.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.9" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1, esquery@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.1.0, esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +eth-block-tracker@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-3.0.1.tgz#95cd5e763c7293e0b1b2790a2a39ac2ac188a5e1" + integrity sha512-WUVxWLuhMmsfenfZvFO5sbl1qFY2IqUlw/FPVmjjdElpqLsZtSG+wPe9Dz7W/sB6e80HgFKknOmKk2eNlznHug== + 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" + +eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" + integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== + dependencies: + idna-uts46-hx "^2.3.1" + js-sha3 "^0.5.7" + +eth-gas-reporter@^0.2.25: + version "0.2.25" + resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.25.tgz#546dfa946c1acee93cb1a94c2a1162292d6ff566" + integrity sha512-1fRgyE4xUB8SoqLgN3eDfpDfwEfRxh2Sz1b7wzFbyQA+9TekMmvSjjoRu9SKcSVyK+vLkLIsVbJDsTWjw195OQ== + dependencies: + "@ethersproject/abi" "^5.0.0-beta.146" + "@solidity-parser/parser" "^0.14.0" + cli-table3 "^0.5.0" + colors "1.4.0" + ethereum-cryptography "^1.0.3" + ethers "^4.0.40" + fs-readdir-recursive "^1.1.0" + lodash "^4.17.14" + markdown-table "^1.1.3" + mocha "^7.1.1" + req-cwd "^2.0.0" + request "^2.88.0" + request-promise-native "^1.0.5" + sha1 "^1.1.1" + sync-request "^6.0.0" + +eth-json-rpc-infura@^3.1.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/eth-json-rpc-infura/-/eth-json-rpc-infura-3.2.1.tgz#26702a821067862b72d979c016fd611502c6057f" + integrity sha512-W7zR4DZvyTn23Bxc0EWsq4XGDdD63+XPUCEhV2zQvQGavDVC4ZpFDK4k99qN7bd7/fjj37+rxmuBOBeIqCA5Mw== + 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" + +eth-json-rpc-middleware@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz#5c9d4c28f745ccb01630f0300ba945f4bef9593f" + integrity sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q== + 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" + +eth-lib@0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" + integrity sha512-VqEBQKH92jNsaE8lG9CTq8M/bc12gdAfb5MY8Ro1hVyXkh7rOtY3m5tRHK3Hus5HqIAAwU2ivcUjTLVwsvf/kw== + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + +eth-lib@0.2.8, eth-lib@^0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.8.tgz#b194058bef4b220ad12ea497431d6cb6aa0623c8" + integrity sha512-ArJ7x1WcWOlSpzdoTBX8vkwlkSQ85CjjifSZtV4co64vWxSV8geWfPI9x4SVYu3DSxnX4yWFVTtGL+j9DUFLNw== + dependencies: + bn.js "^4.11.6" + elliptic "^6.4.0" + xhr-request-promise "^0.1.2" + +eth-lib@^0.1.26: + version "0.1.29" + resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.1.29.tgz#0c11f5060d42da9f931eab6199084734f4dbd1d9" + integrity sha512-bfttrr3/7gG4E02HoWTDUcDDslN003OlOoBxk9virpAZQ1ja/jDgwkWB8QfJF7ojuEowrqy+lzp9VcJG7/k5bQ== + 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" + +eth-query@^2.0.2, eth-query@^2.1.0, eth-query@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eth-query/-/eth-query-2.1.2.tgz#d6741d9000106b51510c72db92d6365456a6da5e" + integrity sha512-srES0ZcvwkR/wd5OQBRA1bIJMww1skfGS0s8wlwK3/oNP4+wnds60krvu5R1QbpRQjMmpG5OMIWro5s7gvDPsA== + dependencies: + json-rpc-random-id "^1.0.0" + xtend "^4.0.1" + +eth-sig-util@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-3.0.0.tgz#75133b3d7c20a5731af0690c385e184ab942b97e" + integrity sha512-4eFkMOhpGbTxBQ3AMzVf0haUX2uTur7DpWiHzWyTURa28BVJJtOkcb9Ok5TV0YvEPG61DODPW7ZUATbJTslioQ== + 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" + +eth-sig-util@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210" + integrity sha512-iNZ576iTOGcfllftB73cPB5AN+XUQAT/T8xzsILsghXC1o8gJUqe3RHlcDqagu+biFpYQ61KQrZZJza8eRSYqw== + dependencies: + ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" + ethereumjs-util "^5.1.1" + +eth-tx-summary@^3.1.2: + version "3.2.4" + resolved "https://registry.yarnpkg.com/eth-tx-summary/-/eth-tx-summary-3.2.4.tgz#e10eb95eb57cdfe549bf29f97f1e4f1db679035c" + integrity sha512-NtlDnaVZah146Rm8HMRUNMgIwG/ED4jiqk0TME9zFheMl1jOp6jL1m0NKGjJwehXQ6ZKCPr16MTr+qspKpEXNg== + 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" + +ethashjs@~0.0.7: + version "0.0.8" + resolved "https://registry.yarnpkg.com/ethashjs/-/ethashjs-0.0.8.tgz#227442f1bdee409a548fb04136e24c874f3aa6f9" + integrity sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw== + dependencies: + async "^2.1.2" + buffer-xor "^2.0.1" + ethereumjs-util "^7.0.2" + miller-rabin "^4.0.0" + +ethereum-bloom-filters@^1.0.6: + version "1.0.10" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz#3ca07f4aed698e75bd134584850260246a5fed8a" + integrity sha512-rxJ5OFN3RwjQxDcFP2Z5+Q9ho4eIdEmSc2ht0fCu8Se9nbXjZ7/031uXoUYJ87KHCOdVeiUuwSnoS7hmYAGVHA== + dependencies: + js-sha3 "^0.8.0" + +ethereum-common@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.2.0.tgz#13bf966131cce1eeade62a1b434249bb4cb120ca" + integrity sha512-XOnAR/3rntJgbCdGhqdaLIxDLWKLmsZOGhHdBKadEr6gEnJLH52k93Ou+TUdFaPN3hJc3isBZBal3U/XZ15abA== + +ethereum-common@^0.0.18: + version "0.0.18" + resolved "https://registry.yarnpkg.com/ethereum-common/-/ethereum-common-0.0.18.tgz#2fdc3576f232903358976eb39da783213ff9523f" + integrity sha512-EoltVQTRNg2Uy4o84qpa2aXymXDJhxm7eos/ACOg0DG4baAbMjhbdAEsx9GeE8sC3XCxnYvrrzZDH8D8MtA2iQ== + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereum-waffle@3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-3.4.0.tgz#990b3c6c26db9c2dd943bf26750a496f60c04720" + integrity sha512-ADBqZCkoSA5Isk486ntKJVjFEawIiC+3HxNqpJqONvh3YXBTNiRfXvJtGuAFLXPG91QaqkGqILEHANAo7j/olQ== + dependencies: + "@ethereum-waffle/chai" "^3.4.0" + "@ethereum-waffle/compiler" "^3.4.0" + "@ethereum-waffle/mock-contract" "^3.3.0" + "@ethereum-waffle/provider" "^3.4.0" + ethers "^5.0.1" + +ethereumjs-abi@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" + integrity sha512-rCjJZ/AE96c/AAZc6O3kaog4FhOsAViaysBxqJNy2+LHP0ttH0zkZ7nXdVHOAyt6lFwLO0nlCwWszysG/ao1+g== + dependencies: + bn.js "^4.10.0" + ethereumjs-util "^4.3.0" + +ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +"ethereumjs-abi@git+https://github.com/ethereumjs/ethereumjs-abi.git": + version "0.6.8" + resolved "git+https://github.com/ethereumjs/ethereumjs-abi.git#ee3994657fa7a427238e6ba92a84d0b529bbcde0" + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-account@3.0.0, ethereumjs-account@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz#728f060c8e0c6e87f1e987f751d3da25422570a9" + integrity sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA== + dependencies: + ethereumjs-util "^6.0.0" + rlp "^2.2.1" + safe-buffer "^5.1.1" + +ethereumjs-account@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/ethereumjs-account/-/ethereumjs-account-2.0.5.tgz#eeafc62de544cb07b0ee44b10f572c9c49e00a84" + integrity sha512-bgDojnXGjhMwo6eXQC0bY6UK2liSFUSMwwylOmQvZbSl/D7NXQ3+vrGO46ZeOgjGfxXmgIeVNDIiHw7fNZM4VA== + dependencies: + ethereumjs-util "^5.0.0" + rlp "^2.0.0" + safe-buffer "^5.1.1" + +ethereumjs-block@2.2.2, ethereumjs-block@^2.2.2, ethereumjs-block@~2.2.0, ethereumjs-block@~2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz#c7654be7e22df489fda206139ecd63e2e9c04965" + integrity sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg== + 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" + +ethereumjs-block@^1.2.2, ethereumjs-block@^1.4.1, ethereumjs-block@^1.6.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/ethereumjs-block/-/ethereumjs-block-1.7.1.tgz#78b88e6cc56de29a6b4884ee75379b6860333c3f" + integrity sha512-B+sSdtqm78fmKkBq78/QLKJbu/4Ts4P2KFISdgcuZUPDm9x+N7qgBPIIFUGbaakQh8bzuquiRVbdmvPKqbILRg== + 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" + +ethereumjs-blockchain@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz#30f2228dc35f6dcf94423692a6902604ae34960f" + integrity sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ== + 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" + +ethereumjs-common@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.0.tgz#d3e82fc7c47c0cef95047f431a99485abc9bb1cd" + integrity sha512-SZOjgK1356hIY7MRj3/ma5qtfr/4B5BL+G4rP/XSMYr2z1H5el4RX5GReYCKmQmYI/nSBmRnwrZ17IfHuG0viQ== + +ethereumjs-common@^1.1.0, ethereumjs-common@^1.3.2, ethereumjs-common@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz#2065dbe9214e850f2e955a80e650cb6999066979" + integrity sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA== + +ethereumjs-tx@2.1.2, ethereumjs-tx@^2.1.1, ethereumjs-tx@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz#5dfe7688bf177b45c9a23f86cf9104d47ea35fed" + integrity sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw== + dependencies: + ethereumjs-common "^1.5.0" + ethereumjs-util "^6.0.0" + +ethereumjs-tx@^1.1.1, ethereumjs-tx@^1.2.0, ethereumjs-tx@^1.2.2, ethereumjs-tx@^1.3.3: + version "1.3.7" + resolved "https://registry.yarnpkg.com/ethereumjs-tx/-/ethereumjs-tx-1.3.7.tgz#88323a2d875b10549b8347e09f4862b546f3d89a" + integrity sha512-wvLMxzt1RPhAQ9Yi3/HKZTn0FZYpnsmQdbKYfUUpi4j1SEIcbkd9tndVjcPrufY3V7j2IebOpC00Zp2P/Ay2kA== + dependencies: + ethereum-common "^0.0.18" + ethereumjs-util "^5.0.0" + +ethereumjs-util@6.2.1, ethereumjs-util@^6.0.0, ethereumjs-util@^6.1.0, ethereumjs-util@^6.2.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethereumjs-util@^4.3.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-4.5.1.tgz#f4bf9b3b515a484e3cc8781d61d9d980f7c83bd0" + integrity sha512-WrckOZ7uBnei4+AKimpuF1B3Fv25OmoRgmYCpGsP7u8PFxXAmAgiJSYT2kRWnt6fVIlKaQlZvuwXp7PIrmn3/w== + dependencies: + 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@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereumjs-util@^5.1.2, ethereumjs-util@^5.1.3, ethereumjs-util@^5.1.5, ethereumjs-util@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz#a833f0e5fca7e5b361384dc76301a721f537bf65" + integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== + 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" + +ethereumjs-util@^7.0.2, ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.0: + version "7.1.5" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" + integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== + 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" + +ethereumjs-vm@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz#e885e861424e373dbc556278f7259ff3fca5edab" + integrity sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA== + 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" + +ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/ethereumjs-vm/-/ethereumjs-vm-2.6.0.tgz#76243ed8de031b408793ac33907fb3407fe400c6" + integrity sha512-r/XIUik/ynGbxS3y+mvGnbOKnuLo40V5Mj1J25+HEO63aWYREIqvWeRO/hnROlMBE5WoniQmPmhiaN0ctiHaXw== + 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" + +ethereumjs-wallet@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474" + integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA== + 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" + +ethers@4.0.0-beta.3: + version "4.0.0-beta.3" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.3.tgz#15bef14e57e94ecbeb7f9b39dd0a4bd435bc9066" + integrity sha512-YYPogooSknTwvHg3+Mv71gM/3Wcrx+ZpCzarBj3mqs9njjRkrOo2/eufzhHloOCo3JSoNI4TQJJ6yU5ABm3Uog== + dependencies: + "@types/node" "^10.3.2" + aes-js "3.0.0" + bn.js "^4.4.0" + elliptic "6.3.3" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.3" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + +ethers@^4.0.20, ethers@^4.0.40: + version "4.0.49" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" + integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== + dependencies: + aes-js "3.0.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.3" + js-sha3 "0.5.7" + scrypt-js "2.0.4" + setimmediate "1.0.4" + uuid "2.0.1" + xmlhttprequest "1.8.0" + +ethers@^5.0.1, ethers@^5.0.2, ethers@^5.2.0, ethers@^5.5.2, ethers@^5.5.3: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + +ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +eventemitter3@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" + integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== + +eventemitter3@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" + integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== + +events@^3.0.0, events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA== + 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" + +express@^4.14.0: + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.11.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +ext@^1.1.2: + version "1.7.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== + dependencies: + type "^2.7.2" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q== + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + 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" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g== + +extsprintf@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" + integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== + +fake-merkle-patricia-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz#4b8c3acfb520afadf9860b1f14cd8ce3402cddd3" + integrity sha512-Tgq37lkc9pUIgIKw5uitNUKcgcYL3R6JvXtKQbOf/ZSavXbidsksgp/pAY6p//uhw0I4yoMsvTSovvVIsk/qxA== + dependencies: + checkpoint-store "^1.1.0" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + 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.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +fd-slicer@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== + dependencies: + pend "~1.2.0" + +fetch-ponyfill@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" + integrity sha512-knK9sGskIg2T7OnYLdZ2hZXn0CtDrAIBxYQLpmEf0BqfdWnwmM1weccUl5+4EdA44tzNSFAuxITPbXtPehUB3g== + dependencies: + node-fetch "~1.7.1" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +file-type@^3.8.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" + integrity sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA== + +file-type@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" + integrity sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ== + +file-type@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/file-type/-/file-type-6.2.0.tgz#e50cd75d356ffed4e306dc4f5bcf52a79903a919" + integrity sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ== + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +find-replace@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" + integrity sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA== + dependencies: + array-back "^1.0.4" + test-value "^2.1.0" + +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA== + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +find-yarn-workspace-root@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" + integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== + dependencies: + fs-extra "^4.0.3" + micromatch "^3.1.4" + +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flat@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.1.tgz#a392059cc382881ff98642f5da4dde0a959f309b" + integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== + dependencies: + is-buffer "~2.0.3" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +flatted@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +flow-stoplight@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" + integrity sha512-rDjbZUKpN8OYhB0IE/vY/I8UWO/602IIJEU/76Tv4LvYnwHCk0BCsvz4eRr9n+FQcri7L5cyaXOo0+/Kh4HisA== + +fmix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" + integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w== + dependencies: + imul "^1.0.0" + +follow-redirects@1.5.10: + version "1.5.10" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" + integrity sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ== + dependencies: + debug "=3.1.0" + +follow-redirects@^1.12.1, follow-redirects@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +for-each@^0.3.3, for-each@~0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ== + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== + +form-data@^2.2.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" + integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.1.1.tgz#c910544499d7c959351bb4260ee7c44a544084c1" + integrity sha512-YcWhMdDCFCja0MmaDroTgNu+NWWrrnUEn92nvDgrtVy9Z71YFnhNVIghoHPt8gs82ijoMzFGeWKvArbyICiJgw== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA== + dependencies: + map-cache "^0.2.2" + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-extra@^4.0.2, fs-extra@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^7.0.0, fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^9.0.0, fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fs-minipass@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== + dependencies: + minipass "^2.6.0" + +fs-readdir-recursive@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== + +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +futoin-hkdf@^1.0.3: + version "1.5.2" + resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.2.tgz#d316623d29f45fe5e6f136f435eccd74096bf676" + integrity sha512-Bnytx8kQJQoEAPGgTZw3kVPy8e/n9CDftPzc0okgaujmbdF1x7w8wg+u2xS0CML233HgruNk6VQW28CzuUFMKw== + +ganache-core@^2.13.2: + version "2.13.2" + resolved "https://registry.yarnpkg.com/ganache-core/-/ganache-core-2.13.2.tgz#27e6fc5417c10e6e76e2e646671869d7665814a3" + integrity sha512-tIF5cR+ANQz0+3pHWxHjIwHqFXcVo0Mb+kcsNhglNFALcYo49aQpnS9dqHartqPfMFjiHh/qFoD3mYK0d/qGgw== + 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" + optionalDependencies: + ethereumjs-wallet "0.6.5" + web3 "1.2.11" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-caller-file@^2.0.1, get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-func-name@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" + integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" + integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-port@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" + integrity sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg== + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + integrity sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA== + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== + +get-stream@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA== + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng== + dependencies: + assert-plus "^1.0.0" + +glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3, glob@^7.1.6, glob@~7.2.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" + integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== + dependencies: + min-document "^2.19.0" + process "^0.11.10" + +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.6.0, globals@^13.9.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + dependencies: + type-fest "^0.20.2" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +google-libphonenumber@^3.2.15, google-libphonenumber@^3.2.4: + version "3.2.32" + resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.32.tgz#63c48a9c247b64a3bc2eec21bdf3fcfbf2e148c0" + integrity sha512-mcNgakausov/B/eTgVeX8qc8IwWjRrupk9UzZZ/QDEvdh5fAjE7Aa211bkZpZj42zKkeS6MTT8avHUwjcLxuGQ== + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +got@9.6.0: + version "9.6.0" + resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" + integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q== + 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" + +got@^11.8.5: + version "11.8.6" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" + integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + +got@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" + integrity sha512-Y5WMo7xKKq1muPsxD+KmrR8DH5auG7fBdDVueZwETwV6VytKyU9OX/ddpq2/1hp1vIPvVb4T81dKQz3BivkNLw== + 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" + +graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q== + +har-validator@~5.1.3: + version "5.1.5" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" + integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== + dependencies: + ajv "^6.12.3" + har-schema "^2.0.0" + +hardhat-contract-sizer@^2.5.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/hardhat-contract-sizer/-/hardhat-contract-sizer-2.8.0.tgz#730a9bf35ed200ba57b6865bd3f459a91c90f205" + integrity sha512-jXt2Si3uIDx5z99J+gvKa0yvIw156pE4dpH9X/PvTQv652BUd+qGj7WT93PXnHXGh5qhQLkjDYeZMYNOThfjFg== + dependencies: + chalk "^4.0.0" + cli-table3 "^0.6.0" + strip-ansi "^6.0.0" + +hardhat-dependency-compiler@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hardhat-dependency-compiler/-/hardhat-dependency-compiler-1.1.3.tgz#1e49e23f68878bd713f860c66648a711bc4a4a79" + integrity sha512-bCDqsOxGST6WkbMvj4lPchYWidNSSBm5CFnkyAex1T11cGmr9otZTGl81W6f9pmrtBXbKCvr3OSuNJ6Q394sAw== + +hardhat-deploy@^0.11.11: + version "0.11.25" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.25.tgz#bd6f2310ad9232a5d73f6e5dfff4112220a392e8" + integrity sha512-ppSgrVE9A13YgTmf2PQGoyIs9o/jgJOMORrUP/rblU5K8mQ2YHWlPvkzZmP4h+SBW+tNmlnvSrf5K5DmMmExhw== + dependencies: + "@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.8.1" + +hardhat-gas-reporter@^1.0.8: + version "1.0.9" + resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz#9a2afb354bc3b6346aab55b1c02ca556d0e16450" + integrity sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg== + dependencies: + array-uniq "1.0.3" + eth-gas-reporter "^0.2.25" + sha1 "^1.1.1" + +hardhat@^2.10.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.13.0.tgz#d52a0ec9b733a651687e5b1c1b0ee9a11a30f3d0" + integrity sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/ethereumjs-block" "^4.0.0" + "@nomicfoundation/ethereumjs-blockchain" "^6.0.0" + "@nomicfoundation/ethereumjs-common" "^3.0.0" + "@nomicfoundation/ethereumjs-evm" "^1.0.0" + "@nomicfoundation/ethereumjs-rlp" "^4.0.0" + "@nomicfoundation/ethereumjs-statemanager" "^1.0.0" + "@nomicfoundation/ethereumjs-trie" "^5.0.0" + "@nomicfoundation/ethereumjs-tx" "^4.0.0" + "@nomicfoundation/ethereumjs-util" "^8.0.0" + "@nomicfoundation/ethereumjs-vm" "^6.0.0" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + abort-controller "^3.0.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + chalk "^2.4.2" + chokidar "^3.4.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + qs "^6.7.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.7.3" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== + dependencies: + ansi-regex "^2.0.0" + +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbol-support-x@^1.4.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" + integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== + +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-to-string-tag-x@^1.2.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz#a045ab383d7b4b2012a00148ab0aa5f290044d4d" + integrity sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw== + dependencies: + has-symbol-support-x "^1.4.1" + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q== + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw== + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ== + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ== + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.3, has@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +heap@0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" + integrity sha512-MzzWcnfB1e4EG2vHi3dXHoBupmuXNZzx6pY6HldVS55JKKBoq3xOyzfSaZRkJp37HIhEYC78knabHff3zc4dQQ== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha512-ycURW7oUxE2sNiPVw1HVEFsW+ecOpJ5zaj7eC0RlwhibhRBod20muUN8qu/gzx956YrLolVvs1MTXwKgC2rVEg== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: + version "2.8.9" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" + integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== + +http-basic@^8.1.1: + version "8.1.3" + resolved "https://registry.yarnpkg.com/http-basic/-/http-basic-8.1.3.tgz#a7cabee7526869b9b710136970805b1004261bbf" + integrity sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw== + dependencies: + caseless "^0.12.0" + concat-stream "^1.6.2" + http-response-object "^3.0.1" + parse-cache-control "^1.0.1" + +http-cache-semantics@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +http-https@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" + integrity sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg== + +http-response-object@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/http-response-object/-/http-response-object-3.0.2.tgz#7f435bb210454e4360d074ef1f989d5ea8aa9810" + integrity sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA== + dependencies: + "@types/node" "^10.0.3" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ== + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24, iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@^0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +idna-uts46-hx@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/idna-uts46-hx/-/idna-uts46-hx-2.3.1.tgz#a1dc5c4df37eee522bf66d969cc980e00e8711f9" + integrity sha512-PWoF9Keq6laYdIRwwCdhTPl60xRqAloYNMQLiyUnG42VjT53oW07BXIRM+NK7eQjzXjAk2gUvX9caRxlnF9TAA== + dependencies: + punycode "2.1.0" + +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +immediate@^3.2.3: + version "3.3.0" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" + integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== + +immediate@~3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + integrity sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg== + +immutable@^4.0.0-rc.12: + version "4.3.0" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be" + integrity sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg== + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg== + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imul@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" + integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3, inherits@~2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inquirer@^6.2.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +internal-slot@^1.0.3, internal-slot@^1.0.4, internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + +invariant@2, invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +io-ts@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.0.1.tgz#1261c12f915c2f48d16393a36966636b48a45aa1" + integrity sha512-RezD+WcCfW4VkMkEcQWL/Nmy/nqsWTvTYg7oUmTGzglvSSV2P9h2z1PVeREPFf0GWNzruYleAt1XCMQZSg1xxQ== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A== + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arguments@^1.0.4, is-arguments@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-buffer@^2.0.2, is-buffer@^2.0.5, is-buffer@~2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-core-module@^2.11.0, is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg== + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1, is-date-object@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw== + +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fn/-/is-fn-1.0.0.tgz#9543d5de7bcf5b08a22ec8a20bae6e286d510d8c" + integrity sha512-XoFPJQmsAShb3jEQRfzf2rqXavq7fIqF/jOekp308JlThqrODnMpweVSGilKTCXELfLhltGP2AGgbQGVP8F1dg== + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw== + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-function@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" + integrity sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ== + +is-generator-function@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-map@^2.0.1, is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + +is-natural-number@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" + integrity sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ== + +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg== + dependencies: + kind-of "^3.0.2" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-object@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" + integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4, is-regex@^1.1.4, is-regex@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-retry-allowed@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" + integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== + +is-set@^2.0.1, is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + +is-typedarray@^1.0.0, is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-url@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" + integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q== + +is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +is-weakset@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA== + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g== + +isurl@^1.0.0-alpha5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" + integrity sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w== + dependencies: + has-to-string-tag-x "^1.2.0" + is-object "^1.0.1" + +js-sha3@0.5.7, js-sha3@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + +js-sha3@0.8.0, js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg== + +js-yaml@3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg== + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha512-Mke0DA0QjUWuJlhsE0ZPPhYiJkRap642SmI/4ztCFaUs6V2AiH1sfecc+57NgaryfAA2VR3v6O+CSjC1jZJKOA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== + +json-buffer@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" + integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-rpc-engine@^3.4.0, json-rpc-engine@^3.6.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-3.8.0.tgz#9d4ff447241792e1d0a232f6ef927302bb0c62a9" + integrity sha512-6QNcvm2gFuuK4TKU1uwfH0Qd/cOSb9c1lls0gbnIhciktIUQJwz6NQNAW4B1KiGPenv7IKu97V222Yo1bNhGuA== + 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" + +json-rpc-error@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/json-rpc-error/-/json-rpc-error-2.0.0.tgz#a7af9c202838b5e905c7250e547f1aff77258a02" + integrity sha512-EwUeWP+KgAZ/xqFpaP6YDAXMtCJi+o/QQpCQFIYyxr01AdADi2y413eM8hSqJcoQym9WMePAJWoaODEJufC4Ug== + dependencies: + inherits "^2.0.1" + +json-rpc-random-id@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8" + integrity sha512-RJ9YYNCkhVDBuP4zN5BBtYAzEl03yq/jIIsyif0JY9qyJuQQZNeDK7anAPKKlyEtLSj2s8h6hNh2F8zO5q7ScA== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json-stable-stringify@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" + integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== + dependencies: + jsonify "^0.0.1" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== + +json-text-sequence@^0.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" + integrity sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w== + dependencies: + delimit-stream "0.1.0" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw== + +json5@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== + dependencies: + minimist "^1.2.0" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" + integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== + +jsprim@^1.2.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.4.0" + verror "1.10.0" + +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" + integrity sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw== + dependencies: + array-includes "^3.1.5" + object.assign "^4.1.3" + +keccak256@^1.0.0: + version "1.0.6" + resolved "https://registry.yarnpkg.com/keccak256/-/keccak256-1.0.6.tgz#dd32fb771558fed51ce4e45a035ae7515573da58" + integrity sha512-8GLiM01PkdJVGUhR1e6M/AvWnSqYS0HaERI+K/QtStGDGlSTx2B1zTqZk4Zlqu5TxHJNTxWAdP9Y+WI50OApUw== + dependencies: + bn.js "^5.2.0" + buffer "^6.0.3" + keccak "^3.0.2" + +keccak@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.1.tgz#ae30a0e94dbe43414f741375cff6d64c8bea0bff" + integrity sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +keyv@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" + integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== + dependencies: + json-buffer "3.0.0" + +keyv@^4.0.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" + integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== + dependencies: + json-buffer "3.0.1" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ== + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw== + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== + optionalDependencies: + graceful-fs "^4.1.9" + +language-subtag-registry@~0.3.2: + version "0.3.22" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" + integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + +language-tags@=1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== + dependencies: + language-subtag-registry "~0.3.2" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw== + dependencies: + invert-kv "^1.0.0" + +level-codec@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-9.0.2.tgz#fd60df8c64786a80d44e63423096ffead63d8cbc" + integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== + dependencies: + buffer "^5.6.0" + +level-codec@~7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/level-codec/-/level-codec-7.0.1.tgz#341f22f907ce0f16763f24bddd681e395a0fb8a7" + integrity sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ== + +level-errors@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.1.2.tgz#4399c2f3d3ab87d0625f7e3676e2d807deff404d" + integrity sha512-Sw/IJwWbPKF5Ai4Wz60B52yj0zYeqzObLh8k1Tk88jVmD51cJSKWSYpRyhVIvFzZdvsPqlH5wfhp/yxdsaQH4w== + dependencies: + errno "~0.1.1" + +level-errors@^2.0.0, level-errors@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-2.0.1.tgz#2132a677bf4e679ce029f517c2f17432800c05c8" + integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== + dependencies: + errno "~0.1.1" + +level-errors@~1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/level-errors/-/level-errors-1.0.5.tgz#83dbfb12f0b8a2516bdc9a31c4876038e227b859" + integrity sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig== + dependencies: + errno "~0.1.1" + +level-iterator-stream@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-2.0.3.tgz#ccfff7c046dcf47955ae9a86f46dfa06a31688b4" + integrity sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.5" + xtend "^4.0.0" + +level-iterator-stream@~1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz#e43b78b1a8143e6fa97a4f485eb8ea530352f2ed" + integrity sha512-1qua0RHNtr4nrZBgYlpV0qHHeHpcRRWTxEZJ8xsemoHAXNL5tbooh4tPEEqIqsbWCAJBmUmkwYK/sW5OrFjWWw== + dependencies: + inherits "^2.0.1" + level-errors "^1.0.3" + readable-stream "^1.0.33" + xtend "^4.0.0" + +level-iterator-stream@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz#2c98a4f8820d87cdacab3132506815419077c730" + integrity sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g== + dependencies: + inherits "^2.0.1" + readable-stream "^2.3.6" + xtend "^4.0.0" + +level-mem@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-3.0.1.tgz#7ce8cf256eac40f716eb6489654726247f5a89e5" + integrity sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg== + dependencies: + level-packager "~4.0.0" + memdown "~3.0.0" + +level-packager@~4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-4.0.1.tgz#7e7d3016af005be0869bc5fa8de93d2a7f56ffe6" + integrity sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q== + dependencies: + encoding-down "~5.0.0" + levelup "^3.0.0" + +level-post@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/level-post/-/level-post-1.0.7.tgz#19ccca9441a7cc527879a0635000f06d5e8f27d0" + integrity sha512-PWYqG4Q00asOrLhX7BejSajByB4EmG2GaKHfj3h5UmmZ2duciXLPGYWIjBzLECFWUGOZWlm5B20h/n3Gs3HKew== + dependencies: + ltgt "^2.1.2" + +level-sublevel@6.6.4: + version "6.6.4" + resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-6.6.4.tgz#f7844ae893919cd9d69ae19d7159499afd5352ba" + integrity sha512-pcCrTUOiO48+Kp6F1+UAzF/OtWqLcQVTVF39HLdZ3RO8XBoXt+XVPKZO1vVr1aUoxHZA9OtD2e1v7G+3S5KFDA== + 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" + +level-supports@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-4.0.1.tgz#431546f9d81f10ff0fea0e74533a0e875c08c66a" + integrity sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA== + +level-transcoder@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== + dependencies: + buffer "^6.0.3" + module-error "^1.0.1" + +level-ws@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-0.0.0.tgz#372e512177924a00424b0b43aef2bb42496d228b" + integrity sha512-XUTaO/+Db51Uiyp/t7fCMGVFOTdtLS/NIACxE/GHsij15mKzxksZifKVjlXDF41JMUP/oM1Oc4YNGdKnc3dVLw== + dependencies: + readable-stream "~1.0.15" + xtend "~2.1.1" + +level-ws@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-1.0.0.tgz#19a22d2d4ac57b18cc7c6ecc4bd23d899d8f603b" + integrity sha512-RXEfCmkd6WWFlArh3X8ONvQPm8jNpfA0s/36M4QzLqrLEIt1iJE9WBHLZ5vZJK6haMjJPJGJCQWfjMNnRcq/9Q== + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.8" + xtend "^4.0.1" + +level@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/level/-/level-8.0.0.tgz#41b4c515dabe28212a3e881b61c161ffead14394" + integrity sha512-ypf0jjAk2BWI33yzEaaotpq7fkOPALKAgDBxggO6Q9HGX2MRXn0wbP1Jn/tJv1gtL867+YOjOB49WaUF3UoJNQ== + dependencies: + browser-level "^1.0.1" + classic-level "^1.2.0" + +levelup@3.1.1, levelup@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-3.1.1.tgz#c2c0b3be2b4dc316647c53b42e2f559e232d2189" + integrity sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg== + dependencies: + deferred-leveldown "~4.0.0" + level-errors "~2.0.0" + level-iterator-stream "~3.0.0" + xtend "~4.0.0" + +levelup@^1.2.1: + version "1.3.9" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-1.3.9.tgz#2dbcae845b2bb2b6bea84df334c475533bbd82ab" + integrity sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ== + 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" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A== + 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" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.assign@^4.0.3, lodash.assign@^4.0.6: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw== + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + +lodash@4.17.20: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.16, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + +log-symbols@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== + dependencies: + chalk "^2.4.2" + +log-symbols@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +looper@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-2.0.0.tgz#66cd0c774af3d4fedac53794f742db56da8f09ec" + integrity sha512-6DzMHJcjbQX/UPHc1rRCBfKlLwDkvuGZ715cIR36wSdYqWXFT35uLXq5P/2orl3tz+t+VOVPxw4yPinQlUDGDQ== + +looper@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/looper/-/looper-3.0.0.tgz#2efa54c3b1cbaba9b94aee2e5914b0be57fbb749" + integrity sha512-LJ9wplN/uSn72oJRsXTx+snxPet5c8XiZmOKCm906NVYu+ag6SB6vUcnJcWxgnl2NfbIyeobAn7Bwv6xRj2XJg== + +loose-envify@^1.0.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +loupe@^2.3.1: + version "2.3.6" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== + dependencies: + get-func-name "^2.0.0" + +lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +lru-cache@5.1.1, lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-3.2.0.tgz#71789b3b7f5399bec8565dda38aa30d2a097efee" + integrity sha512-91gyOKTc2k66UG6kHiH4h3S2eltcPwE1STVfMYC/NG+nZwf8IIuiamfmpGZjpbbxzSyEJaLC0tNSmhjlQUTJow== + dependencies: + pseudomap "^1.0.1" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +ltgt@^2.1.2, ltgt@~2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA== + +ltgt@~2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.1.3.tgz#10851a06d9964b971178441c23c9e52698eece34" + integrity sha512-5VjHC5GsENtIi5rbJd+feEpDKhfr7j0odoUR2Uh978g+2p93nd5o34cTjQWohXsPsCZeqoDnIqEf88mPCe0Pfw== + +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== + dependencies: + pify "^3.0.0" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w== + dependencies: + object-visit "^1.0.0" + +markdown-table@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60" + integrity sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q== + +match-all@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" + integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== + +mcl-wasm@^0.7.1: + version "0.7.9" + resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" + integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +memdown@^1.0.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-1.4.1.tgz#b4e4e192174664ffbae41361aa500f3119efe215" + integrity sha512-iVrGHZB8i4OQfM155xx8akvG9FIj+ht14DX5CQkCTG4EHzZ3d3sgckIf/Lm9ivZalEsFuEVnWv2B2WZvbrro2w== + 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" + +memdown@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/memdown/-/memdown-3.0.0.tgz#93aca055d743b20efc37492e9e399784f2958309" + integrity sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA== + 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" + +memory-level@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" + integrity sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og== + dependencies: + abstract-level "^1.0.0" + functional-red-black-tree "^1.0.1" + module-error "^1.0.1" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +merkle-patricia-tree@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-3.0.0.tgz#448d85415565df72febc33ca362b8b614f5a58f8" + integrity sha512-soRaMuNf/ILmw3KWbybaCjhx86EYeBbD8ph0edQCTed0JN/rxDt1EBN52Ajre3VyGo+91f8+/rfPIRQnnGMqmQ== + 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" + +merkle-patricia-tree@^2.1.2, merkle-patricia-tree@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz#982ca1b5a0fde00eed2f6aeed1f9152860b8208a" + integrity sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g== + 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" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + 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" + +micromatch@^4.0.2, micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +mimic-response@^1.0.0, mimic-response@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== + dependencies: + dom-walk "^0.1.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6, minimist@~1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +minipass@^2.6.0, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== + dependencies: + minipass "^2.9.0" + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp-promise@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + integrity sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w== + dependencies: + mkdirp "*" + +mkdirp@*: + version "2.1.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" + integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== + +mkdirp@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" + integrity sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw== + dependencies: + minimist "^1.2.5" + +mkdirp@0.5.5: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mkdirp@^0.5.1, mkdirp@^0.5.5: + version "0.5.6" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" + integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg== + dependencies: + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.5.3" + debug "4.3.4" + diff "5.0.0" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.2.0" + he "1.2.0" + js-yaml "4.1.0" + log-symbols "4.1.0" + minimatch "5.0.1" + ms "2.1.3" + nanoid "3.3.3" + serialize-javascript "6.0.0" + strip-json-comments "3.1.1" + supports-color "8.1.1" + workerpool "6.2.1" + yargs "16.2.0" + yargs-parser "20.2.4" + yargs-unparser "2.0.0" + +mocha@^6.2.2: + version "6.2.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" + integrity sha512-0R/3FvjIGH3eEuG17ccFPk117XL2rWxatr81a57D+r/x2uTYZRbdZ4oVidEUMh2W2TJDa7MdAb12Lm2/qrKajg== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "2.2.0" + minimatch "3.0.4" + mkdirp "0.5.4" + ms "2.1.1" + node-environment-flags "1.0.5" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mocha@^7.1.1: + version "7.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-7.2.0.tgz#01cc227b00d875ab1eed03a75106689cfed5a604" + integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== + dependencies: + ansi-colors "3.2.3" + browser-stdout "1.3.1" + chokidar "3.3.0" + debug "3.2.6" + diff "3.5.0" + escape-string-regexp "1.0.5" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "3.0.0" + minimatch "3.0.4" + mkdirp "0.5.5" + ms "2.1.1" + node-environment-flags "1.0.6" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "1.6.0" + +mock-fs@^4.1.0: + version "4.14.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" + integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== + +module-error@^1.0.1, module-error@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" + integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +multibase@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.7.0.tgz#1adfc1c50abe05eefeb5091ac0c2728d6b84581b" + integrity sha512-TW8q03O0f6PNFTQDvh3xxH03c8CjGaaYrjkl9UQPG6rz53TQzzxJVCIWVjzcbN/Q5Y53Zd0IBQBMVktVgNx4Fg== + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multibase@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/multibase/-/multibase-0.6.1.tgz#b76df6298536cc17b9f6a6db53ec88f85f8cc12b" + integrity sha512-pFfAwyTjbbQgNc3G7D48JkJxWtoJoBMaR4xQUOuB8RnCgRqaYmWNFeJTTvrJ2w51bjLq2zTby6Rqj9TQ9elSUw== + dependencies: + base-x "^3.0.8" + buffer "^5.5.0" + +multicodec@^0.5.5: + version "0.5.7" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-0.5.7.tgz#1fb3f9dd866a10a55d226e194abba2dcc1ee9ffd" + integrity sha512-PscoRxm3f+88fAtELwUnZxGDkduE2HD9Q6GHUOywQLjOGT/HAdhjLDYNZ1e7VR0s0TP0EwZ16LNUTFpoBGivOA== + dependencies: + varint "^5.0.0" + +multicodec@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/multicodec/-/multicodec-1.0.4.tgz#46ac064657c40380c28367c90304d8ed175a714f" + integrity sha512-NDd7FeS3QamVtbgfvu5h7fd1IlbaC4EQ0/pgU4zqE2vdHCmBGsUa0TiM8/TdSeG6BMPC92OOCf8F1ocE/Wkrrg== + dependencies: + buffer "^5.6.0" + varint "^5.0.0" + +multihashes@^0.4.15, multihashes@~0.4.15: + version "0.4.21" + resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-0.4.21.tgz#dc02d525579f334a7909ade8a122dabb58ccfcb5" + integrity sha512-uVSvmeCWf36pU2nB4/1kzYZjsXD9vofZKpgudqkceYY5g2aZZXJ5r9lxuzoRLl1OAp28XljXsEJ/X/85ZsKmKw== + dependencies: + buffer "^5.5.0" + multibase "^0.7.0" + varint "^5.0.0" + +murmur-128@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" + integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== + dependencies: + encode-utf8 "^1.0.2" + fmix "^0.1.0" + imul "^1.0.0" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ== + +mvdan-sh@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/mvdan-sh/-/mvdan-sh-0.5.0.tgz#fa76f611a103595ad0f04f5d18e582892c46e87c" + integrity sha512-UWbdl4LHd2fUnaEcOUFVWRdWGLkNoV12cKVIPiirYd8qM5VkCoCTXErlDubevrkEG7kGohvjRxAlTQmOqG80tw== + +nan@^2.13.2, nan@^2.14.0: + version "2.17.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" + integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== + +nano-json-stream-parser@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" + integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== + +nanoid@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" + integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + 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" + +napi-macros@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.0.0.tgz#2b6bae421e7b96eb687aa6c77a7858640670001b" + integrity sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg== + +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-environment-flags@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" + integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-environment-flags@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.6.tgz#a30ac13621f6f7d674260a54dede048c3982c088" + integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-fetch@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + +node-fetch@2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^2.6.1, node-fetch@^2.6.7: + version "2.6.9" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" + integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@~1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055" + integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== + +nofilter@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-1.0.4.tgz#78d6f4b6a613e7ced8b015cec534625f7667006e" + integrity sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA== + +nofilter@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" + integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^4.1.0: + version "4.5.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== + +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ== + +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + +numeral@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506" + integrity sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4, object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ== + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.12.3, object-inspect@^1.9.0, object-inspect@~1.12.3: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + +object-is@^1.0.1, object-is@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +object-keys@^1.0.11, object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + integrity sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA== + dependencies: + isobject "^3.0.0" + +object.assign@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.assign@^4.1.2, object.assign@^4.1.3, object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.entries@^1.1.5, object.entries@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" + integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.fromentries@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" + integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.1: + version "2.1.5" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" + integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== + dependencies: + array.prototype.reduce "^1.0.5" + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.hasown@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.2.tgz#f919e21fad4eb38a57bc6345b3afd496515c3f92" + integrity sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw== + dependencies: + define-properties "^1.1.4" + es-abstract "^1.20.4" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ== + dependencies: + isobject "^3.0.1" + +object.values@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +oboe@2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" + integrity sha512-ymBJ4xSC6GBXLT9Y7lirj+xbqBLa+jADGJldGEYG7u8sZbS9GyG+u1Xk9c5cbriKwSpCg41qUhPjvU5xOpvIyQ== + dependencies: + http-https "^1.0.0" + +oboe@2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" + integrity sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA== + dependencies: + http-https "^1.0.0" + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== + dependencies: + mimic-fn "^1.0.0" + +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + +openzeppelin-solidity@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-2.3.0.tgz#1ab7b4cc3782a5472ed61eb740c56a8bfdd74119" + integrity sha512-QYeiPLvB1oSbDt6lDQvvpx7k8ODczvE474hb2kLXZBPKMsxKT1WxTCHBYrCU7kS7hfAku4DcJ0jqOyL+jvjwQw== + +openzeppelin-solidity@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-2.4.0.tgz#5f0a7b30571c45493449166e57b947203415349d" + integrity sha512-533gc5jkspxW5YT0qJo02Za5q1LHwXK9CJCc48jNj/22ncNM/3M/3JfWLqfpB90uqLwOKOovpl0JfaMQTR+gXQ== + +optionator@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + 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" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g== + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + integrity sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw== + +p-cancelable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" + integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== + +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-timeout@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" + integrity sha512-gb0ryzr+K2qFqFv6qi3khoeqMZF/+ajxQipEF6NteZVnvz9tzdsfAVj3lYtn1gAXvH5lfLwfxEII799gt/mRIA== + dependencies: + p-finally "^1.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-asn1@^5.0.0, parse-asn1@^5.1.5: + version "5.1.6" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" + integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== + 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" + +parse-cache-control@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-cache-control/-/parse-cache-control-1.0.1.tgz#8eeab3e54fa56920fe16ba38f77fa21aacc2d74e" + integrity sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg== + +parse-headers@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/parse-headers/-/parse-headers-2.0.5.tgz#069793f9356a54008571eb7f9761153e6c770da9" + integrity sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA== + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ== + dependencies: + error-ex "^1.2.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw== + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== + +patch-package@6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.2.tgz#71d170d650c65c26556f0d0fbbb48d92b6cc5f39" + integrity sha512-YqScVYkVcClUY0v8fF0kWOjDYopzIM8e3bj/RU1DPeEF14+dCGm6UeOYm4jvCyxqIEQ5/eJzmbWfDWnUleFNMg== + 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" + +patch-package@^6.2.2: + version "6.5.1" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.1.tgz#3e5d00c16997e6160291fee06a521c42ac99b621" + integrity sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA== + 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" + +path-browserify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ== + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w== + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6, path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg== + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pend@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw== + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== + +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== + +precond@0.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" + integrity sha512-QCYG84SgGyGzqJ/vlMsxeXd/pgL/I94ixdNFyh1PusWmTCyVfPJjZ1K1jvHtsbfnXQs2TSkEP2fR7QiMZAnKFQ== + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== + +prepend-http@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" + integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-sh@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/prettier-plugin-sh/-/prettier-plugin-sh-0.8.2.tgz#ea0690e87385bcdc1cc22df63e8f182a36cb6eea" + integrity sha512-M8D4G5OqgZtoVKx+U/J/B/gVA4xUKmWflOjayxiDjCQbxz3HOv0zlpYeb6DXd5xMFl7jW2UY1fJjmDzI9pDBFA== + dependencies: + mvdan-sh "^0.5.0" + +prettier-plugin-solidity@^1.0.0-beta.19: + version "1.1.3" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.3.tgz#9a35124f578404caf617634a8cab80862d726cba" + integrity sha512-fQ9yucPi2sBbA2U2Xjh6m4isUTJ7S7QLc/XDDsktqqxYfTwdYKJ0EnnywXHwCGAaYbQNK+HIYPL1OemxuMsgeg== + dependencies: + "@solidity-parser/parser" "^0.16.0" + semver "^7.3.8" + solidity-comments-extractor "^0.0.7" + +prettier@^1.14.3: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + +prettier@^2.1.2, prettier@^2.5.1: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== + +private@^0.1.6, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +promise-to-callback@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" + integrity sha512-uhMIZmKM5ZteDMfLgJnoSq9GCwsNKrYau73Awf1jIy6/eUcuuZ3P+CD9zUv0kJsIUbU+x6uLNIhXhLHDs1pNPA== + dependencies: + is-fn "^1.0.0" + set-immediate-shim "^1.0.1" + +promise@^8.0.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/promise/-/promise-8.3.0.tgz#8cb333d1edeb61ef23869fbb8a4ea0279ab60e0a" + integrity sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg== + dependencies: + asap "~2.0.6" + +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +proper-lockfile@^4.1.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/proper-lockfile/-/proper-lockfile-4.1.2.tgz#c8b9de2af6b2f1601067f98e01ac66baa223141f" + integrity sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA== + dependencies: + graceful-fs "^4.2.4" + retry "^0.12.0" + signal-exit "^3.0.2" + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw== + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ== + +psl@^1.1.28: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + 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" + +pull-cat@^1.1.9: + version "1.1.11" + resolved "https://registry.yarnpkg.com/pull-cat/-/pull-cat-1.1.11.tgz#b642dd1255da376a706b6db4fa962f5fdb74c31b" + integrity sha512-i3w+xZ3DCtTVz8S62hBOuNLRHqVDsHMNZmgrZsjPnsxXUgbWtXEee84lo1XswE7W2a3WHyqsNuDJTjVLAQR8xg== + +pull-defer@^0.2.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/pull-defer/-/pull-defer-0.2.3.tgz#4ee09c6d9e227bede9938db80391c3dac489d113" + integrity sha512-/An3KE7mVjZCqNhZsr22k1Tx8MACnUnHZZNPSJ0S62td8JtYr/AiRG42Vz7Syu31SoTLUzVIe61jtT/pNdjVYA== + +pull-level@^2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pull-level/-/pull-level-2.0.4.tgz#4822e61757c10bdcc7cf4a03af04c92734c9afac" + integrity sha512-fW6pljDeUThpq5KXwKbRG3X7Ogk3vc75d5OQU/TvXXui65ykm+Bn+fiktg+MOx2jJ85cd+sheufPL+rw9QSVZg== + 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" + +pull-live@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pull-live/-/pull-live-1.0.1.tgz#a4ecee01e330155e9124bbbcf4761f21b38f51f5" + integrity sha512-tkNz1QT5gId8aPhV5+dmwoIiA1nmfDOzJDlOOUpU5DNusj6neNd3EePybJ5+sITr2FwyCs/FVpx74YMCfc8YeA== + dependencies: + pull-cat "^1.1.9" + pull-stream "^3.4.0" + +pull-pushable@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pull-pushable/-/pull-pushable-2.2.0.tgz#5f2f3aed47ad86919f01b12a2e99d6f1bd776581" + integrity sha512-M7dp95enQ2kaHvfCt2+DJfyzgCSpWVR2h2kWYnVsW6ZpxQBx5wOu0QWOvQPVoPnBLUZYitYP2y7HyHkLQNeGXg== + +pull-stream@^3.2.3, pull-stream@^3.4.0, pull-stream@^3.6.8: + version "3.7.0" + resolved "https://registry.yarnpkg.com/pull-stream/-/pull-stream-3.7.0.tgz#85de0e44ff38a4d2ad08cc43fc458e1922f9bf0b" + integrity sha512-Eco+/R004UaCK2qEDE8vGklcTG2OeZSVm1kTUQNrykEjDwcFXDZhygFDsW49DbXyJMEhHeRL3z5cRVqPAhXlIw== + +pull-window@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/pull-window/-/pull-window-2.1.4.tgz#fc3b86feebd1920c7ae297691e23f705f88552f0" + integrity sha512-cbDzN76BMlcGG46OImrgpkMf/VkCnupj8JhsrpBw3aWBM9ye345aYnqitmZCgauBkc0HbbRRn9hCnsa3k2FNUg== + dependencies: + looper "^2.0.0" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw== + +punycode@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + integrity sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA== + +punycode@^2.1.0, punycode@^2.1.1: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +qs@^6.4.0, qs@^6.7.0, qs@^6.9.4: + version "6.11.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.1.tgz#6c29dff97f0c0060765911ba65cbc9764186109f" + integrity sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ== + dependencies: + side-channel "^1.0.4" + +qs@~6.5.2: + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== + +query-string@^5.0.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g== + +queue-microtask@^1.2.2, queue-microtask@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.0.6, randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +raw-body@2.5.2, raw-body@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-is@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A== + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ== + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +readable-stream@^1.0.33: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.0, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.0.6, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@~1.0.15: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdirp@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839" + integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== + dependencies: + picomatch "^2.0.4" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +reduce-flatten@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" + integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== + +regenerate@^1.2.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + integrity sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q== + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpp@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + integrity sha512-tJ9+S4oKjxY8IZ9jmjnp/mtytu1u3iyIQAfmI51IKWH6bFf7XR1ybtaO6j7INhZKXOTYADk7V5qxaqLkmNxiZQ== + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + integrity sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g== + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + integrity sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw== + dependencies: + jsesc "~0.5.0" + +repeat-element@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" + integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha512-ZqtSMuVybkISo2OWvqvm7iHSWngvdaW3IpsT9/uP8v4gMi591LY6h35wdOfvQdWCKFWZWm2Y1Opp4kV7vQKT6A== + dependencies: + is-finite "^1.0.0" + +req-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/req-cwd/-/req-cwd-2.0.0.tgz#d4082b4d44598036640fb73ddea01ed53db49ebc" + integrity sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ== + dependencies: + req-from "^2.0.0" + +req-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/req-from/-/req-from-2.0.0.tgz#d74188e47f93796f4aa71df6ee35ae689f3e0e70" + integrity sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA== + dependencies: + resolve-from "^3.0.0" + +request-promise-core@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.4.tgz#3eedd4223208d419867b78ce815167d10593a22f" + integrity sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw== + dependencies: + lodash "^4.17.19" + +request-promise-native@^1.0.5: + version "1.0.9" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.9.tgz#e407120526a5efdc9a39b28a5679bf47b9d9dc28" + integrity sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g== + dependencies: + request-promise-core "1.1.4" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.79.0, request@^2.85.0, request@^2.88.0: + version "2.88.2" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" + integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== + 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" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + integrity sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q== + +require-from-string@^2.0.0, require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug== + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +resolve@^1.10.0, resolve@^1.22.1, resolve@^1.8.1, resolve@~1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^2.0.0-next.4: + version "2.0.0-next.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" + integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +responselike@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" + integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== + dependencies: + lowercase-keys "^1.0.0" + +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== + dependencies: + lowercase-keys "^2.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + integrity sha512-Fn9X8rX8yYF4m81rZCK/5VmrmsSbqS/i3rDLl6ZZHAXgC2nTAx3dhwG8q8odP/RmdLa2YrybDJaAMg+X1ajY3w== + dependencies: + through "~2.3.4" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rimraf@^2.2.8, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.0.0, rlp@^2.2.1, rlp@^2.2.2, rlp@^2.2.3, rlp@^2.2.4: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +run-async@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + +run-parallel-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz#be80e936f5768623a38a963262d6bef8ff11e7ba" + integrity sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw== + dependencies: + queue-microtask "^1.2.2" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +rustbn.js@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" + integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== + +rxjs@6, rxjs@^6.4.0: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-event-emitter@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" + integrity sha512-e1wFe99A91XYYxoQbcq2ZJUWurxEyP8vfz7A7vuUe1s95q8r5ebraVaA1BukYJcpM6V16ugWoD9vngi8Ccu5fg== + dependencies: + events "^3.0.0" + +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg== + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" + integrity sha512-d8DzQxNivoNDogyYmb/9RD5mEQE/Q7vG2dLDUgvfPmKL9xCVzgqUntOdS0me9Cq9Sh9VxIZuoNEFcsfyXRnyUw== + +scrypt-js@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" + integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== + +scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +"scrypt-shim@github:web3-js/scrypt-shim": + version "0.1.0" + resolved "https://codeload.github.com/web3-js/scrypt-shim/tar.gz/aafdadda13e660e25e1c525d1f5b2443f5eb1ebb" + dependencies: + scryptsy "^2.1.0" + semver "^6.3.0" + +scryptsy@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" + integrity sha512-aldIRgMozSJ/Gl6K6qmJZysRP82lz83Wb42vl4PWN8SaLFHIaOzLPc9nUUW2jQN88CuGm5q5HefJ9jZ3nWSmTw== + dependencies: + pbkdf2 "^3.0.3" + +scryptsy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/scryptsy/-/scryptsy-2.1.0.tgz#8d1e8d0c025b58fdd25b6fa9a0dc905ee8faa790" + integrity sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w== + +secp256k1@^4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== + dependencies: + elliptic "^6.5.4" + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + +seedrandom@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.1.tgz#eb3dde015bcf55df05a233514e5df44ef9dce083" + integrity sha512-1/02Y/rUeU1CJBAGLebiC5Lbo5FnB22gQbIFFYTLkwvp1xdABZJH1sn4ZT1MzXmPpzv+Rf/Lu2NcsLJiK4rcDg== + +seek-bzip@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.6.tgz#35c4171f55a680916b52a07859ecf3b5857f21c4" + integrity sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ== + dependencies: + commander "^2.8.1" + +semaphore@>=1.0.1, semaphore@^1.0.3, semaphore@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.1.0.tgz#aaad8b86b20fe8e9b32b16dc2ee682a8cd26a8aa" + integrity sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA== + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.2.1, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + +semver@~5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serialize-javascript@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +servify@^0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/servify/-/servify-0.1.12.tgz#142ab7bee1f1d033b66d0707086085b17c06db95" + integrity sha512-/xE6GvsKKqyo1BAY+KxOWXcLpPsUUyji7Qg3bVD7hh1eRze5bR1uYiuDA/k3Gof1s9BTzQZEJK8sNcNGFIzeWw== + dependencies: + body-parser "^1.16.0" + cors "^2.8.1" + express "^4.14.0" + request "^2.79.0" + xhr "^2.3.3" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + integrity sha512-Li5AOqrZWCVA2n5kryzEmqai6bKSIvpz5oUJHPVj6+dsbD3X1ixtsY5tEnsaNpH3pFAHmG8eIHUrtEtohrg+UQ== + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" + integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +sha1@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848" + integrity sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA== + dependencies: + charenc ">= 0.0.1" + crypt ">= 0.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^2.7.0: + version "2.8.2" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.2.tgz#5708fb0919d440657326cd5fe7d2599d07705019" + integrity sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw== + dependencies: + decompress-response "^3.3.0" + once "^1.3.1" + simple-concat "^1.0.0" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg== + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + 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" + +solc@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== + dependencies: + command-exists "^1.2.8" + commander "3.0.2" + follow-redirects "^1.12.1" + fs-extra "^0.30.0" + js-sha3 "0.8.0" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + +solc@^0.4.20: + version "0.4.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.26.tgz#5390a62a99f40806b86258c737c1cf653cc35cb5" + integrity sha512-o+c6FpkiHd+HPjmjEVpQgH7fqZ14tJpXhho+/bQXlXbliLIS/xjXb42Vxh+qQY1WCSTMQ0+a5vR9vi0MfhU6mA== + dependencies: + fs-extra "^0.30.0" + memorystream "^0.3.1" + require-from-string "^1.1.0" + semver "^5.3.0" + yargs "^4.7.1" + +solc@^0.6.3: + version "0.6.12" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.6.12.tgz#48ac854e0c729361b22a7483645077f58cba080e" + integrity sha512-Lm0Ql2G9Qc7yPP2Ba+WNmzw2jwsrd3u4PobHYlSOxaut3TtUbj9+5ZrT6f4DUpNPEoBaFUOEg9Op9C0mk7ge9g== + 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" + +"solhint-config-keep@github:keep-network/solhint-config-keep": + version "0.1.0" + resolved "https://codeload.github.com/keep-network/solhint-config-keep/tar.gz/5e1751e58c0f1c507305ffc8c7f6c58047657ada" + +solhint@3.3.6: + version "3.3.6" + resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.3.6.tgz#abe9af185a9a7defefba480047b3e42cbe9a1210" + integrity sha512-HWUxTAv2h7hx3s3hAab3ifnlwb02ZWhwFU/wSudUHqteMS3ll9c+m1FlGn9V8ztE2rf3Z82fQZA005Wv7KpcFA== + dependencies: + "@solidity-parser/parser" "^0.13.2" + ajv "^6.6.1" + antlr4 "4.7.1" + ast-parents "0.0.1" + chalk "^2.4.2" + commander "2.18.0" + cosmiconfig "^5.0.7" + eslint "^5.6.0" + fast-diff "^1.1.2" + glob "^7.1.3" + ignore "^4.0.6" + js-yaml "^3.12.0" + lodash "^4.17.11" + semver "^6.3.0" + optionalDependencies: + prettier "^1.14.3" + +solidity-ast@^0.4.15: + version "0.4.46" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.46.tgz#d0745172dced937741d07464043564e35b147c59" + integrity sha512-MlPZQfPhjWXqh7YxWcBGDXaPZIfMYCOHYoLEhGDWulNwEPIQQZuB7mA9eP17CU0jY/bGR4avCEUVVpvHtT2gbA== + +solidity-comments-extractor@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" + integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + 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" + +source-map-support@0.5.12: + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.13, source-map-support@^0.5.17: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" + integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== + +source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" + integrity sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" + integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== + +spdx-expression-parse@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" + integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.13" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" + integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + +spinnies@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/spinnies/-/spinnies-0.4.3.tgz#2ea0ad148e78353ddf621dec3951a6f4c3cbf66e" + integrity sha512-TTA2vWXrXJpfThWAl2t2hchBnCMI1JM5Wmb2uyI7Zkefdw/xO98LDy6/SBYwQPiYXL3swx3Eb44ZxgoS8X5wpA== + dependencies: + chalk "^2.4.2" + cli-cursor "^3.0.0" + strip-ansi "^5.2.0" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +sshpk@^1.7.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== + 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" + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g== + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g== + +stop-iteration-iterator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz#6a60be0b4ee757d1ed5254858ec66b10c49285e4" + integrity sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ== + dependencies: + internal-slot "^1.0.4" + +stream-to-pull-stream@^1.7.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/stream-to-pull-stream/-/stream-to-pull-stream-1.7.3.tgz#4161aa2d2eb9964de60bfa1af7feaf917e874ece" + integrity sha512-6sNyqJpr5dIOQdgNy/xcDWwDuzAsAwVzhzrWlAPAQ7Lkjx/rv0wgvxEyKwTq6FmNd5rjTrELt/CLmaSw7crMGg== + dependencies: + looper "^3.0.0" + pull-stream "^3.2.3" + +streamsearch@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" + integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== + +string-format@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" + integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw== + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string.prototype.matchall@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" + integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.4.3" + side-channel "^1.0.4" + +string.prototype.trim@^1.2.7, string.prototype.trim@~1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g== + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-dirs@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/strip-dirs/-/strip-dirs-2.1.0.tgz#4987736264fc344cf20f6c34aca9d13d1d4ed6c5" + integrity sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g== + dependencies: + is-natural-number "^4.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@2.0.1, strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + +strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== + dependencies: + has-flag "^3.0.0" + +supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +swarm-js@0.1.39: + version "0.1.39" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.39.tgz#79becb07f291d4b2a178c50fee7aa6e10342c0e8" + integrity sha512-QLMqL2rzF6n5s50BptyD6Oi0R1aWlJC5Y17SRIVXRj6OR1DRIPM7nepvrxxkjA1zNzFz6mUOMjfeqeDaWB7OOg== + dependencies: + bluebird "^3.5.0" + buffer "^5.0.5" + decompress "^4.0.0" + 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-promise "^0.1.2" + +swarm-js@^0.1.40: + version "0.1.42" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" + integrity sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ== + dependencies: + bluebird "^3.5.0" + buffer "^5.0.5" + eth-lib "^0.1.26" + fs-extra "^4.0.2" + got "^11.8.5" + 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" + +sync-request@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/sync-request/-/sync-request-6.1.0.tgz#e96217565b5e50bbffe179868ba75532fb597e68" + integrity sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw== + dependencies: + http-response-object "^3.0.1" + sync-rpc "^1.2.1" + then-request "^6.0.0" + +sync-rpc@^1.2.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/sync-rpc/-/sync-rpc-1.3.6.tgz#b2e8b2550a12ccbc71df8644810529deb68665a7" + integrity sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw== + dependencies: + get-port "^3.1.0" + +table-layout@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" + integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== + dependencies: + array-back "^4.0.1" + deep-extend "~0.6.0" + typical "^5.2.0" + wordwrapjs "^4.0.0" + +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +table@^6.0.9, table@^6.8.0: + version "6.8.1" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf" + integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + +tape@^4.6.3: + version "4.16.2" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.16.2.tgz#7565e6af20426565557266e9dda7215869b297b6" + integrity sha512-TUChV+q0GxBBCEbfCYkGLkv8hDJYjMdSWdE0/Lr331sB389dsvFUHNV9ph5iQqKzt8Ss9drzcda/YeexclBFqg== + dependencies: + call-bind "~1.0.2" + deep-equal "~1.1.1" + defined "~1.0.1" + dotignore "~0.1.2" + for-each "~0.3.3" + glob "~7.2.3" + has "~1.0.3" + inherits "~2.0.4" + is-regex "~1.1.4" + minimist "~1.2.7" + object-inspect "~1.12.3" + resolve "~1.22.1" + resumer "~0.0.0" + string.prototype.trim "~1.2.7" + through "~2.3.8" + +tar-stream@^1.5.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" + integrity sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A== + dependencies: + bl "^1.0.0" + buffer-alloc "^1.2.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.1" + xtend "^4.0.0" + +tar@^4.0.2: + version "4.4.19" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" + integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== + dependencies: + chownr "^1.1.4" + fs-minipass "^1.2.7" + minipass "^2.9.0" + minizlib "^1.3.3" + mkdirp "^0.5.5" + safe-buffer "^5.2.1" + yallist "^3.1.1" + +test-value@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" + integrity sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w== + dependencies: + array-back "^1.0.3" + typical "^2.6.0" + +testrpc@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" + integrity sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA== + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +then-request@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/then-request/-/then-request-6.0.2.tgz#ec18dd8b5ca43aaee5cb92f7e4c1630e950d4f0c" + integrity sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA== + 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" + +through2@^2.0.3: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +timed-out@^4.0.0, timed-out@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== + +tiny-secp256k1@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" + integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + +tmp@0.0.33, tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmp@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" + integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== + dependencies: + rimraf "^2.6.3" + +to-buffer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og== + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg== + dependencies: + kind-of "^3.0.2" + +to-readable-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771" + integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q== + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg== + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tough-cookie@^2.3.3, tough-cookie@~2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw== + +truffle-flattener@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/truffle-flattener/-/truffle-flattener-1.6.0.tgz#abb64488b711e6cca0a9d3e449f6a85e35964c5d" + integrity sha512-scS5Bsi4CZyvlrmD4iQcLHTiG2RQFUXVheTgWeH6PuafmI+Lk5U87Es98loM3w3ImqC9/fPHq+3QIXbcPuoJ1Q== + dependencies: + "@resolver-engine/imports-fs" "^0.2.2" + "@solidity-parser/parser" "^0.14.1" + find-up "^2.1.0" + mkdirp "^1.0.4" + tsort "0.0.1" + +ts-command-line-args@^2.2.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.4.2.tgz#b4815b23c35f8a0159d4e69e01012d95690bc448" + integrity sha512-mJLQQBOdyD4XI/ZWQY44PIdYde47JhV2xl380O7twPkTQ+Y5vFDHsk8LOeXKuz7dVY5aDCfAzRarNfSqtKOkQQ== + dependencies: + "@morgan-stanley/ts-mocking-bird" "^0.6.2" + chalk "^4.1.0" + command-line-args "^5.1.1" + command-line-usage "^6.1.0" + string-format "^2.0.0" + +ts-essentials@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-1.0.4.tgz#ce3b5dade5f5d97cf69889c11bf7d2da8555b15a" + integrity sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ== + +ts-essentials@^6.0.3: + version "6.0.7" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-6.0.7.tgz#5f4880911b7581a873783740ce8b94da163d18a6" + integrity sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw== + +ts-essentials@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-7.0.3.tgz#686fd155a02133eedcc5362dc8b5056cde3e5a38" + integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== + +ts-generator@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ts-generator/-/ts-generator-0.1.1.tgz#af46f2fb88a6db1f9785977e9590e7bcd79220ab" + integrity sha512-N+ahhZxTLYu1HNTQetwWcx3so8hcYbkKBHTr4b4/YgObFTIKkOSSsaa+nal12w8mfrJAyzJfETXawbNjSfP2gQ== + 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" + +ts-node@^10.4.0: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + 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" + +ts-node@^8.4.1: + version "8.10.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.10.2.tgz#eee03764633b1234ddd37f8db9ec10b75ec7fb8d" + integrity sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA== + dependencies: + arg "^4.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + +tsconfig-paths@^3.14.1: + version "3.14.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" + integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +tweetnacl-util@^0.15.0, tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA== + +tweetnacl@^1.0.0, tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + +type-detect@^4.0.0, type-detect@^4.0.5: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== + +typechain@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-3.0.0.tgz#d5a47700831f238e43f7429b987b4bb54849b92e" + integrity sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg== + dependencies: + 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" + +typechain@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-6.1.0.tgz#462a35f555accf870689d1ba5698749108d0ce81" + integrity sha512-GGfkK0p3fUgz8kYxjSS4nKcWXE0Lo+teHTetghousIK5njbNoYNDlwn91QIyD181L3fVqlTvBE0a/q3AZmjNfw== + dependencies: + "@types/prettier" "^2.1.1" + debug "^4.1.1" + fs-extra "^7.0.0" + glob "^7.1.6" + js-sha3 "^0.8.0" + lodash "^4.17.15" + mkdirp "^1.0.4" + prettier "^2.1.2" + ts-command-line-args "^2.2.0" + ts-essentials "^7.0.1" + +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== + +typeforce@^1.11.5: + version "1.18.0" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.18.0.tgz#d7416a2c5845e085034d70fcc5b6cc4a90edbfdc" + integrity sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g== + +typescript@^3.6.4: + version "3.9.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" + integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== + +typescript@^4.5.4: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +typewise-core@^1.2, typewise-core@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" + integrity sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg== + +typewise@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typewise/-/typewise-1.0.3.tgz#1067936540af97937cc5dcf9922486e9fa284651" + integrity sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ== + dependencies: + typewise-core "^1.2.0" + +typewiselite@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typewiselite/-/typewiselite-1.0.0.tgz#c8882fa1bb1092c06005a97f34ef5c8508e3664e" + integrity sha512-J9alhjVHupW3Wfz6qFRGgQw0N3gr8hOkw6zm7FZ6UR1Cse/oD9/JVok7DNE9TT9IbciDHX2Ex9+ksE6cRmtymw== + +typical@^2.6.0, typical@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" + integrity sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg== + +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" + integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== + +ultron@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" + integrity sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +unbzip2-stream@^1.0.9: + version "1.4.3" + resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" + integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== + dependencies: + buffer "^5.2.1" + through "^2.3.8" + +underscore@1.12.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.12.1.tgz#7bb8cc9b3d397e201cf8553336d262544ead829e" + integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== + +underscore@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" + integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== + +underscore@>1.4.4: + version "1.13.6" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== + +undici@^5.14.0: + version "5.21.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.21.0.tgz#b00dfc381f202565ab7f52023222ab862bb2494f" + integrity sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA== + dependencies: + busboy "^1.6.0" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +unorm@^1.3.3: + version "1.6.0" + resolved "https://registry.yarnpkg.com/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" + integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ== + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA== + dependencies: + prepend-http "^1.0.1" + +url-parse-lax@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" + integrity sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ== + dependencies: + prepend-http "^2.0.0" + +url-set-query@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" + integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== + +url-to-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" + integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ== + dependencies: + punycode "1.3.2" + querystring "0.2.0" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +utf-8-validate@^5.0.2: + version "5.0.10" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" + integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== + dependencies: + node-gyp-build "^4.3.0" + +utf8@3.0.0, utf8@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +util.promisify@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.1.1.tgz#77832f57ced2c9478174149cae9b96e9918cd54b" + integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== + 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" + +util@^0.12.0: + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + which-typed-array "^1.1.2" + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +uuid@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" + integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== + +uuid@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +uuid@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" + integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +v8-compile-cache@^2.0.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" + integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +varint@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" + integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== + +vary@^1, vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw== + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +web3-bzz@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" + integrity sha512-XGpWUEElGypBjeFyUhTkiPXFbDVD6Nr/S5jznE3t8cWUA0FxRf1n3n/NuIZeb0H9RkN2Ctd/jNma/k8XGa3YKg== + dependencies: + "@types/node" "^12.12.6" + got "9.6.0" + swarm-js "^0.1.40" + underscore "1.9.1" + +web3-bzz@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.2.tgz#a3b9f613c49fd3e120e0997088a73557d5adb724" + integrity sha512-b1O2ObsqUN1lJxmFSjvnEC4TsaCbmh7Owj3IAIWTKqL9qhVgx7Qsu5O9cD13pBiSPNZJ68uJPaKq380QB4NWeA== + dependencies: + "@types/node" "^10.12.18" + got "9.6.0" + swarm-js "0.1.39" + underscore "1.9.1" + +web3-bzz@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.4.tgz#a4adb7a8cba3d260de649bdb1f14ed359bfb3821" + integrity sha512-MqhAo/+0iQSMBtt3/QI1rU83uvF08sYq8r25+OUZ+4VtihnYsmkkca+rdU0QbRyrXY2/yGIpI46PFdh0khD53A== + dependencies: + "@types/node" "^10.12.18" + got "9.6.0" + swarm-js "0.1.39" + underscore "1.9.1" + +web3-bzz@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.3.6.tgz#95f370aecc3ff6ad07f057e6c0c916ef09b04dde" + integrity sha512-ibHdx1wkseujFejrtY7ZyC0QxQ4ATXjzcNUpaLrvM6AEae8prUiyT/OloG9FWDgFD2CPLwzKwfSQezYQlANNlw== + dependencies: + "@types/node" "^12.12.6" + got "9.6.0" + swarm-js "^0.1.40" + underscore "1.12.1" + +web3-core-helpers@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.11.tgz#84c681ed0b942c0203f3b324a245a127e8c67a99" + integrity sha512-PEPoAoZd5ME7UfbnCZBdzIerpe74GEvlwT4AjOmHeCVZoIFk7EqvOZDejJHt+feJA6kMVTdd0xzRNN295UhC1A== + dependencies: + underscore "1.9.1" + web3-eth-iban "1.2.11" + web3-utils "1.2.11" + +web3-core-helpers@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.2.tgz#484974f4bd4a487217b85b0d7cfe841af0907619" + integrity sha512-HJrRsIGgZa1jGUIhvGz4S5Yh6wtOIo/TMIsSLe+Xay+KVnbseJpPprDI5W3s7H2ODhMQTbogmmUFquZweW2ImQ== + dependencies: + underscore "1.9.1" + web3-eth-iban "1.2.2" + web3-utils "1.2.2" + +web3-core-helpers@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.2.4.tgz#ffd425861f4d66b3f38df032afdb39ea0971fc0f" + integrity sha512-U7wbsK8IbZvF3B7S+QMSNP0tni/6VipnJkB0tZVEpHEIV2WWeBHYmZDnULWcsS/x/jn9yKhJlXIxWGsEAMkjiw== + dependencies: + underscore "1.9.1" + web3-eth-iban "1.2.4" + web3-utils "1.2.4" + +web3-core-helpers@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core-helpers/-/web3-core-helpers-1.3.6.tgz#c478246a9abe4e5456acf42657dac2f7c330be74" + integrity sha512-nhtjA2ZbkppjlxTSwG0Ttu6FcPkVu1rCN5IFAOVpF/L0SEt+jy+O5l90+cjDq0jAYvlBwUwnbh2mR9hwDEJCNA== + dependencies: + underscore "1.12.1" + web3-eth-iban "1.3.6" + web3-utils "1.3.6" + +web3-core-method@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.11.tgz#f880137d1507a0124912bf052534f168b8d8fbb6" + integrity sha512-ff0q76Cde94HAxLDZ6DbdmKniYCQVtvuaYh+rtOUMB6kssa5FX0q3vPmixi7NPooFnbKmmZCM6NvXg4IreTPIw== + 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" + +web3-core-method@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.2.tgz#d4fe2bb1945b7152e5f08e4ea568b171132a1e56" + integrity sha512-szR4fDSBxNHaF1DFqE+j6sFR/afv9Aa36OW93saHZnrh+iXSrYeUUDfugeNcRlugEKeUCkd4CZylfgbK2SKYJA== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.2" + web3-core-promievent "1.2.2" + web3-core-subscriptions "1.2.2" + web3-utils "1.2.2" + +web3-core-method@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.2.4.tgz#a0fbc50b8ff5fd214021435cc2c6d1e115807aed" + integrity sha512-8p9kpL7di2qOVPWgcM08kb+yKom0rxRCMv6m/K+H+yLSxev9TgMbCgMSbPWAHlyiF3SJHw7APFKahK5Z+8XT5A== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.4" + web3-core-promievent "1.2.4" + web3-core-subscriptions "1.2.4" + web3-utils "1.2.4" + +web3-core-method@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core-method/-/web3-core-method-1.3.6.tgz#4b0334edd94b03dfec729d113c69a4eb6ebc68ae" + integrity sha512-RyegqVGxn0cyYW5yzAwkPlsSEynkdPiegd7RxgB4ak1eKk2Cv1q2x4C7D2sZjeeCEF+q6fOkVmo2OZNqS2iQxg== + dependencies: + "@ethersproject/transactions" "^5.0.0-beta.135" + underscore "1.12.1" + web3-core-helpers "1.3.6" + web3-core-promievent "1.3.6" + web3-core-subscriptions "1.3.6" + web3-utils "1.3.6" + +web3-core-promievent@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.11.tgz#51fe97ca0ddec2f99bf8c3306a7a8e4b094ea3cf" + integrity sha512-il4McoDa/Ox9Agh4kyfQ8Ak/9ABYpnF8poBLL33R/EnxLsJOGQG2nZhkJa3I067hocrPSjEdlPt/0bHXsln4qA== + dependencies: + eventemitter3 "4.0.4" + +web3-core-promievent@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.2.tgz#3b60e3f2a0c96db8a891c927899d29d39e66ab1c" + integrity sha512-tKvYeT8bkUfKABcQswK6/X79blKTKYGk949urZKcLvLDEaWrM3uuzDwdQT3BNKzQ3vIvTggFPX9BwYh0F1WwqQ== + dependencies: + any-promise "1.3.0" + eventemitter3 "3.1.2" + +web3-core-promievent@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.2.4.tgz#75e5c0f2940028722cdd21ba503ebd65272df6cb" + integrity sha512-gEUlm27DewUsfUgC3T8AxkKi8Ecx+e+ZCaunB7X4Qk3i9F4C+5PSMGguolrShZ7Zb6717k79Y86f3A00O0VAZw== + dependencies: + any-promise "1.3.0" + eventemitter3 "3.1.2" + +web3-core-promievent@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core-promievent/-/web3-core-promievent-1.3.6.tgz#6c27dc79de8f71b74f5d17acaf9aaf593d3cb0c9" + integrity sha512-Z+QzfyYDTXD5wJmZO5wwnRO8bAAHEItT1XNSPVb4J1CToV/I/SbF7CuF8Uzh2jns0Cm1109o666H7StFFvzVKw== + dependencies: + eventemitter3 "4.0.4" + +web3-core-requestmanager@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.11.tgz#fe6eb603fbaee18530293a91f8cf26d8ae28c45a" + integrity sha512-oFhBtLfOiIbmfl6T6gYjjj9igOvtyxJ+fjS+byRxiwFJyJ5BQOz4/9/17gWR1Cq74paTlI7vDGxYfuvfE/mKvA== + 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" + +web3-core-requestmanager@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.2.tgz#667ba9ac724c9c76fa8965ae8a3c61f66e68d8d6" + integrity sha512-a+gSbiBRHtHvkp78U2bsntMGYGF2eCb6219aMufuZWeAZGXJ63Wc2321PCbA8hF9cQrZI4EoZ4kVLRI4OF15Hw== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.2" + web3-providers-http "1.2.2" + web3-providers-ipc "1.2.2" + web3-providers-ws "1.2.2" + +web3-core-requestmanager@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.2.4.tgz#0a7020a23fb91c6913c611dfd3d8c398d1e4b4a8" + integrity sha512-eZJDjyNTDtmSmzd3S488nR/SMJtNnn/GuwxnMh3AzYCqG3ZMfOylqTad2eYJPvc2PM5/Gj1wAMQcRpwOjjLuPg== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.4" + web3-providers-http "1.2.4" + web3-providers-ipc "1.2.4" + web3-providers-ws "1.2.4" + +web3-core-requestmanager@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core-requestmanager/-/web3-core-requestmanager-1.3.6.tgz#4fea269fe913fd4fca464b4f7c65cb94857b5b2a" + integrity sha512-2rIaeuqeo7QN1Eex7aXP0ZqeteJEPWXYFS/M3r3LXMiV8R4STQBKE+//dnHJXoo2ctzEB5cgd+7NaJM8S3gPyA== + dependencies: + underscore "1.12.1" + util "^0.12.0" + web3-core-helpers "1.3.6" + web3-providers-http "1.3.6" + web3-providers-ipc "1.3.6" + web3-providers-ws "1.3.6" + +web3-core-subscriptions@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.11.tgz#beca908fbfcb050c16f45f3f0f4c205e8505accd" + integrity sha512-qEF/OVqkCvQ7MPs1JylIZCZkin0aKK9lDxpAtQ1F8niEDGFqn7DT8E/vzbIa0GsOjL2fZjDhWJsaW+BSoAW1gg== + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-core-subscriptions@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.2.tgz#bf4ba23a653a003bdc3551649958cc0b080b068e" + integrity sha512-QbTgigNuT4eicAWWr7ahVpJyM8GbICsR1Ys9mJqzBEwpqS+RXTRVSkwZ2IsxO+iqv6liMNwGregbJLq4urMFcQ== + dependencies: + eventemitter3 "3.1.2" + underscore "1.9.1" + web3-core-helpers "1.2.2" + +web3-core-subscriptions@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.2.4.tgz#0dc095b5cfd82baa527a39796e3515a846b21b99" + integrity sha512-3D607J2M8ymY9V+/WZq4MLlBulwCkwEjjC2U+cXqgVO1rCyVqbxZNCmHyNYHjDDCxSEbks9Ju5xqJxDSxnyXEw== + dependencies: + eventemitter3 "3.1.2" + underscore "1.9.1" + web3-core-helpers "1.2.4" + +web3-core-subscriptions@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core-subscriptions/-/web3-core-subscriptions-1.3.6.tgz#ee24e7974d1d72ff6c992c599deba4ef9b308415" + integrity sha512-wi9Z9X5X75OKvxAg42GGIf81ttbNR2TxzkAsp1g+nnp5K8mBwgZvXrIsDuj7Z7gx72Y45mWJADCWjk/2vqNu8g== + dependencies: + eventemitter3 "4.0.4" + underscore "1.12.1" + web3-core-helpers "1.3.6" + +web3-core@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.11.tgz#1043cacc1becb80638453cc5b2a14be9050288a7" + integrity sha512-CN7MEYOY5ryo5iVleIWRE3a3cZqVaLlIbIzDPsvQRUfzYnvzZQRZBm9Mq+ttDi2STOOzc1MKylspz/o3yq/LjQ== + 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" + +web3-core@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.2.tgz#334b99c8222ef9cfd0339e27352f0b58ea789a2f" + integrity sha512-miHAX3qUgxV+KYfaOY93Hlc3kLW2j5fH8FJy6kSxAv+d4d5aH0wwrU2IIoJylQdT+FeenQ38sgsCnFu9iZ1hCQ== + dependencies: + "@types/bn.js" "^4.11.4" + "@types/node" "^12.6.1" + web3-core-helpers "1.2.2" + web3-core-method "1.2.2" + web3-core-requestmanager "1.2.2" + web3-utils "1.2.2" + +web3-core@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.2.4.tgz#2df13b978dcfc59c2abaa887d27f88f21ad9a9d6" + integrity sha512-CHc27sMuET2cs1IKrkz7xzmTdMfZpYswe7f0HcuyneTwS1yTlTnHyqjAaTy0ZygAb/x4iaVox+Gvr4oSAqSI+A== + dependencies: + "@types/bignumber.js" "^5.0.0" + "@types/bn.js" "^4.11.4" + "@types/node" "^12.6.1" + web3-core-helpers "1.2.4" + web3-core-method "1.2.4" + web3-core-requestmanager "1.2.4" + web3-utils "1.2.4" + +web3-core@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.3.6.tgz#a6a761d1ff2f3ee462b8dab679229d2f8e267504" + integrity sha512-gkLDM4T1Sc0T+HZIwxrNrwPg0IfWI0oABSglP2X5ZbBAYVUeEATA0o92LWV8BeF+okvKXLK1Fek/p6axwM/h3Q== + dependencies: + "@types/bn.js" "^4.11.5" + "@types/node" "^12.12.6" + bignumber.js "^9.0.0" + web3-core-helpers "1.3.6" + web3-core-method "1.3.6" + web3-core-requestmanager "1.3.6" + web3-utils "1.3.6" + +web3-eth-abi@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.11.tgz#a887494e5d447c2926d557a3834edd66e17af9b0" + integrity sha512-PkRYc0+MjuLSgg03QVWqWlQivJqRwKItKtEpRUaxUAeLE7i/uU39gmzm2keHGcQXo3POXAbOnMqkDvOep89Crg== + dependencies: + "@ethersproject/abi" "5.0.0-beta.153" + underscore "1.9.1" + web3-utils "1.2.11" + +web3-eth-abi@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.2.tgz#d5616d88a90020f894763423a9769f2da11fe37a" + integrity sha512-Yn/ZMgoOLxhTVxIYtPJ0eS6pnAnkTAaJgUJh1JhZS4ekzgswMfEYXOwpMaD5eiqPJLpuxmZFnXnBZlnQ1JMXsw== + dependencies: + ethers "4.0.0-beta.3" + underscore "1.9.1" + web3-utils "1.2.2" + +web3-eth-abi@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.2.4.tgz#5b73e5ef70b03999227066d5d1310b168845e2b8" + integrity sha512-8eLIY4xZKoU3DSVu1pORluAw9Ru0/v4CGdw5so31nn+7fR8zgHMgwbFe0aOqWQ5VU42PzMMXeIJwt4AEi2buFg== + dependencies: + ethers "4.0.0-beta.3" + underscore "1.9.1" + web3-utils "1.2.4" + +web3-eth-abi@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-abi/-/web3-eth-abi-1.3.6.tgz#4272ca48d817aa651bbf97b269f5ff10abc2b8a9" + integrity sha512-Or5cRnZu6WzgScpmbkvC6bfNxR26hqiKK4i8sMPFeTUABQcb/FU3pBj7huBLYbp9dH+P5W79D2MqwbWwjj9DoQ== + dependencies: + "@ethersproject/abi" "5.0.7" + underscore "1.12.1" + web3-utils "1.3.6" + +web3-eth-accounts@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.11.tgz#a9e3044da442d31903a7ce035a86d8fa33f90520" + integrity sha512-6FwPqEpCfKIh3nSSGeo3uBm2iFSnFJDfwL3oS9pyegRBXNsGRVpgiW63yhNzL0796StsvjHWwQnQHsZNxWAkGw== + 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" + +web3-eth-accounts@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.2.tgz#c187e14bff6baa698ac352220290222dbfd332e5" + integrity sha512-KzHOEyXOEZ13ZOkWN3skZKqSo5f4Z1ogPFNn9uZbKCz+kSp+gCAEKxyfbOsB/JMAp5h7o7pb6eYsPCUBJmFFiA== + dependencies: + any-promise "1.3.0" + crypto-browserify "3.12.0" + eth-lib "0.2.7" + ethereumjs-common "^1.3.2" + ethereumjs-tx "^2.1.1" + scrypt-shim "github:web3-js/scrypt-shim" + underscore "1.9.1" + uuid "3.3.2" + web3-core "1.2.2" + web3-core-helpers "1.2.2" + web3-core-method "1.2.2" + web3-utils "1.2.2" + +web3-eth-accounts@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.2.4.tgz#ada6edc49542354328a85cafab067acd7f88c288" + integrity sha512-04LzT/UtWmRFmi4hHRewP5Zz43fWhuHiK5XimP86sUQodk/ByOkXQ3RoXyGXFMNoRxdcAeRNxSfA2DpIBc9xUw== + dependencies: + "@web3-js/scrypt-shim" "^0.1.0" + any-promise "1.3.0" + crypto-browserify "3.12.0" + eth-lib "0.2.7" + ethereumjs-common "^1.3.2" + ethereumjs-tx "^2.1.1" + underscore "1.9.1" + uuid "3.3.2" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-core-method "1.2.4" + web3-utils "1.2.4" + +web3-eth-accounts@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-accounts/-/web3-eth-accounts-1.3.6.tgz#f9fcb50b28ee58090ab292a10d996155caa2b474" + integrity sha512-Ilr0hG6ONbCdSlVKffasCmNwftD5HsNpwyQASevocIQwHdTlvlwO0tb3oGYuajbKOaDzNTwXfz25bttAEoFCGA== + 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.12.1" + uuid "3.3.2" + web3-core "1.3.6" + web3-core-helpers "1.3.6" + web3-core-method "1.3.6" + web3-utils "1.3.6" + +web3-eth-contract@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.11.tgz#917065902bc27ce89da9a1da26e62ef663663b90" + integrity sha512-MzYuI/Rq2o6gn7vCGcnQgco63isPNK5lMAan2E51AJLknjSLnOxwNY3gM8BcKoy4Z+v5Dv00a03Xuk78JowFow== + 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" + +web3-eth-contract@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.2.tgz#84e92714918a29e1028ee7718f0712536e14e9a1" + integrity sha512-EKT2yVFws3FEdotDQoNsXTYL798+ogJqR2//CaGwx3p0/RvQIgfzEwp8nbgA6dMxCsn9KOQi7OtklzpnJMkjtA== + dependencies: + "@types/bn.js" "^4.11.4" + underscore "1.9.1" + web3-core "1.2.2" + web3-core-helpers "1.2.2" + web3-core-method "1.2.2" + web3-core-promievent "1.2.2" + web3-core-subscriptions "1.2.2" + web3-eth-abi "1.2.2" + web3-utils "1.2.2" + +web3-eth-contract@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.2.4.tgz#68ef7cc633232779b0a2c506a810fbe903575886" + integrity sha512-b/9zC0qjVetEYnzRA1oZ8gF1OSSUkwSYi5LGr4GeckLkzXP7osEnp9lkO/AQcE4GpG+l+STnKPnASXJGZPgBRQ== + dependencies: + "@types/bn.js" "^4.11.4" + underscore "1.9.1" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-core-method "1.2.4" + web3-core-promievent "1.2.4" + web3-core-subscriptions "1.2.4" + web3-eth-abi "1.2.4" + web3-utils "1.2.4" + +web3-eth-contract@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-contract/-/web3-eth-contract-1.3.6.tgz#cccf4d32dc56917fb6923e778498a9ba2a5ba866" + integrity sha512-8gDaRrLF2HCg+YEZN1ov0zN35vmtPnGf3h1DxmJQK5Wm2lRMLomz9rsWsuvig3UJMHqZAQKD7tOl3ocJocQsmA== + dependencies: + "@types/bn.js" "^4.11.5" + underscore "1.12.1" + web3-core "1.3.6" + web3-core-helpers "1.3.6" + web3-core-method "1.3.6" + web3-core-promievent "1.3.6" + web3-core-subscriptions "1.3.6" + web3-eth-abi "1.3.6" + web3-utils "1.3.6" + +web3-eth-ens@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.11.tgz#26d4d7f16d6cbcfff918e39832b939edc3162532" + integrity sha512-dbW7dXP6HqT1EAPvnniZVnmw6TmQEKF6/1KgAxbo8iBBYrVTMDGFQUUnZ+C4VETGrwwaqtX4L9d/FrQhZ6SUiA== + 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" + +web3-eth-ens@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.2.tgz#0a4abed1d4cbdacbf5e1ab06e502d806d1192bc6" + integrity sha512-CFjkr2HnuyMoMFBoNUWojyguD4Ef+NkyovcnUc/iAb9GP4LHohKrODG4pl76R5u61TkJGobC2ij6TyibtsyVYg== + dependencies: + eth-ens-namehash "2.0.8" + underscore "1.9.1" + web3-core "1.2.2" + web3-core-helpers "1.2.2" + web3-core-promievent "1.2.2" + web3-eth-abi "1.2.2" + web3-eth-contract "1.2.2" + web3-utils "1.2.2" + +web3-eth-ens@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.2.4.tgz#b95b3aa99fb1e35c802b9e02a44c3046a3fa065e" + integrity sha512-g8+JxnZlhdsCzCS38Zm6R/ngXhXzvc3h7bXlxgKU4coTzLLoMpgOAEz71GxyIJinWTFbLXk/WjNY0dazi9NwVw== + dependencies: + eth-ens-namehash "2.0.8" + underscore "1.9.1" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-core-promievent "1.2.4" + web3-eth-abi "1.2.4" + web3-eth-contract "1.2.4" + web3-utils "1.2.4" + +web3-eth-ens@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-ens/-/web3-eth-ens-1.3.6.tgz#0d28c5d4ea7b4462ef6c077545a77956a6cdf175" + integrity sha512-n27HNj7lpSkRxTgSx+Zo7cmKAgyg2ElFilaFlUu/X2CNH23lXfcPm2bWssivH9z0ndhg0OyR4AYFZqPaqDHkJA== + dependencies: + content-hash "^2.5.2" + eth-ens-namehash "2.0.8" + underscore "1.12.1" + web3-core "1.3.6" + web3-core-helpers "1.3.6" + web3-core-promievent "1.3.6" + web3-eth-abi "1.3.6" + web3-eth-contract "1.3.6" + web3-utils "1.3.6" + +web3-eth-iban@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.11.tgz#f5f73298305bc7392e2f188bf38a7362b42144ef" + integrity sha512-ozuVlZ5jwFC2hJY4+fH9pIcuH1xP0HEFhtWsR69u9uDIANHLPQQtWYmdj7xQ3p2YT4bQLq/axKhZi7EZVetmxQ== + dependencies: + bn.js "^4.11.9" + web3-utils "1.2.11" + +web3-eth-iban@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.2.tgz#76bec73bad214df7c4192388979a59fc98b96c5a" + integrity sha512-gxKXBoUhaTFHr0vJB/5sd4i8ejF/7gIsbM/VvemHT3tF5smnmY6hcwSMmn7sl5Gs+83XVb/BngnnGkf+I/rsrQ== + dependencies: + bn.js "4.11.8" + web3-utils "1.2.2" + +web3-eth-iban@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.2.4.tgz#8e0550fd3fd8e47a39357d87fe27dee9483ee476" + integrity sha512-D9HIyctru/FLRpXakRwmwdjb5bWU2O6UE/3AXvRm6DCOf2e+7Ve11qQrPtaubHfpdW3KWjDKvlxV9iaFv/oTMQ== + dependencies: + bn.js "4.11.8" + web3-utils "1.2.4" + +web3-eth-iban@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-iban/-/web3-eth-iban-1.3.6.tgz#0d6ba21fe78f190af8919e9cd5453882457209e0" + integrity sha512-nfMQaaLA/zsg5W4Oy/EJQbs8rSs1vBAX6b/35xzjYoutXlpHMQadujDx2RerTKhSHqFXSJeQAfE+2f6mdhYkRQ== + dependencies: + bn.js "^4.11.9" + web3-utils "1.3.6" + +web3-eth-personal@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.11.tgz#a38b3942a1d87a62070ce0622a941553c3d5aa70" + integrity sha512-42IzUtKq9iHZ8K9VN0vAI50iSU9tOA1V7XU2BhF/tb7We2iKBVdkley2fg26TxlOcKNEHm7o6HRtiiFsVK4Ifw== + 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" + +web3-eth-personal@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.2.tgz#eee1c86a8132fa16b5e34c6d421ca92e684f0be6" + integrity sha512-4w+GLvTlFqW3+q4xDUXvCEMU7kRZ+xm/iJC8gm1Li1nXxwwFbs+Y+KBK6ZYtoN1qqAnHR+plYpIoVo27ixI5Rg== + dependencies: + "@types/node" "^12.6.1" + web3-core "1.2.2" + web3-core-helpers "1.2.2" + web3-core-method "1.2.2" + web3-net "1.2.2" + web3-utils "1.2.2" + +web3-eth-personal@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.2.4.tgz#3224cca6851c96347d9799b12c1b67b2a6eb232b" + integrity sha512-5Russ7ZECwHaZXcN3DLuLS7390Vzgrzepl4D87SD6Sn1DHsCZtvfdPIYwoTmKNp69LG3mORl7U23Ga5YxqkICw== + dependencies: + "@types/node" "^12.6.1" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-core-method "1.2.4" + web3-net "1.2.4" + web3-utils "1.2.4" + +web3-eth-personal@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth-personal/-/web3-eth-personal-1.3.6.tgz#226137916754c498f0284f22c55924c87a2efcf0" + integrity sha512-pOHU0+/h1RFRYoh1ehYBehRbcKWP4OSzd4F7mDljhHngv6W8ewMHrAN8O1ol9uysN2MuCdRE19qkRg5eNgvzFQ== + dependencies: + "@types/node" "^12.12.6" + web3-core "1.3.6" + web3-core-helpers "1.3.6" + web3-core-method "1.3.6" + web3-net "1.3.6" + web3-utils "1.3.6" + +web3-eth@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.11.tgz#4c81fcb6285b8caf544058fba3ae802968fdc793" + integrity sha512-REvxW1wJ58AgHPcXPJOL49d1K/dPmuw4LjPLBPStOVkQjzDTVmJEIsiLwn2YeuNDd4pfakBwT8L3bz1G1/wVsQ== + 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" + +web3-eth@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.2.tgz#65a1564634a23b990efd1655bf94ad513904286c" + integrity sha512-UXpC74mBQvZzd4b+baD4Ocp7g+BlwxhBHumy9seyE/LMIcMlePXwCKzxve9yReNpjaU16Mmyya6ZYlyiKKV8UA== + dependencies: + underscore "1.9.1" + web3-core "1.2.2" + web3-core-helpers "1.2.2" + web3-core-method "1.2.2" + web3-core-subscriptions "1.2.2" + web3-eth-abi "1.2.2" + web3-eth-accounts "1.2.2" + web3-eth-contract "1.2.2" + web3-eth-ens "1.2.2" + web3-eth-iban "1.2.2" + web3-eth-personal "1.2.2" + web3-net "1.2.2" + web3-utils "1.2.2" + +web3-eth@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.2.4.tgz#24c3b1f1ac79351bbfb808b2ab5c585fa57cdd00" + integrity sha512-+j+kbfmZsbc3+KJpvHM16j1xRFHe2jBAniMo1BHKc3lho6A8Sn9Buyut6odubguX2AxoRArCdIDCkT9hjUERpA== + dependencies: + underscore "1.9.1" + web3-core "1.2.4" + web3-core-helpers "1.2.4" + web3-core-method "1.2.4" + web3-core-subscriptions "1.2.4" + web3-eth-abi "1.2.4" + web3-eth-accounts "1.2.4" + web3-eth-contract "1.2.4" + web3-eth-ens "1.2.4" + web3-eth-iban "1.2.4" + web3-eth-personal "1.2.4" + web3-net "1.2.4" + web3-utils "1.2.4" + +web3-eth@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-eth/-/web3-eth-1.3.6.tgz#2c650893d540a7a0eb1365dd5b2dca24ac919b7c" + integrity sha512-9+rnywRRpyX3C4hfsAQXPQh6vHh9XzQkgLxo3gyeXfbhbShUoq2gFVuy42vsRs//6JlsKdyZS7Z3hHPHz2wreA== + dependencies: + underscore "1.12.1" + web3-core "1.3.6" + web3-core-helpers "1.3.6" + web3-core-method "1.3.6" + web3-core-subscriptions "1.3.6" + web3-eth-abi "1.3.6" + web3-eth-accounts "1.3.6" + web3-eth-contract "1.3.6" + web3-eth-ens "1.3.6" + web3-eth-iban "1.3.6" + web3-eth-personal "1.3.6" + web3-net "1.3.6" + web3-utils "1.3.6" + +web3-net@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.11.tgz#eda68ef25e5cdb64c96c39085cdb74669aabbe1b" + integrity sha512-sjrSDj0pTfZouR5BSTItCuZ5K/oZPVdVciPQ6981PPPIwJJkCMeVjD7I4zO3qDPCnBjBSbWvVnLdwqUBPtHxyg== + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-utils "1.2.11" + +web3-net@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.2.tgz#5c3226ca72df7c591422440ce6f1203fd42ddad9" + integrity sha512-K07j2DXq0x4UOJgae65rWZKraOznhk8v5EGSTdFqASTx7vWE/m+NqBijBYGEsQY1lSMlVaAY9UEQlcXK5HzXTw== + dependencies: + web3-core "1.2.2" + web3-core-method "1.2.2" + web3-utils "1.2.2" + +web3-net@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.2.4.tgz#1d246406d3aaffbf39c030e4e98bce0ca5f25458" + integrity sha512-wKOsqhyXWPSYTGbp7ofVvni17yfRptpqoUdp3SC8RAhDmGkX6irsiT9pON79m6b3HUHfLoBilFQyt/fTUZOf7A== + dependencies: + web3-core "1.2.4" + web3-core-method "1.2.4" + web3-utils "1.2.4" + +web3-net@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-net/-/web3-net-1.3.6.tgz#a56492e2227475e38db29394f8bac305a2446e41" + integrity sha512-KhzU3wMQY/YYjyMiQzbaLPt2kut88Ncx2iqjy3nw28vRux3gVX0WOCk9EL/KVJBiAA/fK7VklTXvgy9dZnnipw== + dependencies: + web3-core "1.3.6" + web3-core-method "1.3.6" + web3-utils "1.3.6" + +web3-provider-engine@14.2.1: + version "14.2.1" + resolved "https://registry.yarnpkg.com/web3-provider-engine/-/web3-provider-engine-14.2.1.tgz#ef351578797bf170e08d529cb5b02f8751329b95" + integrity sha512-iSv31h2qXkr9vrL6UZDm4leZMc32SjWJFGOp/D92JXfcEboCqraZyuExDkpxKw8ziTufXieNM7LSXNHzszYdJw== + 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 "^1.4.2" + 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" + +web3-providers-http@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.11.tgz#1cd03442c61670572d40e4dcdf1faff8bd91e7c6" + integrity sha512-psh4hYGb1+ijWywfwpB2cvvOIMISlR44F/rJtYkRmQ5jMvG4FOCPlQJPiHQZo+2cc3HbktvvSJzIhkWQJdmvrA== + dependencies: + web3-core-helpers "1.2.11" + xhr2-cookies "1.1.0" + +web3-providers-http@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.2.tgz#155e55c1d69f4c5cc0b411ede40dea3d06720956" + integrity sha512-BNZ7Hguy3eBszsarH5gqr9SIZNvqk9eKwqwmGH1LQS1FL3NdoOn7tgPPdddrXec4fL94CwgNk4rCU+OjjZRNDg== + dependencies: + web3-core-helpers "1.2.2" + xhr2-cookies "1.1.0" + +web3-providers-http@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.2.4.tgz#514fcad71ae77832c2c15574296282fbbc5f4a67" + integrity sha512-dzVCkRrR/cqlIrcrWNiPt9gyt0AZTE0J+MfAu9rR6CyIgtnm1wFUVVGaxYRxuTGQRO4Dlo49gtoGwaGcyxqiTw== + dependencies: + web3-core-helpers "1.2.4" + xhr2-cookies "1.1.0" + +web3-providers-http@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-providers-http/-/web3-providers-http-1.3.6.tgz#36e8724a7424d52827819d53fd75dbf31f5422c2" + integrity sha512-OQkT32O1A06dISIdazpGLveZcOXhEo5cEX6QyiSQkiPk/cjzDrXMw4SKZOGQbbS1+0Vjizm1Hrp7O8Vp2D1M5Q== + dependencies: + web3-core-helpers "1.3.6" + xhr2-cookies "1.1.0" + +web3-providers-ipc@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.11.tgz#d16d6c9be1be6e0b4f4536c4acc16b0f4f27ef21" + integrity sha512-yhc7Y/k8hBV/KlELxynWjJDzmgDEDjIjBzXK+e0rHBsYEhdCNdIH5Psa456c+l0qTEU2YzycF8VAjYpWfPnBpQ== + dependencies: + oboe "2.1.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + +web3-providers-ipc@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.2.tgz#c6d165a12bc68674b4cdd543ea18aec79cafc2e8" + integrity sha512-t97w3zi5Kn/LEWGA6D9qxoO0LBOG+lK2FjlEdCwDQatffB/+vYrzZ/CLYVQSoyFZAlsDoBasVoYSWZK1n39aHA== + dependencies: + oboe "2.1.4" + underscore "1.9.1" + web3-core-helpers "1.2.2" + +web3-providers-ipc@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.2.4.tgz#9d6659f8d44943fb369b739f48df09092be459bd" + integrity sha512-8J3Dguffin51gckTaNrO3oMBo7g+j0UNk6hXmdmQMMNEtrYqw4ctT6t06YOf9GgtOMjSAc1YEh3LPrvgIsR7og== + dependencies: + oboe "2.1.4" + underscore "1.9.1" + web3-core-helpers "1.2.4" + +web3-providers-ipc@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-providers-ipc/-/web3-providers-ipc-1.3.6.tgz#cef8d12c1ebb47adce5ebf597f553c623362cb4a" + integrity sha512-+TVsSd2sSVvVgHG4s6FXwwYPPT91boKKcRuEFXqEfAbUC5t52XOgmyc2LNiD9LzPhed65FbV4LqICpeYGUvSwA== + dependencies: + oboe "2.1.5" + underscore "1.12.1" + web3-core-helpers "1.3.6" + +web3-providers-ws@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.11.tgz#a1dfd6d9778d840561d9ec13dd453046451a96bb" + integrity sha512-ZxnjIY1Er8Ty+cE4migzr43zA/+72AF1myzsLaU5eVgdsfV7Jqx7Dix1hbevNZDKFlSoEyq/3j/jYalh3So1Zg== + dependencies: + eventemitter3 "4.0.4" + underscore "1.9.1" + web3-core-helpers "1.2.11" + websocket "^1.0.31" + +web3-providers-ws@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.2.tgz#d2c05c68598cea5ad3fa6ef076c3bcb3ca300d29" + integrity sha512-Wb1mrWTGMTXOpJkL0yGvL/WYLt8fUIXx8k/l52QB2IiKzvyd42dTWn4+j8IKXGSYYzOm7NMqv6nhA5VDk12VfA== + dependencies: + underscore "1.9.1" + web3-core-helpers "1.2.2" + websocket "github:web3-js/WebSocket-Node#polyfill/globalThis" + +web3-providers-ws@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.2.4.tgz#099ee271ee03f6ea4f5df9cfe969e83f4ce0e36f" + integrity sha512-F/vQpDzeK+++oeeNROl1IVTufFCwCR2hpWe5yRXN0ApLwHqXrMI7UwQNdJ9iyibcWjJf/ECbauEEQ8CHgE+MYQ== + dependencies: + "@web3-js/websocket" "^1.0.29" + underscore "1.9.1" + web3-core-helpers "1.2.4" + +web3-providers-ws@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-providers-ws/-/web3-providers-ws-1.3.6.tgz#e1df617bc89d66165abdf2191da0014c505bfaac" + integrity sha512-bk7MnJf5or0Re2zKyhR3L3CjGululLCHXx4vlbc/drnaTARUVvi559OI5uLytc/1k5HKUUyENAxLvetz2G1dnQ== + dependencies: + eventemitter3 "4.0.4" + underscore "1.12.1" + web3-core-helpers "1.3.6" + websocket "^1.0.32" + +web3-shh@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.11.tgz#f5d086f9621c9a47e98d438010385b5f059fd88f" + integrity sha512-B3OrO3oG1L+bv3E1sTwCx66injW1A8hhwpknDUbV+sw3fehFazA06z9SGXUefuFI1kVs4q2vRi0n4oCcI4dZDg== + dependencies: + web3-core "1.2.11" + web3-core-method "1.2.11" + web3-core-subscriptions "1.2.11" + web3-net "1.2.11" + +web3-shh@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.2.tgz#44ed998f2a6ba0ec5cb9d455184a0f647826a49c" + integrity sha512-og258NPhlBn8yYrDWjoWBBb6zo1OlBgoWGT+LL5/LPqRbjPe09hlOYHgscAAr9zZGtohTOty7RrxYw6Z6oDWCg== + dependencies: + web3-core "1.2.2" + web3-core-method "1.2.2" + web3-core-subscriptions "1.2.2" + web3-net "1.2.2" + +web3-shh@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.2.4.tgz#5c8ff5ab624a3b14f08af0d24d2b16c10e9f70dd" + integrity sha512-z+9SCw0dE+69Z/Hv8809XDbLj7lTfEv9Sgu8eKEIdGntZf4v7ewj5rzN5bZZSz8aCvfK7Y6ovz1PBAu4QzS4IQ== + dependencies: + web3-core "1.2.4" + web3-core-method "1.2.4" + web3-core-subscriptions "1.2.4" + web3-net "1.2.4" + +web3-shh@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-shh/-/web3-shh-1.3.6.tgz#4e3486c7eca5cbdb87f88910948223a5b7ea6c20" + integrity sha512-9zRo415O0iBslxBnmu9OzYjNErzLnzOsy+IOvSpIreLYbbAw0XkDWxv3SfcpKnTIWIACBR4AYMIxmmyi5iB3jw== + dependencies: + web3-core "1.3.6" + web3-core-method "1.3.6" + web3-core-subscriptions "1.3.6" + web3-net "1.3.6" + +web3-utils@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.11.tgz#af1942aead3fb166ae851a985bed8ef2c2d95a82" + integrity sha512-3Tq09izhD+ThqHEaWYX4VOT7dNPdZiO+c/1QMA0s5X2lDFKK/xHJb7cyTRRVzN2LvlHbR7baS1tmQhSua51TcQ== + 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" + +web3-utils@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.2.tgz#b53a08c40d2c3f31d3c4a28e7d749405df99c8c0" + integrity sha512-joF+s3243TY5cL7Z7y4h1JsJpUCf/kmFmj+eJar7Y2yNIGVcW961VyrAms75tjUysSuHaUQ3eQXjBEUJueT52A== + dependencies: + bn.js "4.11.8" + eth-lib "0.2.7" + 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" + +web3-utils@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.2.4.tgz#96832a39a66b05bf8862a5b0bdad2799d709d951" + integrity sha512-+S86Ip+jqfIPQWvw2N/xBQq5JNqCO0dyvukGdJm8fEWHZbckT4WxSpHbx+9KLEWY4H4x9pUwnoRkK87pYyHfgQ== + dependencies: + bn.js "4.11.8" + eth-lib "0.2.7" + 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" + +web3-utils@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.3.6.tgz#390bc9fa3a7179746963cfaca55bb80ac4d8dc10" + integrity sha512-hHatFaQpkQgjGVER17gNx8u1qMyaXFZtM0y0XLGH1bzsjMPlkMPLRcYOrZ00rOPfTEuYFOdrpGOqZXVmGrMZRg== + 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.12.1" + utf8 "3.0.0" + +web3-utils@^1.0.0-beta.31: + version "1.9.0" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.9.0.tgz#7c5775a47586cefb4ad488831be8f6627be9283d" + integrity sha512-p++69rCNNfu2jM9n5+VD/g26l+qkEOQ1m6cfRQCbH8ZRrtquTmrirJMgTmyOoax5a5XRYOuws14aypCOs51pdQ== + dependencies: + 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" + +web3@1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.11.tgz#50f458b2e8b11aa37302071c170ed61cff332975" + integrity sha512-mjQ8HeU41G6hgOYm1pmeH0mRAeNKJGnJEUzDMoerkpw7QUQT4exVREgF1MYPvL/z6vAshOXei25LE/t/Bxl8yQ== + 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" + +web3@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.2.tgz#b1b8b69aafdf94cbaeadbb68a8aa1df2ef266aec" + integrity sha512-/ChbmB6qZpfGx6eNpczt5YSUBHEA5V2+iUCbn85EVb3Zv6FVxrOo5Tv7Lw0gE2tW7EEjASbCyp3mZeiZaCCngg== + dependencies: + "@types/node" "^12.6.1" + web3-bzz "1.2.2" + web3-core "1.2.2" + web3-eth "1.2.2" + web3-eth-personal "1.2.2" + web3-net "1.2.2" + web3-shh "1.2.2" + web3-utils "1.2.2" + +web3@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.2.4.tgz#6e7ab799eefc9b4648c2dab63003f704a1d5e7d9" + integrity sha512-xPXGe+w0x0t88Wj+s/dmAdASr3O9wmA9mpZRtixGZxmBexAF0MjfqYM+MS4tVl5s11hMTN3AZb8cDD4VLfC57A== + dependencies: + "@types/node" "^12.6.1" + web3-bzz "1.2.4" + web3-core "1.2.4" + web3-eth "1.2.4" + web3-eth-personal "1.2.4" + web3-net "1.2.4" + web3-shh "1.2.4" + web3-utils "1.2.4" + +web3@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/web3/-/web3-1.3.6.tgz#599425461c3f9a8cbbefa70616438995f4a064cc" + integrity sha512-jEpPhnL6GDteifdVh7ulzlPrtVQeA30V9vnki9liYlUvLV82ZM7BNOQJiuzlDePuE+jZETZSP/0G/JlUVt6pOA== + dependencies: + web3-bzz "1.3.6" + web3-core "1.3.6" + web3-eth "1.3.6" + web3-eth-personal "1.3.6" + web3-net "1.3.6" + web3-shh "1.3.6" + web3-utils "1.3.6" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +websocket@1.0.32: + version "1.0.32" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.32.tgz#1f16ddab3a21a2d929dec1687ab21cfdc6d3dbb1" + integrity sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q== + 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" + +websocket@^1.0.31, websocket@^1.0.32: + version "1.0.34" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" + integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== + 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" + +"websocket@github:web3-js/WebSocket-Node#polyfill/globalThis": + version "1.0.29" + resolved "https://codeload.github.com/web3-js/WebSocket-Node/tar.gz/ef5ea2f41daf4a2113b80c9223df884b4d56c400" + dependencies: + debug "^2.2.0" + es5-ext "^0.10.50" + nan "^2.14.0" + typedarray-to-buffer "^3.1.5" + yaeti "^0.0.6" + +whatwg-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + +whatwg-fetch@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" + integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ== + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + +which-typed-array@^1.1.2, which-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.10" + +which@1.3.1, which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wif@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" + integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== + dependencies: + bs58check "<3.0.0" + +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + integrity sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw== + +word-wrap@^1.2.3, word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wordwrapjs@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" + integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== + dependencies: + reduce-flatten "^2.0.0" + typical "^5.2.0" + +workerpool@6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw== + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +ws@7.4.6: + version "7.4.6" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" + integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== + +ws@^3.0.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-3.3.3.tgz#f1cf84fe2d5e901ebce94efaece785f187a228f2" + integrity sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + ultron "~1.1.0" + +ws@^5.1.1: + version "5.2.3" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.3.tgz#05541053414921bc29c63bee14b8b0dd50b07b3d" + integrity sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA== + dependencies: + async-limiter "~1.0.0" + +ws@^7.4.6: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xhr-request-promise@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/xhr-request-promise/-/xhr-request-promise-0.1.3.tgz#2d5f4b16d8c6c893be97f1a62b0ed4cf3ca5f96c" + integrity sha512-YUBytBsuwgitWtdRzXDDkWAXzhdGB8bYm0sSzMPZT7Z2MBjMSTHFsyCT1yCRATY+XC69DUrQraRAEgcoCRaIPg== + dependencies: + xhr-request "^1.1.0" + +xhr-request@^1.0.1, xhr-request@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr-request/-/xhr-request-1.1.0.tgz#f4a7c1868b9f198723444d82dcae317643f2e2ed" + integrity sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA== + 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" + +xhr2-cookies@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" + integrity sha512-hjXUA6q+jl/bd8ADHcVfFsSPIf+tyLIjuO9TwJC9WI6JP2zKcS7C+p56I9kCLLsaCiNT035iYvEUUzdEFj/8+g== + dependencies: + cookiejar "^2.1.1" + +xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: + version "2.6.0" + resolved "https://registry.yarnpkg.com/xhr/-/xhr-2.6.0.tgz#b69d4395e792b4173d6b7df077f0fc5e4e2b249d" + integrity sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA== + dependencies: + global "~4.4.0" + is-function "^1.0.1" + parse-headers "^2.0.0" + xtend "^4.0.0" + +xmlhttprequest@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" + integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== + +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + integrity sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ== + dependencies: + object-keys "~0.4.0" + +y18n@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" + integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== + +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yaeti@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" + integrity sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug== + +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yaml@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + +yargs-parser@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + integrity sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA== + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.0.6" + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f" + integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== + dependencies: + flat "^4.1.0" + lodash "^4.17.15" + yargs "^13.3.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.2, yargs@^13.3.0: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^4.7.1: + version "4.8.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + integrity sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA== + 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" + +yauzl@^2.4.2: + version "2.10.0" + resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== + dependencies: + buffer-crc32 "~0.2.3" + fd-slicer "~1.1.0" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zksync-web3@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" + integrity sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw== From 21993264515d44c558697b4ac78d9fda65196f13 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 12:57:31 +0200 Subject: [PATCH 002/198] Adding wormholeTBTC address for Polygon testnet --- cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json b/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json index 64f4bd593..2176e8dce 100644 --- a/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json +++ b/cross-chain/polygon/external/mumbai/PolygonWormholeTBTC.json @@ -1,4 +1,3 @@ { - "address": "0x1111111111111111111111111111111111111111", - "memo": "TODO: needs attestation" + "address": "0xf6cc0cc8d54a4b1a63a0e9745663e0c844ee4d48" } From 8377d1e0b63c321b2958be0635d5574382df5679 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 12:58:43 +0200 Subject: [PATCH 003/198] Updating Wormhole Gateway mapping with Optimism --- .../00_resolve_optimism_wormhole_gateway.ts | 28 +++++++++++++ ...th_arbitrum_in_wormhole_gateway_mapping.ts | 2 - ...th_optimism_in_wormhole_gateway_mapping.ts | 41 +++++++++++++++++++ .../mumbai/OptimismWormholeGateway.json | 4 ++ .../polygon/OptimismWormholeGateway.json | 4 ++ 5 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 cross-chain/polygon/deploy_sidechain/00_resolve_optimism_wormhole_gateway.ts create mode 100644 cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json create mode 100644 cross-chain/polygon/external/polygon/OptimismWormholeGateway.json diff --git a/cross-chain/polygon/deploy_sidechain/00_resolve_optimism_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/00_resolve_optimism_wormhole_gateway.ts new file mode 100644 index 000000000..5be6e22e5 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/00_resolve_optimism_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const OptimismWormholeGateway = await deployments.getOrNull( + "OptimismWormholeGateway" + ) + + if ( + OptimismWormholeGateway && + helpers.address.isValid(OptimismWormholeGateway.address) + ) { + log( + `using existing OptimismWormholeGateway at ${OptimismWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake OptimismWormholeGateway for hardhat network") + } else { + throw new Error("deployed OptimismWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["OptimismWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts index a8a3ac616..bebbad98b 100644 --- a/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts +++ b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts @@ -14,8 +14,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // This ID is valid for both Arbitrum Goerli and Mainnet const arbitrumWormholeChainID = 23 - // TODO: Add Optimism mapping - const arbitrumWormholeGateway = await deployments.getOrNull( "ArbitrumWormholeGateway" ) diff --git a/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..79eba79b8 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts @@ -0,0 +1,41 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake OptimismWormholeGateway for local development purposes only. + const fakeOptimismWormholeGateway = + "0x2af5DC16568EFF2d480a43A77E6C409e497FcFb9" + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Optimism Goerli and Mainnet + const optimismWormholeChainID = 24 + + const optimismWormholeGateway = await deployments.getOrNull( + "OptimismWormholeGateway" + ) + + let optimismWormholeGatewayAddress = optimismWormholeGateway?.address + if (!optimismWormholeGatewayAddress && hre.network.name === "hardhat") { + optimismWormholeGatewayAddress = fakeOptimismWormholeGateway + log( + `fake OptimismWormholeGateway address ${optimismWormholeGatewayAddress}` + ) + } + + await execute( + "PolygonWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + optimismWormholeChainID, + ethers.utils.hexZeroPad(optimismWormholeGatewayAddress, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["PolygonWormholeGateway"] diff --git a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json new file mode 100644 index 000000000..f86634ceb --- /dev/null +++ b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json @@ -0,0 +1,4 @@ +{ + "address": "0x1111111111111111111111111111111111111111", + "memo": "TODO: change to the correct address once available" +} diff --git a/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json new file mode 100644 index 000000000..f86634ceb --- /dev/null +++ b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json @@ -0,0 +1,4 @@ +{ + "address": "0x1111111111111111111111111111111111111111", + "memo": "TODO: change to the correct address once available" +} From 8154fd0e4c64bb5bf4bd8a22938da21e33314a1d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 13:20:59 +0200 Subject: [PATCH 004/198] Adding description around updating Wormhole Gateway mapping --- cross-chain/polygon/README.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cross-chain/polygon/README.adoc b/cross-chain/polygon/README.adoc index 831c24273..7eb3c240b 100644 --- a/cross-chain/polygon/README.adoc +++ b/cross-chain/polygon/README.adoc @@ -23,6 +23,16 @@ delegated to `PolygonWormholeGateway`. - `PolygonWormholeGateway` is a smart contract wrapping and unwrapping Wormhole-specific tBTC representation into the canonical `PolygonTBTC` token. +=== Updating Wormhole Gateway mapping + +The deployment scripts are responsible for managing updates of the tBTC gateway +addresses across various chains. These addresses are stored in the `external/` +directory for a specific network, such as `mumbai/ArbitrumWormholeGateway.json.` +It is important to note that these addresses should remain constant for the +mainnet network. However, there may be instances where a new version of a +cross-chain module is deployed to the testing network, which would require a +manual update of the corresponding address. + === Deploy contracts To deploy all contracts on the given network, please run: From 6b4fc1e478402c56c4ecb7035debe90ed2952665 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 14:58:06 +0200 Subject: [PATCH 005/198] Adding description to README about Wormhole Gateway mapping Added description mentioning about the need of updating Wormhole Gateway addresses for testing networks. --- cross-chain/arbitrum/README.adoc | 10 ++++++++++ cross-chain/optimism/README.adoc | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/cross-chain/arbitrum/README.adoc b/cross-chain/arbitrum/README.adoc index d75cb778d..5c4786b1b 100644 --- a/cross-chain/arbitrum/README.adoc +++ b/cross-chain/arbitrum/README.adoc @@ -23,6 +23,16 @@ delegated to `ArbitrumWormholeGateway`. - `ArbitrumWormholeGateway` is a smart contract wrapping and unwrapping Wormhole-specific tBTC representation into the canonical `ArbitrumTBTC` token. +=== Updating Wormhole Gateway mapping + +The deployment scripts are responsible for managing updates of the tBTC gateway +addresses across various chains. These addresses are stored in the `external/` +directory for a specific network, such as `arbitrumGoerli/OptimismWormholeGateway.json.` +It is important to note that these addresses should remain constant for the +mainnet network. However, there may be instances where a new version of a +cross-chain module is deployed to the testing network, which would require a +manual update of the corresponding address. + === Deploy contracts To deploy all contracts on the given network, please run: diff --git a/cross-chain/optimism/README.adoc b/cross-chain/optimism/README.adoc index cf54a807c..0970bd560 100644 --- a/cross-chain/optimism/README.adoc +++ b/cross-chain/optimism/README.adoc @@ -23,6 +23,16 @@ delegated to `OptimismWormholeGateway`. - `OptimismWormholeGateway` is a smart contract wrapping and unwrapping Wormhole-specific tBTC representation into the canonical `OptimismTBTC` token. +=== Updating Wormhole Gateway mapping + +The deployment scripts are responsible for managing updates of the tBTC gateway +addresses across various chains. These addresses are stored in the `external/` +directory for a specific network, such as `optimismGoerli/ArbitrumWormholeGateway.json.` +It is important to note that these addresses should remain constant for the +mainnet network. However, there may be instances where a new version of a +cross-chain module is deployed to the testing network, which would require a +manual update of the corresponding address. + === Deploy contracts To deploy all contracts on the given network, please run: From ba3ab4ed697e96b1243c417360dc21c28d382d40 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 16:35:00 +0200 Subject: [PATCH 006/198] Adding Polygon to Wormhole Gateway mapping At this point it is a placeholder only. The address should be updated once we deploy contract on Polygon. --- .../00_resolve_polygon_wormhole_gateway.ts | 28 +++++++++++++ ...ith_polygon_in_wormhole_gateway_mapping.ts | 39 +++++++++++++++++++ .../optimism/PolygonWormholeGateway.json | 3 ++ .../PolygonWormholeGateway.json | 3 ++ 4 files changed, 73 insertions(+) create mode 100644 cross-chain/optimism/deploy_l2/00_resolve_polygon_wormhole_gateway.ts create mode 100644 cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/optimism/external/optimism/PolygonWormholeGateway.json create mode 100644 cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json diff --git a/cross-chain/optimism/deploy_l2/00_resolve_polygon_wormhole_gateway.ts b/cross-chain/optimism/deploy_l2/00_resolve_polygon_wormhole_gateway.ts new file mode 100644 index 000000000..8ab3573d8 --- /dev/null +++ b/cross-chain/optimism/deploy_l2/00_resolve_polygon_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const PolygonWormholeGateway = await deployments.getOrNull( + "PolygonWormholeGateway" + ) + + if ( + PolygonWormholeGateway && + helpers.address.isValid(PolygonWormholeGateway.address) + ) { + log( + `using existing PolygonWormholeGateway at ${PolygonWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake PolygonWormholeGateway for hardhat network") + } else { + throw new Error("deployed PolygonWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["PolygonWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..cdb03f9c3 --- /dev/null +++ b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute, log } = deployments + const { deployer } = await getNamedAccounts() + + // Fake PolygonWormholeGateway for local development purposes only. + const fakePolygonWormholeGateway = + "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Polygon Testnet (Mumbai) and Mainnet + const polygonWormholeChainID = 5 + + const polygonWormholeGateway = await deployments.getOrNull( + "PolygonWormholeGateway" + ) + + let polygonWormholeGatewayAddress = polygonWormholeGateway?.address + if (!polygonWormholeGatewayAddress && hre.network.name === "hardhat") { + polygonWormholeGatewayAddress = fakePolygonWormholeGateway + log(`fake PolygonWormholeGateway address ${polygonWormholeGatewayAddress}`) + } + + await execute( + "OptimismWormholeGateway", + { from: deployer, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + polygonWormholeChainID, + ethers.utils.hexZeroPad(polygonWormholeGatewayAddress, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json b/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} diff --git a/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} From d7757c64abd7a0f25391bf8eba026c2897f10320 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 11 Apr 2023 16:42:19 +0200 Subject: [PATCH 007/198] Adding Wormhole Gateway mappings for Optimism and Polygon These files are the placeholders and will be used once we have the correct addresses of Optimism and Polygon gateways. These scripts will need to be executed by the governanance, because the ownership was already transferred from the deployer to governance address. --- .../00_resolve_optimism_wormhole_gateway.ts | 28 +++++++++++++ .../00_resolve_polygon_wormhole_gateway.ts | 28 +++++++++++++ ...th_optimism_in_wormhole_gateway_mapping.ts | 41 +++++++++++++++++++ ...ith_polygon_in_wormhole_gateway_mapping.ts | 39 ++++++++++++++++++ .../OptimismWormholeGateway.json | 3 ++ .../PolygonWormholeGateway.json | 3 ++ .../arbitrumOne/OptimismWormholeGateway.json | 3 ++ .../arbitrumOne/PolygonWormholeGateway.json | 3 ++ 8 files changed, 148 insertions(+) create mode 100644 cross-chain/arbitrum/deploy_l2/00_resolve_optimism_wormhole_gateway.ts create mode 100644 cross-chain/arbitrum/deploy_l2/00_resolve_polygon_wormhole_gateway.ts create mode 100644 cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts create mode 100644 cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json create mode 100644 cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json create mode 100644 cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json create mode 100644 cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json diff --git a/cross-chain/arbitrum/deploy_l2/00_resolve_optimism_wormhole_gateway.ts b/cross-chain/arbitrum/deploy_l2/00_resolve_optimism_wormhole_gateway.ts new file mode 100644 index 000000000..5be6e22e5 --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/00_resolve_optimism_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const OptimismWormholeGateway = await deployments.getOrNull( + "OptimismWormholeGateway" + ) + + if ( + OptimismWormholeGateway && + helpers.address.isValid(OptimismWormholeGateway.address) + ) { + log( + `using existing OptimismWormholeGateway at ${OptimismWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake OptimismWormholeGateway for hardhat network") + } else { + throw new Error("deployed OptimismWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["OptimismWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/00_resolve_polygon_wormhole_gateway.ts b/cross-chain/arbitrum/deploy_l2/00_resolve_polygon_wormhole_gateway.ts new file mode 100644 index 000000000..8ab3573d8 --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/00_resolve_polygon_wormhole_gateway.ts @@ -0,0 +1,28 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { helpers, deployments } = hre + const { log } = deployments + + const PolygonWormholeGateway = await deployments.getOrNull( + "PolygonWormholeGateway" + ) + + if ( + PolygonWormholeGateway && + helpers.address.isValid(PolygonWormholeGateway.address) + ) { + log( + `using existing PolygonWormholeGateway at ${PolygonWormholeGateway.address}` + ) + } else if (hre.network.name === "hardhat") { + log("using fake PolygonWormholeGateway for hardhat network") + } else { + throw new Error("deployed PolygonWormholeGateway contract not found") + } +} + +export default func + +func.tags = ["PolygonWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..8246a3a2b --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts @@ -0,0 +1,41 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute, log } = deployments + const { governance } = await getNamedAccounts() + + // Fake OptimismWormholeGateway for local development purposes only. + const fakeOptimismWormholeGateway = + "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Optimism Goerli and Mainnet + const optimismWormholeChainID = 24 + + const optimismWormholeGateway = await deployments.getOrNull( + "OptimismWormholeGateway" + ) + + let optimismWormholeGatewayAddress = optimismWormholeGateway?.address + if (!optimismWormholeGatewayAddress && hre.network.name === "hardhat") { + optimismWormholeGatewayAddress = fakeOptimismWormholeGateway + log( + `fake OptimismWormholeGateway address ${optimismWormholeGatewayAddress}` + ) + } + + await execute( + "ArbitrumWormholeGateway", + { from: governance, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + optimismWormholeChainID, + ethers.utils.hexZeroPad(optimismWormholeGatewayAddress, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts new file mode 100644 index 000000000..3e38706e4 --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -0,0 +1,39 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, ethers } = hre + const { execute, log } = deployments + const { governance } = await getNamedAccounts() + + // Fake PolygonWormholeGateway for local development purposes only. + const fakePolygonWormholeGateway = + "0x1af5DC16568EFF2d480a43A77E6C409e497FcFb9" + + // See https://book.wormhole.com/reference/contracts.html + // This ID is valid for both Polygon Testnet (Mumbai) and Mainnet + const polygonWormholeChainID = 5 + + const polygonWormholeGateway = await deployments.getOrNull( + "PolygonWormholeGateway" + ) + + let polygonWormholeGatewayAddress = polygonWormholeGateway?.address + if (!polygonWormholeGatewayAddress && hre.network.name === "hardhat") { + polygonWormholeGatewayAddress = fakePolygonWormholeGateway + log(`fake PolygonWormholeGateway address ${polygonWormholeGatewayAddress}`) + } + + await execute( + "ArbitrumWormholeGateway", + { from: governance, log: true, waitConfirmations: 1 }, + "updateGatewayAddress", + polygonWormholeChainID, + ethers.utils.hexZeroPad(polygonWormholeGatewayAddress, 32) + ) +} + +export default func + +func.tags = ["SetGatewayAddress"] +func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} diff --git a/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} diff --git a/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json new file mode 100644 index 000000000..6ce8c509b --- /dev/null +++ b/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json @@ -0,0 +1,3 @@ +{ + "address": "TODO: change to the correct address once available" +} From 97686e252972e4cd846be043b23c66d952fb75ef Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Tue, 11 Apr 2023 18:33:06 +0200 Subject: [PATCH 008/198] Added light relay maintainer proxy contract --- .../relay/LightRelayMaintainerProxy.sol | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 solidity/contracts/relay/LightRelayMaintainerProxy.sol diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol new file mode 100644 index 000000000..23d635212 --- /dev/null +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-3.0-only + +// ██████████████ ▐████▌ ██████████████ +// ██████████████ ▐████▌ ██████████████ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ +// ██████████████ ▐████▌ ██████████████ +// ██████████████ ▐████▌ ██████████████ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ +// ▐████▌ ▐████▌ + +pragma solidity 0.8.17; + +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@keep-network/random-beacon/contracts/Reimbursable.sol"; +import "@keep-network/random-beacon/contracts/ReimbursementPool.sol"; + +import "./LightRelay.sol"; + +/// @title LightRelayMaintainerProxy +/// @notice The proxy contract that allows the relay maintainers to be refunded +/// for the spent gas from the `ReimbursementPool`. When proving the +/// next Bitcoin difficulty epoch, the maintainer calls the +/// `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay` +/// contract. +contract LightRelayMaintainerProxy is Ownable, Reimbursable { + ILightRelay public lightRelay; + + /// @notice Stores the addresses that can maintain the relay. Those + /// addresses are attested by the DAO. + /// @dev The goal is to prevent a griefing attack by frontrunning relay + /// maintainer which is responsible for retargetting the relay in the + /// given round. The maintainer's transaction would revert with no gas + /// refund. Having the ability to restrict maintainer addresses is also + /// important in case the underlying relay contract has authorization + /// requirements for callers. + mapping(address => bool) public isAuthorized; + + /// @notice Gas that is meant to balance the retarget overall cost. Can be + // updated by the governance based on the current market conditions. + uint256 public retargetGasOffset; + + event LightRelayUpdated(address newRelay); + + event MaintainerAuthorized(address indexed maintainer); + + event MaintainerDeauthorized(address indexed maintainer); + + event RetargetGasOffsetUpdated(uint256 retargetGasOffset); + + modifier onlyRelayMaintainer() { + require(isAuthorized[msg.sender], "Caller is not authorized"); + _; + } + + modifier onlyReimbursableAdmin() override { + require(owner() == msg.sender, "Caller is not the owner"); + _; + } + + constructor(ILightRelay _lightRelay, ReimbursementPool _reimbursementPool) { + lightRelay = _lightRelay; + reimbursementPool = _reimbursementPool; + + retargetGasOffset = 50000; + } + + /// @notice Allows the governance to upgrade the `LightRelay` address. + /// @dev The function does not implement any governance delay and does not + /// check the status of the `LightRelay`. The Governance implementation + /// needs to ensure all requirements for the upgrade are satisfied + /// before executing this function. + function updateLightRelay(ILightRelay _lightRelay) external onlyOwner { + lightRelay = _lightRelay; + + emit LightRelayUpdated(address(_lightRelay)); + } + + /// @notice Authorizes the given address as a maintainer. Can only be called + /// by the owner. + /// @dev The function does not implement any governance delay. + /// @param maintainer The address of the maintainer to be authorized. + function authorize(address maintainer) external onlyOwner { + isAuthorized[maintainer] = true; + emit MaintainerAuthorized(maintainer); + } + + /// @notice Deauthorizes the given address as a maintainer. Can only be called + /// by the owner. + /// @dev The function does not implement any governance delay. + /// @param maintainer The address of the maintainer to be deauthorized. + function deauthorize(address maintainer) external onlyOwner { + isAuthorized[maintainer] = false; + emit MaintainerDeauthorized(maintainer); + } + + /// @notice Updates the values of retarget gas offset. + /// @dev Can be called only by the contract owner. The caller is responsible + /// for validating the parameter. The function does not implement any + /// governance delay. + /// @param newRetargetGasOffset New retarget gas offset. + function updateRetargetGasOffset(uint256 newRetargetGasOffset) + external + onlyOwner + { + retargetGasOffset = newRetargetGasOffset; + emit RetargetGasOffsetUpdated(retargetGasOffset); + } + + /// @notice Wraps `LightRelay.retarget` call and reimburses the caller's + /// transaction cost. Can only be called by an authorized relay + /// maintainer. + /// @dev See `LightRelay.retarget` function documentation. + function retarget(bytes memory headers) external onlyRelayMaintainer { + uint256 gasStart = gasleft(); + + lightRelay.retarget(headers); + + reimbursementPool.refund( + (gasStart - gasleft()) + retargetGasOffset, + msg.sender + ); + } +} From a4a7d9bc57b5daf09d9166af7bfcd654ded93695 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Tue, 11 Apr 2023 18:33:34 +0200 Subject: [PATCH 009/198] Added light relay maintainer proxy scripts --- .../40_deploy_light_relay_maintainer_proxy.ts | 35 +++++++++++++++++++ ..._light_relay_maintainer_proxy_ownership.ts | 19 ++++++++++ ..._maintainer_proxy_in_reimbursement_pool.ts | 31 ++++++++++++++++ ...t_relay_maintainer_proxy_in_light_relay.ts | 29 +++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts create mode 100644 solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts create mode 100644 solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts create mode 100644 solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts diff --git a/solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts b/solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts new file mode 100644 index 000000000..ebd769237 --- /dev/null +++ b/solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts @@ -0,0 +1,35 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments, getNamedAccounts, helpers } = hre + const { deploy } = deployments + const { deployer } = await getNamedAccounts() + + const ReimbursementPool = await deployments.get("ReimbursementPool") + const LightRelay = await deployments.get("LightRelay") + + const lightRelayMaintainerProxy = await deploy("LightRelayMaintainerProxy", { + contract: "LightRelayMaintainerProxy", + from: deployer, + args: [LightRelay.address, ReimbursementPool.address], + log: true, + waitConfirmations: 1, + }) + + if (hre.network.tags.etherscan) { + await helpers.etherscan.verify(lightRelayMaintainerProxy) + } + + if (hre.network.tags.tenderly) { + await hre.tenderly.verify({ + name: "LightRelayMaintainerProxy", + address: lightRelayMaintainerProxy.address, + }) + } +} + +export default func + +func.tags = ["LightRelayMaintainerProxy"] +func.dependencies = ["LightRelay", "ReimbursementPool"] diff --git a/solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts b/solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts new file mode 100644 index 000000000..a3c60468b --- /dev/null +++ b/solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts @@ -0,0 +1,19 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, helpers } = hre + const { deployer, governance } = await getNamedAccounts() + + await helpers.ownable.transferOwnership( + "LightRelayMaintainerProxy", + governance, + deployer + ) +} + +export default func + +func.tags = ["TransferLightRelayMaintainerProxyOwnership"] +func.dependencies = ["LightRelayMaintainerProxy"] +func.runAtTheEnd = true diff --git a/solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts b/solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts new file mode 100644 index 000000000..5a168efcb --- /dev/null +++ b/solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts @@ -0,0 +1,31 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { governance } = await getNamedAccounts() + + const LightRelayMaintainerProxy = await deployments.get( + "LightRelayMaintainerProxy" + ) + + await execute( + "ReimbursementPool", + { from: governance, log: true, waitConfirmations: 1 }, + "authorize", + LightRelayMaintainerProxy.address + ) +} + +export default func + +func.tags = ["AuthorizeLightRelayMaintainerProxyInReimbursementPool"] +func.dependencies = ["ReimbursementPool", "LightRelayMaintainerProxy"] + +// On mainnet, the ReimbursementPool ownership is passed to the Threshold +// Council / DAO and that address is not controlled by the dev team. +// Hence, this step can be executed only for non-mainnet networks such as +// Hardhat (unit tests) and Goerli (testnet). +func.skip = async (hre: HardhatRuntimeEnvironment): Promise => + hre.network.name === "mainnet" diff --git a/solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts new file mode 100644 index 000000000..644cb6bcc --- /dev/null +++ b/solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts @@ -0,0 +1,29 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() + + const LightRelayMaintainerProxy = await deployments.get( + "LightRelayMaintainerProxy" + ) + + // TODO: Find who should call this step + await execute( + "LightRelay", + { from: deployer, log: true, waitConfirmations: 1 }, + "authorize", + LightRelayMaintainerProxy.address + ) +} + +export default func + +func.tags = ["AuthorizeLightRelayMaintainerProxyInLightRelay"] +func.dependencies = ["LightRelay", "LightRelayMaintainerProxy"] + +// TODO: Check if it should be done in mainnet +func.skip = async (hre: HardhatRuntimeEnvironment): Promise => + hre.network.name === "mainnet" From 3f2beed09481dbb6c6ef8525b9b2ce522c9da0ba Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Tue, 11 Apr 2023 18:38:40 +0200 Subject: [PATCH 010/198] Added unit tests for light relay maintainer proxy --- .../relay/LightRelayMaintainerProxy.test.ts | 471 ++++++++++++++++++ 1 file changed, 471 insertions(+) create mode 100644 solidity/test/relay/LightRelayMaintainerProxy.test.ts diff --git a/solidity/test/relay/LightRelayMaintainerProxy.test.ts b/solidity/test/relay/LightRelayMaintainerProxy.test.ts new file mode 100644 index 000000000..3e532189a --- /dev/null +++ b/solidity/test/relay/LightRelayMaintainerProxy.test.ts @@ -0,0 +1,471 @@ +/* eslint-disable no-underscore-dangle */ +/* eslint-disable @typescript-eslint/no-unused-expressions */ + +import { ethers, deployments, helpers, waffle } from "hardhat" +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" +import { expect } from "chai" +import { ContractTransaction, BigNumber } from "ethers" +import type { + LightRelay, + LightRelayMaintainerProxy, + ReimbursementPool, +} from "../../typechain" +import { concatenateHexStrings } from "../helpers/contract-test-helpers" +import longHeaders from "./longHeaders.json" + +const { provider } = waffle + +const { createSnapshot, restoreSnapshot } = helpers.snapshot + +const fixture = async () => { + await deployments.fixture() + + const { deployer, governance } = await helpers.signers.getNamedSigners() + const [thirdParty, maintainer] = await helpers.signers.getUnnamedSigners() + + const reimbursementPool: ReimbursementPool = + await helpers.contracts.getContract("ReimbursementPool") + + const lightRelayMaintainerProxy: LightRelayMaintainerProxy = + await helpers.contracts.getContract("LightRelayMaintainerProxy") + + const lightRelay: LightRelay = await helpers.contracts.getContract( + "LightRelay" + ) + + await lightRelay.connect(deployer).setAuthorizationStatus(true) + + return { + deployer, + governance, + maintainer, + thirdParty, + reimbursementPool, + lightRelayMaintainerProxy, + lightRelay, + } +} + +describe("LightRelayMaintainerProxy", () => { + let deployer: SignerWithAddress + let governance: SignerWithAddress + let maintainer: SignerWithAddress + let thirdParty: SignerWithAddress + let reimbursementPool: ReimbursementPool + let lightRelayMaintainerProxy: LightRelayMaintainerProxy + let lightRelay: LightRelay + + before(async () => { + // eslint-disable-next-line @typescript-eslint/no-extra-semi + ;({ + deployer, + governance, + maintainer, + thirdParty, + reimbursementPool, + lightRelayMaintainerProxy, + lightRelay, + } = await waffle.loadFixture(fixture)) + + await deployer.sendTransaction({ + to: reimbursementPool.address, + value: ethers.utils.parseEther("100"), + }) + }) + + describe("authorize", () => { + context("When called by non-owner", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(thirdParty) + .authorize(maintainer.address) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("When called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + tx = await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should authorize the address", async () => { + expect(await lightRelayMaintainerProxy.isAuthorized(maintainer.address)) + .to.be.true + }) + + it("should emit the MaintainerAuthorized event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "MaintainerAuthorized") + .withArgs(maintainer.address) + }) + }) + }) + + describe("deauthorize", () => { + context("When called by non-owner", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(thirdParty) + .deauthorize(maintainer.address) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("When called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + // Authorize the maintainer first + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + + tx = await lightRelayMaintainerProxy + .connect(governance) + .deauthorize(maintainer.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should deauthorize the address", async () => { + expect(await lightRelayMaintainerProxy.isAuthorized(maintainer.address)) + .to.be.false + }) + + it("should emit the MaintainerDeauthorized event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "MaintainerDeauthorized") + .withArgs(maintainer.address) + }) + }) + }) + + describe("updateLightRelay", () => { + context("When called by non-owner", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(thirdParty) + .updateLightRelay(thirdParty.address) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("When called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + tx = await lightRelayMaintainerProxy + .connect(governance) + .updateLightRelay(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should update the light relay address", async () => { + expect(await lightRelayMaintainerProxy.lightRelay()).to.be.equal( + thirdParty.address + ) + }) + + it("should emit the LightRelayUpdated event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "LightRelayUpdated") + .withArgs(thirdParty.address) + }) + }) + }) + + describe("updateReimbursementPool", () => { + context("when called by a third party", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(thirdParty) + .updateReimbursementPool(thirdParty.address) + ).to.be.revertedWith("Caller is not the owner") + }) + }) + + context("when called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + tx = await lightRelayMaintainerProxy + .connect(governance) + .updateReimbursementPool(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should emit the ReimbursementPoolUpdated event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "ReimbursementPoolUpdated") + .withArgs(thirdParty.address) + }) + }) + }) + + describe("updateRetargetGasOffset", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when called by a third party", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(thirdParty) + .updateRetargetGasOffset(123456) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("when called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + tx = await lightRelayMaintainerProxy + .connect(governance) + .updateRetargetGasOffset(123456) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should emit the RetargetGasOffsetUpdated event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "RetargetGasOffsetUpdated") + .withArgs(123456) + }) + + it("should update retargetGasOffset", async () => { + const updatedOffset = + await lightRelayMaintainerProxy.retargetGasOffset() + expect(updatedOffset).to.be.equal(123456) + }) + }) + }) + + describe("retarget", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when called by an unauthorized third party", () => { + const headerHex = longHeaders.chain.map((h) => h.hex) + const retargetHeaders = concatenateHexStrings(headerHex.slice(85, 105)) + + // Even though transaction reverts some funds were spent. + // We need to restore the state to keep the balances as initially. + before(async () => createSnapshot()) + after(async () => restoreSnapshot()) + + it("should revert", async () => { + const tx = lightRelayMaintainerProxy + .connect(thirdParty) + .retarget(retargetHeaders) + + await expect(tx).to.be.revertedWith("Caller is not authorized") + }) + }) + + context("when called by an authorized maintainer", () => { + context("when the proof length is 10 headers", () => { + const genesis = longHeaders.epochStart + const headerHex = longHeaders.chain.map((h) => h.hex) + const retargetHeaders = concatenateHexStrings(headerHex.slice(85, 105)) + const genesisProofLength = 10 + + let initialMaintainerBalance: BigNumber + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await lightRelay + .connect(deployer) + .genesis(genesis.hex, genesis.height, genesisProofLength) + + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + + // Since the default retarget gas offset parameter is set to a value + // appropriate for the proof length of 20, set it to a lower value. + await lightRelayMaintainerProxy + .connect(governance) + .updateRetargetGasOffset(30000) + + initialMaintainerBalance = await provider.getBalance( + maintainer.address + ) + tx = await lightRelayMaintainerProxy + .connect(maintainer) + .retarget(retargetHeaders) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should emit Retarget event", async () => { + await expect(tx).to.emit(lightRelay, "Retarget") + }) + + it("should refund ETH", async () => { + const postMaintainerBalance = await provider.getBalance( + maintainer.address + ) + const diff = postMaintainerBalance.sub(initialMaintainerBalance) + + expect(diff).to.be.gt(0) + expect(diff).to.be.lt( + ethers.utils.parseUnits("1000000", "gwei") // 0,001 ETH + ) + }) + }) + + context("when the proof length is 20 headers", () => { + const genesis = longHeaders.epochStart + const headerHex = longHeaders.chain.map((h) => h.hex) + const retargetHeaders = concatenateHexStrings(headerHex.slice(75, 115)) + const genesisProofLength = 20 + + let initialMaintainerBalance: BigNumber + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await lightRelay + .connect(deployer) + .genesis(genesis.hex, genesis.height, genesisProofLength) + + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + + initialMaintainerBalance = await provider.getBalance( + maintainer.address + ) + + // Do not change the retarget gas offset parameter. The default value + // should be appropriate for the proof length of 20. + tx = await lightRelayMaintainerProxy + .connect(maintainer) + .retarget(retargetHeaders) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should emit Retarget event", async () => { + await expect(tx).to.emit(lightRelay, "Retarget") + }) + + it("should refund ETH", async () => { + const postMaintainerBalance = await provider.getBalance( + maintainer.address + ) + const diff = postMaintainerBalance.sub(initialMaintainerBalance) + + expect(diff).to.be.gt(0) + expect(diff).to.be.lt( + ethers.utils.parseUnits("1000000", "gwei") // 0,001 ETH + ) + }) + }) + + context("when the proof length is 50 headers", () => { + const genesis = longHeaders.epochStart + const headerHex = longHeaders.chain.map((h) => h.hex) + const retargetHeaders = concatenateHexStrings(headerHex.slice(45, 145)) + const genesisProofLength = 50 + + let initialMaintainerBalance: BigNumber + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await lightRelay + .connect(deployer) + .genesis(genesis.hex, genesis.height, genesisProofLength) + + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + + // Since the default retarget gas offset parameter is set to a value + // appropriate for the proof length of 20, set it to a higher value. + await lightRelayMaintainerProxy + .connect(governance) + .updateRetargetGasOffset(120000) + + initialMaintainerBalance = await provider.getBalance( + maintainer.address + ) + + tx = await lightRelayMaintainerProxy + .connect(maintainer) + .retarget(retargetHeaders) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should emit Retarget event", async () => { + await expect(tx).to.emit(lightRelay, "Retarget") + }) + + it("should refund ETH", async () => { + const postMaintainerBalance = await provider.getBalance( + maintainer.address + ) + const diff = postMaintainerBalance.sub(initialMaintainerBalance) + + expect(diff).to.be.gt(0) + expect(diff).to.be.lt( + ethers.utils.parseUnits("1000000", "gwei") // 0,001 ETH + ) + }) + }) + }) + }) +}) From 5081078d83abd9456a2020bb471ed3d08df38166 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 11:30:10 +0200 Subject: [PATCH 011/198] Updated the retarget gas offset parameter default value --- solidity/contracts/relay/LightRelayMaintainerProxy.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol index 23d635212..841b7ef26 100644 --- a/solidity/contracts/relay/LightRelayMaintainerProxy.sol +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -66,7 +66,7 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { lightRelay = _lightRelay; reimbursementPool = _reimbursementPool; - retargetGasOffset = 50000; + retargetGasOffset = 52000; } /// @notice Allows the governance to upgrade the `LightRelay` address. From 4e6583eab2233ecd75c162f07d3be78c6211701a Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 12 Apr 2023 11:37:05 +0200 Subject: [PATCH 012/198] Return bool from `validateDepositSweepProposal` function Here we add a return type for the `validateDepositSweepProposal` function. This is needed by the contract binding generator that doesn't handle non-returning view functions properly. --- solidity/contracts/bridge/WalletCoordinator.sol | 5 ++++- solidity/test/bridge/WalletCoordinator.test.ts | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 94f651873..aa9bfafb7 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -410,6 +410,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// supposed to do that check on their own. /// @param proposal The sweeping proposal to validate. /// @param depositsExtraInfo Deposits extra data required to perform the validation. + /// @return True if the proposal is valid. Reverts otherwise. /// @dev Requirements: /// - The target wallet must be in the Live state, /// - The number of deposits included in the sweep must be in @@ -435,7 +436,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { function validateDepositSweepProposal( DepositSweepProposal calldata proposal, DepositExtraInfo[] calldata depositsExtraInfo - ) external view { + ) external view returns (bool) { require( bridge.wallets(proposal.walletPubKeyHash).state == Wallets.WalletState.Live, @@ -515,6 +516,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { "Deposit targets different vault" ); } + + return true; } /// @notice Validates the sweep tx fee by checking if the part of the fee diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index f9ac8c631..aaf00d5c2 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2014,12 +2014,14 @@ describe("WalletCoordinator", () => { depositTwo.extraInfo, ] - await expect( - walletCoordinator.validateDepositSweepProposal( + const result = + await walletCoordinator.validateDepositSweepProposal( proposal, depositsExtraInfo ) - ).to.not.be.reverted + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(result).to.be.true }) } ) From 73d256987d73856dc0a127b808678599bbbe26ed Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 12:47:05 +0200 Subject: [PATCH 013/198] Increased the retarget gas offset value --- solidity/contracts/relay/LightRelayMaintainerProxy.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol index 841b7ef26..9223e57a6 100644 --- a/solidity/contracts/relay/LightRelayMaintainerProxy.sol +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -66,7 +66,7 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { lightRelay = _lightRelay; reimbursementPool = _reimbursementPool; - retargetGasOffset = 52000; + retargetGasOffset = 54000; } /// @notice Allows the governance to upgrade the `LightRelay` address. From ffde7c58c4ace4f8cc3215c893e9dcc0da53d622 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 13:20:07 +0200 Subject: [PATCH 014/198] Added additional checks when authorizing and deauthorizing maintainer --- .../relay/LightRelayMaintainerProxy.sol | 12 +- .../relay/LightRelayMaintainerProxy.test.ts | 129 ++++++++++++------ 2 files changed, 97 insertions(+), 44 deletions(-) diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol index 9223e57a6..11a20e54d 100644 --- a/solidity/contracts/relay/LightRelayMaintainerProxy.sol +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -81,19 +81,25 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { } /// @notice Authorizes the given address as a maintainer. Can only be called - /// by the owner. + /// by the owner and the address of the maintainer must not be + /// already authorized. /// @dev The function does not implement any governance delay. /// @param maintainer The address of the maintainer to be authorized. function authorize(address maintainer) external onlyOwner { + require(!isAuthorized[maintainer], "Maintainer is already authorized"); + isAuthorized[maintainer] = true; emit MaintainerAuthorized(maintainer); } - /// @notice Deauthorizes the given address as a maintainer. Can only be called - /// by the owner. + /// @notice Deauthorizes the given address as a maintainer. Can only be + /// called by the owner and the address of the maintainer must be + /// authorized. /// @dev The function does not implement any governance delay. /// @param maintainer The address of the maintainer to be deauthorized. function deauthorize(address maintainer) external onlyOwner { + require(isAuthorized[maintainer], "Maintainer is not authorized"); + isAuthorized[maintainer] = false; emit MaintainerDeauthorized(maintainer); } diff --git a/solidity/test/relay/LightRelayMaintainerProxy.test.ts b/solidity/test/relay/LightRelayMaintainerProxy.test.ts index 3e532189a..4e7ca8d87 100644 --- a/solidity/test/relay/LightRelayMaintainerProxy.test.ts +++ b/solidity/test/relay/LightRelayMaintainerProxy.test.ts @@ -84,30 +84,56 @@ describe("LightRelayMaintainerProxy", () => { }) }) - context("When called by the owner", () => { - let tx: ContractTransaction + context("when called by the owner", () => { + context("When the maintainer is already authorized", () => { + before(async () => { + await createSnapshot() - before(async () => { - await createSnapshot() + // Authorize the maintainer to see if the next attempt reverts. + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + }) - tx = await lightRelayMaintainerProxy - .connect(governance) - .authorize(maintainer.address) - }) + after(async () => { + await restoreSnapshot() + }) - after(async () => { - await restoreSnapshot() + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + ).to.be.revertedWith("Maintainer is already authorized") + }) }) - it("should authorize the address", async () => { - expect(await lightRelayMaintainerProxy.isAuthorized(maintainer.address)) - .to.be.true - }) + context("When the maintainer is not authorized yet", () => { + let tx: ContractTransaction - it("should emit the MaintainerAuthorized event", async () => { - await expect(tx) - .to.emit(lightRelayMaintainerProxy, "MaintainerAuthorized") - .withArgs(maintainer.address) + before(async () => { + await createSnapshot() + + tx = await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should authorize the address", async () => { + expect( + await lightRelayMaintainerProxy.isAuthorized(maintainer.address) + ).to.be.true + }) + + it("should emit the MaintainerAuthorized event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "MaintainerAuthorized") + .withArgs(maintainer.address) + }) }) }) }) @@ -123,35 +149,56 @@ describe("LightRelayMaintainerProxy", () => { }) }) - context("When called by the owner", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() + context("when called by the owner", () => { + context("when the maintainer is not authorized", () => { + before(async () => { + await createSnapshot() + }) - // Authorize the maintainer first - await lightRelayMaintainerProxy - .connect(governance) - .authorize(maintainer.address) + after(async () => { + await restoreSnapshot() + }) - tx = await lightRelayMaintainerProxy - .connect(governance) - .deauthorize(maintainer.address) + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(governance) + .deauthorize(maintainer.address) + ).to.be.revertedWith("Maintainer is not authorized") + }) }) - after(async () => { - await restoreSnapshot() - }) + context("when the maintainer is authorized", () => { + let tx: ContractTransaction - it("should deauthorize the address", async () => { - expect(await lightRelayMaintainerProxy.isAuthorized(maintainer.address)) - .to.be.false - }) + before(async () => { + await createSnapshot() - it("should emit the MaintainerDeauthorized event", async () => { - await expect(tx) - .to.emit(lightRelayMaintainerProxy, "MaintainerDeauthorized") - .withArgs(maintainer.address) + // Authorize the maintainer first + await lightRelayMaintainerProxy + .connect(governance) + .authorize(maintainer.address) + + tx = await lightRelayMaintainerProxy + .connect(governance) + .deauthorize(maintainer.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should deauthorize the address", async () => { + expect( + await lightRelayMaintainerProxy.isAuthorized(maintainer.address) + ).to.be.false + }) + + it("should emit the MaintainerDeauthorized event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "MaintainerDeauthorized") + .withArgs(maintainer.address) + }) }) }) }) From 72908513971b47900921ce7c7e6b20d5c2ee863d Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 13:22:16 +0200 Subject: [PATCH 015/198] Removed unnecessary line --- solidity/contracts/relay/LightRelayMaintainerProxy.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol index 11a20e54d..4f5ff5864 100644 --- a/solidity/contracts/relay/LightRelayMaintainerProxy.sol +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -76,7 +76,6 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { /// before executing this function. function updateLightRelay(ILightRelay _lightRelay) external onlyOwner { lightRelay = _lightRelay; - emit LightRelayUpdated(address(_lightRelay)); } From 26487a77dd80751538fcaf5a0f4006ba1799370c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 12 Apr 2023 13:25:04 +0200 Subject: [PATCH 016/198] Adding wormholeTBTC address on Polygon --- cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json b/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json index 64f4bd593..8b19a5d13 100644 --- a/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json +++ b/cross-chain/polygon/external/polygon/PolygonWormholeTBTC.json @@ -1,4 +1,3 @@ { - "address": "0x1111111111111111111111111111111111111111", - "memo": "TODO: needs attestation" + "address": "0x3362b2B92b331925F09F9E5bCA3E8C43921a435C" } From 9e63ec7183bfe545b171b4b1ad4c3da9c8bd4e13 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 12 Apr 2023 13:25:42 +0200 Subject: [PATCH 017/198] Replacing address with a string to avoid accidental deployment --- .../polygon/external/mumbai/OptimismWormholeGateway.json | 3 +-- .../polygon/external/polygon/OptimismWormholeGateway.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json index f86634ceb..6ce8c509b 100644 --- a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json +++ b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json @@ -1,4 +1,3 @@ { - "address": "0x1111111111111111111111111111111111111111", - "memo": "TODO: change to the correct address once available" + "address": "TODO: change to the correct address once available" } diff --git a/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json index f86634ceb..6ce8c509b 100644 --- a/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json +++ b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json @@ -1,4 +1,3 @@ { - "address": "0x1111111111111111111111111111111111111111", - "memo": "TODO: change to the correct address once available" + "address": "TODO: change to the correct address once available" } From 3707dc9e9b20cb098e10f00e09454ec3bfa5551c Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 13:56:38 +0200 Subject: [PATCH 018/198] Replaced third party by non-owner --- solidity/test/relay/LightRelayMaintainerProxy.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solidity/test/relay/LightRelayMaintainerProxy.test.ts b/solidity/test/relay/LightRelayMaintainerProxy.test.ts index 4e7ca8d87..3afa5b3a2 100644 --- a/solidity/test/relay/LightRelayMaintainerProxy.test.ts +++ b/solidity/test/relay/LightRelayMaintainerProxy.test.ts @@ -244,7 +244,7 @@ describe("LightRelayMaintainerProxy", () => { }) describe("updateReimbursementPool", () => { - context("when called by a third party", () => { + context("when called by non-owner", () => { it("should revert", async () => { await expect( lightRelayMaintainerProxy @@ -285,7 +285,7 @@ describe("LightRelayMaintainerProxy", () => { await restoreSnapshot() }) - context("when called by a third party", () => { + context("when called by non-owner", () => { it("should revert", async () => { await expect( lightRelayMaintainerProxy @@ -332,7 +332,7 @@ describe("LightRelayMaintainerProxy", () => { await restoreSnapshot() }) - context("when called by an unauthorized third party", () => { + context("when called by an unauthorized address", () => { const headerHex = longHeaders.chain.map((h) => h.hex) const retargetHeaders = concatenateHexStrings(headerHex.slice(85, 105)) From c3b6518ce2e15c62514c36cafcaf47bc7b472694 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 12 Apr 2023 14:13:30 +0200 Subject: [PATCH 019/198] Fixing README description --- cross-chain/polygon/README.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cross-chain/polygon/README.adoc b/cross-chain/polygon/README.adoc index 7eb3c240b..8cd49aeb4 100644 --- a/cross-chain/polygon/README.adoc +++ b/cross-chain/polygon/README.adoc @@ -54,6 +54,6 @@ the contracts before running the deployment script. This command produces an `export.json` file containing contract deployment info. Note that for the chains other than `hardhat` the following environment variables are needed: -- `PARENTCHAIN_CHAIN_API_URL` - URL to access blockchain services, e.g. `https://opt-goerli.g.alchemy.com/v2/` -- `PARENTCHAIN_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>` -- `POLYGONSCAN_API_KEY` - Polygon Etherscan API key +- `SIDECHAIN_API_URL` - URL to access blockchain services, e.g. `https://polygon.g.alchemy.com/v2/` +- `SIDECHAIN_ACCOUNTS_PRIVATE_KEYS` - Private keys for the deployer and council `<0xOwnerPrivKey,0xCouncilPrivKey>` +- `POLYGONSCAN_API_KEY` - Polygonscan API key From 68c74672b816cabca0de4d4abb8e4f61a70af691 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Wed, 12 Apr 2023 14:15:13 +0200 Subject: [PATCH 020/198] Added non-zero address requirement for contracts --- .../relay/LightRelayMaintainerProxy.sol | 14 +++++ .../relay/LightRelayMaintainerProxy.test.ts | 54 ++++++++++++------- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/solidity/contracts/relay/LightRelayMaintainerProxy.sol b/solidity/contracts/relay/LightRelayMaintainerProxy.sol index 4f5ff5864..2d1347fd7 100644 --- a/solidity/contracts/relay/LightRelayMaintainerProxy.sol +++ b/solidity/contracts/relay/LightRelayMaintainerProxy.sol @@ -63,6 +63,15 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { } constructor(ILightRelay _lightRelay, ReimbursementPool _reimbursementPool) { + require( + address(_lightRelay) != address(0), + "Light relay must not be zero address" + ); + require( + address(_reimbursementPool) != address(0), + "Reimbursement pool must not be zero address" + ); + lightRelay = _lightRelay; reimbursementPool = _reimbursementPool; @@ -75,6 +84,11 @@ contract LightRelayMaintainerProxy is Ownable, Reimbursable { /// needs to ensure all requirements for the upgrade are satisfied /// before executing this function. function updateLightRelay(ILightRelay _lightRelay) external onlyOwner { + require( + address(_lightRelay) != address(0), + "New light relay must not be zero address" + ); + lightRelay = _lightRelay; emit LightRelayUpdated(address(_lightRelay)); } diff --git a/solidity/test/relay/LightRelayMaintainerProxy.test.ts b/solidity/test/relay/LightRelayMaintainerProxy.test.ts index 3afa5b3a2..c755ae205 100644 --- a/solidity/test/relay/LightRelayMaintainerProxy.test.ts +++ b/solidity/test/relay/LightRelayMaintainerProxy.test.ts @@ -17,6 +17,8 @@ const { provider } = waffle const { createSnapshot, restoreSnapshot } = helpers.snapshot +const ZERO_ADDRESS = ethers.constants.AddressZero + const fixture = async () => { await deployments.fixture() @@ -214,31 +216,43 @@ describe("LightRelayMaintainerProxy", () => { }) }) - context("When called by the owner", () => { - let tx: ContractTransaction + context("when called by the owner", () => { + context("when called with zero address", () => { + it("should revert", async () => { + await expect( + lightRelayMaintainerProxy + .connect(governance) + .updateLightRelay(ZERO_ADDRESS) + ).to.be.revertedWith("New light relay must not be zero address") + }) + }) - before(async () => { - await createSnapshot() + context("When called with a non-zero address", () => { + let tx: ContractTransaction - tx = await lightRelayMaintainerProxy - .connect(governance) - .updateLightRelay(thirdParty.address) - }) + before(async () => { + await createSnapshot() - after(async () => { - await restoreSnapshot() - }) + tx = await lightRelayMaintainerProxy + .connect(governance) + .updateLightRelay(thirdParty.address) + }) - it("should update the light relay address", async () => { - expect(await lightRelayMaintainerProxy.lightRelay()).to.be.equal( - thirdParty.address - ) - }) + after(async () => { + await restoreSnapshot() + }) - it("should emit the LightRelayUpdated event", async () => { - await expect(tx) - .to.emit(lightRelayMaintainerProxy, "LightRelayUpdated") - .withArgs(thirdParty.address) + it("should update the light relay address", async () => { + expect(await lightRelayMaintainerProxy.lightRelay()).to.be.equal( + thirdParty.address + ) + }) + + it("should emit the LightRelayUpdated event", async () => { + await expect(tx) + .to.emit(lightRelayMaintainerProxy, "LightRelayUpdated") + .withArgs(thirdParty.address) + }) }) }) }) From 03837dc2418c4027edc192727a6d2f025bc4d5e9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 12 Apr 2023 14:21:42 +0200 Subject: [PATCH 021/198] Fixing the ref names of dirs where we keep the deployment scripts The deployment dirs are named as follows: deploy_parentchain/ and deploy_sidechain/ All the references need to be fixed to the correct names. --- cross-chain/polygon/package.json | 4 ++-- cross-chain/polygon/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cross-chain/polygon/package.json b/cross-chain/polygon/package.json index b88c9f9f4..0e417c0e3 100644 --- a/cross-chain/polygon/package.json +++ b/cross-chain/polygon/package.json @@ -9,8 +9,8 @@ "contracts/", "!contracts/hardhat-dependency-compiler", "!**/test/", - "parentchain/", - "sidechain/", + "deploy_parentchain/", + "deploy_sidechain/", "export/", "tasks/", "export.json" diff --git a/cross-chain/polygon/tsconfig.json b/cross-chain/polygon/tsconfig.json index dbf0d98ae..92896c14b 100644 --- a/cross-chain/polygon/tsconfig.json +++ b/cross-chain/polygon/tsconfig.json @@ -7,5 +7,5 @@ "resolveJsonModule": true }, "files": ["./hardhat.config.ts"], - "include": ["./parentchain", "deploy_sidechain", "./test", "./typechain"] + "include": ["./deploy_parentchain", "./deploy_sidechain", "./test", "./typechain"] } From accb79171df01922f2a95c6f73e660f4966d56da Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 12 Apr 2023 14:58:47 +0200 Subject: [PATCH 022/198] Splitting deployment and verification to separate files It might happen that a deployment transaction will appear on Polygonscan after some time. For the mainnet we deploy the scripts one by one and can observer the Polygonscan. For the testnet, waiting for 10 sec. was enough for a transaction to appear on testnet Polygonscan. --- .../01_deploy_polygon_tbtc_token.ts | 39 +++------------ .../02_verify_polygon_tbtc_token.ts | 34 +++++++++++++ ... => 03_deploy_polygon_wormhole_gateway.ts} | 49 +++++-------------- .../04_verify_polygon_wormhole_gateway.ts | 35 +++++++++++++ 4 files changed, 90 insertions(+), 67 deletions(-) create mode 100644 cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts rename cross-chain/polygon/deploy_sidechain/{02_deploy_polygon_wormhole_gateway.ts => 03_deploy_polygon_wormhole_gateway.ts} (50%) create mode 100644 cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts diff --git a/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts b/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts index 39576c7dc..8a748c7ae 100644 --- a/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts +++ b/cross-chain/polygon/deploy_sidechain/01_deploy_polygon_tbtc_token.ts @@ -5,37 +5,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { ethers, getNamedAccounts, helpers } = hre const { deployer } = await getNamedAccounts() - const [, proxyDeployment] = await helpers.upgrades.deployProxy( - "PolygonTBTC", - { - contractName: "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:L2TBTC", - initializerArgs: ["Polygon tBTC v2", "tBTC"], - factoryOpts: { signer: await ethers.getSigner(deployer) }, - proxyOpts: { - kind: "transparent", - }, - } - ) - - // TODO: Investigate the possibility of adding Tenderly verification for the - // sidechain and upgradable proxy. - - // Contracts can be verified on Polygonscan in a similar way as we - // do it on L1 Etherscan - if (hre.network.tags.polygonscan) { - // Polygonscan might not include the recently added proxy transaction right - // after deployment. We need to wait some time so that transaction is - // visible on Polygonscan. - await new Promise((resolve) => setTimeout(resolve, 10000)) - // We use `verify` instead of `verify:verify` as the `verify` task is defined - // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation - // contract, the proxy itself and any proxy-related contracts, as well as - // link the proxy to the implementation contract’s ABI on (Ether)scan. - await hre.run("verify", { - address: proxyDeployment.address, - constructorArgsParams: proxyDeployment.args, - }) - } + await helpers.upgrades.deployProxy("PolygonTBTC", { + contractName: "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:L2TBTC", + initializerArgs: ["Polygon tBTC v2", "tBTC"], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + }) } export default func diff --git a/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts b/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts new file mode 100644 index 000000000..429800441 --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts @@ -0,0 +1,34 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments } = hre + + const proxyDeployment = await deployments.get("PolygonTBTC") + + // TODO: Investigate the possibility of adding Tenderly verification for the + // sidechain and upgradable proxy. + + // Contracts can be verified on Polygonscan in a similar way as we + // do it on L1 Etherscan + if (hre.network.tags.polygonscan) { + if (hre.network.name === "mumbai") { + // Polygonscan might not include the recently added proxy transaction right + // after deployment. We need to wait some time so that transaction is + // visible on Polygonscan. + await new Promise((resolve) => setTimeout(resolve, 10000)) // 10sec + } + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["PolygonTBTC"] diff --git a/cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/03_deploy_polygon_wormhole_gateway.ts similarity index 50% rename from cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts rename to cross-chain/polygon/deploy_sidechain/03_deploy_polygon_wormhole_gateway.ts index 04aeed96f..e78485d4e 100644 --- a/cross-chain/polygon/deploy_sidechain/02_deploy_polygon_wormhole_gateway.ts +++ b/cross-chain/polygon/deploy_sidechain/03_deploy_polygon_wormhole_gateway.ts @@ -27,42 +27,19 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { log(`fake Polygon WormholeTBTC address ${polygonWormholeTBTCAddress}`) } - const [, proxyDeployment] = await helpers.upgrades.deployProxy( - "PolygonWormholeGateway", - { - contractName: - "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", - initializerArgs: [ - polygonTokenBridgeAddress, - polygonWormholeTBTCAddress, - polygonTBTC.address, - ], - factoryOpts: { signer: await ethers.getSigner(deployer) }, - proxyOpts: { - kind: "transparent", - }, - } - ) - - // TODO: Investigate the possibility of adding Tenderly verification for the - // sidechain and upgradable proxy. - - // Contracts can be verified on Polygonscan in a similar way as we - // do it on L1 Etherscan - if (hre.network.tags.polygonscan) { - // Polygonscan might not include the recently added proxy transaction right - // after deployment. We need to wait some time so that transaction is - // visible on Polygonscan. - await new Promise((resolve) => setTimeout(resolve, 10000)) - // We use `verify` instead of `verify:verify` as the `verify` task is defined - // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation - // contract, the proxy itself and any proxy-related contracts, as well as - // link the proxy to the implementation contract’s ABI on (Ether)scan. - await hre.run("verify", { - address: proxyDeployment.address, - constructorArgsParams: proxyDeployment.args, - }) - } + await helpers.upgrades.deployProxy("PolygonWormholeGateway", { + contractName: + "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", + initializerArgs: [ + polygonTokenBridgeAddress, + polygonWormholeTBTCAddress, + polygonTBTC.address, + ], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + }) } export default func diff --git a/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts new file mode 100644 index 000000000..ecb37b66f --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts @@ -0,0 +1,35 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployments } = hre + + const proxyDeployment = await deployments.get("PolygonWormholeGateway") + + // TODO: Investigate the possibility of adding Tenderly verification for the + // sidechain and upgradable proxy. + + // Contracts can be verified on Polygonscan in a similar way as we + // do it on L1 Etherscan + if (hre.network.tags.polygonscan) { + if (hre.network.name === "mumbai") { + // Polygonscan might not include the recently added proxy transaction right + // after deployment. We need to wait some time so that transaction is + // visible on Polygonscan. + await new Promise((resolve) => setTimeout(resolve, 10000)) // 10sec + } + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["PolygonWormholeGateway"] +func.dependencies = ["PolygonTokenBridge", "PolygonWormholeTBTC"] From a293229cf27b4d1d4f298bcccc3746cfe9f90b6a Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 09:37:10 +0200 Subject: [PATCH 023/198] Renamed deployment files --- ...ntainer_proxy.ts => 36_deploy_light_relay_maintainer_proxy.ts} | 0 ...p.ts => 37_transfer_light_relay_maintainer_proxy_ownership.ts} | 0 ...thorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts} | 0 ...> 39_authorize_light_relay_maintainer_proxy_in_light_relay.ts} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename solidity/deploy/{40_deploy_light_relay_maintainer_proxy.ts => 36_deploy_light_relay_maintainer_proxy.ts} (100%) rename solidity/deploy/{41_transfer_light_relay_maintainer_proxy_ownership.ts => 37_transfer_light_relay_maintainer_proxy_ownership.ts} (100%) rename solidity/deploy/{42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts => 38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts} (100%) rename solidity/deploy/{43_authorize_light_relay_maintainer_proxy_in_light_relay.ts => 39_authorize_light_relay_maintainer_proxy_in_light_relay.ts} (100%) diff --git a/solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts b/solidity/deploy/36_deploy_light_relay_maintainer_proxy.ts similarity index 100% rename from solidity/deploy/40_deploy_light_relay_maintainer_proxy.ts rename to solidity/deploy/36_deploy_light_relay_maintainer_proxy.ts diff --git a/solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts b/solidity/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts similarity index 100% rename from solidity/deploy/41_transfer_light_relay_maintainer_proxy_ownership.ts rename to solidity/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts diff --git a/solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts b/solidity/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts similarity index 100% rename from solidity/deploy/42_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts rename to solidity/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts diff --git a/solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts similarity index 100% rename from solidity/deploy/43_authorize_light_relay_maintainer_proxy_in_light_relay.ts rename to solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts From 53bcde8254bdbef80ededa96ff161d8ac99a88da Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 09:48:24 +0200 Subject: [PATCH 024/198] Removed unnecessary TODOs --- .../39_authorize_light_relay_maintainer_proxy_in_light_relay.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts index 644cb6bcc..f76a5fb2d 100644 --- a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +++ b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts @@ -10,7 +10,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { "LightRelayMaintainerProxy" ) - // TODO: Find who should call this step await execute( "LightRelay", { from: deployer, log: true, waitConfirmations: 1 }, @@ -24,6 +23,5 @@ export default func func.tags = ["AuthorizeLightRelayMaintainerProxyInLightRelay"] func.dependencies = ["LightRelay", "LightRelayMaintainerProxy"] -// TODO: Check if it should be done in mainnet func.skip = async (hre: HardhatRuntimeEnvironment): Promise => hre.network.name === "mainnet" From 01f68f98587bd4c65179c151ead181932055ab86 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 10:16:44 +0200 Subject: [PATCH 025/198] Added script for transferring ownership of light relay --- .../94_transfer_light_relay_ownership.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 solidity/deploy/94_transfer_light_relay_ownership.ts diff --git a/solidity/deploy/94_transfer_light_relay_ownership.ts b/solidity/deploy/94_transfer_light_relay_ownership.ts new file mode 100644 index 000000000..f4f996e22 --- /dev/null +++ b/solidity/deploy/94_transfer_light_relay_ownership.ts @@ -0,0 +1,19 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, helpers } = hre + const { deployer, governance } = await getNamedAccounts() + + await helpers.ownable.transferOwnership("LightRelay", governance, deployer) +} + +export default func + +func.tags = ["TransferLightRelayOwnership"] +func.dependencies = ["LightRelay"] +func.runAtTheEnd = true + +// Only execute for mainnet. +func.skip = async (hre: HardhatRuntimeEnvironment): Promise => + hre.network.name !== "mainnet" From 2070ca23f6feb132153cb0a8fd887b888b7ad2a4 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 10:39:41 +0200 Subject: [PATCH 026/198] Renamed script --- ...er_light_relay_ownership.ts => 94_transfer_relay_ownership.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename solidity/deploy/{94_transfer_light_relay_ownership.ts => 94_transfer_relay_ownership.ts} (100%) diff --git a/solidity/deploy/94_transfer_light_relay_ownership.ts b/solidity/deploy/94_transfer_relay_ownership.ts similarity index 100% rename from solidity/deploy/94_transfer_light_relay_ownership.ts rename to solidity/deploy/94_transfer_relay_ownership.ts From 81f540a5326b4fa39f14d4d60cedd8b635437624 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 10:58:33 +0200 Subject: [PATCH 027/198] Removed unnecessary condition in deployment script --- ...39_authorize_light_relay_maintainer_proxy_in_light_relay.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts index f76a5fb2d..bd59239c8 100644 --- a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +++ b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts @@ -22,6 +22,3 @@ export default func func.tags = ["AuthorizeLightRelayMaintainerProxyInLightRelay"] func.dependencies = ["LightRelay", "LightRelayMaintainerProxy"] - -func.skip = async (hre: HardhatRuntimeEnvironment): Promise => - hre.network.name === "mainnet" From e7cdfd6d13bd87efc9ff68a656c71eae88fa73b2 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 14:59:16 +0200 Subject: [PATCH 028/198] Updating WormholeGateway addresses --- .../polygon/external/mumbai/OptimismWormholeGateway.json | 2 +- .../polygon/external/polygon/OptimismWormholeGateway.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json index 6ce8c509b..334fdb833 100644 --- a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json +++ b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" } diff --git a/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json index 6ce8c509b..ffd563462 100644 --- a/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json +++ b/cross-chain/polygon/external/polygon/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0x1293a54e160D1cd7075487898d65266081A15458" } From 1d65be3e3d598b482857af94b0294c254fc0c45e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 15:01:33 +0200 Subject: [PATCH 029/198] Updating tag names for verification scripts --- .../polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts | 2 +- .../deploy_sidechain/04_verify_polygon_wormhole_gateway.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts b/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts index 429800441..d60d94379 100644 --- a/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts +++ b/cross-chain/polygon/deploy_sidechain/02_verify_polygon_tbtc_token.ts @@ -31,4 +31,4 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["PolygonTBTC"] +func.tags = ["VerifyPolygonTBTC"] diff --git a/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts index ecb37b66f..46831f6f6 100644 --- a/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts +++ b/cross-chain/polygon/deploy_sidechain/04_verify_polygon_wormhole_gateway.ts @@ -31,5 +31,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["PolygonWormholeGateway"] +func.tags = ["VerifyPolygonWormholeGateway"] func.dependencies = ["PolygonTokenBridge", "PolygonWormholeTBTC"] From 6318cdb88aace7be92cf2c04e50baed1d5ef6dae Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 15:15:39 +0200 Subject: [PATCH 030/198] Updating OptimismWormholeGateway addresses --- .../external/arbitrumGoerli/OptimismWormholeGateway.json | 2 +- .../arbitrum/external/arbitrumOne/OptimismWormholeGateway.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json index 6ce8c509b..334fdb833 100644 --- a/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" } diff --git a/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json index 6ce8c509b..ffd563462 100644 --- a/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumOne/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0x1293a54e160D1cd7075487898d65266081A15458" } From 462925b1bd07e05f87beb7c9fcba541d335c0be1 Mon Sep 17 00:00:00 2001 From: Tomasz Slabon Date: Thu, 13 Apr 2023 15:36:47 +0200 Subject: [PATCH 031/198] Minor improvements --- .../test/relay/LightRelayMaintainerProxy.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/solidity/test/relay/LightRelayMaintainerProxy.test.ts b/solidity/test/relay/LightRelayMaintainerProxy.test.ts index c755ae205..a4914bca9 100644 --- a/solidity/test/relay/LightRelayMaintainerProxy.test.ts +++ b/solidity/test/relay/LightRelayMaintainerProxy.test.ts @@ -76,7 +76,7 @@ describe("LightRelayMaintainerProxy", () => { }) describe("authorize", () => { - context("When called by non-owner", () => { + context("when called by non-owner", () => { it("should revert", async () => { await expect( lightRelayMaintainerProxy @@ -87,7 +87,7 @@ describe("LightRelayMaintainerProxy", () => { }) context("when called by the owner", () => { - context("When the maintainer is already authorized", () => { + context("when the maintainer is already authorized", () => { before(async () => { await createSnapshot() @@ -110,7 +110,7 @@ describe("LightRelayMaintainerProxy", () => { }) }) - context("When the maintainer is not authorized yet", () => { + context("when the maintainer is not authorized yet", () => { let tx: ContractTransaction before(async () => { @@ -141,7 +141,7 @@ describe("LightRelayMaintainerProxy", () => { }) describe("deauthorize", () => { - context("When called by non-owner", () => { + context("when called by non-owner", () => { it("should revert", async () => { await expect( lightRelayMaintainerProxy @@ -206,7 +206,7 @@ describe("LightRelayMaintainerProxy", () => { }) describe("updateLightRelay", () => { - context("When called by non-owner", () => { + context("when called by non-owner", () => { it("should revert", async () => { await expect( lightRelayMaintainerProxy @@ -227,7 +227,7 @@ describe("LightRelayMaintainerProxy", () => { }) }) - context("When called with a non-zero address", () => { + context("when called with a non-zero address", () => { let tx: ContractTransaction before(async () => { From 4708fa7c70522a6e94e0ecd831948ee5361b8f89 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 15:24:47 +0200 Subject: [PATCH 032/198] Adding OpenZeppelin artifact --- .../optimism/.openzeppelin/optimism.json | 458 ++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 cross-chain/optimism/.openzeppelin/optimism.json diff --git a/cross-chain/optimism/.openzeppelin/optimism.json b/cross-chain/optimism/.openzeppelin/optimism.json new file mode 100644 index 000000000..c52e16b7b --- /dev/null +++ b/cross-chain/optimism/.openzeppelin/optimism.json @@ -0,0 +1,458 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x02612d20CC087670a959Bb12cA3c5fd56C8A3DB3", + "txHash": "0xa65c96e54138ce98982724621dd628402a974d1ae83c84f31f29c0814bb6ca32" + }, + "proxies": [ + { + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "txHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "kind": "transparent" + }, + { + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "txHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "kind": "transparent" + } + ], + "impls": { + "1eca3b29684e1fcc811e32be6ee7e72cd846a93f69838508595506ae72555f18": { + "address": "0xDa534b567099Ca481384133bC121D5843F681365", + "txHash": "0x829cdc13462fd02cb0d1ea65f6ba42a4eeb19c3add8749d8ce1dba71ce624ece", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:400" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:32" + }, + { + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:33" + }, + { + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:120" + }, + { + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)3261_storage)", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:28" + }, + { + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:40", + "renamedFrom": "_PERMIT_TYPEHASH" + }, + { + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:108" + }, + { + "label": "_owner", + "offset": 0, + "slot": "254", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "304", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "isMinter", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:76" + }, + { + "label": "minters", + "offset": 0, + "slot": "355", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:77" + }, + { + "label": "isGuardian", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:85" + }, + { + "label": "guardians", + "offset": 0, + "slot": "357", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:89" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Counter)3261_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)3261_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "8d82320b79dc3b6f338cc614911d23963b5c050b43486868e87b856fd8a24e25": { + "address": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "txHash": "0x116d01d85cc74ed47f07fda6a60fbf61a2c43b12b11810c7dcced736ff7018d9", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2216", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2216": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} From f445d7b7bd31d2bf796959c6ea17d77f66c6d1be Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 15:25:18 +0200 Subject: [PATCH 033/198] Adding optimism deployment artifacts --- .../optimism/deployments/optimism/.chainId | 1 + .../deployments/optimism/OptimismTBTC.json | 863 ++++++++++++++++++ .../optimism/OptimismWormholeGateway.json | 495 ++++++++++ 3 files changed, 1359 insertions(+) create mode 100644 cross-chain/optimism/deployments/optimism/.chainId create mode 100644 cross-chain/optimism/deployments/optimism/OptimismTBTC.json create mode 100644 cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json diff --git a/cross-chain/optimism/deployments/optimism/.chainId b/cross-chain/optimism/deployments/optimism/.chainId new file mode 100644 index 000000000..9a037142a --- /dev/null +++ b/cross-chain/optimism/deployments/optimism/.chainId @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimism/OptimismTBTC.json b/cross-chain/optimism/deployments/optimism/OptimismTBTC.json new file mode 100644 index 000000000..49104ddab --- /dev/null +++ b/cross-chain/optimism/deployments/optimism/OptimismTBTC.json @@ -0,0 +1,863 @@ +{ + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "abi": [ + { + "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": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "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": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "transactionIndex": 0, + "gasUsed": "732138", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000002000000000000000000000000000400000000400000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000004800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000040000000020000000002000000000440000200000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x594257007b4b959a5ddcbc54209224b32a539ab57df66a6fdc72a1ef59f82728", + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 89899840, + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000da534b567099ca481384133bc121d5843f681365" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x594257007b4b959a5ddcbc54209224b32a539ab57df66a6fdc72a1ef59f82728" + }, + { + "transactionIndex": 0, + "blockNumber": 89899840, + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x594257007b4b959a5ddcbc54209224b32a539ab57df66a6fdc72a1ef59f82728" + }, + { + "transactionIndex": 0, + "blockNumber": 89899840, + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x594257007b4b959a5ddcbc54209224b32a539ab57df66a6fdc72a1ef59f82728" + }, + { + "transactionIndex": 0, + "blockNumber": 89899840, + "transactionHash": "0xa824aaf0c1e4f99fc25786e6b52ad14e7963002dffa16cdc1a217b6f344947cc", + "address": "0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002612d20cc087670a959bb12ca3c5fd56c8a3db3", + "logIndex": 3, + "blockHash": "0x594257007b4b959a5ddcbc54209224b32a539ab57df66a6fdc72a1ef59f82728" + } + ], + "blockNumber": 89899840, + "cumulativeGasUsed": "732138", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0xDa534b567099Ca481384133bC121D5843F681365", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json b/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json new file mode 100644 index 000000000..075c93cda --- /dev/null +++ b/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json @@ -0,0 +1,495 @@ +{ + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositWormholeTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x1293a54e160D1cd7075487898d65266081A15458", + "transactionIndex": 0, + "gasUsed": "749603", + "logsBloom": "0x00000000000000000000400000000000400000000002000000800000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000002000001000000000000000080000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000001800000000000000000000000000000000400000000000000000000000000000004000000000020000000000000000000440000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000010", + "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b", + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 89900107, + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000041c9b5639e3f2f6c61e9b78b2c6ff3746e79d91a" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" + }, + { + "transactionIndex": 0, + "blockNumber": 89900107, + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" + }, + { + "transactionIndex": 0, + "blockNumber": 89900107, + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" + }, + { + "transactionIndex": 0, + "blockNumber": 89900107, + "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002612d20cc087670a959bb12ca3c5fd56c8a3db3", + "logIndex": 3, + "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" + } + ], + "blockNumber": 89900107, + "cumulativeGasUsed": "749603", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file From 162547fa669c3abe7cd3f69a71743562c70932a5 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 16:01:51 +0200 Subject: [PATCH 034/198] Bumping up optimism dev version --- cross-chain/optimism/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-chain/optimism/package.json b/cross-chain/optimism/package.json index 443d3c8ac..6d1c8e009 100644 --- a/cross-chain/optimism/package.json +++ b/cross-chain/optimism/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2-optimism", - "version": "1.0.0-dev", + "version": "1.1.0-dev", "description": "tBTC v2 on Optimism", "license": "GPL-3.0-only", "files": [ From cd71aeca98c02dc4acbbe5234dcdce7e9a079925 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 13 Apr 2023 16:17:45 +0200 Subject: [PATCH 035/198] Replacing Polygon Token Bridges with the right ones --- cross-chain/polygon/external/mumbai/PolygonTokenBridge.json | 2 +- cross-chain/polygon/external/polygon/PolygonTokenBridge.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json b/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json index 1101a8259..4cd179db5 100644 --- a/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json +++ b/cross-chain/polygon/external/mumbai/PolygonTokenBridge.json @@ -1,3 +1,3 @@ { - "address": "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE" + "address": "0x377D55a7928c046E18eEbb61977e714d2a76472a" } diff --git a/cross-chain/polygon/external/polygon/PolygonTokenBridge.json b/cross-chain/polygon/external/polygon/PolygonTokenBridge.json index 4558b0d5d..1101a8259 100644 --- a/cross-chain/polygon/external/polygon/PolygonTokenBridge.json +++ b/cross-chain/polygon/external/polygon/PolygonTokenBridge.json @@ -1,3 +1,3 @@ { - "address": "0x1D68124e65faFC907325e3EDbF8c4d84499DAa8b" + "address": "0x5a58505a96D1dbf8dF91cB21B54419FC36e93fdE" } From e1cf973a7f4344c88de8c690027f6896dac7527e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 11:18:21 +0200 Subject: [PATCH 036/198] Adding OpenZeppelin artifact --- .../polygon/.openzeppelin/polygon.json | 458 ++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 cross-chain/polygon/.openzeppelin/polygon.json diff --git a/cross-chain/polygon/.openzeppelin/polygon.json b/cross-chain/polygon/.openzeppelin/polygon.json new file mode 100644 index 000000000..e6911feff --- /dev/null +++ b/cross-chain/polygon/.openzeppelin/polygon.json @@ -0,0 +1,458 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x1293a54e160D1cd7075487898d65266081A15458", + "txHash": "0x8c9bfa62c866106dbf81be9e8d8054ca4f32d1d9521ea8fe7acb9ebdcdb52bec" + }, + "proxies": [ + { + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "txHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "kind": "transparent" + }, + { + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "txHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "kind": "transparent" + } + ], + "impls": { + "1eca3b29684e1fcc811e32be6ee7e72cd846a93f69838508595506ae72555f18": { + "address": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "txHash": "0xa15a1dd354c258763e95fdd9f2b2b84a6b92cedb158b36be785c2af40a413a37", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:400" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:32" + }, + { + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:33" + }, + { + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:120" + }, + { + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)3261_storage)", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:28" + }, + { + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:40", + "renamedFrom": "_PERMIT_TYPEHASH" + }, + { + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:108" + }, + { + "label": "_owner", + "offset": 0, + "slot": "254", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "304", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "isMinter", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:76" + }, + { + "label": "minters", + "offset": 0, + "slot": "355", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:77" + }, + { + "label": "isGuardian", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:85" + }, + { + "label": "guardians", + "offset": 0, + "slot": "357", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:89" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Counter)3261_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)3261_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "8d82320b79dc3b6f338cc614911d23963b5c050b43486868e87b856fd8a24e25": { + "address": "0x292C9fdf2e2475599cBe350cc473c221Bd67AE28", + "txHash": "0x08171c08a2bcdfad5a89bebe4206b7b31db2608bbe2b286a61c2389fe148fa8b", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2216", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2216": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} From 8e570127f56262e23bd685f1e681ea4974d1132f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 11:18:44 +0200 Subject: [PATCH 037/198] Adding deployment artifacts --- .../polygon/deployments/polygon/.chainId | 1 + .../deployments/polygon/PolygonTBTC.json | 878 ++++++++++++++++++ .../polygon/PolygonWormholeGateway.json | 510 ++++++++++ 3 files changed, 1389 insertions(+) create mode 100644 cross-chain/polygon/deployments/polygon/.chainId create mode 100644 cross-chain/polygon/deployments/polygon/PolygonTBTC.json create mode 100644 cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json diff --git a/cross-chain/polygon/deployments/polygon/.chainId b/cross-chain/polygon/deployments/polygon/.chainId new file mode 100644 index 000000000..0973804c4 --- /dev/null +++ b/cross-chain/polygon/deployments/polygon/.chainId @@ -0,0 +1 @@ +137 \ No newline at end of file diff --git a/cross-chain/polygon/deployments/polygon/PolygonTBTC.json b/cross-chain/polygon/deployments/polygon/PolygonTBTC.json new file mode 100644 index 000000000..f197708f2 --- /dev/null +++ b/cross-chain/polygon/deployments/polygon/PolygonTBTC.json @@ -0,0 +1,878 @@ +{ + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "abi": [ + { + "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": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "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": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "transactionIndex": 79, + "gasUsed": "732126", + "logsBloom": "0x00000000000000000000400000000000400000000002000000800000000000000000000000000000000000000000000000008000000000000000000000400400000000000000000000000000000002804001000000000000000180000000000000000000020000000000000000000800000000800000000080000000400000400000000000000000000000000000000000000000000080000000000000800000200000000000000000000000000400000000000000000000000000000000004000000020000000040001000000440000000000000400000000100000000020000000000000000000200000000000000000000000000000000000000000100000", + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7", + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "logs": [ + { + "transactionIndex": 79, + "blockNumber": 41515399, + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000041c9b5639e3f2f6c61e9b78b2c6ff3746e79d91a" + ], + "data": "0x", + "logIndex": 313, + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7" + }, + { + "transactionIndex": 79, + "blockNumber": 41515399, + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 314, + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7" + }, + { + "transactionIndex": 79, + "blockNumber": 41515399, + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 315, + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7" + }, + { + "transactionIndex": 79, + "blockNumber": 41515399, + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001293a54e160d1cd7075487898d65266081a15458", + "logIndex": 316, + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7" + }, + { + "transactionIndex": 79, + "blockNumber": 41515399, + "transactionHash": "0xe5766e62d8d28bd3089fc0a9de08609377a6ff8bba42da5430d2fa0da427319e", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf", + "0x00000000000000000000000048aff66a7a9ce3b8fc4f62c80604bc310edf94cd" + ], + "data": "0x000000000000000000000000000000000000000000000000008072eeb5e02bb6000000000000000000000000000000000000000000000003ab0f9eb607138fb80000000000000000000000000000000000000000000000fa41596499a1d1af36000000000000000000000000000000000000000000000003aa8f2bc7513364020000000000000000000000000000000000000000000000fa41d9d78857b1daec", + "logIndex": 317, + "blockHash": "0x1e76121aff9cb677e1c87f028f99d34c21dd61c70cc5eedac783763b78f6b4d7" + } + ], + "blockNumber": 41515399, + "cumulativeGasUsed": "10665876", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json b/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json new file mode 100644 index 000000000..b5a673953 --- /dev/null +++ b/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json @@ -0,0 +1,510 @@ +{ + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositWormholeTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "transactionIndex": 34, + "gasUsed": "749615", + "logsBloom": "0x00000000000000000000000000000000400000000800000000800000000000000000000000000000000000000000000000008400000000000000000000000400000000000000000000000000000006800001000800000000000100000000000000000000030000000001000000000800000000800000000080000000000000400000000000000000000000000000000000000000000080000000000000800000200000000008000004000000000400000000000000000000000000000000004000000020000000000001000000440000000000000400000000100000000020000000000000000000002000000000000000000000000000000000000000100000", + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3", + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "logs": [ + { + "transactionIndex": 34, + "blockNumber": 41515765, + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000292c9fdf2e2475599cbe350cc473c221bd67ae28" + ], + "data": "0x", + "logIndex": 144, + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + }, + { + "transactionIndex": 34, + "blockNumber": 41515765, + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 145, + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + }, + { + "transactionIndex": 34, + "blockNumber": 41515765, + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 146, + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + }, + { + "transactionIndex": 34, + "blockNumber": 41515765, + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001293a54e160d1cd7075487898d65266081a15458", + "logIndex": 147, + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + }, + { + "transactionIndex": 34, + "blockNumber": 41515765, + "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf", + "0x000000000000000000000000eb4f2a75cac4bbcb4d71c252e4cc80eb80bb3a34" + ], + "data": "0x0000000000000000000000000000000000000000000000000082da2deb4f2812000000000000000000000000000000000000000000000003a1842f4eb9b1aa5e00000000000000000000000000000000000000000000052254a12ab84b8f7f3c000000000000000000000000000000000000000000000003a1015520ce62824c000000000000000000000000000000000000000000000522552404e636dea74e", + "logIndex": 148, + "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + } + ], + "blockNumber": 41515765, + "cumulativeGasUsed": "5384226", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x292C9fdf2e2475599cBe350cc473c221Bd67AE28", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file From aae7bd59118c0d96ba9541765d0468c611a180b5 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 11:26:43 +0200 Subject: [PATCH 038/198] Bumping up polygon package dev version --- cross-chain/polygon/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-chain/polygon/package.json b/cross-chain/polygon/package.json index 0e417c0e3..e815eda85 100644 --- a/cross-chain/polygon/package.json +++ b/cross-chain/polygon/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2-polygon", - "version": "1.0.0-dev", + "version": "1.1.0-dev", "description": "tBTC v2 on Polygon", "license": "GPL-3.0-only", "files": [ From c26096096de81f609b7cfb022c5b8bda76503f85 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 14:35:16 +0200 Subject: [PATCH 039/198] Updating Polygon Wormhole addresses --- .../external/arbitrumGoerli/PolygonWormholeGateway.json | 2 +- .../arbitrum/external/arbitrumOne/PolygonWormholeGateway.json | 2 +- .../optimism/external/optimism/PolygonWormholeGateway.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json index 6ce8c509b..334fdb833 100644 --- a/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" } diff --git a/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json index 6ce8c509b..6571efe8d 100644 --- a/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumOne/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab" } diff --git a/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json b/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json index 6ce8c509b..6571efe8d 100644 --- a/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json +++ b/cross-chain/optimism/external/optimism/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0x09959798B95d00a3183d20FaC298E4594E599eab" } From c8d38b7081c592bfb2d91293f96943014957bd5d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 14:41:55 +0200 Subject: [PATCH 040/198] Updating Polygon Wormhole address for Optimism Goerli --- .../external/optimismGoerli/PolygonWormholeGateway.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json index 6ce8c509b..334fdb833 100644 --- a/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json +++ b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "TODO: change to the correct address once available" + "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" } From e4919637b9046234c43dc8d30b1291074696429c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 14:57:27 +0200 Subject: [PATCH 041/198] Updating tags for gateway mapping It might happen that council will need to execute the wormhole mappings separetly. We need to make unique tags for that. --- .../deploy_l2/12_update_wormhole_gateway_mapping.ts | 2 +- .../13_update_with_optimism_in_wormhole_gateway_mapping.ts | 2 +- .../14_update_with_polygon_in_wormhole_gateway_mapping.ts | 2 +- .../deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts | 2 +- .../13_update_with_arbitrum_in_wormhole_gateway_mapping.ts | 2 +- .../14_update_with_polygon_in_wormhole_gateway_mapping.ts | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cross-chain/arbitrum/deploy_l2/12_update_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/12_update_wormhole_gateway_mapping.ts index 8b72f4d4c..512a262f0 100644 --- a/cross-chain/arbitrum/deploy_l2/12_update_wormhole_gateway_mapping.ts +++ b/cross-chain/arbitrum/deploy_l2/12_update_wormhole_gateway_mapping.ts @@ -25,5 +25,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetArbitrumGatewayAddress"] func.dependencies = ["ArbitrumWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts index 8246a3a2b..a7645d7e6 100644 --- a/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts +++ b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts @@ -37,5 +37,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetOptimismGatewayAddress"] func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts index 3e38706e4..801fd9654 100644 --- a/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts +++ b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -35,5 +35,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetPolygonGatewayAddress"] func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts index 8fdd85840..320dd6c9b 100644 --- a/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/12_update_self_in_wormhole_gateway_mapping.ts @@ -25,5 +25,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetOptimismGatewayAddress"] func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts index 8838bbdc9..32767e21e 100644 --- a/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts @@ -37,5 +37,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetArbitrumGatewayAddress"] func.dependencies = ["OptimismWormholeGateway"] diff --git a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts index cdb03f9c3..eb7699868 100644 --- a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -4,7 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, ethers } = hre const { execute, log } = deployments - const { deployer } = await getNamedAccounts() + const { governace } = await getNamedAccounts() // Fake PolygonWormholeGateway for local development purposes only. const fakePolygonWormholeGateway = @@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await execute( "OptimismWormholeGateway", - { from: deployer, log: true, waitConfirmations: 1 }, + { from: governace, log: true, waitConfirmations: 1 }, "updateGatewayAddress", polygonWormholeChainID, ethers.utils.hexZeroPad(polygonWormholeGatewayAddress, 32) @@ -35,5 +35,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetPolygonGatewayAddress"] func.dependencies = ["OptimismWormholeGateway"] From bb63f2b5fb7aefbb87aa7f0dc2f836973595166b Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 14 Apr 2023 15:01:07 +0200 Subject: [PATCH 042/198] Unique tags for Polygon wormhole mappings --- .../12_update_self_in_wormhole_gateway_mapping.ts | 2 +- .../13_update_with_arbitrum_in_wormhole_gateway_mapping.ts | 2 +- .../14_update_with_optimism_in_wormhole_gateway_mapping.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts index ad174c13e..4c64dd339 100644 --- a/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts +++ b/cross-chain/polygon/deploy_sidechain/12_update_self_in_wormhole_gateway_mapping.ts @@ -23,5 +23,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetPolygonGatewayAddress"] func.dependencies = ["PolygonWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts index bebbad98b..1faf0eb26 100644 --- a/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts +++ b/cross-chain/polygon/deploy_sidechain/13_update_with_arbitrum_in_wormhole_gateway_mapping.ts @@ -37,5 +37,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetArbitrumGatewayAddress"] func.dependencies = ["PolygonWormholeGateway"] diff --git a/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts b/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts index 79eba79b8..2bbc986e1 100644 --- a/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts +++ b/cross-chain/polygon/deploy_sidechain/14_update_with_optimism_in_wormhole_gateway_mapping.ts @@ -37,5 +37,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func -func.tags = ["SetGatewayAddress"] +func.tags = ["SetOptimismGatewayAddress"] func.dependencies = ["PolygonWormholeGateway"] From 487ebf29e03c875b56997932eef47eae4607b128 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 18 Apr 2023 11:48:20 +0200 Subject: [PATCH 043/198] Changing governance to deployer for running "updateGatewayAddress" For the local development purposes and running tests on hardhat we need a deployer to run "updateGatewayAddress". This change does not affect anything on mainnet. --- .../13_update_with_optimism_in_wormhole_gateway_mapping.ts | 4 ++-- .../14_update_with_polygon_in_wormhole_gateway_mapping.ts | 4 ++-- .../14_update_with_polygon_in_wormhole_gateway_mapping.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts index a7645d7e6..d78a29ba7 100644 --- a/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts +++ b/cross-chain/arbitrum/deploy_l2/13_update_with_optimism_in_wormhole_gateway_mapping.ts @@ -4,7 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, ethers } = hre const { execute, log } = deployments - const { governance } = await getNamedAccounts() + const { deployer } = await getNamedAccounts() // Fake OptimismWormholeGateway for local development purposes only. const fakeOptimismWormholeGateway = @@ -28,7 +28,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await execute( "ArbitrumWormholeGateway", - { from: governance, log: true, waitConfirmations: 1 }, + { from: deployer, log: true, waitConfirmations: 1 }, "updateGatewayAddress", optimismWormholeChainID, ethers.utils.hexZeroPad(optimismWormholeGatewayAddress, 32) diff --git a/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts index 801fd9654..1566d0492 100644 --- a/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts +++ b/cross-chain/arbitrum/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -4,7 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, ethers } = hre const { execute, log } = deployments - const { governance } = await getNamedAccounts() + const { deployer } = await getNamedAccounts() // Fake PolygonWormholeGateway for local development purposes only. const fakePolygonWormholeGateway = @@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await execute( "ArbitrumWormholeGateway", - { from: governance, log: true, waitConfirmations: 1 }, + { from: deployer, log: true, waitConfirmations: 1 }, "updateGatewayAddress", polygonWormholeChainID, ethers.utils.hexZeroPad(polygonWormholeGatewayAddress, 32) diff --git a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts index eb7699868..c266425f1 100644 --- a/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts +++ b/cross-chain/optimism/deploy_l2/14_update_with_polygon_in_wormhole_gateway_mapping.ts @@ -4,7 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployments, getNamedAccounts, ethers } = hre const { execute, log } = deployments - const { governace } = await getNamedAccounts() + const { deployer } = await getNamedAccounts() // Fake PolygonWormholeGateway for local development purposes only. const fakePolygonWormholeGateway = @@ -26,7 +26,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await execute( "OptimismWormholeGateway", - { from: governace, log: true, waitConfirmations: 1 }, + { from: deployer, log: true, waitConfirmations: 1 }, "updateGatewayAddress", polygonWormholeChainID, ethers.utils.hexZeroPad(polygonWormholeGatewayAddress, 32) From eed1bb3feb823d3f6ea5a6fdc591425dbfb90eac Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 18 Apr 2023 11:51:53 +0200 Subject: [PATCH 044/198] Linting only --- cross-chain/polygon/tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cross-chain/polygon/tsconfig.json b/cross-chain/polygon/tsconfig.json index 92896c14b..8e745e822 100644 --- a/cross-chain/polygon/tsconfig.json +++ b/cross-chain/polygon/tsconfig.json @@ -7,5 +7,10 @@ "resolveJsonModule": true }, "files": ["./hardhat.config.ts"], - "include": ["./deploy_parentchain", "./deploy_sidechain", "./test", "./typechain"] + "include": [ + "./deploy_parentchain", + "./deploy_sidechain", + "./test", + "./typechain" + ] } From b96fee2e054814e937967782d7842f48d9d38de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Fri, 24 Feb 2023 16:57:44 +0100 Subject: [PATCH 045/198] Automatically generate contracts documentation We are creating a GH Actions workflow which automatically generates the contracts documentation in Markdown, based on the functions and the NatSpec-format comments in the Solidity files stored in the `contracts` folder in `keep-network/tbtc-v2/solidity`. For certain workflow triggers, the generated documentation will be pushed to the `threshold-network/threshold` repository, under `./docs/app-development/tbtc-v2/tbtc-v2-api`. As the `.docs` folder is synched with Threshold docs GitBook space, the pushed docs will be displayed in HTML under `docs.threshold.network` domain. There are two main jobs in the workflow: * `contracts-docs-publish-preview` * `contracts-docs-publish` Both call a reusable workflow `reusable-solidity-docs.yml` which resides in the `keep-network/ci` repository under `.github/workflows`. The jobs differ in parameters with witch the reusable action is called. The common part of the jobs is the beginning stage, where the Solidity files are being prepared for Markdown generation. During that stage the jobs will remove the spaces chars between the NatSpec comments markers (`///`) and the text of the comment. This is done to ensure proper rendering of the lists in the output docs and is a default action made by `reusable-solidity-docs.yml`. Another pre-processing is running a `sed` command on a `./contracts/bridge/BitcoinTx.sol` that removes incorrectly used line with `//` blank comment in the middle of section with NatSpec's `///` comments (which was breaking the formatting of that comment in Markdown). Once files are ready, the jobs use Docgen tool to generate the Markdown docs. The tool needs to be installed in the project and configured in the `hardhat.config.ts`. The configuration that we use specifies that the docs should be generated to the `geerated-docs` subfolder, to one single `index.md` file. The `.sol` files in the `./solidity/contracts/test` folder will be ignored during generation (those are test/stub contracts which are not used on Mainnet). A custom template will be used during docs generations. The template was created based on the default `https://github.com/OpenZeppelin/solidity-docgen/blob/master/src/themes/markdown/common.hbs` template, but it removes the cursive from the `@dev` type comments (because the cursive didn't work well with formatting of the lists). Once the Docgen is run and the `index.md` file is generated, the jobs will add a Table of Contents to the file, to improve the navigation. The TOC will be added by the `markdown-toc` tool and will be generated using `--maxdepth 2` param, which results in listing all the contract names, but not the functions. Once the TOC is added, we'll start to see the difference in the behavior of the jobs. The `contracts-docs-publish-preview` job is triggered for: * `pull_request` events, if the PR modifies either files if `./solidity/contracts` or the workflow file itself, * `push` events, when the push is made to a branch which name starts with `releases/mainnet/solidity/`, * `workflow_dispatch` events. The job publishes the generated artifacts as artifacts of the GH Actions workflow run. For PRs, link to the run with the artifacts will be posted as a PR comment. The `contracts-docs-publish` job is triggered for: * published releases, which names start with `refs/tags/solidity/`. The job pushes the generated file to the `./docs/app-development/tbtc-v2/tbtc-v2-api` folder in the `threshold-network/threshold` repo, to the `main` branch. The `.docs` folder is synched with the GitBook Threshold documentation, so thanks to the job, the changes in the contracts should be reflected on the docs.threshold.network. In order for the job to work, we need to configure a user which will create the commit The user needs to have right to commit to the `threshold-network/threshold` repo. We also need to configure following secrets: - [ ] `THRESHOLD_DOCS_GITHUB_TOKEN` - [ ] `GPG_PRIVATE_KEY` - [ ] `GPG_PASSPHRASE` We're using a GPG key to be able to do verified commits. --- .github/workflows/contracts-docs.yml | 87 ++++++++++++++++++++++++++++ solidity/.prettierignore | 1 + solidity/docgen-templates/common.hbs | 33 +++++++++++ solidity/hardhat.config.ts | 7 +++ solidity/package.json | 1 + solidity/yarn.lock | 44 +++++++++++++- 6 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/contracts-docs.yml create mode 100644 solidity/docgen-templates/common.hbs diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml new file mode 100644 index 000000000..30cf15d16 --- /dev/null +++ b/.github/workflows/contracts-docs.yml @@ -0,0 +1,87 @@ +name: Solidity docs + +on: + pull_request: + push: + branches: + - releases/mainnet/solidity/** + release: + types: + - "published" + workflow_dispatch: + +jobs: + docs-detect-changes: + runs-on: ubuntu-latest + outputs: + path-filter: ${{ steps.filter.outputs.path-filter }} + steps: + - uses: actions/checkout@v3 + if: github.event_name == 'pull_request' + - uses: dorny/paths-filter@v2 + if: github.event_name == 'pull_request' + id: filter + with: + filters: | + path-filter: + - './solidity/contracts/**' + - './.github/workflows/solidity-docs.yml' + + # This job will be triggered for PRs which modify contracts. It will generate + # the archive with contracts documentation in Markdown and attatch it to the + # workflow run results. Link to the archive will be posted in a PR comment. + # The job will also be run after manual triggering and after pushes to the + # `releases/mainnet/solidity/**` branches. + contracts-docs-publish-preview: + name: Publish preview of contracts documentation + needs: docs-detect-changes + if: | + github.event_name == 'pull_request' + || github.event_name == 'push' + || github.event_name == 'workflow_dispatch' + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main + with: + projectSubfolder: /solidity + # We need to remove unnecessary `//` comment used in the `@dev` + # section of `BitcoinTx` documentation, which was causing problem with + # rendering of the `.md` file. We do that by executing + # `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The + # command substitutes `///` + newline + `//` + newline with just `///` + + # newline and does this in a loop. + preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol + publish: false + commentPR: true + exportAsGHArtifacts: true + + # This job will be triggered for releases which name starts with + # `refs/tags/solidity/`. It will generate contracts documentation in + # Markdown and sync it with a specific path of + # `threshold-network/threshold` repository. If changes will be detected, + # the destination repository will be updated. The commit pushing the + # changes will be verified using GPG key. + contracts-docs-publish: + name: Publish contracts documentation + needs: docs-detect-changes + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/') + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main + with: + projectSubfolder: /solidity + # We need to remove unnecessary `//` comment used in the `@dev` + # section of `BitcoinTx` documentation, which was causing problem with + # rendering of the `.md` file. We do that by executing + # `sed -i ':a;N;$!ba;s_///\n//\n_///\n_g'` on the problematic file. The + # command substitutes `///` + newline + `//` + newline with just `///` + + # newline and does this in a loop. + preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol + # TODO: change publish to true, uncomment other params below, change branch to `main` + publish: true + verifyCommits: true + destinationRepo: threshold-network/threshold + destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api + destinationBranch: main + userEmail: thesis-heimdall@users.noreply.github.com + userName: Heimdall + secrets: + githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} + gpgPrivateKey: ${{ secrets.GPG_PRIVATE_KEY }} + gpgPassphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/solidity/.prettierignore b/solidity/.prettierignore index 6d3a1b378..a0e5f649c 100644 --- a/solidity/.prettierignore +++ b/solidity/.prettierignore @@ -6,4 +6,5 @@ deployments/ export/ hardhat-dependency-compiler/ typechain/ +docgen-templates/ export.json diff --git a/solidity/docgen-templates/common.hbs b/solidity/docgen-templates/common.hbs new file mode 100644 index 000000000..564f17b45 --- /dev/null +++ b/solidity/docgen-templates/common.hbs @@ -0,0 +1,33 @@ +{{h}} {{name}} + +{{#if signature}} +```solidity +{{{signature}}} +``` +{{/if}} + +{{{natspec.notice}}} + +{{#if natspec.dev}} +{{{natspec.dev}}} +{{/if}} + +{{#if natspec.params}} +{{h 2}} Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +{{#each params}} +| {{name}} | {{type}} | {{{joinLines natspec}}} | +{{/each}} +{{/if}} + +{{#if natspec.returns}} +{{h 2}} Return Values + +| Name | Type | Description | +| ---- | ---- | ----------- | +{{#each returns}} +| {{#if name}}{{name}}{{else}}[{{@index}}]{{/if}} | {{type}} | {{{joinLines natspec}}} | +{{/each}} +{{/if}} \ No newline at end of file diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 18312cdb1..f10501fc0 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -11,6 +11,7 @@ import "hardhat-deploy" import "@tenderly/hardhat-tenderly" import "@typechain/hardhat" import "hardhat-dependency-compiler" +import "solidity-docgen" const ecdsaSolidityCompilerConfig = { version: "0.8.17", @@ -246,6 +247,12 @@ const config: HardhatUserConfig = { typechain: { outDir: "typechain", }, + docgen: { + outputDir: "generated-docs", + templates: "docgen-templates", + pages: "single", // `single`, `items` or `files` + exclude: ["./test"], + }, } export default config diff --git a/solidity/package.json b/solidity/package.json index c4c1c9ad2..f3ee6bd36 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -69,6 +69,7 @@ "prettier-plugin-solidity": "^1.0.0-beta.19", "solhint": "^3.3.7", "solhint-config-keep": "github:keep-network/solhint-config-keep", + "solidity-docgen": "^0.6.0-beta.34", "ts-node": "^10.4.0", "typechain": "^6.1.0", "typescript": "^4.5.4" diff --git a/solidity/yarn.lock b/solidity/yarn.lock index 221f88bce..a3acc9996 100644 --- a/solidity/yarn.lock +++ b/solidity/yarn.lock @@ -108,7 +108,7 @@ resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-0.1.11.tgz#c35e3b385091fc6f0c0c355b73270f4a8559ad38" integrity sha512-i3oK1guBxH89AEBaVA1d5CHnANehL36gPIcSpPBWiYZrKTGGVvbwNmVoaDwaKFXih0N22vXQAf2Rul8w5VzC3w== dependencies: - "@umpirsky/country-list" "git+https://github.com/umpirsky/country-list#05fda51" + "@umpirsky/country-list" "git://github.com/umpirsky/country-list#05fda51" bigi "^1.1.0" bignumber.js "^9.0.0" bip32 "2.0.5" @@ -7442,6 +7442,18 @@ growl@1.10.5: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== +handlebars@^4.7.7: + version "4.7.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -9535,6 +9547,11 @@ negotiator@0.6.3: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +neo-async@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + next-tick@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" @@ -11358,11 +11375,24 @@ solidity-ast@^0.4.15: resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.32.tgz#ba613ca24c7c79007798033e8a0f32a71285f09e" integrity sha512-vCx17410X+NMnpLVyg6ix4NMCHFIkvWrJb1rPBBeQYEQChX93Zgb9WB9NaIY4zpsr3Q8IvAfohw+jmuBzGf8OQ== +solidity-ast@^0.4.38: + version "0.4.45" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.45.tgz#37c1c17bd79123106fc69d94b4a8e9237ae8c625" + integrity sha512-N6uqfaDulVZqjpjru+KvMLjV89M3hesyr/1/t8nkjohRagFSDmDxZvb9viKV98pdwpMzs61Nt2JAApgh0fkL0g== + solidity-comments-extractor@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== +solidity-docgen@^0.6.0-beta.34: + version "0.6.0-beta.34" + resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.6.0-beta.34.tgz#f1766b13ea864ea71b8e727796d30a69ea90014a" + integrity sha512-igdGrkg8gT1jn+B2NwzjEtSf+7NTrSi/jz88zO7MZWgETmcWbXaxgAsQP4BQeC4YFeH0Pie1NsLP7+9qDgvFtA== + dependencies: + handlebars "^4.7.7" + solidity-ast "^0.4.38" + source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -11415,7 +11445,7 @@ source-map@^0.5.6, source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0: +source-map@^0.6.0, source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -12323,6 +12353,11 @@ typical@^5.2.0: resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== +uglify-js@^3.1.4: + version "3.17.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== + ultron@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ultron/-/ultron-1.1.1.tgz#9fe1536a10a664a65266a1e3ccf85fd36302bc9c" @@ -13679,6 +13714,11 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== + wordwrapjs@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" From 52c0b630bbbd8133050d7ce57af91314489023b3 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 18 Apr 2023 13:24:38 +0200 Subject: [PATCH 046/198] Adding missing workflow for Polygon --- .github/workflows/cross-chain-polygon.yml | 168 ++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 .github/workflows/cross-chain-polygon.yml diff --git a/.github/workflows/cross-chain-polygon.yml b/.github/workflows/cross-chain-polygon.yml new file mode 100644 index 000000000..1ccc029e4 --- /dev/null +++ b/.github/workflows/cross-chain-polygon.yml @@ -0,0 +1,168 @@ +name: Cross-chain Polygon + +on: + schedule: + - cron: "0 0 * * *" + push: + branches: + - main + paths: + - "cross-chain/polygon/**" + - ".github/workflows/cross-chain-polygon.yml" + +jobs: + contracts-detect-changes: + runs-on: ubuntu-latest + outputs: + path-filter: ${{ steps.filter.outputs.path-filter }} + steps: + - uses: actions/checkout@v3 + if: github.event_name == 'pull_request' + + - uses: dorny/paths-filter@v2 + if: github.event_name == 'pull_request' + id: filter + with: + filters: | + path-filter: + - './cross-chain/polygon/**' + - './.github/workflows/cross-chain-polygon.yml' + + contracts-build-and-test: + needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cross-chain/polygon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: "14.x" + cache: "yarn" + cache-dependency-path: cross-chain/polygon/yarn.lock + + # A workaround for transitive dependencies that use the obsolete git:// + # prefix instead of the recommended https:// + - name: Configure git to not use unauthenticated protocol + run: git config --global url."https://".insteadOf git:// + + - name: Install dependencies + run: yarn install + + - name: Build contracts + run: yarn build + + - name: Run tests + run: yarn test + + contracts-deployment-dry-run: + needs: contracts-detect-changes + if: | + github.event_name != 'pull_request' + || needs.contracts-detect-changes.outputs.path-filter == 'true' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cross-chain/polygon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: "14.x" + cache: "yarn" + cache-dependency-path: cross-chain/polygon/yarn.lock + + # A workaround for transitive dependencies that use the obsolete git:// + # prefix instead of the recommended https:// + - name: Configure git to not use unauthenticated protocol + run: git config --global url."https://".insteadOf git:// + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Deploy contracts + run: yarn deploy + + contracts-format: + needs: contracts-detect-changes + if: | + github.event_name == 'push' + || needs.contracts-detect-changes.outputs.path-filter == 'true' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cross-chain/polygon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: "14.x" + cache: "yarn" + cache-dependency-path: cross-chain/polygon/yarn.lock + + # A workaround for transitive dependencies that use the obsolete git:// + # prefix instead of the recommended https:// + - name: Configure git to not use unauthenticated protocol + run: git config --global url."https://".insteadOf git:// + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Check formatting + run: yarn format + + contracts-slither: + needs: contracts-detect-changes + if: | + github.event_name == 'push' + || needs.contracts-detect-changes.outputs.path-filter == 'true' + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./cross-chain/polygon + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: "14.x" + cache: "yarn" + cache-dependency-path: cross-chain/polygon/yarn.lock + + - uses: actions/setup-python@v4 + with: + python-version: 3.10.8 + + - name: Install Solidity + env: + SOLC_VERSION: 0.8.17 # according to solidity.version in hardhat.config.ts + run: | + pip3 install solc-select + solc-select install $SOLC_VERSION + solc-select use $SOLC_VERSION + + - name: Install Slither + env: + SLITHER_VERSION: 0.8.3 + run: pip3 install slither-analyzer==$SLITHER_VERSION + + # A workaround for transitive dependencies that use the obsolete git:// + # prefix instead of the recommended https:// + - name: Configure git to not use unauthenticated protocol + run: git config --global url."https://".insteadOf git:// + + - name: Install dependencies + run: yarn install + + - name: Run Slither + run: slither --hardhat-artifacts-directory build . From bcc8a6166cd4fac74d68d604ab1a7d4ea3d67399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 19 Apr 2023 12:11:58 +0200 Subject: [PATCH 047/198] Cleanup, fix wrong filename --- .github/workflows/contracts-docs.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 30cf15d16..862a6e4d9 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -25,7 +25,7 @@ jobs: filters: | path-filter: - './solidity/contracts/**' - - './.github/workflows/solidity-docs.yml' + - './.github/workflows/contracts-docs.yml' # This job will be triggered for PRs which modify contracts. It will generate # the archive with contracts documentation in Markdown and attatch it to the @@ -73,7 +73,6 @@ jobs: # command substitutes `///` + newline + `//` + newline with just `///` + # newline and does this in a loop. preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol - # TODO: change publish to true, uncomment other params below, change branch to `main` publish: true verifyCommits: true destinationRepo: threshold-network/threshold From ea869cf112cc8c1c0928a194c3a6de4e2964a863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 19 Apr 2023 13:21:44 +0200 Subject: [PATCH 048/198] Change user commiting docs We renamed Heimdall user to Valkyrie. --- .github/workflows/contracts-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 862a6e4d9..c945b58b1 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -78,8 +78,8 @@ jobs: destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBranch: main - userEmail: thesis-heimdall@users.noreply.github.com - userName: Heimdall + userEmail: thesis-valkyrie@users.noreply.github.com + userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} gpgPrivateKey: ${{ secrets.GPG_PRIVATE_KEY }} From 56debc1b57b90e5181d041ce4cd2d1af45f7efc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 19 Apr 2023 14:32:51 +0200 Subject: [PATCH 049/198] Update name of the secrets --- .github/workflows/contracts-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index c945b58b1..cb02a7692 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -82,5 +82,5 @@ jobs: userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} - gpgPrivateKey: ${{ secrets.GPG_PRIVATE_KEY }} - gpgPassphrase: ${{ secrets.GPG_PASSPHRASE }} + gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PASSPHRASE }} + gpgPassphrase: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }} From 706c53321b793e7afc9c7f2450547212c4f7ae77 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 19 Apr 2023 14:39:28 +0200 Subject: [PATCH 050/198] Partial events pulls This changeset adds the partial events pulls mechanism that can be useful for some Ethereum provider (e.g. Alchemy, QuickNode) who limit the maximum number of blocks that can be queried or events that can be pulled at once but allows to get an arbitrary number of events in batches of a certain size. This solution is based on https://github.com/keep-network/tbtc.js/pull/141 --- typescript/src/chain.ts | 9 ++++ typescript/src/ethereum-helpers.ts | 82 ++++++++++++++++++++++++++++++ typescript/src/ethereum.ts | 13 +++-- 3 files changed, 101 insertions(+), 3 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index 934ae09ed..dae8606d2 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -24,6 +24,7 @@ import { DkgResultSubmittedEvent, NewWalletRegisteredEvent, } from "./wallet" +import type { ExecutionLoggerFn } from "./backoff" /** * Represents a generic chain identifier. @@ -78,6 +79,14 @@ export namespace GetEvents { * Number of retries in case of an error getting the events. */ retries?: number + /** + * Number of blocks for interval length in partial events pulls. + */ + batchedQueryBlockInterval?: number + /** + * A logger function to pass execution messages. + */ + logger?: ExecutionLoggerFn } /** diff --git a/typescript/src/ethereum-helpers.ts b/typescript/src/ethereum-helpers.ts index c5c769c0c..456016476 100644 --- a/typescript/src/ethereum-helpers.ts +++ b/typescript/src/ethereum-helpers.ts @@ -1,9 +1,16 @@ +import { + Contract as EthersContract, + Event as EthersEvent, + EventFilter as EthersEventFilter, +} from "ethers" import { backoffRetrier, skipRetryWhenMatched, ExecutionLoggerFn, } from "./backoff" +const GET_EVENTS_BLOCK_INTERVAL = 10_000 + /** * Sends ethereum transaction with retries. * @param fn Function to execute with retries. @@ -72,3 +79,78 @@ function resolveEthersError(err: unknown): unknown { return err } + +/** + * Looks up all existing events defined by the {@link event} filter on + * {@link sourceContract}, searching past blocks and then returning them. + * Does not wait for any new events. It starts searching from provided block number. + * If the {@link fromBlock} is missing it starts searching from block `0`. + * It pulls events in one `getLogs` call. If the call fails it fallbacks to querying + * events in batches of {@link batchedQueryBlockInterval} blocks. If the parameter + * is not set it queries in {@link GET_EVENTS_BLOCK_INTERVAL} blocks batches. + * @param sourceContract The contract instance that emits the event. + * @param event The event filter to query. + * @param fromBlock Starting block for events search. + * @param toBlock Ending block for events search. + * @param batchedQueryBlockInterval Block interval for batched events pulls. + * @param logger A logger function to pass execution messages. + * @returns A promise that will be fulfilled by the list of event objects once + * they are found. + */ +export async function getEvents( + sourceContract: EthersContract, + event: EthersEventFilter, + fromBlock: number = 0, + toBlock: number | string = "latest", + batchedQueryBlockInterval: number = GET_EVENTS_BLOCK_INTERVAL, + logger: ExecutionLoggerFn = console.debug +): Promise { + return new Promise(async (resolve, reject) => { + let resultEvents: EthersEvent[] = [] + try { + resultEvents = await sourceContract.queryFilter(event, fromBlock, toBlock) + } catch (err) { + logger( + `switching to partial events pulls; ` + + `failed to get events in one request from contract: [${event.address}], ` + + `fromBlock: [${fromBlock}], toBlock: [${toBlock}]: [${err}]` + ) + + try { + if (typeof toBlock === "string") { + toBlock = (await sourceContract.provider.getBlock(toBlock)).number + } + + let batchStartBlock = fromBlock + + while (batchStartBlock <= toBlock) { + let batchEndBlock = batchStartBlock + batchedQueryBlockInterval + if (batchEndBlock > toBlock) { + batchEndBlock = toBlock + } + logger( + `executing partial events pull from contract: [${event.address}], ` + + `fromBlock: [${batchStartBlock}], toBlock: [${batchEndBlock}]` + ) + const foundEvents = await sourceContract.queryFilter( + event, + batchStartBlock, + batchEndBlock + ) + + resultEvents = resultEvents.concat(foundEvents) + logger( + `fetched [${foundEvents.length}] events, has ` + + `[${resultEvents.length}] total` + ) + + batchStartBlock = batchEndBlock + 1 + } + } catch (error) { + return reject(error) + } + } + + return resolve(resultEvents) + }) +} diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index be0f276cf..69cf0c86e 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -26,7 +26,7 @@ import { RevealedDeposit, DepositRevealedEvent, } from "./deposit" -import { sendWithRetry } from "./ethereum-helpers" +import { getEvents, sendWithRetry } from "./ethereum-helpers" import { RedemptionRequest } from "./redemption" import { compressPublicKey, @@ -197,6 +197,10 @@ class EthereumContract { /** * Get events emitted by the Ethereum contract. + * It starts searching from provided block number. If the {@link GetEvents.Options#fromBlock} + * option is missing it looks for a contract's defined property + * {@link _deployedAtBlockNumber}. If the property is missing starts searching + * from block `0`. * @param eventName Name of the event. * @param options Options for events fetching. * @param filterArgs Arguments for events filtering. @@ -212,10 +216,13 @@ class EthereumContract { return backoffRetrier( options?.retries ?? this._totalRetryAttempts )(async () => { - return await this._instance.queryFilter( + return await getEvents( + this._instance, this._instance.filters[eventName](...filterArgs), options?.fromBlock ?? this._deployedAtBlockNumber, - options?.toBlock ?? "latest" + options?.toBlock, + options?.batchedQueryBlockInterval, + options?.logger ) }) } From 0b39289f11a75f22c2097e06c7e9d8985ad82f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 19 Apr 2023 14:59:08 +0200 Subject: [PATCH 051/198] Update commiter's e-mail --- .github/workflows/contracts-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index cb02a7692..f5bb8e731 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -78,7 +78,7 @@ jobs: destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBranch: main - userEmail: thesis-valkyrie@users.noreply.github.com + userEmail: valkyrie@thesis.co userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} From cf023193dbba7d20d82968429566114ba63f2b07 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 20 Apr 2023 13:23:00 +0200 Subject: [PATCH 052/198] Changing Council address on Optimism The old Council address should not be used due to the problems in Safe UI when on Optimism network. The Council is now using new address which changes this commit. --- cross-chain/optimism/hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-chain/optimism/hardhat.config.ts b/cross-chain/optimism/hardhat.config.ts index f3cf09c47..62fd7f58f 100644 --- a/cross-chain/optimism/hardhat.config.ts +++ b/cross-chain/optimism/hardhat.config.ts @@ -117,7 +117,7 @@ const config: HardhatUserConfig = { goerli: 0, optimismGoerli: 0, mainnet: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", - optimism: "0x9f6e831c8f8939dc0c830c6e492e7cef4f9c2f5f", + optimism: "0x7fB50BBabeDEE52b8760Ba15c0c199aF33Fc2EfA", }, }, mocha: { From b8e433ee9a02de6e05d9fd9929df7267fa3358b2 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 24 Apr 2023 14:48:13 +0200 Subject: [PATCH 053/198] Disabling LightRelay authorization for goerli / system_tests network Current setup does not include "authorize" function neither for goerli nor system_tests network. When running system tests the deployment script fails because it cannot find the "authorize" function. This "authorize" function is not needed for system tests and we can skip it. --- ...t_relay_maintainer_proxy_in_light_relay.ts | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts index bd59239c8..bf757a562 100644 --- a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +++ b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts @@ -2,20 +2,22 @@ import { HardhatRuntimeEnvironment } from "hardhat/types" import { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - const { getNamedAccounts, deployments } = hre - const { execute } = deployments - const { deployer } = await getNamedAccounts() + if (hre.network.name !== "goerli" && hre.network.name !== "system_tests") { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() - const LightRelayMaintainerProxy = await deployments.get( - "LightRelayMaintainerProxy" - ) + const LightRelayMaintainerProxy = await deployments.get( + "LightRelayMaintainerProxy" + ) - await execute( - "LightRelay", - { from: deployer, log: true, waitConfirmations: 1 }, - "authorize", - LightRelayMaintainerProxy.address - ) + await execute( + "LightRelay", + { from: deployer, log: true, waitConfirmations: 1 }, + "authorize", + LightRelayMaintainerProxy.address + ) + } } export default func From d10b0703d73d57127f6aee1800e344d92419573f Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Mon, 24 Apr 2023 17:12:06 +0200 Subject: [PATCH 054/198] WalletCoordinator: rename proposal submitter to a coordinator We want to add the functionality of requesting heartbeats through the WalletCoordinator contract. Once we add heartbeat requests, the "proposal submitter" roles will no longer sound good. In this commit, the "proposal submitter" role has been renamed to the "coordinator" role. --- .../contracts/bridge/WalletCoordinator.sol | 75 ++- .../test/bridge/WalletCoordinator.test.ts | 528 +++++++++--------- 2 files changed, 290 insertions(+), 313 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index eb4a8be41..8360c01f6 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -116,8 +116,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { bytes4 refundLocktime; } - /// @notice Mapping that holds addresses allowed to submit proposals. - mapping(address => bool) public isProposalSubmitter; + /// @notice Mapping that holds addresses allowed to submit proposals and + /// request heartbeats. + mapping(address => bool) public isCoordinator; /// @notice Mapping that holds wallet time locks. The key is a 20-byte /// wallet public key hash. @@ -178,9 +179,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// the current market conditions. uint32 public depositSweepProposalSubmissionGasOffset; - event ProposalSubmitterAdded(address indexed proposalSubmitter); + event CoordinatorAdded(address indexed coordinator); - event ProposalSubmitterRemoved(address indexed proposalSubmitter); + event CoordinatorRemoved(address indexed coordinator); event WalletManuallyUnlocked(bytes20 indexed walletPubKeyHash); @@ -200,19 +201,19 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { event DepositSweepProposalSubmitted( DepositSweepProposal proposal, - address indexed proposalSubmitter + address indexed coordinator ); // TODO: Enhance this modifier by adding the coordinator role check. See: // https://github.com/keep-network/tbtc-v2/pull/575#discussion_r1151564813 - modifier onlyProposalSubmitterOrWalletMember( + modifier onlyCoordinator( bytes20 walletPubKeyHash, WalletMemberContext calldata walletMemberContext ) { - bool proposalSubmitter = isProposalSubmitter[msg.sender]; + bool _isCoordinator = isCoordinator[msg.sender]; bool walletMember = false; - if (!proposalSubmitter) { + if (!_isCoordinator) { bytes32 ecdsaWalletID = bridge .wallets(walletPubKeyHash) .ecdsaWalletID; @@ -226,8 +227,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { } require( - proposalSubmitter || walletMember, - "Caller is neither a proposal submitter nor a wallet member" + _isCoordinator || walletMember, + "Caller is neither a coordinator nor a wallet member" ); _; @@ -251,8 +252,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { __Ownable_init(); bridge = _bridge; - // Pre-fetch wallet registry address to save gas on calls protected - // by the onlyProposalSubmitterOrWalletMember modifier. + // Pre-fetch addresses to save gas later. (, , walletRegistry, reimbursementPool) = _bridge.contractReferences(); depositSweepProposalValidity = 4 hours; @@ -262,38 +262,32 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { depositSweepProposalSubmissionGasOffset = 25000; } - /// @notice Adds the given address to the proposal submitters set. - /// @param proposalSubmitter Address of the new proposal submitter. + /// @notice Adds the given address to the set of coordinator addresses. + /// @param coordinator Address of the new coordinator. /// @dev Requirements: /// - The caller must be the owner, - /// - The `proposalSubmitter` must not be an existing proposal submitter. - function addProposalSubmitter(address proposalSubmitter) - external - onlyOwner - { + /// - The `coordinator` must not be an existing coordinator. + function addCoordinator(address coordinator) external onlyOwner { require( - !isProposalSubmitter[proposalSubmitter], - "This address is already a proposal submitter" + !isCoordinator[coordinator], + "This address is already a coordinator" ); - isProposalSubmitter[proposalSubmitter] = true; - emit ProposalSubmitterAdded(proposalSubmitter); + isCoordinator[coordinator] = true; + emit CoordinatorAdded(coordinator); } - /// @notice Removes the given address from the proposal submitters set. - /// @param proposalSubmitter Address of the existing proposal submitter. + /// @notice Removes the given address from the set of coordinator addresses. + /// @param coordinator Address of the existing coordinator. /// @dev Requirements: /// - The caller must be the owner, - /// - The `proposalSubmitter` must be an existing proposal submitter. - function removeProposalSubmitter(address proposalSubmitter) - external - onlyOwner - { + /// - The `coordinator` must be an existing coordinator. + function removeCoordinator(address coordinator) external onlyOwner { require( - isProposalSubmitter[proposalSubmitter], - "This address is not a proposal submitter" + isCoordinator[coordinator], + "This address is not a coordinator" ); - delete isProposalSubmitter[proposalSubmitter]; - emit ProposalSubmitterRemoved(proposalSubmitter); + delete isCoordinator[coordinator]; + emit CoordinatorRemoved(coordinator); } /// @notice Allows to unlock the given wallet before their time lock expires. @@ -376,21 +370,18 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @param proposal The deposit sweep proposal /// @param walletMemberContext Optional parameter holding some data allowing /// to confirm the wallet membership of the caller. This parameter is - /// relevant only when the caller is not a registered proposal - /// submitter but claims to be a member of the target wallet. + /// relevant only when the caller is not a registered coordinator but + /// claims to be a member of the target wallet. /// @dev Requirements: - /// - The caller is either a proposal submitter or a member of the - /// target wallet, + /// - The caller is either a coordinator or a member of the target + /// wallet, /// - The wallet is not time-locked. function submitDepositSweepProposal( DepositSweepProposal calldata proposal, WalletMemberContext calldata walletMemberContext ) public - onlyProposalSubmitterOrWalletMember( - proposal.walletPubKeyHash, - walletMemberContext - ) + onlyCoordinator(proposal.walletPubKeyHash, walletMemberContext) onlyAfterWalletLock(proposal.walletPubKeyHash) { walletLock[proposal.walletPubKeyHash] = WalletLock( diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 49fcb5f59..377b5793e 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -74,7 +74,7 @@ describe("WalletCoordinator", () => { await walletCoordinator.initialize(bridge.address) }) - describe("addProposalSubmitter", () => { + describe("addCoordinator", () => { before(async () => { await createSnapshot() }) @@ -88,19 +88,19 @@ describe("WalletCoordinator", () => { await expect( walletCoordinator .connect(thirdParty) - .addProposalSubmitter(thirdParty.address) + .addCoordinator(thirdParty.address) ).to.be.revertedWith("Ownable: caller is not the owner") }) }) context("when called by the owner", () => { - context("when the proposal submitter already exists", () => { + context("when the coordinator already exists", () => { before(async () => { await createSnapshot() await walletCoordinator .connect(owner) - .addProposalSubmitter(thirdParty.address) + .addCoordinator(thirdParty.address) }) after(async () => { @@ -109,14 +109,12 @@ describe("WalletCoordinator", () => { it("should revert", async () => { await expect( - walletCoordinator - .connect(owner) - .addProposalSubmitter(thirdParty.address) - ).to.be.revertedWith("This address is already a proposal submitter") + walletCoordinator.connect(owner).addCoordinator(thirdParty.address) + ).to.be.revertedWith("This address is already a coordinator") }) }) - context("when the proposal submitter does not exist yet", () => { + context("when the coordinator does not exist yet", () => { let tx: ContractTransaction before(async () => { @@ -124,30 +122,29 @@ describe("WalletCoordinator", () => { tx = await walletCoordinator .connect(owner) - .addProposalSubmitter(thirdParty.address) + .addCoordinator(thirdParty.address) }) after(async () => { await restoreSnapshot() }) - it("should add the new proposal submitter", async () => { + it("should add the new coordinator", async () => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect( - await walletCoordinator.isProposalSubmitter(thirdParty.address) - ).to.be.true + expect(await walletCoordinator.isCoordinator(thirdParty.address)).to + .be.true }) - it("should emit the ProposalSubmitterAdded event", async () => { + it("should emit the CoordinatorAdded event", async () => { await expect(tx) - .to.emit(walletCoordinator, "ProposalSubmitterAdded") + .to.emit(walletCoordinator, "CoordinatorAdded") .withArgs(thirdParty.address) }) }) }) }) - describe("removeProposalSubmitter", () => { + describe("removeCoordinator", () => { before(async () => { await createSnapshot() }) @@ -161,23 +158,23 @@ describe("WalletCoordinator", () => { await expect( walletCoordinator .connect(thirdParty) - .removeProposalSubmitter(thirdParty.address) + .removeCoordinator(thirdParty.address) ).to.be.revertedWith("Ownable: caller is not the owner") }) }) context("when called by the owner", () => { - context("when the proposal submitter does not exist", () => { + context("when the coordinator does not exist", () => { it("should revert", async () => { await expect( walletCoordinator .connect(owner) - .removeProposalSubmitter(thirdParty.address) - ).to.be.revertedWith("This address is not a proposal submitter") + .removeCoordinator(thirdParty.address) + ).to.be.revertedWith("This address is not a coordinator") }) }) - context("when the proposal submitter exists", () => { + context("when the coordinator exists", () => { let tx: ContractTransaction before(async () => { @@ -185,27 +182,26 @@ describe("WalletCoordinator", () => { await walletCoordinator .connect(owner) - .addProposalSubmitter(thirdParty.address) + .addCoordinator(thirdParty.address) tx = await walletCoordinator .connect(owner) - .removeProposalSubmitter(thirdParty.address) + .removeCoordinator(thirdParty.address) }) after(async () => { await restoreSnapshot() }) - it("should remove the proposal submitter", async () => { + it("should remove the coordinator", async () => { // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect( - await walletCoordinator.isProposalSubmitter(thirdParty.address) - ).to.be.false + expect(await walletCoordinator.isCoordinator(thirdParty.address)).to + .be.false }) - it("should emit the ProposalSubmitterRemoved event", async () => { + it("should emit the CoordinatorRemoved event", async () => { await expect(tx) - .to.emit(walletCoordinator, "ProposalSubmitterRemoved") + .to.emit(walletCoordinator, "CoordinatorRemoved") .withArgs(thirdParty.address) }) }) @@ -239,7 +235,7 @@ describe("WalletCoordinator", () => { await walletCoordinator .connect(owner) - .addProposalSubmitter(thirdParty.address) + .addCoordinator(thirdParty.address) // Submit a proposal to set a wallet time lock. await walletCoordinator.connect(thirdParty).submitDepositSweepProposal( @@ -576,7 +572,7 @@ describe("WalletCoordinator", () => { }) context( - "when the caller is neither a proposal submitter nor a wallet member", + "when the caller is neither a coordinator nor a wallet member", () => { before(async () => { await createSnapshot() @@ -632,219 +628,108 @@ describe("WalletCoordinator", () => { ) await expect(tx).to.be.revertedWith( - "Caller is neither a proposal submitter nor a wallet member" + "Caller is neither a coordinator nor a wallet member" ) }) } ) - context( - "when the caller is a proposal submitter or a wallet member", - () => { - context("when the caller is a proposal submitter", () => { + context("when the caller is a coordinator or a wallet member", () => { + context("when the caller is a coordinator", () => { + before(async () => { + await createSnapshot() + + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when wallet is time-locked", () => { before(async () => { await createSnapshot() + // Submit a proposal to set a wallet time lock. await walletCoordinator - .connect(owner) - .addProposalSubmitter(thirdParty.address) + .connect(thirdParty) + .submitDepositSweepProposal( + { + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }, + emptyWalletMemberContext + ) + + // Jump to the end of the lock period but not beyond it. + await increaseTime( + (await walletCoordinator.depositSweepProposalValidity()) - 1 + ) }) after(async () => { await restoreSnapshot() }) - context("when wallet is time-locked", () => { - before(async () => { - await createSnapshot() - - // Submit a proposal to set a wallet time lock. - await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) - - // Jump to the end of the lock period but not beyond it. - await increaseTime( - (await walletCoordinator.depositSweepProposalValidity()) - 1 - ) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should revert", async () => { - await expect( - walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( + it("should revert", async () => { + await expect( + walletCoordinator.connect(thirdParty).submitDepositSweepProposal( + { + walletPubKeyHash, + depositsKeys: [ { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 1, - }, - ], - sweepTxFee: 5000, + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 1, }, - emptyWalletMemberContext - ) - ).to.be.revertedWith("Wallet locked") - }) - }) - - context("when wallet is not time-locked", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() - - // Submit a proposal to set a wallet time lock. - await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) - - // Jump beyond the lock period. - await increaseTime( - await walletCoordinator.depositSweepProposalValidity() - ) - - tx = await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 1, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should time lock the wallet", async () => { - const lockedUntil = - (await lastBlockTime()) + - (await walletCoordinator.depositSweepProposalValidity()) - - const walletLock = await walletCoordinator.walletLock( - walletPubKeyHash - ) - - expect(walletLock.expiresAt).to.be.equal(lockedUntil) - expect(walletLock.cause).to.be.equal(walletAction.DepositSweep) - }) - - it("should emit the DepositSweepProposalSubmitted event", async () => { - await expect(tx).to.emit( - walletCoordinator, - "DepositSweepProposalSubmitted" - ) - - // The `expect.to.emit.withArgs` assertion has troubles with - // matching complex event arguments as it uses strict equality - // underneath. To overcome that problem, we manually get event's - // arguments and check it against the expected ones using deep - // equality assertion (eql). - const receipt = await ethers.provider.getTransactionReceipt( - tx.hash - ) - expect(receipt.logs.length).to.be.equal(1) - expect( - walletCoordinator.interface.parseLog(receipt.logs[0]).args - ).to.be.eql([ - [ - walletPubKeyHash, - [ - [ - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - 1, - ], ], - BigNumber.from(5000), - ], - thirdParty.address, - ]) - }) + sweepTxFee: 5000, + }, + emptyWalletMemberContext + ) + ).to.be.revertedWith("Wallet locked") }) }) - // Here we just check that a wallet member not registered as an - // explicit proposal submitter can actually propose a sweep. Detailed - // assertions are already done within the previous scenario called - // `when the caller is a proposal submitter`. - context("when the caller is a wallet member", () => { + context("when wallet is not time-locked", () => { + let tx: ContractTransaction + before(async () => { await createSnapshot() - bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ - ecdsaWalletID, - mainUtxoHash: HashZero, - pendingRedemptionsValue: 0, - createdAt: 0, - movingFundsRequestedAt: 0, - closingStartedAt: 0, - pendingMovedFundsSweepRequestsCount: 0, - state: walletState.Live, - movingFundsTargetWalletsCommitmentHash: HashZero, - }) - - walletRegistry.isWalletMember - .whenCalledWith( - ecdsaWalletID, - walletMembersIDs, - thirdParty.address, - 1 + // Submit a proposal to set a wallet time lock. + await walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposal( + { + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }, + emptyWalletMemberContext ) - .returns(true) - }) - after(async () => { - bridge.wallets.reset() - walletRegistry.isWalletMember.reset() - - await restoreSnapshot() - }) + // Jump beyond the lock period. + await increaseTime( + await walletCoordinator.depositSweepProposalValidity() + ) - it("should succeed", async () => { - const tx = walletCoordinator + tx = await walletCoordinator .connect(thirdParty) .submitDepositSweepProposal( { @@ -853,22 +738,126 @@ describe("WalletCoordinator", () => { { fundingTxHash: "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, + fundingOutputIndex: 1, }, ], sweepTxFee: 5000, }, - { - walletMembersIDs, - walletMemberIndex: 1, - } + emptyWalletMemberContext ) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should time lock the wallet", async () => { + const lockedUntil = + (await lastBlockTime()) + + (await walletCoordinator.depositSweepProposalValidity()) - await expect(tx).to.not.be.reverted + const walletLock = await walletCoordinator.walletLock( + walletPubKeyHash + ) + + expect(walletLock.expiresAt).to.be.equal(lockedUntil) + expect(walletLock.cause).to.be.equal(walletAction.DepositSweep) + }) + + it("should emit the DepositSweepProposalSubmitted event", async () => { + await expect(tx).to.emit( + walletCoordinator, + "DepositSweepProposalSubmitted" + ) + + // The `expect.to.emit.withArgs` assertion has troubles with + // matching complex event arguments as it uses strict equality + // underneath. To overcome that problem, we manually get event's + // arguments and check it against the expected ones using deep + // equality assertion (eql). + const receipt = await ethers.provider.getTransactionReceipt(tx.hash) + expect(receipt.logs.length).to.be.equal(1) + expect( + walletCoordinator.interface.parseLog(receipt.logs[0]).args + ).to.be.eql([ + [ + walletPubKeyHash, + [ + [ + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + 1, + ], + ], + BigNumber.from(5000), + ], + thirdParty.address, + ]) }) }) - } - ) + }) + + // Here we just check that a wallet member not registered as an + // explicit coordinator can actually propose a sweep. Detailed + // assertions are already done within the previous scenario called + // `when the caller is a proposal submitter`. + context("when the caller is a wallet member", () => { + before(async () => { + await createSnapshot() + + bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ + ecdsaWalletID, + mainUtxoHash: HashZero, + pendingRedemptionsValue: 0, + createdAt: 0, + movingFundsRequestedAt: 0, + closingStartedAt: 0, + pendingMovedFundsSweepRequestsCount: 0, + state: walletState.Live, + movingFundsTargetWalletsCommitmentHash: HashZero, + }) + + walletRegistry.isWalletMember + .whenCalledWith( + ecdsaWalletID, + walletMembersIDs, + thirdParty.address, + 1 + ) + .returns(true) + }) + + after(async () => { + bridge.wallets.reset() + walletRegistry.isWalletMember.reset() + + await restoreSnapshot() + }) + + it("should succeed", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposal( + { + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }, + { + walletMembersIDs, + walletMemberIndex: 1, + } + ) + + await expect(tx).to.not.be.reverted + }) + }) + }) }) describe("submitDepositSweepProposalWithReimbursement", () => { @@ -888,7 +877,7 @@ describe("WalletCoordinator", () => { // Just double check that `submitDepositSweepProposalWithReimbursement` has // the same ACL as `submitDepositSweepProposal`. context( - "when the caller is neither a proposal submitter nor a wallet member", + "when the caller is neither a coordinator nor a wallet member", () => { before(async () => { await createSnapshot() @@ -944,7 +933,7 @@ describe("WalletCoordinator", () => { ) await expect(tx).to.be.revertedWith( - "Caller is neither a proposal submitter nor a wallet member" + "Caller is neither a coordinator nor a wallet member" ) }) } @@ -953,57 +942,54 @@ describe("WalletCoordinator", () => { // Here we just check that the reimbursement works. Detailed // assertions are already done within the scenario stressing the // `submitDepositSweepProposal` function. - context( - "when the caller is a proposal submitter or a wallet member", - () => { - before(async () => { - await createSnapshot() + context("when the caller is a coordinator or a wallet member", () => { + before(async () => { + await createSnapshot() - reimbursementPool.refund.returns() + reimbursementPool.refund.returns() - await walletCoordinator - .connect(owner) - .addProposalSubmitter(thirdParty.address) + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) - await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposalWithReimbursement( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) - }) + await walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposalWithReimbursement( + { + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }, + emptyWalletMemberContext + ) + }) - after(async () => { - reimbursementPool.refund.reset() + after(async () => { + reimbursementPool.refund.reset() - await restoreSnapshot() - }) + await restoreSnapshot() + }) - it("should do the refund", async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(reimbursementPool.refund).to.have.been.calledOnce + it("should do the refund", async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(reimbursementPool.refund).to.have.been.calledOnce - expect(reimbursementPool.refund.getCall(0).args[0]).to.be.closeTo( - BigNumber.from(60000), - 1000 - ) + expect(reimbursementPool.refund.getCall(0).args[0]).to.be.closeTo( + BigNumber.from(60000), + 1000 + ) - expect(reimbursementPool.refund.getCall(0).args[1]).to.be.equal( - thirdParty.address - ) - }) - } - ) + expect(reimbursementPool.refund.getCall(0).args[1]).to.be.equal( + thirdParty.address + ) + }) + }) }) describe("validateDepositSweepProposal", () => { From 7591ca3dc38ea1b1ac022132023f0e13feffee2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 25 Apr 2023 10:30:58 +0200 Subject: [PATCH 055/198] Rename the input with project directory The name of the input in the reusable action has changed, we're updating the name in the jobs that use it. --- .github/workflows/contracts-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index f5bb8e731..a065d11dc 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -41,7 +41,7 @@ jobs: || github.event_name == 'workflow_dispatch' uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: - projectSubfolder: /solidity + projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` # section of `BitcoinTx` documentation, which was causing problem with # rendering of the `.md` file. We do that by executing @@ -65,7 +65,7 @@ jobs: if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/') uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: - projectSubfolder: /solidity + projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` # section of `BitcoinTx` documentation, which was causing problem with # rendering of the `.md` file. We do that by executing From 517b7ad3bc14b048fec5a66de93b6cf3c87d1b1c Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 12:16:02 +0200 Subject: [PATCH 056/198] Removed the wallet member authorization in WalletCoordinator Having every wallet member be able to submit sweep proposals to the wallet enables the risk of griefing the coordination protocol. The address authorized to submit proposals can keep submitting proposals that wallet members will reject off-chain. Given that we do not perform the validation on-chain during the proposal submission to optimize gas coordination costs, every address eligible to submit a proposal can block the wallet for a certain timeout specific to the proposed action. Addresses appointed by the DAO as coordinators can be stripped of the coordinator role if they abuse the protocol. It is not possible to remove the address from the wallet member list though. A possible solution for the problem of a malicious wallet member griefing the coordination is introducing a rotating role of a wallet member coordinator, as proposed in RFC 7: Sweeping coordination. Given that we are not going to use this mechanism in the first iteration of sweeping and redemptions and given that the WalletCoordinator contract is supposed to be deployed behind an upgradeable transparent proxy, the ACL allowing wallet members to submit proposals has been removed. If we decide to enable wallet members to submit proposals in the future, we will probably do it as specified in RFC 7: Sweeping coordination, by introducing a rotating wallet member coordination role. --- .../contracts/bridge/WalletCoordinator.sol | 54 +- .../test/bridge/WalletCoordinator.test.ts | 521 ++++++------------ 2 files changed, 186 insertions(+), 389 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 8360c01f6..0f51a80e8 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -70,13 +70,6 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { WalletAction cause; } - /// @notice Helper structure carrying data necessary to validate the wallet - /// membership of the caller. - struct WalletMemberContext { - uint32[] walletMembersIDs; - uint256 walletMemberIndex; - } - /// @notice Helper structure representing a deposit sweep proposal. struct DepositSweepProposal { // 20-byte public key hash of the target wallet. @@ -204,32 +197,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { address indexed coordinator ); - // TODO: Enhance this modifier by adding the coordinator role check. See: - // https://github.com/keep-network/tbtc-v2/pull/575#discussion_r1151564813 - modifier onlyCoordinator( - bytes20 walletPubKeyHash, - WalletMemberContext calldata walletMemberContext - ) { - bool _isCoordinator = isCoordinator[msg.sender]; - bool walletMember = false; - - if (!_isCoordinator) { - bytes32 ecdsaWalletID = bridge - .wallets(walletPubKeyHash) - .ecdsaWalletID; - - walletMember = walletRegistry.isWalletMember( - ecdsaWalletID, - walletMemberContext.walletMembersIDs, - msg.sender, - walletMemberContext.walletMemberIndex - ); - } - - require( - _isCoordinator || walletMember, - "Caller is neither a coordinator nor a wallet member" - ); + modifier onlyCoordinator() { + require(isCoordinator[msg.sender], "Caller is not a coordinator"); _; } @@ -368,20 +337,12 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// off-chain members. Wallet members are supposed to validate /// the proposal on their own, before taking any action. /// @param proposal The deposit sweep proposal - /// @param walletMemberContext Optional parameter holding some data allowing - /// to confirm the wallet membership of the caller. This parameter is - /// relevant only when the caller is not a registered coordinator but - /// claims to be a member of the target wallet. /// @dev Requirements: - /// - The caller is either a coordinator or a member of the target - /// wallet, + /// - The caller is a coordinator, /// - The wallet is not time-locked. - function submitDepositSweepProposal( - DepositSweepProposal calldata proposal, - WalletMemberContext calldata walletMemberContext - ) + function submitDepositSweepProposal(DepositSweepProposal calldata proposal) public - onlyCoordinator(proposal.walletPubKeyHash, walletMemberContext) + onlyCoordinator onlyAfterWalletLock(proposal.walletPubKeyHash) { walletLock[proposal.walletPubKeyHash] = WalletLock( @@ -397,12 +358,11 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// caller's transaction cost. /// @dev See `submitDepositSweepProposal` function documentation. function submitDepositSweepProposalWithReimbursement( - DepositSweepProposal calldata proposal, - WalletMemberContext calldata walletMemberContext + DepositSweepProposal calldata proposal ) external { uint256 gasStart = gasleft(); - submitDepositSweepProposal(proposal, walletMemberContext); + submitDepositSweepProposal(proposal); reimbursementPool.refund( (gasStart - gasleft()) + depositSweepProposalSubmissionGasOffset, diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 377b5793e..977a3bcec 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -21,11 +21,6 @@ const { AddressZero, HashZero } = ethers.constants const day = 86400 const depositLocktime = 30 * day -const emptyWalletMemberContext = { - walletMembersIDs: [], - walletMemberIndex: 0, -} - const emptyDepositExtraInfo = { fundingTx: { version: "0x00000000", @@ -238,20 +233,17 @@ describe("WalletCoordinator", () => { .addCoordinator(thirdParty.address) // Submit a proposal to set a wallet time lock. - await walletCoordinator.connect(thirdParty).submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) + await walletCoordinator.connect(thirdParty).submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }) tx = await walletCoordinator .connect(owner) @@ -559,9 +551,6 @@ describe("WalletCoordinator", () => { describe("submitDepositSweepProposal", () => { const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" - const ecdsaWalletID = - "0x4ad6b3ccbca81645865d8d0d575797a15528e98ced22f29a6f906d3259569863" - const walletMembersIDs = [1, 3, 10, 22, 5] before(async () => { await createSnapshot() @@ -571,290 +560,179 @@ describe("WalletCoordinator", () => { await restoreSnapshot() }) - context( - "when the caller is neither a coordinator nor a wallet member", - () => { - before(async () => { - await createSnapshot() + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) - bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ - ecdsaWalletID, - mainUtxoHash: HashZero, - pendingRedemptionsValue: 0, - createdAt: 0, - movingFundsRequestedAt: 0, - closingStartedAt: 0, - pendingMovedFundsSweepRequestsCount: 0, - state: walletState.Live, - movingFundsTargetWalletsCommitmentHash: HashZero, - }) + after(async () => { + await restoreSnapshot() + }) - walletRegistry.isWalletMember - .whenCalledWith( - ecdsaWalletID, - walletMembersIDs, - thirdParty.address, - 1 - ) - .returns(false) - }) + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }) - after(async () => { - bridge.wallets.reset() - walletRegistry.isWalletMember.reset() + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) - await restoreSnapshot() - }) + context("when the caller is a coordinator", () => { + before(async () => { + await createSnapshot() - it("should revert", async () => { - const tx = walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - { - walletMembersIDs, - walletMemberIndex: 1, - } - ) + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + }) - await expect(tx).to.be.revertedWith( - "Caller is neither a coordinator nor a wallet member" - ) - }) - } - ) + after(async () => { + await restoreSnapshot() + }) - context("when the caller is a coordinator or a wallet member", () => { - context("when the caller is a coordinator", () => { + context("when wallet is time-locked", () => { before(async () => { await createSnapshot() + // Submit a proposal to set a wallet time lock. await walletCoordinator - .connect(owner) - .addCoordinator(thirdParty.address) + .connect(thirdParty) + .submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }) + + // Jump to the end of the lock period but not beyond it. + await increaseTime( + (await walletCoordinator.depositSweepProposalValidity()) - 1 + ) }) after(async () => { await restoreSnapshot() }) - context("when wallet is time-locked", () => { - before(async () => { - await createSnapshot() - - // Submit a proposal to set a wallet time lock. - await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) - - // Jump to the end of the lock period but not beyond it. - await increaseTime( - (await walletCoordinator.depositSweepProposalValidity()) - 1 - ) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should revert", async () => { - await expect( - walletCoordinator.connect(thirdParty).submitDepositSweepProposal( + it("should revert", async () => { + await expect( + walletCoordinator.connect(thirdParty).submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 1, - }, - ], - sweepTxFee: 5000, + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 1, }, - emptyWalletMemberContext - ) - ).to.be.revertedWith("Wallet locked") - }) + ], + sweepTxFee: 5000, + }) + ).to.be.revertedWith("Wallet locked") }) + }) - context("when wallet is not time-locked", () => { - let tx: ContractTransaction + context("when wallet is not time-locked", () => { + let tx: ContractTransaction - before(async () => { - await createSnapshot() + before(async () => { + await createSnapshot() - // Submit a proposal to set a wallet time lock. - await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( + // Submit a proposal to set a wallet time lock. + await walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, }, - emptyWalletMemberContext - ) + ], + sweepTxFee: 5000, + }) - // Jump beyond the lock period. - await increaseTime( - await walletCoordinator.depositSweepProposalValidity() - ) + // Jump beyond the lock period. + await increaseTime( + await walletCoordinator.depositSweepProposalValidity() + ) - tx = await walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( + tx = await walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposal({ + walletPubKeyHash, + depositsKeys: [ { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 1, - }, - ], - sweepTxFee: 5000, + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 1, }, - emptyWalletMemberContext - ) - }) + ], + sweepTxFee: 5000, + }) + }) - after(async () => { - await restoreSnapshot() - }) + after(async () => { + await restoreSnapshot() + }) - it("should time lock the wallet", async () => { - const lockedUntil = - (await lastBlockTime()) + - (await walletCoordinator.depositSweepProposalValidity()) + it("should time lock the wallet", async () => { + const lockedUntil = + (await lastBlockTime()) + + (await walletCoordinator.depositSweepProposalValidity()) - const walletLock = await walletCoordinator.walletLock( - walletPubKeyHash - ) + const walletLock = await walletCoordinator.walletLock( + walletPubKeyHash + ) - expect(walletLock.expiresAt).to.be.equal(lockedUntil) - expect(walletLock.cause).to.be.equal(walletAction.DepositSweep) - }) + expect(walletLock.expiresAt).to.be.equal(lockedUntil) + expect(walletLock.cause).to.be.equal(walletAction.DepositSweep) + }) - it("should emit the DepositSweepProposalSubmitted event", async () => { - await expect(tx).to.emit( - walletCoordinator, - "DepositSweepProposalSubmitted" - ) + it("should emit the DepositSweepProposalSubmitted event", async () => { + await expect(tx).to.emit( + walletCoordinator, + "DepositSweepProposalSubmitted" + ) - // The `expect.to.emit.withArgs` assertion has troubles with - // matching complex event arguments as it uses strict equality - // underneath. To overcome that problem, we manually get event's - // arguments and check it against the expected ones using deep - // equality assertion (eql). - const receipt = await ethers.provider.getTransactionReceipt(tx.hash) - expect(receipt.logs.length).to.be.equal(1) - expect( - walletCoordinator.interface.parseLog(receipt.logs[0]).args - ).to.be.eql([ + // The `expect.to.emit.withArgs` assertion has troubles with + // matching complex event arguments as it uses strict equality + // underneath. To overcome that problem, we manually get event's + // arguments and check it against the expected ones using deep + // equality assertion (eql). + const receipt = await ethers.provider.getTransactionReceipt(tx.hash) + expect(receipt.logs.length).to.be.equal(1) + expect( + walletCoordinator.interface.parseLog(receipt.logs[0]).args + ).to.be.eql([ + [ + walletPubKeyHash, [ - walletPubKeyHash, [ - [ - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - 1, - ], + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + 1, ], - BigNumber.from(5000), ], - thirdParty.address, - ]) - }) - }) - }) - - // Here we just check that a wallet member not registered as an - // explicit coordinator can actually propose a sweep. Detailed - // assertions are already done within the previous scenario called - // `when the caller is a proposal submitter`. - context("when the caller is a wallet member", () => { - before(async () => { - await createSnapshot() - - bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ - ecdsaWalletID, - mainUtxoHash: HashZero, - pendingRedemptionsValue: 0, - createdAt: 0, - movingFundsRequestedAt: 0, - closingStartedAt: 0, - pendingMovedFundsSweepRequestsCount: 0, - state: walletState.Live, - movingFundsTargetWalletsCommitmentHash: HashZero, - }) - - walletRegistry.isWalletMember - .whenCalledWith( - ecdsaWalletID, - walletMembersIDs, - thirdParty.address, - 1 - ) - .returns(true) - }) - - after(async () => { - bridge.wallets.reset() - walletRegistry.isWalletMember.reset() - - await restoreSnapshot() - }) - - it("should succeed", async () => { - const tx = walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposal( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - { - walletMembersIDs, - walletMemberIndex: 1, - } - ) - - await expect(tx).to.not.be.reverted + BigNumber.from(5000), + ], + thirdParty.address, + ]) }) }) }) @@ -862,9 +740,6 @@ describe("WalletCoordinator", () => { describe("submitDepositSweepProposalWithReimbursement", () => { const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" - const ecdsaWalletID = - "0x4ad6b3ccbca81645865d8d0d575797a15528e98ced22f29a6f906d3259569863" - const walletMembersIDs = [1, 3, 10, 22, 5] before(async () => { await createSnapshot() @@ -876,73 +751,38 @@ describe("WalletCoordinator", () => { // Just double check that `submitDepositSweepProposalWithReimbursement` has // the same ACL as `submitDepositSweepProposal`. - context( - "when the caller is neither a coordinator nor a wallet member", - () => { - before(async () => { - await createSnapshot() - - bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ - ecdsaWalletID, - mainUtxoHash: HashZero, - pendingRedemptionsValue: 0, - createdAt: 0, - movingFundsRequestedAt: 0, - closingStartedAt: 0, - pendingMovedFundsSweepRequestsCount: 0, - state: walletState.Live, - movingFundsTargetWalletsCommitmentHash: HashZero, - }) - - walletRegistry.isWalletMember - .whenCalledWith( - ecdsaWalletID, - walletMembersIDs, - thirdParty.address, - 1 - ) - .returns(false) - }) - - after(async () => { - bridge.wallets.reset() - walletRegistry.isWalletMember.reset() + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) - await restoreSnapshot() - }) + after(async () => { + await restoreSnapshot() + }) - it("should revert", async () => { - const tx = walletCoordinator - .connect(thirdParty) - .submitDepositSweepProposalWithReimbursement( + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposalWithReimbursement({ + walletPubKeyHash, + depositsKeys: [ { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, }, - { - walletMembersIDs, - walletMemberIndex: 1, - } - ) + ], + sweepTxFee: 5000, + }) - await expect(tx).to.be.revertedWith( - "Caller is neither a coordinator nor a wallet member" - ) - }) - } - ) + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) // Here we just check that the reimbursement works. Detailed // assertions are already done within the scenario stressing the // `submitDepositSweepProposal` function. - context("when the caller is a coordinator or a wallet member", () => { + context("when the caller is a coordinator", () => { before(async () => { await createSnapshot() @@ -954,20 +794,17 @@ describe("WalletCoordinator", () => { await walletCoordinator .connect(thirdParty) - .submitDepositSweepProposalWithReimbursement( - { - walletPubKeyHash, - depositsKeys: [ - { - fundingTxHash: - "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", - fundingOutputIndex: 0, - }, - ], - sweepTxFee: 5000, - }, - emptyWalletMemberContext - ) + .submitDepositSweepProposalWithReimbursement({ + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }) }) after(async () => { From 2ccb56975529f172dfdad5aefc415649e7a2b279 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 12:46:50 +0200 Subject: [PATCH 057/198] Removed reference to EcdsaWalletRegistry from WalletCoordinator This reference is no longer needed after the authorization rule allowing wallet members to propose sweep proposals has been removed (see the previous commit). --- solidity/contracts/bridge/WalletCoordinator.sol | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 0f51a80e8..8ca9a2cb2 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -17,7 +17,6 @@ pragma solidity 0.8.17; import {BTCUtils} from "@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol"; import {BytesLib} from "@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol"; -import {IWalletRegistry as EcdsaWalletRegistry} from "@keep-network/ecdsa/contracts/api/IWalletRegistry.sol"; import "@keep-network/random-beacon/contracts/Reimbursable.sol"; import "@keep-network/random-beacon/contracts/ReimbursementPool.sol"; @@ -120,9 +119,6 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @notice Handle to the Bridge contract. Bridge public bridge; - /// @notice Handle to the WalletRegistry contract. - EcdsaWalletRegistry public walletRegistry; - /// @notice Determines the deposit sweep proposal validity time. In other /// words, this is the worst-case time for a deposit sweep during /// which the wallet is busy and cannot take another actions. This @@ -222,7 +218,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { bridge = _bridge; // Pre-fetch addresses to save gas later. - (, , walletRegistry, reimbursementPool) = _bridge.contractReferences(); + (, , , reimbursementPool) = _bridge.contractReferences(); depositSweepProposalValidity = 4 hours; depositMinAge = 2 hours; From 2b0af957342e9edd6736c69e2b6c6f9f717e2b55 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 15:51:07 +0200 Subject: [PATCH 058/198] Add Heartbeat action to WalletCoordinator With the existing, pretty computationally-expensive tECDSA signing algorithm, we would prefer not to execute heartbeats at the same time as other wallet actions (sweeping, redemptions, moving funds). Moreover, we would prefer not to execute heartbeats from multiple wallets at the same time. Such coordination is complicated off-chain for the same reason as the coordination of sweeps and redemptions. We could - as we do now - execute heartbeats at fixed hours but it does not help with coordination between heartbeats and sweeps. Also, it does not solve the problem of multiple heartbeats at the same time. For this reason, the heartbeat has been made a first-class wallet action coordinated in the on-chain contract just like the rest of wallet actions. --- .../contracts/bridge/WalletCoordinator.sol | 92 +++++- .../test/bridge/WalletCoordinator.test.ts | 280 ++++++++++++++++++ solidity/test/fixtures/index.ts | 9 +- 3 files changed, 376 insertions(+), 5 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 8ca9a2cb2..0b72adeac 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -48,6 +48,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { enum WalletAction { /// @dev The wallet does not perform any action. Idle, + /// @dev The wallet is executing heartbeat. + Heartbeat, /// @dev The wallet is handling a deposit sweep action. DepositSweep, /// @dev The wallet is handling a redemption action. @@ -119,6 +121,21 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @notice Handle to the Bridge contract. Bridge public bridge; + /// @notice Determines the wallet heartbeat request validity time. In other + /// words, this is the worst-case time for a wallet heartbeat + /// during which the wallet is busy and canot take other actions. + /// This is also the duration of the time lock applied to the wallet + /// once a new heartbeat request is submitted. + /// + /// For example, if a deposit sweep proposal was submitted at + /// 2 pm and heartbeatRequestValidity is 1 hour, the next request or + /// proposal (of any type) can be submitted after 3 pm. + uint32 public heartbeatRequestValidity; + + /// @notice Gas that is meant to balance the heartbeat request overall cost. + /// Can be updated by the owner based on the current conditions. + uint32 public heartbeatRequestGasOffset; // TODO: allow to update it + /// @notice Determines the deposit sweep proposal validity time. In other /// words, this is the worst-case time for a deposit sweep during /// which the wallet is busy and cannot take another actions. This @@ -165,7 +182,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @notice Gas that is meant to balance the deposit sweep proposal /// submission overall cost. Can be updated by the owner based on - /// the current market conditions. + /// the current conditions. uint32 public depositSweepProposalSubmissionGasOffset; event CoordinatorAdded(address indexed coordinator); @@ -174,6 +191,13 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { event WalletManuallyUnlocked(bytes20 indexed walletPubKeyHash); + event HeartbeatRequestParametersUpdated( + uint32 heartbeatRequestValidity, + uint32 heartbeatRequestGasOffset + ); + + event HeartbeatRequestSubmitted(bytes20 walletPubKeyHash, bytes message); + event DepositSweepProposalValidityUpdated( uint32 depositSweepProposalValidity ); @@ -220,6 +244,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { // Pre-fetch addresses to save gas later. (, , , reimbursementPool) = _bridge.contractReferences(); + heartbeatRequestValidity = 1 hours; // TODO: Check this value! + depositSweepProposalValidity = 4 hours; depositMinAge = 2 hours; depositRefundSafetyMargin = 24 hours; @@ -268,6 +294,23 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { emit WalletManuallyUnlocked(walletPubKeyHash); } + /// @notice Updates values related to heartbeat request. + /// @param _heartbeatRequestValidity The new value of heartbeatRequestValidity. + /// @param _heartbeatRequestGasOffset The new value of heartbeatRequestGasOffset. + function updateHeartbeatRequestParameters( + uint32 _heartbeatRequestValidity, + uint32 _heartbeatRequestGasOffset + ) external onlyOwner { + heartbeatRequestValidity = _heartbeatRequestValidity; + heartbeatRequestGasOffset = _heartbeatRequestGasOffset; + emit HeartbeatRequestParametersUpdated( + _heartbeatRequestValidity, + _heartbeatRequestGasOffset + ); + } + + // TODO: Introduce updateDepositSweepParameters to save on contract size (?) + /// @notice Updates the value of the depositSweepProposalValidity parameter. /// @param _depositSweepProposalValidity New value. /// @dev Requirements: @@ -326,6 +369,53 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { ); } + /// @notice Submits a heartbeat request from the wallet. Locks the wallet + /// for a specific time, equal to the request validity period. + /// This function validates the proposed heartbeat messge to see + /// if it matches the heartbeat format expected by the Bridge. + /// @param walletPubKeyHash 20-byte public key hash of the wallet that is + /// supposed to execute the heartbeat. + /// @param message The proposed heartbeat message for the wallet to sign. + /// @dev Requirements: + /// - The caller is a coordinator, + /// - The wallet is not time-locked, + /// - The message to sign is a valid heartbeat message. + function requestHeartbeat(bytes20 walletPubKeyHash, bytes calldata message) + public + onlyCoordinator + onlyAfterWalletLock(walletPubKeyHash) + { + require( + Heartbeat.isValidHeartbeatMessage(message), + "Not a valid heartbeat message" + ); + + walletLock[walletPubKeyHash] = WalletLock( + /* solhint-disable-next-line not-rely-on-time */ + uint32(block.timestamp) + heartbeatRequestValidity, + WalletAction.Heartbeat + ); + + emit HeartbeatRequestSubmitted(walletPubKeyHash, message); + } + + /// @notice Wraps `requestHeartbeat` call and reimburses the caller's + /// transaction cost. + /// @dev See `requestHeartbeat` function documentation. + function requestHeartbeatWithReimbursement( + bytes20 walletPubKeyHash, + bytes calldata message + ) external { + uint256 gasStart = gasleft(); + + requestHeartbeat(walletPubKeyHash, message); + + reimbursementPool.refund( + (gasStart - gasleft()) + heartbeatRequestGasOffset, + msg.sender + ); + } + /// @notice Submits a deposit sweep proposal. Locks the target wallet /// for a specific time, equal to the proposal validity period. /// This function does not store the proposal in the state but diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 977a3bcec..0745cf669 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -269,6 +269,57 @@ describe("WalletCoordinator", () => { }) }) + describe("updateHeartbeatRequestParameters", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when called by a third party", () => { + it("should revert", async () => { + await expect( + walletCoordinator + .connect(thirdParty) + .updateHeartbeatRequestParameters(3600, 1000) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("when called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + tx = await walletCoordinator + .connect(owner) + .updateHeartbeatRequestParameters(125, 126) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should update heartbeat parameters", async () => { + expect(await walletCoordinator.heartbeatRequestValidity()).to.be.equal( + 125 + ) + expect(await walletCoordinator.heartbeatRequestGasOffset()).to.be.equal( + 126 + ) + }) + + it("should emit the HeartbeatRequestParametersUpdated event", async () => { + await expect(tx) + .to.emit(walletCoordinator, "HeartbeatRequestParametersUpdated") + .withArgs(125, 126) + }) + }) + }) + describe("updateDepositSweepProposalValidity", () => { before(async () => { await createSnapshot() @@ -549,6 +600,235 @@ describe("WalletCoordinator", () => { }) }) + describe("requestHeartbeat", () => { + const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" + + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) + + context("when the caller is a coordinator", () => { + before(async () => { + await createSnapshot() + + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when the wallet is time-locked", () => { + before(async () => { + await createSnapshot() + + // Submit a request to set a wallet time lock. + await walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + + // Jump to the end of the lock period but not beyond it. + await increaseTime( + (await walletCoordinator.heartbeatRequestValidity()) - 1 + ) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + await expect( + walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + ).to.be.revertedWith("Wallet locked") + }) + }) + + context("when the wallet is not time-locked", () => { + before(async () => { + await createSnapshot() + + await walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + + // Jump beyond the lock period. + await increaseTime(await walletCoordinator.heartbeatRequestValidity()) + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when the message is not a valid heartbeat", () => { + it("should revert", async () => { + await expect( + walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xff000000000000000000000000000000" + ) + ).to.be.revertedWith("Not a valid heartbeat message") + }) + }) + + context("when the message is a valid heartbeat", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + tx = await walletCoordinator + .connect(thirdParty) + .requestHeartbeat( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should time lock the wallet", async () => { + const lockedUntil = + (await lastBlockTime()) + + (await walletCoordinator.heartbeatRequestValidity()) + + const walletLock = await walletCoordinator.walletLock( + walletPubKeyHash + ) + + expect(walletLock.expiresAt).to.be.equal(lockedUntil) + expect(walletLock.cause).to.be.equal(walletAction.Heartbeat) + }) + + it("should emit the HeartbeatRequestSubmitted event", async () => { + await expect(tx) + .to.emit(walletCoordinator, "HeartbeatRequestSubmitted") + .withArgs(walletPubKeyHash, "0xffffffffffffffff1111111111111111") + }) + }) + }) + }) + }) + + describe("requestHeartbeatWithReimbursement", () => { + const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" + + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + // Just double check that `requestHeartbeatWithReimbursement` has + // the same ACL as `requestHeartbeat`. + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .requestHeartbeatWithReimbursement( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) + + // Here we just check that the reimbursement works. Detailed + // assertions are already done within the scenario stressing the + // `requestHeartbeat` function. + context("when the caller is a coordinator", () => { + before(async () => { + await createSnapshot() + + reimbursementPool.refund.returns() + + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + + await walletCoordinator + .connect(thirdParty) + .requestHeartbeatWithReimbursement( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + }) + + after(async () => { + reimbursementPool.refund.reset() + + await restoreSnapshot() + }) + + it("should do the refund", async () => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(reimbursementPool.refund).to.have.been.calledOnce + + expect(reimbursementPool.refund.getCall(0).args[0]).to.be.closeTo( + BigNumber.from(31000), + 1000 + ) + + expect(reimbursementPool.refund.getCall(0).args[1]).to.be.equal( + thirdParty.address + ) + }) + }) + }) + describe("submitDepositSweepProposal", () => { const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" diff --git a/solidity/test/fixtures/index.ts b/solidity/test/fixtures/index.ts index d5a67c57a..21f35eed5 100644 --- a/solidity/test/fixtures/index.ts +++ b/solidity/test/fixtures/index.ts @@ -50,10 +50,11 @@ export const walletState = { export const walletAction = { Idle: 0, - DepositSweep: 1, - Redemption: 2, - MovingFunds: 3, - MovedFundsSweep: 4, + Heartbeat: 1, + DepositSweep: 2, + Redemption: 3, + MovingFunds: 4, + MovedFundsSweep: 5, } export const ecdsaDkgState = { From 3765875707a01c7902f67a4e5af1fc8454dab497 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 16:20:08 +0200 Subject: [PATCH 059/198] Aggregate deposit sweep proposal update parameter functions into one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This approach allows to reduce the contract size a bit: 13.789 to 13.489 and makes the contract future-proof for numerous future move funds and redemption parameters. If we were updating parameters in separate functions, we'd probably stumble upon contract size problems in the future. Aggregating deposit sweep parameter update functions into one could be problematic given the `*Updated` events already potentially emitted.  --- .../contracts/bridge/WalletCoordinator.sol | 91 +++----- .../test/bridge/WalletCoordinator.test.ts | 201 ++---------------- 2 files changed, 40 insertions(+), 252 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 0b72adeac..0e5a28e3f 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -134,7 +134,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @notice Gas that is meant to balance the heartbeat request overall cost. /// Can be updated by the owner based on the current conditions. - uint32 public heartbeatRequestGasOffset; // TODO: allow to update it + uint32 public heartbeatRequestGasOffset; /// @notice Determines the deposit sweep proposal validity time. In other /// words, this is the worst-case time for a deposit sweep during @@ -198,17 +198,11 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { event HeartbeatRequestSubmitted(bytes20 walletPubKeyHash, bytes message); - event DepositSweepProposalValidityUpdated( - uint32 depositSweepProposalValidity - ); - - event DepositMinAgeUpdated(uint32 depositMinAge); - - event DepositRefundSafetyMarginUpdated(uint32 depositRefundSafetyMargin); - - event DepositSweepMaxSizeUpdated(uint16 depositSweepMaxSize); - - event DepositSweepProposalSubmissionGasOffsetUpdated( + event DepositSweepProposalParametersUpdated( + uint32 depositSweepProposalValidity, + uint32 depositMinAge, + uint32 depositRefundSafetyMargin, + uint16 depositSweepMaxSize, uint32 depositSweepProposalSubmissionGasOffset ); @@ -219,7 +213,6 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { modifier onlyCoordinator() { require(isCoordinator[msg.sender], "Caller is not a coordinator"); - _; } @@ -294,9 +287,11 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { emit WalletManuallyUnlocked(walletPubKeyHash); } - /// @notice Updates values related to heartbeat request. - /// @param _heartbeatRequestValidity The new value of heartbeatRequestValidity. - /// @param _heartbeatRequestGasOffset The new value of heartbeatRequestGasOffset. + /// @notice Updates parameters related to heartbeat request. + /// @param _heartbeatRequestValidity The new value of `heartbeatRequestValidity`. + /// @param _heartbeatRequestGasOffset The new value of `heartbeatRequestGasOffset`. + /// @dev Requirements: + /// - The caller must be the owner. function updateHeartbeatRequestParameters( uint32 _heartbeatRequestValidity, uint32 _heartbeatRequestGasOffset @@ -309,62 +304,32 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { ); } - // TODO: Introduce updateDepositSweepParameters to save on contract size (?) + /// @notice Updates parameters related to deposit sweep proposal. + /// @param _depositSweepProposalValidity The new value of `depositSweepProposalValidity`. + /// @param _depositMinAge The new value of `depositMinAge`. + /// @param _depositRefundSafetyMargin The new value of `depositRefundSafetyMargin`. + /// @param _depositSweepMaxSize The new value of `depositSweepMaxSize`. - /// @notice Updates the value of the depositSweepProposalValidity parameter. - /// @param _depositSweepProposalValidity New value. /// @dev Requirements: /// - The caller must be the owner. - function updateDepositSweepProposalValidity( - uint32 _depositSweepProposalValidity + function updateDepositSweepProposalParameters( + uint32 _depositSweepProposalValidity, + uint32 _depositMinAge, + uint32 _depositRefundSafetyMargin, + uint16 _depositSweepMaxSize, + uint32 _depositSweepProposalSubmissionGasOffset ) external onlyOwner { depositSweepProposalValidity = _depositSweepProposalValidity; - emit DepositSweepProposalValidityUpdated(_depositSweepProposalValidity); - } - - /// @notice Updates the value of the depositMinAge parameter. - /// @param _depositMinAge New value. - /// @dev Requirements: - /// - The caller must be the owner. - function updateDepositMinAge(uint32 _depositMinAge) external onlyOwner { depositMinAge = _depositMinAge; - emit DepositMinAgeUpdated(_depositMinAge); - } - - /// @notice Updates the value of the depositRefundSafetyMargin parameter. - /// @param _depositRefundSafetyMargin New value. - /// @dev Requirements: - /// - The caller must be the owner. - function updateDepositRefundSafetyMargin(uint32 _depositRefundSafetyMargin) - external - onlyOwner - { depositRefundSafetyMargin = _depositRefundSafetyMargin; - emit DepositRefundSafetyMarginUpdated(_depositRefundSafetyMargin); - } - - /// @notice Updates the value of the depositSweepMaxSize parameter. - /// @param _depositSweepMaxSize New value. - /// @dev Requirements: - /// - The caller must be the owner. - function updateDepositSweepMaxSize(uint16 _depositSweepMaxSize) - external - onlyOwner - { depositSweepMaxSize = _depositSweepMaxSize; - emit DepositSweepMaxSizeUpdated(_depositSweepMaxSize); - } - - /// @notice Updates the value of the depositSweepProposalSubmissionGasOffset - /// parameter. - /// @param _depositSweepProposalSubmissionGasOffset New value. - /// @dev Requirements: - /// - The caller must be the owner. - function updateDepositSweepProposalSubmissionGasOffset( - uint32 _depositSweepProposalSubmissionGasOffset - ) external onlyOwner { depositSweepProposalSubmissionGasOffset = _depositSweepProposalSubmissionGasOffset; - emit DepositSweepProposalSubmissionGasOffsetUpdated( + + emit DepositSweepProposalParametersUpdated( + _depositSweepProposalValidity, + _depositMinAge, + _depositRefundSafetyMargin, + _depositSweepMaxSize, _depositSweepProposalSubmissionGasOffset ); } diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 0745cf669..bc4bae8bf 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -320,7 +320,7 @@ describe("WalletCoordinator", () => { }) }) - describe("updateDepositSweepProposalValidity", () => { + describe("updateDepositSweepProposalParameters", () => { before(async () => { await createSnapshot() }) @@ -334,7 +334,7 @@ describe("WalletCoordinator", () => { await expect( walletCoordinator .connect(thirdParty) - .updateDepositSweepProposalValidity(120) + .updateDepositSweepProposalParameters(101, 102, 103, 104, 105) ).to.be.revertedWith("Ownable: caller is not the owner") }) }) @@ -347,208 +347,31 @@ describe("WalletCoordinator", () => { tx = await walletCoordinator .connect(owner) - .updateDepositSweepProposalValidity(120) + .updateDepositSweepProposalParameters(101, 102, 103, 104, 105) }) after(async () => { await restoreSnapshot() }) - it("should update the parameter", async () => { + it("should update deposit sweep proposal parameters", async () => { expect( await walletCoordinator.depositSweepProposalValidity() - ).to.be.equal(120) - }) - - it("should emit the DepositSweepProposalValidityUpdated event", async () => { - await expect(tx) - .to.emit(walletCoordinator, "DepositSweepProposalValidityUpdated") - .withArgs(120) - }) - }) - }) - - describe("updateDepositMinAge", () => { - before(async () => { - await createSnapshot() - }) - - after(async () => { - await restoreSnapshot() - }) - - context("when called by a third party", () => { - it("should revert", async () => { - await expect( - walletCoordinator.connect(thirdParty).updateDepositMinAge(140) - ).to.be.revertedWith("Ownable: caller is not the owner") - }) - }) - - context("when called by the owner", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() - - tx = await walletCoordinator.connect(owner).updateDepositMinAge(140) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should update the parameter", async () => { - expect(await walletCoordinator.depositMinAge()).to.be.equal(140) - }) - - it("should emit the DepositMinAgeUpdated event", async () => { - await expect(tx) - .to.emit(walletCoordinator, "DepositMinAgeUpdated") - .withArgs(140) - }) - }) - }) - - describe("updateDepositRefundSafetyMargin", () => { - before(async () => { - await createSnapshot() - }) - - after(async () => { - await restoreSnapshot() - }) - - context("when called by a third party", () => { - it("should revert", async () => { - await expect( - walletCoordinator - .connect(thirdParty) - .updateDepositRefundSafetyMargin(160) - ).to.be.revertedWith("Ownable: caller is not the owner") - }) - }) - - context("when called by the owner", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() - - tx = await walletCoordinator - .connect(owner) - .updateDepositRefundSafetyMargin(160) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should update the parameter", async () => { + ).to.be.equal(101) + expect(await walletCoordinator.depositMinAge()).to.be.equal(102) expect(await walletCoordinator.depositRefundSafetyMargin()).to.be.equal( - 160 + 103 ) - }) - - it("should emit the DepositRefundSafetyMarginUpdated event", async () => { - await expect(tx) - .to.emit(walletCoordinator, "DepositRefundSafetyMarginUpdated") - .withArgs(160) - }) - }) - }) - - describe("updateDepositSweepMaxSize", () => { - before(async () => { - await createSnapshot() - }) - - after(async () => { - await restoreSnapshot() - }) - - context("when called by a third party", () => { - it("should revert", async () => { - await expect( - walletCoordinator.connect(thirdParty).updateDepositSweepMaxSize(15) - ).to.be.revertedWith("Ownable: caller is not the owner") - }) - }) - - context("when called by the owner", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() - - tx = await walletCoordinator - .connect(owner) - .updateDepositSweepMaxSize(15) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should update the parameter", async () => { - expect(await walletCoordinator.depositSweepMaxSize()).to.be.equal(15) - }) - - it("should emit the DepositSweepMaxSizeUpdated event", async () => { - await expect(tx) - .to.emit(walletCoordinator, "DepositSweepMaxSizeUpdated") - .withArgs(15) - }) - }) - }) - - describe("updateDepositSweepProposalSubmissionGasOffset", () => { - before(async () => { - await createSnapshot() - }) - - after(async () => { - await restoreSnapshot() - }) - - context("when called by a third party", () => { - it("should revert", async () => { - await expect( - walletCoordinator - .connect(thirdParty) - .updateDepositSweepProposalSubmissionGasOffset(1000000) - ).to.be.revertedWith("Ownable: caller is not the owner") - }) - }) - - context("when called by the owner", () => { - let tx: ContractTransaction - - before(async () => { - await createSnapshot() - - tx = await walletCoordinator - .connect(owner) - .updateDepositSweepProposalSubmissionGasOffset(1000000) - }) - - after(async () => { - await restoreSnapshot() - }) - - it("should update the parameter", async () => { + expect(await walletCoordinator.depositSweepMaxSize()).to.be.equal(104) expect( await walletCoordinator.depositSweepProposalSubmissionGasOffset() - ).to.be.equal(1000000) + ).to.be.equal(105) }) - it("should emit the DepositSweepProposalSubmissionGasOffsetUpdated event", async () => { + it("should emit the DepositSweepProposalParametersUpdated event", async () => { await expect(tx) - .to.emit( - walletCoordinator, - "DepositSweepProposalSubmissionGasOffsetUpdated" - ) - .withArgs(1000000) + .to.emit(walletCoordinator, "DepositSweepProposalParametersUpdated") + .withArgs(101, 102, 103, 104, 105) }) }) }) From ee3d5d76cb60cfaaedd229ebe00100a1b2d9fdb5 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Tue, 25 Apr 2023 16:21:41 +0200 Subject: [PATCH 060/198] TypeScript: Start version 1.3.0-dev We released version 1.2.0, so need to start a next one for development. --- typescript/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/package.json b/typescript/package.json index ea49a4a19..94094e38c 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2.ts", - "version": "1.2.0-dev", + "version": "1.3.0-dev", "license": "MIT", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", From db8c8889034acfc2c9dee3c65ec71207284a7715 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 18:57:12 +0200 Subject: [PATCH 061/198] Reworked WalletCoordinator unit tests to work with ReimbursementPool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change allows to fine-tune the gas offset parameters. The previous ones were not very accurate it seems. The other problem was that we did not take into consideration that the first call will always cost more given that the contract fields have to be set to non-default values. --- .../contracts/bridge/WalletCoordinator.sol | 4 +- .../test/bridge/WalletCoordinator.test.ts | 121 ++++++++++++------ 2 files changed, 83 insertions(+), 42 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 0e5a28e3f..1a15b8caa 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -238,12 +238,13 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { (, , , reimbursementPool) = _bridge.contractReferences(); heartbeatRequestValidity = 1 hours; // TODO: Check this value! + heartbeatRequestGasOffset = 5_000; depositSweepProposalValidity = 4 hours; depositMinAge = 2 hours; depositRefundSafetyMargin = 24 hours; depositSweepMaxSize = 5; - depositSweepProposalSubmissionGasOffset = 25000; + depositSweepProposalSubmissionGasOffset = 5_000; } /// @notice Adds the given address to the set of coordinator addresses. @@ -309,7 +310,6 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @param _depositMinAge The new value of `depositMinAge`. /// @param _depositRefundSafetyMargin The new value of `depositRefundSafetyMargin`. /// @param _depositSweepMaxSize The new value of `depositSweepMaxSize`. - /// @dev Requirements: /// - The caller must be the owner. function updateDepositSweepProposalParameters( diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index bc4bae8bf..d6cf43ae9 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -1,5 +1,5 @@ import crypto from "crypto" -import { ethers, helpers } from "hardhat" +import { ethers, helpers, waffle } from "hardhat" import chai, { expect } from "chai" import { FakeContract, smock } from "@defi-wonderland/smock" import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers" @@ -14,6 +14,7 @@ import { walletAction, walletState } from "../fixtures" chai.use(smock.matchers) +const { provider } = waffle const { lastBlockTime, increaseTime } = helpers.time const { createSnapshot, restoreSnapshot } = helpers.snapshot const { AddressZero, HashZero } = ethers.constants @@ -40,33 +41,50 @@ describe("WalletCoordinator", () => { let walletRegistry: FakeContract let bridge: FakeContract - let reimbursementPool: FakeContract + let reimbursementPool: ReimbursementPool let walletCoordinator: WalletCoordinator before(async () => { + const { deployer } = await helpers.signers.getNamedSigners() // eslint-disable-next-line @typescript-eslint/no-extra-semi ;[owner, thirdParty] = await helpers.signers.getUnnamedSigners() walletRegistry = await smock.fake("IWalletRegistry") - reimbursementPool = await smock.fake("ReimbursementPool") - bridge = await smock.fake("Bridge") + const ReimbursementPool = await ethers.getContractFactory( + "ReimbursementPool" + ) + // Using the same parameter values as currently on mainnet + reimbursementPool = await ReimbursementPool.connect(deployer).deploy( + 40_800, + 500_000_000_000 + ) + + const WalletCoordinator = await ethers.getContractFactory( + "WalletCoordinator" + ) + walletCoordinator = await WalletCoordinator.connect(deployer).deploy() + bridge.contractReferences.returns([ AddressZero, AddressZero, walletRegistry.address, reimbursementPool.address, ]) + await walletCoordinator.connect(deployer).initialize(bridge.address) - const WalletCoordinator = await ethers.getContractFactory( - "WalletCoordinator" - ) - - walletCoordinator = await WalletCoordinator.deploy() + await reimbursementPool + .connect(deployer) + .authorize(walletCoordinator.address) + await walletCoordinator.connect(deployer).transferOwnership(owner.address) - await walletCoordinator.initialize(bridge.address) + // Fund the ReimbursementPool + await deployer.sendTransaction({ + to: reimbursementPool.address, + value: ethers.utils.parseEther("10"), + }) }) describe("addCoordinator", () => { @@ -613,41 +631,48 @@ describe("WalletCoordinator", () => { // assertions are already done within the scenario stressing the // `requestHeartbeat` function. context("when the caller is a coordinator", () => { + let coordinatorBalanceBefore: BigNumber + let coordinatorBalanceAfter: BigNumber + before(async () => { await createSnapshot() - reimbursementPool.refund.returns() - await walletCoordinator .connect(owner) .addCoordinator(thirdParty.address) + // The first-ever heartbeat request will be more expensive given it has + // to set fields to non-zero values. We shouldn't adjust gas offset + // based on it. await walletCoordinator .connect(thirdParty) .requestHeartbeatWithReimbursement( walletPubKeyHash, "0xffffffffffffffff1111111111111111" ) + // Jump beyond the lock period. + await increaseTime(await walletCoordinator.heartbeatRequestValidity()) + + coordinatorBalanceBefore = await provider.getBalance(thirdParty.address) + + await walletCoordinator + .connect(thirdParty) + .requestHeartbeatWithReimbursement( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111" + ) + + coordinatorBalanceAfter = await provider.getBalance(thirdParty.address) }) after(async () => { - reimbursementPool.refund.reset() - await restoreSnapshot() }) it("should do the refund", async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(reimbursementPool.refund).to.have.been.calledOnce - - expect(reimbursementPool.refund.getCall(0).args[0]).to.be.closeTo( - BigNumber.from(31000), - 1000 - ) - - expect(reimbursementPool.refund.getCall(0).args[1]).to.be.equal( - thirdParty.address - ) + const diff = coordinatorBalanceAfter.sub(coordinatorBalanceBefore) + expect(diff).to.be.gt(0) + expect(diff).to.be.lt(ethers.utils.parseUnits("1000000", "gwei")) // 0,001 ETH }) }) }) @@ -886,15 +911,39 @@ describe("WalletCoordinator", () => { // assertions are already done within the scenario stressing the // `submitDepositSweepProposal` function. context("when the caller is a coordinator", () => { + let coordinatorBalanceBefore: BigNumber + let coordinatorBalanceAfter: BigNumber + before(async () => { await createSnapshot() - reimbursementPool.refund.returns() - await walletCoordinator .connect(owner) .addCoordinator(thirdParty.address) + // The first-ever proposal will be more expensive given it has to set + // fields to non-zero values. We shouldn't adjust gas offset based on it. + await walletCoordinator + .connect(thirdParty) + .submitDepositSweepProposalWithReimbursement({ + walletPubKeyHash, + depositsKeys: [ + { + fundingTxHash: + "0x51f373dcbb6122bcb1c62964b5f3be923092dc64bc9e31257931d58c4eadb9f5", + fundingOutputIndex: 0, + }, + ], + sweepTxFee: 5000, + }) + + // Jump beyond the lock period. + await increaseTime( + await walletCoordinator.depositSweepProposalValidity() + ) + + coordinatorBalanceBefore = await provider.getBalance(thirdParty.address) + await walletCoordinator .connect(thirdParty) .submitDepositSweepProposalWithReimbursement({ @@ -908,26 +957,18 @@ describe("WalletCoordinator", () => { ], sweepTxFee: 5000, }) + + coordinatorBalanceAfter = await provider.getBalance(thirdParty.address) }) after(async () => { - reimbursementPool.refund.reset() - await restoreSnapshot() }) it("should do the refund", async () => { - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(reimbursementPool.refund).to.have.been.calledOnce - - expect(reimbursementPool.refund.getCall(0).args[0]).to.be.closeTo( - BigNumber.from(60000), - 1000 - ) - - expect(reimbursementPool.refund.getCall(0).args[1]).to.be.equal( - thirdParty.address - ) + const diff = coordinatorBalanceAfter.sub(coordinatorBalanceBefore) + expect(diff).to.be.gt(0) + expect(diff).to.be.lt(ethers.utils.parseUnits("1000000", "gwei")) // 0,001 ETH }) }) }) From af533858d6e968b797d81cf77400c7c270a6ea5d Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 25 Apr 2023 19:04:39 +0200 Subject: [PATCH 062/198] Removed a TODO to inspect 1 hour heartbeatRequestValidity According to the Go client code, the signingAttemptMaximumBlocks() is 1+5+30+5 and there are 2 signingBatchInterludeBlocks. signingAttemptsLimit is set to 5. Given the heartbeat should sign a single message, the maximum time it may take assuming 12s block time is 5*(1+5+30+5+2)*12s/60s = 40min. --- solidity/contracts/bridge/WalletCoordinator.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 1a15b8caa..c9f3847b9 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -237,7 +237,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { // Pre-fetch addresses to save gas later. (, , , reimbursementPool) = _bridge.contractReferences(); - heartbeatRequestValidity = 1 hours; // TODO: Check this value! + heartbeatRequestValidity = 1 hours; heartbeatRequestGasOffset = 5_000; depositSweepProposalValidity = 4 hours; From 8bf75c3d246ab2a10136e2821fdac07724544fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 26 Apr 2023 10:56:06 +0200 Subject: [PATCH 063/198] Run tests weekly We're decreasing frequency of running the tests (we do not develop contracts as actively as we used to so running them every 24h is too aggressive, especially that the tests use testnet funds). From now on we will run tests weekly (every Sunday at 0:00). We can still trigger the tests manually if needed. --- .github/workflows/system-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index 1c4176b86..eb158f401 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -2,7 +2,7 @@ name: System tests on: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * 0" #weekly, at 00:00 on Sunday workflow_dispatch: jobs: From 66f46076e7f708d0e40d903dc95e5bb07d5dd560 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 26 Apr 2023 16:18:08 +0200 Subject: [PATCH 064/198] Added coordinator's address to HeartbeatRequestSubmitted We missed the coordinator's address in HeartbeatRequestSubmittedEvent emitted by the WalletCoordinator contract. Adding it now. It is important to be able to track easily which coordinator posted the given proposal in case it did not meet the expectations/needs. --- solidity/contracts/bridge/WalletCoordinator.sol | 8 ++++++-- solidity/test/bridge/WalletCoordinator.test.ts | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index c9f3847b9..7872f84b9 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -196,7 +196,11 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { uint32 heartbeatRequestGasOffset ); - event HeartbeatRequestSubmitted(bytes20 walletPubKeyHash, bytes message); + event HeartbeatRequestSubmitted( + bytes20 walletPubKeyHash, + bytes message, + address indexed coordinator + ); event DepositSweepProposalParametersUpdated( uint32 depositSweepProposalValidity, @@ -361,7 +365,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { WalletAction.Heartbeat ); - emit HeartbeatRequestSubmitted(walletPubKeyHash, message); + emit HeartbeatRequestSubmitted(walletPubKeyHash, message, msg.sender); } /// @notice Wraps `requestHeartbeat` call and reimburses the caller's diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index d6cf43ae9..67d8aae39 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -586,7 +586,11 @@ describe("WalletCoordinator", () => { it("should emit the HeartbeatRequestSubmitted event", async () => { await expect(tx) .to.emit(walletCoordinator, "HeartbeatRequestSubmitted") - .withArgs(walletPubKeyHash, "0xffffffffffffffff1111111111111111") + .withArgs( + walletPubKeyHash, + "0xffffffffffffffff1111111111111111", + thirdParty.address + ) }) }) }) From 15f71186c43223ee564cb3d121269ba12c7c67fe Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 28 Apr 2023 15:13:52 +0200 Subject: [PATCH 065/198] Making a system test wait a little before a bitcoin client calls Multiple runs of system tests showed that it happens from time to time that a bitcoin client doesn't "sync" instantly with the bitcoin chain after an event happens, e.g. deposit. It might not retrieve requested data right after the call. This commit make a system test wait at the begging of a transaction confirmation instead of at the end, which gives some time for a bitcoin client to "sync" in the background. --- system-tests/test/utils/bitcoin.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system-tests/test/utils/bitcoin.ts b/system-tests/test/utils/bitcoin.ts index 62670f6ed..d052eddb7 100644 --- a/system-tests/test/utils/bitcoin.ts +++ b/system-tests/test/utils/bitcoin.ts @@ -80,6 +80,9 @@ export async function waitTransactionConfirmed( sleep = 60000 ): Promise { for (;;) { + // eslint-disable-next-line no-await-in-loop + await new Promise((r) => setTimeout(r, sleep)) + console.log(` Checking confirmations count for transaction ${transactionHash} `) @@ -99,9 +102,6 @@ export async function waitTransactionConfirmed( console.log(` Transaction ${transactionHash} has only ${confirmations}/${requiredConfirmations} confirmations. Waiting for more... `) - - // eslint-disable-next-line no-await-in-loop - await new Promise((r) => setTimeout(r, sleep)) } } From 58a7e5600ac81dcf18d955482a809750b8398a98 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 28 Apr 2023 15:19:35 +0200 Subject: [PATCH 066/198] Changing a backoff retrier for the system tests withBackoffRetrier implementation will try to call a bitcoin client again in case of the thrown error. A lot of times it happens that there is no error in response, but rather no data is returned. This commit hanlde this case as well and fixes the system tests, which were failing for this reason. --- typescript/src/electrum.ts | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/typescript/src/electrum.ts b/typescript/src/electrum.ts index a43993209..db1f543fb 100644 --- a/typescript/src/electrum.ts +++ b/typescript/src/electrum.ts @@ -374,13 +374,25 @@ export class Client implements BitcoinClient { height: number } - const scriptHashHistory: HistoryEntry[] = await this.withBackoffRetrier< - HistoryEntry[] - >()(async () => { - return await electrum.blockchain_scripthash_getHistory( - scriptHash.reverse().toString("hex") - ) - }) + let scriptHashHistory: HistoryEntry[] = [] + for (let attempt = 0; attempt < this.totalRetryAttempts; attempt++) { + try { + scriptHashHistory = await electrum.blockchain_scripthash_getHistory( + scriptHash.reverse().toString("hex") + ) + if (scriptHashHistory.length != 0) { + break + } + } catch { + // Handle the case when a bitcoin client throws an error and should retry + const waitMillis = this.waitBackoff(attempt) + await new Promise((r) => setTimeout(r, waitMillis)) + continue + } + // Handle the case when a bitcoin client returns nothing and should retry + const waitMillis = this.waitBackoff(attempt) + await new Promise((r) => setTimeout(r, waitMillis)) + } const tx = scriptHashHistory.find( (t) => t.tx_hash === transactionHash.toString() @@ -432,6 +444,12 @@ export class Client implements BitcoinClient { }) } + waitBackoff(attempt: number): number { + const backoffMillis = Math.pow(2, attempt) * 1000 + const jitterMillis = Math.floor(Math.random() * 100) + return backoffMillis + jitterMillis + } + // eslint-disable-next-line valid-jsdoc /** * @see {BitcoinClient#getHeadersChain} From 24c9b6553ed0c313ca35ea43250a06ca7676d248 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 28 Apr 2023 15:33:06 +0200 Subject: [PATCH 067/198] Adding 'clean' task to hardhat system tests --- system-tests/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/system-tests/package.json b/system-tests/package.json index 87424bbaa..01436b1b7 100644 --- a/system-tests/package.json +++ b/system-tests/package.json @@ -3,6 +3,7 @@ "version": "1.0.0-dev", "license": "MIT", "scripts": { + "clean": "hardhat clean && rm -rf cache/", "format": "npm run lint", "format:fix": "npm run lint:fix", "lint": "npm run lint:eslint && npm run lint:config", From 91b757b950f95cb4ce9697a23f43723169d71d39 Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Tue, 2 May 2023 15:07:44 -0400 Subject: [PATCH 068/198] use human readable outputs in deposits --- monitoring/src/deposit-monitor.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 248720c22..0ce0a7583 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -7,16 +7,18 @@ import type { SystemEvent, Monitor as SystemEventMonitor } from "./system-event" import type { DepositRevealedEvent as DepositRevealedChainEvent } from "@keep-network/tbtc-v2.ts/dist/src/deposit" import type { Bridge } from "@keep-network/tbtc-v2.ts/dist/src/chain" +const SATS_PER_BTC = 1e8 + const DepositRevealed = ( chainEvent: DepositRevealedChainEvent ): SystemEvent => ({ - title: "Deposit revealed", + title: "Deposit Revealed", type: SystemEventType.Informational, data: { - btcFundingTxHash: chainEvent.fundingTxHash.toString(), + btcFundingTxHash: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountSat: chainEvent.amount.toString(), - ethRevealTxHash: chainEvent.transactionHash.toPrefixedString(), + amountBTC: (chainEvent.amount / SATS_PER_BTC).toFixed(2), + ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, }, block: chainEvent.blockNumber, }) @@ -24,12 +26,13 @@ const DepositRevealed = ( const LargeDepositRevealed = ( chainEvent: DepositRevealedChainEvent ): SystemEvent => ({ - title: "Large deposit revealed", + title: "Large Deposit Revealed", type: SystemEventType.Warning, data: { - btcFundingTxHash: chainEvent.fundingTxHash.toString(), + btcFundingTx: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountSat: chainEvent.amount.toString(), + amountBTC: (chainEvent.amount / SATS_PER_BTC).toFixed(2), + ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, ethRevealTxHash: chainEvent.transactionHash.toPrefixedString(), }, block: chainEvent.blockNumber, From 5c20a3e7427c00975325bfce925bfc0e9282e7bc Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Tue, 2 May 2023 15:26:59 -0400 Subject: [PATCH 069/198] Handle BigNumbers properly --- monitoring/src/deposit-monitor.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 0ce0a7583..0769b7069 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -7,7 +7,9 @@ import type { SystemEvent, Monitor as SystemEventMonitor } from "./system-event" import type { DepositRevealedEvent as DepositRevealedChainEvent } from "@keep-network/tbtc-v2.ts/dist/src/deposit" import type { Bridge } from "@keep-network/tbtc-v2.ts/dist/src/chain" -const SATS_PER_BTC = 1e8 +function satsToRoundedBTC(sats: BigNumber): string { + return (sats.div(BigNumber.from(1e6)).toNumber() / 100).toFixed(2) +} const DepositRevealed = ( chainEvent: DepositRevealedChainEvent @@ -17,7 +19,7 @@ const DepositRevealed = ( data: { btcFundingTxHash: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountBTC: (chainEvent.amount / SATS_PER_BTC).toFixed(2), + amountBTC: satsToRoundedBTC(chainEvent.amount), ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, }, block: chainEvent.blockNumber, @@ -31,9 +33,8 @@ const LargeDepositRevealed = ( data: { btcFundingTx: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountBTC: (chainEvent.amount / SATS_PER_BTC).toFixed(2), + amountBTC: satsToRoundedBTC(chainEvent.amount), ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, - ethRevealTxHash: chainEvent.transactionHash.toPrefixedString(), }, block: chainEvent.blockNumber, }) From a1b07bc61c6797137514f5d7406d399191ca2336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 3 May 2023 13:51:05 +0200 Subject: [PATCH 070/198] Update destination branch input's name We decided to push the docs updates not directly to branch synched with GitBook, but create a PR and set a GitBook-synched branch as a base branch for that PR. This resulted in changes in the `keep-network/ci/.github/workflows/reusable-solidity-docs.yml` workflow's inputs. --- .github/workflows/contracts-docs.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index a065d11dc..ceff6bcad 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -57,8 +57,8 @@ jobs: # `refs/tags/solidity/`. It will generate contracts documentation in # Markdown and sync it with a specific path of # `threshold-network/threshold` repository. If changes will be detected, - # the destination repository will be updated. The commit pushing the - # changes will be verified using GPG key. + # a PR updating the docs will be created in the destination repository. The + # commit pushing the changes will be verified using GPG key. contracts-docs-publish: name: Publish contracts documentation needs: docs-detect-changes @@ -77,7 +77,7 @@ jobs: verifyCommits: true destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api - destinationBranch: main + destinationBaseBranch: main userEmail: valkyrie@thesis.co userName: Valkyrie secrets: From e06fccd37c90eb341aade13675d8e763c88aff22 Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Wed, 3 May 2023 10:19:35 -0400 Subject: [PATCH 071/198] Revert to the original deposit event titles --- monitoring/src/deposit-monitor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 0769b7069..835e6153b 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -14,7 +14,7 @@ function satsToRoundedBTC(sats: BigNumber): string { const DepositRevealed = ( chainEvent: DepositRevealedChainEvent ): SystemEvent => ({ - title: "Deposit Revealed", + title: "Deposit revealed", type: SystemEventType.Informational, data: { btcFundingTxHash: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, @@ -28,7 +28,7 @@ const DepositRevealed = ( const LargeDepositRevealed = ( chainEvent: DepositRevealedChainEvent ): SystemEvent => ({ - title: "Large Deposit Revealed", + title: "Large deposit revealed", type: SystemEventType.Warning, data: { btcFundingTx: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, From e953b05feda4f54b0864ecf41e0b7d7c4aaf6e26 Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Wed, 3 May 2023 11:32:28 -0400 Subject: [PATCH 072/198] Handle testnet in addition to mainnet --- monitoring/src/deposit-monitor.ts | 82 +++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 835e6153b..2598c4546 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -1,43 +1,75 @@ import { BigNumber } from "ethers" import { SystemEventType } from "./system-event" -import { context } from "./context" +import { context, Environment } from "./context" import type { SystemEvent, Monitor as SystemEventMonitor } from "./system-event" import type { DepositRevealedEvent as DepositRevealedChainEvent } from "@keep-network/tbtc-v2.ts/dist/src/deposit" import type { Bridge } from "@keep-network/tbtc-v2.ts/dist/src/chain" -function satsToRoundedBTC(sats: BigNumber): string { - return (sats.div(BigNumber.from(1e6)).toNumber() / 100).toFixed(2) +const satsToRoundedBTC = (sats: BigNumber): string => + (sats.div(BigNumber.from(1e6)).toNumber() / 100).toFixed(2) + +const hashUrls = (chainEvent: DepositRevealedChainEvent) => { + let fundingHashUrlPrefix = "" + if (context.environment === Environment.Mainnet) { + fundingHashUrlPrefix = "https://mempool.space/tx/" + } + if (context.environment === Environment.Testnet) { + fundingHashUrlPrefix = "https://mempool.space/testnet/tx/" + } + + let revealHashUrlPrefix = "" + if (context.environment === Environment.Mainnet) { + revealHashUrlPrefix = "https://etherscan.io/tx/" + } + if (context.environment === Environment.Testnet) { + revealHashUrlPrefix = "https://goerli.etherscan.io/tx/" + } + + const fundingHash = chainEvent.fundingTxHash.toString() + const transactionHash = chainEvent.transactionHash.toPrefixedString() + return { + btcFundingTxHashURL: fundingHashUrlPrefix + fundingHash, + ethRevealTxHashURL: revealHashUrlPrefix + transactionHash, + } } const DepositRevealed = ( chainEvent: DepositRevealedChainEvent -): SystemEvent => ({ - title: "Deposit revealed", - type: SystemEventType.Informational, - data: { - btcFundingTxHash: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, - btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountBTC: satsToRoundedBTC(chainEvent.amount), - ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, - }, - block: chainEvent.blockNumber, -}) +): SystemEvent => { + const { btcFundingTxHashURL, ethRevealTxHashURL } = hashUrls(chainEvent) + + return { + title: "Deposit revealed", + type: SystemEventType.Informational, + data: { + btcFundingTxHashURL, + btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), + amountBTC: satsToRoundedBTC(chainEvent.amount), + ethRevealTxHashURL, + }, + block: chainEvent.blockNumber, + } +} const LargeDepositRevealed = ( chainEvent: DepositRevealedChainEvent -): SystemEvent => ({ - title: "Large deposit revealed", - type: SystemEventType.Warning, - data: { - btcFundingTx: `https://mempool.space/tx/${chainEvent.fundingTxHash.toString()}`, - btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), - amountBTC: satsToRoundedBTC(chainEvent.amount), - ethRevealTxHash: `https://etherscan.io/tx/${chainEvent.transactionHash.toPrefixedString()}`, - }, - block: chainEvent.blockNumber, -}) +): SystemEvent => { + const { btcFundingTxHashURL, ethRevealTxHashURL } = hashUrls(chainEvent) + + return { + title: "Large deposit revealed", + type: SystemEventType.Warning, + data: { + btcFundingTxHashURL, + btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), + amountBTC: satsToRoundedBTC(chainEvent.amount), + ethRevealTxHashURL, + }, + block: chainEvent.blockNumber, + } +} export class DepositMonitor implements SystemEventMonitor { private bridge: Bridge From 80c599af5e0e4ed094a39c6d52b94db6ef407950 Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Wed, 3 May 2023 11:34:58 -0400 Subject: [PATCH 073/198] keep the original transaction hashes --- monitoring/src/deposit-monitor.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 2598c4546..85c221824 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -44,9 +44,11 @@ const DepositRevealed = ( title: "Deposit revealed", type: SystemEventType.Informational, data: { + btcFundingTxHash: chainEvent.fundingTxHash.toString(), btcFundingTxHashURL, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), amountBTC: satsToRoundedBTC(chainEvent.amount), + ethRevealTxHash: chainEvent.transactionHash.toPrefixedString(), ethRevealTxHashURL, }, block: chainEvent.blockNumber, @@ -62,9 +64,11 @@ const LargeDepositRevealed = ( title: "Large deposit revealed", type: SystemEventType.Warning, data: { + btcFundingTxHash: chainEvent.fundingTxHash.toString(), btcFundingTxHashURL, btcFundingOutputIndex: chainEvent.fundingOutputIndex.toString(), amountBTC: satsToRoundedBTC(chainEvent.amount), + ethRevealTxHash: chainEvent.transactionHash.toPrefixedString(), ethRevealTxHashURL, }, block: chainEvent.blockNumber, From d837a69b439de6ef1ad2b5c0b4f7abbeed409d42 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 4 May 2023 13:55:00 +0200 Subject: [PATCH 074/198] Pass deposits reveal blocks as part of the sweep proposal Here we extend the deposit sweep proposal by adding an array containing the reveal blocks of each deposit. This information strongly facilitates the off-chain processing. Using those blocks, wallet operators can quickly fetch corresponding `Bridge.DepositRevealed` events carrying deposit data necessary to perform proposal validation. Worth noting, this field is not explicitly validated within the `validateDepositSweepProposal` function because if something is wrong here the off-chain wallet operators will fail anyway as they won't be able to gather deposit data necessary to perform the on-chain validation using the `validateDepositSweepProposal` function. --- .../contracts/bridge/WalletCoordinator.sol | 10 +++++++ .../test/bridge/WalletCoordinator.test.ts | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 7872f84b9..333372979 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -79,6 +79,16 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { DepositKey[] depositsKeys; // Proposed BTC fee for the entire transaction. uint256 sweepTxFee; + // Array containing the reveal blocks of each deposit. This information + // strongly facilitates the off-chain processing. Using those blocks, + // wallet operators can quickly fetch corresponding Bridge.DepositRevealed + // events carrying deposit data necessary to perform proposal validation. + // This field is not explicitly validated within the validateDepositSweepProposal + // function because if something is wrong here the off-chain wallet + // operators will fail anyway as they won't be able to gather deposit + // data necessary to perform the on-chain validation using the + // validateDepositSweepProposal function. + uint256[] depositsRevealBlocks; } /// @notice Helper structure representing a plain-text deposit key. diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 67d8aae39..fb9e1dee6 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -261,6 +261,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) tx = await walletCoordinator @@ -714,6 +715,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) await expect(tx).to.be.revertedWith("Caller is not a coordinator") @@ -750,6 +752,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) // Jump to the end of the lock period but not beyond it. @@ -774,6 +777,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) ).to.be.revertedWith("Wallet locked") }) @@ -798,6 +802,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) // Jump beyond the lock period. @@ -817,6 +822,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) }) @@ -862,6 +868,7 @@ describe("WalletCoordinator", () => { ], ], BigNumber.from(5000), + [BigNumber.from(1000)], ], thirdParty.address, ]) @@ -905,6 +912,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) await expect(tx).to.be.revertedWith("Caller is not a coordinator") @@ -939,6 +947,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) // Jump beyond the lock period. @@ -960,6 +969,7 @@ describe("WalletCoordinator", () => { }, ], sweepTxFee: 5000, + depositsRevealBlocks: [1000], }) coordinatorBalanceAfter = await provider.getBalance(thirdParty.address) @@ -1052,6 +1062,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [], sweepTxFee: 0, + depositsRevealBlocks: [], }, [] ) @@ -1092,6 +1103,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [], // Set size to 0. sweepTxFee: 0, // Not relevant in this scenario. + depositsRevealBlocks: [], // Not relevant in this scenario. }, [] // Not relevant in this scenario. ) @@ -1115,6 +1127,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys, sweepTxFee: 0, // Not relevant in this scenario. + depositsRevealBlocks: [], // Not relevant in this scenario. }, [] // Not relevant in this scenario. ) @@ -1130,6 +1143,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [createTestDeposit(walletPubKeyHash, vault).key], sweepTxFee: 0, // Not relevant in this scenario. + depositsRevealBlocks: [], // Not relevant in this scenario. } // The extra data array contains two items. @@ -1191,6 +1205,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [depositOne.key, depositTwo.key], sweepTxFee: 0, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1260,6 +1275,7 @@ describe("WalletCoordinator", () => { depositsKeys: [depositOne.key, depositTwo.key], // Exceed the max per-deposit fee by one. sweepTxFee: bridgeDepositTxMaxFee * 2 + 1, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1326,6 +1342,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [depositOne.key, depositTwo.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1397,6 +1414,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [depositOne.key, depositTwo.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1467,6 +1485,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [depositOne.key, depositTwo.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1520,6 +1539,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [deposit.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } // Corrupt the extra data by setting a different @@ -1580,6 +1600,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [deposit.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } // Corrupt the extra data by reversing the proper @@ -1645,6 +1666,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [deposit.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } // Corrupt the extra data by reversing the proper @@ -1743,6 +1765,7 @@ describe("WalletCoordinator", () => { walletPubKeyHash, depositsKeys: [depositOne.key, depositTwo.key], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1826,6 +1849,7 @@ describe("WalletCoordinator", () => { depositTwo.key, ], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1909,6 +1933,7 @@ describe("WalletCoordinator", () => { depositTwo.key, ], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ @@ -1982,6 +2007,7 @@ describe("WalletCoordinator", () => { depositTwo.key, ], sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. } const depositsExtraInfo = [ From 02d32a8f4572403b146110c23e1c579fc3ca33a5 Mon Sep 17 00:00:00 2001 From: Beau Shinkle Date: Thu, 4 May 2023 09:27:19 -0400 Subject: [PATCH 075/198] Use a switch statement for the env-based urls --- monitoring/src/deposit-monitor.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/monitoring/src/deposit-monitor.ts b/monitoring/src/deposit-monitor.ts index 85c221824..751ffbd10 100644 --- a/monitoring/src/deposit-monitor.ts +++ b/monitoring/src/deposit-monitor.ts @@ -12,19 +12,18 @@ const satsToRoundedBTC = (sats: BigNumber): string => const hashUrls = (chainEvent: DepositRevealedChainEvent) => { let fundingHashUrlPrefix = "" - if (context.environment === Environment.Mainnet) { - fundingHashUrlPrefix = "https://mempool.space/tx/" - } - if (context.environment === Environment.Testnet) { - fundingHashUrlPrefix = "https://mempool.space/testnet/tx/" - } - let revealHashUrlPrefix = "" - if (context.environment === Environment.Mainnet) { - revealHashUrlPrefix = "https://etherscan.io/tx/" - } - if (context.environment === Environment.Testnet) { - revealHashUrlPrefix = "https://goerli.etherscan.io/tx/" + switch (context.environment) { + case Environment.Mainnet: { + fundingHashUrlPrefix = "https://mempool.space/tx/" + revealHashUrlPrefix = "https://etherscan.io/tx/" + break + } + case Environment.Testnet: { + fundingHashUrlPrefix = "https://mempool.space/testnet/tx/" + revealHashUrlPrefix = "https://goerli.etherscan.io/tx/" + break + } } const fundingHash = chainEvent.fundingTxHash.toString() From 354baaa8ad8f85bb2ef98cfea03ef6ad18fabd8e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 8 May 2023 14:25:07 +0200 Subject: [PATCH 076/198] Lowering wait time before requesting tx confirmation to 30sec --- system-tests/test/utils/bitcoin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-tests/test/utils/bitcoin.ts b/system-tests/test/utils/bitcoin.ts index d052eddb7..5df7ded63 100644 --- a/system-tests/test/utils/bitcoin.ts +++ b/system-tests/test/utils/bitcoin.ts @@ -77,7 +77,7 @@ export async function waitTransactionConfirmed( bitcoinClient: BitcoinClient, transactionHash: BitcoinTransactionHash, requiredConfirmations: number = defaultTxProofDifficultyFactor, - sleep = 60000 + sleep = 30000 ): Promise { for (;;) { // eslint-disable-next-line no-await-in-loop From a577338a7921c4fc2eacf8b13403f7081bad2f54 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 8 May 2023 14:26:46 +0200 Subject: [PATCH 077/198] Using func.skip instead of if statement to ignore this script from executing --- ...t_relay_maintainer_proxy_in_light_relay.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts index bf757a562..caf86da21 100644 --- a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +++ b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts @@ -2,25 +2,26 @@ import { HardhatRuntimeEnvironment } from "hardhat/types" import { DeployFunction } from "hardhat-deploy/types" const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (hre.network.name !== "goerli" && hre.network.name !== "system_tests") { - const { getNamedAccounts, deployments } = hre - const { execute } = deployments - const { deployer } = await getNamedAccounts() + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() - const LightRelayMaintainerProxy = await deployments.get( - "LightRelayMaintainerProxy" - ) + const LightRelayMaintainerProxy = await deployments.get( + "LightRelayMaintainerProxy" + ) - await execute( - "LightRelay", - { from: deployer, log: true, waitConfirmations: 1 }, - "authorize", - LightRelayMaintainerProxy.address - ) - } + await execute( + "LightRelay", + { from: deployer, log: true, waitConfirmations: 1 }, + "authorize", + LightRelayMaintainerProxy.address + ) } export default func func.tags = ["AuthorizeLightRelayMaintainerProxyInLightRelay"] func.dependencies = ["LightRelay", "LightRelayMaintainerProxy"] + +func.skip = async (hre: HardhatRuntimeEnvironment): Promise => + hre.network.name === "goerli" || hre.network.name === "system_tests" From 0cbfe8a0484829c688eaf2c00c960466975ddc4c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 8 May 2023 22:24:22 +0200 Subject: [PATCH 078/198] Revert "Changing a backoff retrier for the system tests" This reverts commit 58a7e5600ac81dcf18d955482a809750b8398a98. --- typescript/src/electrum.ts | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/typescript/src/electrum.ts b/typescript/src/electrum.ts index db1f543fb..a43993209 100644 --- a/typescript/src/electrum.ts +++ b/typescript/src/electrum.ts @@ -374,25 +374,13 @@ export class Client implements BitcoinClient { height: number } - let scriptHashHistory: HistoryEntry[] = [] - for (let attempt = 0; attempt < this.totalRetryAttempts; attempt++) { - try { - scriptHashHistory = await electrum.blockchain_scripthash_getHistory( - scriptHash.reverse().toString("hex") - ) - if (scriptHashHistory.length != 0) { - break - } - } catch { - // Handle the case when a bitcoin client throws an error and should retry - const waitMillis = this.waitBackoff(attempt) - await new Promise((r) => setTimeout(r, waitMillis)) - continue - } - // Handle the case when a bitcoin client returns nothing and should retry - const waitMillis = this.waitBackoff(attempt) - await new Promise((r) => setTimeout(r, waitMillis)) - } + const scriptHashHistory: HistoryEntry[] = await this.withBackoffRetrier< + HistoryEntry[] + >()(async () => { + return await electrum.blockchain_scripthash_getHistory( + scriptHash.reverse().toString("hex") + ) + }) const tx = scriptHashHistory.find( (t) => t.tx_hash === transactionHash.toString() @@ -444,12 +432,6 @@ export class Client implements BitcoinClient { }) } - waitBackoff(attempt: number): number { - const backoffMillis = Math.pow(2, attempt) * 1000 - const jitterMillis = Math.floor(Math.random() * 100) - return backoffMillis + jitterMillis - } - // eslint-disable-next-line valid-jsdoc /** * @see {BitcoinClient#getHeadersChain} From 924876ae546380429804faec3da20da72016c4c2 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Tue, 9 May 2023 14:29:46 +0200 Subject: [PATCH 079/198] Add script to authorize maintainer in LightRelayMaintainerProxy As part of the mainnet deployment we have to authorize a maintainer bot in the LightRelayMaintainerProxy. The address is the same relay maintainer we used in V1. Refs: https://github.com/keep-network/tbtc-v2/issues/597 --- ...ntainer_in_light_relay_maintainer_proxy.ts | 27 +++++++++++++++++++ ...light_relay_maintainer_proxy_ownership.ts} | 0 ...maintainer_proxy_in_reimbursement_pool.ts} | 0 ..._relay_maintainer_proxy_in_light_relay.ts} | 0 4 files changed, 27 insertions(+) create mode 100644 solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts rename solidity/deploy/{37_transfer_light_relay_maintainer_proxy_ownership.ts => 38_transfer_light_relay_maintainer_proxy_ownership.ts} (100%) rename solidity/deploy/{38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts => 39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts} (100%) rename solidity/deploy/{39_authorize_light_relay_maintainer_proxy_in_light_relay.ts => 40_authorize_light_relay_maintainer_proxy_in_light_relay.ts} (100%) diff --git a/solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts b/solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts new file mode 100644 index 000000000..c4cc99c96 --- /dev/null +++ b/solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts @@ -0,0 +1,27 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" +import { ethers } from "hardhat" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { deployer } = await getNamedAccounts() + + const relayMaintainerMainnet = ethers.utils.getAddress( + "0xCb6Ed7E78d27FDff28127F9CbD61d861F09a2324" + ) + + await execute( + "LightRelayMaintainerProxy", + { from: deployer, log: true, waitConfirmations: 1 }, + "authorize", + relayMaintainerMainnet + ) +} + +export default func + +func.tags = ["LightRelayMaintainerProxyAuthorizeMaintainer"] +func.dependencies = ["LightRelayMaintainerProxy"] +func.skip = async (hre: HardhatRuntimeEnvironment): Promise => + hre.network.name !== "mainnet" diff --git a/solidity/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts b/solidity/deploy/38_transfer_light_relay_maintainer_proxy_ownership.ts similarity index 100% rename from solidity/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts rename to solidity/deploy/38_transfer_light_relay_maintainer_proxy_ownership.ts diff --git a/solidity/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts b/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts similarity index 100% rename from solidity/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts rename to solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_light_relay.ts similarity index 100% rename from solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts rename to solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_light_relay.ts From 1a5312918d407f5ca25704692157e5e8078e8b52 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 10 May 2023 15:30:17 +0200 Subject: [PATCH 080/198] Begin solidity 1.4.0-dev version v1.3.0 was already released so we need to start a new version development. --- solidity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/package.json b/solidity/package.json index 00b763838..3b23d4904 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2", - "version": "1.3.0-dev", + "version": "1.4.0-dev", "license": "GPL-3.0-only", "files": [ "artifacts/", From 47f7109079c6289adb1925ce149a4733bd4a0a47 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 10 May 2023 21:44:38 +0200 Subject: [PATCH 081/198] Normalize the amount to bridge before calling Wormhole We need to eliminate the dust that cannot be bridged with Wormhole due to the decimal shift in the Wormhole Bridge contract. We cut the dust the same way as the Wormhole Bridge. See https://github.com/wormhole-foundation/wormhole/blob/96682bdbeb7c87bfa110eade0554b3d8cbf788d2/ethereum/contracts/bridge/Bridge.sol#L276-L288 --- solidity/contracts/l2/L2WormholeGateway.sol | 25 +++++++++++++--- solidity/test/l2/L2WormholeGateway.test.ts | 33 ++++++++++++++++----- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/solidity/contracts/l2/L2WormholeGateway.sol b/solidity/contracts/l2/L2WormholeGateway.sol index ee69729b3..22dc0d844 100644 --- a/solidity/contracts/l2/L2WormholeGateway.sol +++ b/solidity/contracts/l2/L2WormholeGateway.sol @@ -192,7 +192,8 @@ contract L2WormholeGateway is /// - The L2WormholeGateway must have at least `amount` of the wormhole /// tBTC. /// - The recipient must not be 0x0. - /// - The amount to transfer must not be 0. + /// - The amount to transfer must not be 0, + /// - The amount to transfer must be >= 10^10 (1e18 precision). /// Depending if Wormhole tBTC gateway is registered on the target /// chain, this function uses transfer or transfer with payload over /// the Wormhole bridge. @@ -210,14 +211,21 @@ contract L2WormholeGateway is uint256 arbiterFee, uint32 nonce ) external payable nonReentrant returns (uint64) { + require(recipient != bytes32(0), "0x0 recipient not allowed"); + require(amount != 0, "Amount must not be 0"); + + // Normalize the amount to bridge. The dust can not be bridged due to + // the decimal shift in the Wormhole Bridge contract. + amount = normalize(amount); + + // Check again after dropping the dust. + require(amount != 0, "Amount too low to bridge"); + require( bridgeToken.balanceOf(address(this)) >= amount, "Not enough wormhole tBTC in the gateway to bridge" ); - require(recipient != bytes32(0), "0x0 recipient not allowed"); - require(amount != 0, "Amount must not be 0"); - bytes32 gateway = gateways[recipientChain]; emit WormholeTbtcSent( @@ -386,4 +394,13 @@ contract L2WormholeGateway is { return address(uint160(uint256(_address))); } + + /// @dev Eliminates the dust that cannot be bridged with Wormhole + /// due to the decimal shift in the Wormhole Bridge contract. + /// See https://github.com/wormhole-foundation/wormhole/blob/96682bdbeb7c87bfa110eade0554b3d8cbf788d2/ethereum/contracts/bridge/Bridge.sol#L276-L288 + function normalize(uint256 amount) internal pure returns (uint256) { + amount /= 10**10; + amount *= 10**10; + return amount; + } } diff --git a/solidity/test/l2/L2WormholeGateway.test.ts b/solidity/test/l2/L2WormholeGateway.test.ts index 9bea66b40..c4d899874 100644 --- a/solidity/test/l2/L2WormholeGateway.test.ts +++ b/solidity/test/l2/L2WormholeGateway.test.ts @@ -4,6 +4,7 @@ import { randomBytes } from "crypto" import { expect } from "chai" import { ethers, getUnnamedAccounts, helpers, waffle } from "hardhat" import { ContractTransaction } from "ethers" +import { to1e18 } from "../helpers/contract-test-helpers" import type { L2TBTC, @@ -308,7 +309,7 @@ describe("L2WormholeGateway", () => { const arbiterFee = 3 const nonce = 4 - const liquidity = 1100 + const liquidity = to1e18(1100) before(async () => { await createSnapshot() @@ -331,7 +332,7 @@ describe("L2WormholeGateway", () => { gateway .connect(depositor1) .sendTbtc( - liquidity + 1, + liquidity.add(to1e18(1)), recipientChain, padTo32Bytes(recipient), arbiterFee, @@ -376,9 +377,27 @@ describe("L2WormholeGateway", () => { }) }) + context("when the amount is below dust", async () => { + const amount = ethers.BigNumber.from(10000000000).sub(1) // 10^10 - 1 + + it("should revert", async () => { + await expect( + gateway + .connect(depositor1) + .sendTbtc( + amount, + recipientChain, + padTo32Bytes(recipient), + arbiterFee, + nonce + ) + ).to.be.revertedWith("Amount too low to bridge") + }) + }) + context("when the receiver address and amount are non-zero", () => { context("when the target chain has no tBTC gateway", () => { - const amount = 997 + const amount = ethers.BigNumber.from(10000000000) // 10^10 let tx: ContractTransaction @@ -437,7 +456,7 @@ describe("L2WormholeGateway", () => { }) context("when the target chain has a tBTC gateway", () => { - const amount = 998 + const amount = to1e18(998) const targetGateway = "0x4c810fe802d68c6ef0e1291b52fca5812bbc97c9" let tx: ContractTransaction @@ -507,7 +526,7 @@ describe("L2WormholeGateway", () => { }) describe("depositWormholeTbtc", () => { - const amount = 129 + const amount = to1e18(129) context("when the minting limit is not exceeded", () => { let tx: ContractTransaction @@ -556,11 +575,11 @@ describe("L2WormholeGateway", () => { await wormholeBridgeStub.mintWormholeToken( depositor1.address, - 2 * amount + amount.mul(2) ) await wormholeTbtc .connect(depositor1) - .approve(gateway.address, 2 * amount) + .approve(gateway.address, amount.mul(2)) await gateway.connect(depositor1).depositWormholeTbtc(amount) }) From 350fc08d0ba017a6631d3d99c0239a3400fcd9db Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 10 May 2023 21:55:24 +0200 Subject: [PATCH 082/198] Ignore slither warning We need to divide before multiplying to lose the precision. This works as expected. --- solidity/contracts/l2/L2WormholeGateway.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/solidity/contracts/l2/L2WormholeGateway.sol b/solidity/contracts/l2/L2WormholeGateway.sol index 22dc0d844..5f97b304f 100644 --- a/solidity/contracts/l2/L2WormholeGateway.sol +++ b/solidity/contracts/l2/L2WormholeGateway.sol @@ -399,6 +399,7 @@ contract L2WormholeGateway is /// due to the decimal shift in the Wormhole Bridge contract. /// See https://github.com/wormhole-foundation/wormhole/blob/96682bdbeb7c87bfa110eade0554b3d8cbf788d2/ethereum/contracts/bridge/Bridge.sol#L276-L288 function normalize(uint256 amount) internal pure returns (uint256) { + // slither-disable-next-line divide-before-multiply amount /= 10**10; amount *= 10**10; return amount; From c5bde29519c1a000d9664a66940fe83909ea906a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 00:49:59 +0200 Subject: [PATCH 083/198] Adding a script that updates ArbitrumWormholeGateway contact This script should be executed when ArbitrumWormholeGateway requires an update. It is possible because this contract was deployed behind the OpenZeppelin transperant proxy pattern. func.skip should be commented 'yarn deploy --tags UpgradeArbitrumWormholeGateway --network ' is the deployment command. --- .../03_upgrade_arbitrum_wormhole_gateway.ts | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts diff --git a/cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts b/cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts new file mode 100644 index 000000000..6fab3095f --- /dev/null +++ b/cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts @@ -0,0 +1,50 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, getNamedAccounts, helpers, deployments } = hre + const { deployer } = await getNamedAccounts() + + const ArbitrumTokenBridge = await deployments.get("ArbitrumTokenBridge") + const ArbitrumWormholeTBTC = await deployments.get("ArbitrumWormholeTBTC") + const ArbitrumTBTC = await deployments.get("ArbitrumTBTC") + + const [, proxyDeployment] = await helpers.upgrades.upgradeProxy( + "ArbitrumWormholeGateway", + "ArbitrumWormholeGateway", + { + contractName: + "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", + initializerArgs: [ + ArbitrumTokenBridge.address, + ArbitrumWormholeTBTC.address, + ArbitrumTBTC.address, + ], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + } + ) + + // Contracts can be verified on L2 Arbiscan in a similar way as we do it on + // L1 Etherscan + if (hre.network.tags.arbiscan) { + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["UpgradeArbitrumWormholeGateway"] + +// Comment this line when running an upgrade. +// yarn deploy --tags UpgradeArbitrumWormholeGateway --network +func.skip = async () => true From eeb04c2d0c35f070cfeeee617e25dac38f87b04f Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Thu, 11 May 2023 09:03:44 +0200 Subject: [PATCH 084/198] Improved L2WoromholeGateway tests for dropping dust We now test are corner cases for dust dropping before bridging. --- solidity/test/l2/L2WormholeGateway.test.ts | 178 ++++++++++++++++++--- 1 file changed, 159 insertions(+), 19 deletions(-) diff --git a/solidity/test/l2/L2WormholeGateway.test.ts b/solidity/test/l2/L2WormholeGateway.test.ts index c4d899874..efe819532 100644 --- a/solidity/test/l2/L2WormholeGateway.test.ts +++ b/solidity/test/l2/L2WormholeGateway.test.ts @@ -377,27 +377,9 @@ describe("L2WormholeGateway", () => { }) }) - context("when the amount is below dust", async () => { - const amount = ethers.BigNumber.from(10000000000).sub(1) // 10^10 - 1 - - it("should revert", async () => { - await expect( - gateway - .connect(depositor1) - .sendTbtc( - amount, - recipientChain, - padTo32Bytes(recipient), - arbiterFee, - nonce - ) - ).to.be.revertedWith("Amount too low to bridge") - }) - }) - context("when the receiver address and amount are non-zero", () => { context("when the target chain has no tBTC gateway", () => { - const amount = ethers.BigNumber.from(10000000000) // 10^10 + const amount = to1e18(11) let tx: ContractTransaction @@ -521,6 +503,164 @@ describe("L2WormholeGateway", () => { ) }) }) + + context("when the amount is below dust", async () => { + const amount = ethers.BigNumber.from(10000000000).sub(1) // 10^10 - 1 + + it("should revert", async () => { + await expect( + gateway + .connect(depositor1) + .sendTbtc( + amount, + recipientChain, + padTo32Bytes(recipient), + arbiterFee, + nonce + ) + ).to.be.revertedWith("Amount too low to bridge") + }) + }) + + context("when the amount just above the dust", () => { + const amount = ethers.BigNumber.from(10000000000) // 10^10 + + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await canonicalTbtc + .connect(depositor1) + .approve(gateway.address, amount) + tx = await gateway + .connect(depositor1) + .sendTbtc(amount, recipientChain, recipient, arbiterFee, nonce) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should burn canonical tBTC from the caller", async () => { + expect(tx) + .to.emit(canonicalTbtc, "Transfer") + .withArgs(depositor1.address, ZERO_ADDRESS, amount) + }) + + it("should approve burned amount of wormhole tBTC to the bridge", async () => { + expect(tx) + .to.emit(wormholeTbtc, "Approved") + .withArgs(wormholeBridgeStub.address, amount) + }) + + it("should sent the entire amount through the bridge", async () => { + await expect(tx) + .to.emit(wormholeBridgeStub, "WormholeBridgeStub_transferTokens") + .withArgs( + wormholeTbtc.address, + amount, + recipientChain, + recipient, + arbiterFee, + nonce + ) + }) + }) + + context("when the amount has a small dust", () => { + const amount = ethers.BigNumber.from(10000000001) // 10^10 + 1 + const amountToTake = ethers.BigNumber.from(10000000000) + + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await canonicalTbtc + .connect(depositor1) + .approve(gateway.address, amount) + tx = await gateway + .connect(depositor1) + .sendTbtc(amount, recipientChain, recipient, arbiterFee, nonce) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should burn canonical tBTC from the caller after dropping dust", async () => { + expect(tx) + .to.emit(canonicalTbtc, "Transfer") + .withArgs(depositor1.address, ZERO_ADDRESS, amountToTake) + }) + + it("should approve burned amount of wormhole tBTC to the bridge after dropping dust", async () => { + expect(tx) + .to.emit(wormholeTbtc, "Approved") + .withArgs(wormholeBridgeStub.address, amountToTake) + }) + + it("should drop the dust before sending over the bridge", async () => { + await expect(tx) + .to.emit(wormholeBridgeStub, "WormholeBridgeStub_transferTokens") + .withArgs( + wormholeTbtc.address, + amountToTake, + recipientChain, + recipient, + arbiterFee, + nonce + ) + }) + }) + + context("when the amount has a lot of dust", () => { + const amount = ethers.BigNumber.from(19999999999) // 2* 10^10 - 1 + const amountToTake = ethers.BigNumber.from(10000000000) + + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + await canonicalTbtc + .connect(depositor1) + .approve(gateway.address, amount) + tx = await gateway + .connect(depositor1) + .sendTbtc(amount, recipientChain, recipient, arbiterFee, nonce) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should burn canonical tBTC from the caller after dropping dust", async () => { + expect(tx) + .to.emit(canonicalTbtc, "Transfer") + .withArgs(depositor1.address, ZERO_ADDRESS, amountToTake) + }) + + it("should approve burned amount of wormhole tBTC to the bridge after dropping dust", async () => { + expect(tx) + .to.emit(wormholeTbtc, "Approved") + .withArgs(wormholeBridgeStub.address, amountToTake) + }) + + it("should drop the dust before sending over the bridge", async () => { + await expect(tx) + .to.emit(wormholeBridgeStub, "WormholeBridgeStub_transferTokens") + .withArgs( + wormholeTbtc.address, + amountToTake, + recipientChain, + recipient, + arbiterFee, + nonce + ) + }) + }) }) }) }) From ff398b89352242751753e1bd7738c7543e309a1a Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Thu, 11 May 2023 09:21:04 +0200 Subject: [PATCH 085/198] Test name grammar fix --- solidity/test/l2/L2WormholeGateway.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/test/l2/L2WormholeGateway.test.ts b/solidity/test/l2/L2WormholeGateway.test.ts index efe819532..5cb91c83d 100644 --- a/solidity/test/l2/L2WormholeGateway.test.ts +++ b/solidity/test/l2/L2WormholeGateway.test.ts @@ -522,7 +522,7 @@ describe("L2WormholeGateway", () => { }) }) - context("when the amount just above the dust", () => { + context("when the amount is just above the dust", () => { const amount = ethers.BigNumber.from(10000000000) // 10^10 let tx: ContractTransaction From 7f34311610593d6bf09d8b7fa96106678ab00766 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 09:42:32 +0200 Subject: [PATCH 086/198] Adding upgrade deployment scripts for Optimism and Polygon network --- .../03_upgrade_optimism_wormhole_gateway.ts | 50 +++++++++++++++++++ .../05_upgrade_polygon_wormhole_gateway.ts | 50 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts create mode 100644 cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts diff --git a/cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts b/cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts new file mode 100644 index 000000000..4f4c9d23d --- /dev/null +++ b/cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts @@ -0,0 +1,50 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, getNamedAccounts, helpers, deployments } = hre + const { deployer } = await getNamedAccounts() + + const OptimismTokenBridge = await deployments.get("OptimismTokenBridge") + const OptimismWormholeTBTC = await deployments.get("OptimismWormholeTBTC") + const OptimismTBTC = await deployments.get("OptimismTBTC") + + const [, proxyDeployment] = await helpers.upgrades.upgradeProxy( + "OptimismWormholeGateway", + "OptimismWormholeGateway", + { + contractName: + "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", + initializerArgs: [ + OptimismTokenBridge.address, + OptimismWormholeTBTC.address, + OptimismTBTC.address, + ], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + } + ) + + // Contracts can be verified on L2 Arbiscan in a similar way as we do it on + // L1 Etherscan + if (hre.network.tags.arbiscan) { + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["UpgradeOptimismWormholeGateway"] + +// Comment this line when running an upgrade. +// yarn deploy --tags UpgradeOptimismWormholeGateway --network +// func.skip = async () => true diff --git a/cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts new file mode 100644 index 000000000..a3845960f --- /dev/null +++ b/cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts @@ -0,0 +1,50 @@ +import type { HardhatRuntimeEnvironment } from "hardhat/types" +import type { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, getNamedAccounts, helpers, deployments } = hre + const { deployer } = await getNamedAccounts() + + const PolygonTokenBridge = await deployments.get("PolygonTokenBridge") + const PolygonWormholeTBTC = await deployments.get("PolygonWormholeTBTC") + const PolygonTBTC = await deployments.get("PolygonTBTC") + + const [, proxyDeployment] = await helpers.upgrades.upgradeProxy( + "PolygonWormholeGateway", + "PolygonWormholeGateway", + { + contractName: + "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:L2WormholeGateway", + initializerArgs: [ + PolygonTokenBridge.address, + PolygonWormholeTBTC.address, + PolygonTBTC.address, + ], + factoryOpts: { signer: await ethers.getSigner(deployer) }, + proxyOpts: { + kind: "transparent", + }, + } + ) + + // Contracts can be verified on L2 Arbiscan in a similar way as we do it on + // L1 Etherscan + if (hre.network.tags.arbiscan) { + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation + // contract, the proxy itself and any proxy-related contracts, as well as + // link the proxy to the implementation contract’s ABI on (Ether)scan. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } +} + +export default func + +func.tags = ["UpgradePolygonWormholeGateway"] + +// Comment this line when running an upgrade. +// yarn deploy --tags UpgradePolygonWormholeGateway --network +func.skip = async () => true From f90751b4ee35aa04dc4ab25deea23978826dd0c6 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 10 May 2023 15:10:05 +0200 Subject: [PATCH 087/198] Artifacts deployed in v1.3.0 --- .../mainnet/LightRelayMaintainerProxy.json | 479 ++++++++++++++++++ .../d71d4b4434e6669852eaf643ebd2a7bc.json | 209 ++++++++ solidity/export.json | 274 ++++++++++ 3 files changed, 962 insertions(+) create mode 100644 solidity/deployments/mainnet/LightRelayMaintainerProxy.json create mode 100644 solidity/deployments/mainnet/solcInputs/d71d4b4434e6669852eaf643ebd2a7bc.json diff --git a/solidity/deployments/mainnet/LightRelayMaintainerProxy.json b/solidity/deployments/mainnet/LightRelayMaintainerProxy.json new file mode 100644 index 000000000..49e6989d5 --- /dev/null +++ b/solidity/deployments/mainnet/LightRelayMaintainerProxy.json @@ -0,0 +1,479 @@ +{ + "address": "0x4ca2f6206Da1A7Cb8155FEA68797EFDf25EFa3C8", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ILightRelay", + "name": "_lightRelay", + "type": "address" + }, + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newRelay", + "type": "address" + } + ], + "name": "LightRelayUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "MaintainerAuthorized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "MaintainerDeauthorized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReimbursementPool", + "type": "address" + } + ], + "name": "ReimbursementPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "retargetGasOffset", + "type": "uint256" + } + ], + "name": "RetargetGasOffsetUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lightRelay", + "outputs": [ + { + "internalType": "contract ILightRelay", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reimbursementPool", + "outputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "headers", + "type": "bytes" + } + ], + "name": "retarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "retargetGasOffset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILightRelay", + "name": "_lightRelay", + "type": "address" + } + ], + "name": "updateLightRelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "name": "updateReimbursementPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newRetargetGasOffset", + "type": "uint256" + } + ], + "name": "updateRetargetGasOffset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xcd5b1a450600bced35f90ad711a5d1002b5f5e4c4402b5c97396658ad22a3458", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x4ca2f6206Da1A7Cb8155FEA68797EFDf25EFa3C8", + "transactionIndex": 111, + "gasUsed": "716205", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000002000000000002000000000000400000000000000000040000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5453e8f389a55041ec95a15d753d97093ef689185ad7bb8ee52974edfa62f228", + "transactionHash": "0xcd5b1a450600bced35f90ad711a5d1002b5f5e4c4402b5c97396658ad22a3458", + "logs": [ + { + "transactionIndex": 111, + "blockNumber": 17230104, + "transactionHash": "0xcd5b1a450600bced35f90ad711a5d1002b5f5e4c4402b5c97396658ad22a3458", + "address": "0x4ca2f6206Da1A7Cb8155FEA68797EFDf25EFa3C8", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 279, + "blockHash": "0x5453e8f389a55041ec95a15d753d97093ef689185ad7bb8ee52974edfa62f228" + } + ], + "blockNumber": 17230104, + "cumulativeGasUsed": "13641493", + "status": 1, + "byzantium": true + }, + "args": [ + "0x836cdFE63fe2d63f8Bdb69b96f6097F36635896E", + "0x8adF3f35dBE4026112bCFc078872bcb967732Ea8" + ], + "numDeployments": 1, + "solcInputHash": "d71d4b4434e6669852eaf643ebd2a7bc", + "metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract ILightRelay\",\"name\":\"_lightRelay\",\"type\":\"address\"},{\"internalType\":\"contract ReimbursementPool\",\"name\":\"_reimbursementPool\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newRelay\",\"type\":\"address\"}],\"name\":\"LightRelayUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"maintainer\",\"type\":\"address\"}],\"name\":\"MaintainerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"maintainer\",\"type\":\"address\"}],\"name\":\"MaintainerDeauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newReimbursementPool\",\"type\":\"address\"}],\"name\":\"ReimbursementPoolUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"retargetGasOffset\",\"type\":\"uint256\"}],\"name\":\"RetargetGasOffsetUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"maintainer\",\"type\":\"address\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"maintainer\",\"type\":\"address\"}],\"name\":\"deauthorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lightRelay\",\"outputs\":[{\"internalType\":\"contract ILightRelay\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reimbursementPool\",\"outputs\":[{\"internalType\":\"contract ReimbursementPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"headers\",\"type\":\"bytes\"}],\"name\":\"retarget\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retargetGasOffset\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ILightRelay\",\"name\":\"_lightRelay\",\"type\":\"address\"}],\"name\":\"updateLightRelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ReimbursementPool\",\"name\":\"_reimbursementPool\",\"type\":\"address\"}],\"name\":\"updateReimbursementPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newRetargetGasOffset\",\"type\":\"uint256\"}],\"name\":\"updateRetargetGasOffset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"authorize(address)\":{\"details\":\"The function does not implement any governance delay.\",\"params\":{\"maintainer\":\"The address of the maintainer to be authorized.\"}},\"deauthorize(address)\":{\"details\":\"The function does not implement any governance delay.\",\"params\":{\"maintainer\":\"The address of the maintainer to be deauthorized.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"retarget(bytes)\":{\"details\":\"See `LightRelay.retarget` function documentation.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateLightRelay(address)\":{\"details\":\"The function does not implement any governance delay and does not check the status of the `LightRelay`. The Governance implementation needs to ensure all requirements for the upgrade are satisfied before executing this function.\"},\"updateRetargetGasOffset(uint256)\":{\"details\":\"Can be called only by the contract owner. The caller is responsible for validating the parameter. The function does not implement any governance delay.\",\"params\":{\"newRetargetGasOffset\":\"New retarget gas offset.\"}}},\"stateVariables\":{\"isAuthorized\":{\"details\":\"The goal is to prevent a griefing attack by frontrunning relay maintainer which is responsible for retargetting the relay in the given round. The maintainer's transaction would revert with no gas refund. Having the ability to restrict maintainer addresses is also important in case the underlying relay contract has authorization requirements for callers.\"}},\"title\":\"LightRelayMaintainerProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"authorize(address)\":{\"notice\":\"Authorizes the given address as a maintainer. Can only be called by the owner and the address of the maintainer must not be already authorized.\"},\"deauthorize(address)\":{\"notice\":\"Deauthorizes the given address as a maintainer. Can only be called by the owner and the address of the maintainer must be authorized.\"},\"isAuthorized(address)\":{\"notice\":\"Stores the addresses that can maintain the relay. Those addresses are attested by the DAO.\"},\"retarget(bytes)\":{\"notice\":\"Wraps `LightRelay.retarget` call and reimburses the caller's transaction cost. Can only be called by an authorized relay maintainer.\"},\"retargetGasOffset()\":{\"notice\":\"Gas that is meant to balance the retarget overall cost. Can be\"},\"updateLightRelay(address)\":{\"notice\":\"Allows the governance to upgrade the `LightRelay` address.\"},\"updateRetargetGasOffset(uint256)\":{\"notice\":\"Updates the values of retarget gas offset.\"}},\"notice\":\"The proxy contract that allows the relay maintainers to be refunded for the spent gas from the `ReimbursementPool`. When proving the next Bitcoin difficulty epoch, the maintainer calls the `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay` contract.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/relay/LightRelayMaintainerProxy.sol\":\"LightRelayMaintainerProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\n/** @title BitcoinSPV */\\n/** @author Summa (https://summa.one) */\\n\\nimport {BytesLib} from \\\"./BytesLib.sol\\\";\\nimport {SafeMath} from \\\"./SafeMath.sol\\\";\\n\\nlibrary BTCUtils {\\n using BytesLib for bytes;\\n using SafeMath for uint256;\\n\\n // The target at minimum Difficulty. Also the target of the genesis block\\n uint256 public constant DIFF1_TARGET = 0xffff0000000000000000000000000000000000000000000000000000;\\n\\n uint256 public constant RETARGET_PERIOD = 2 * 7 * 24 * 60 * 60; // 2 weeks in seconds\\n uint256 public constant RETARGET_PERIOD_BLOCKS = 2016; // 2 weeks in blocks\\n\\n uint256 public constant ERR_BAD_ARG = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\\n\\n /* ***** */\\n /* UTILS */\\n /* ***** */\\n\\n /// @notice Determines the length of a VarInt in bytes\\n /// @dev A VarInt of >1 byte is prefixed with a flag indicating its length\\n /// @param _flag The first byte of a VarInt\\n /// @return The number of non-flag bytes in the VarInt\\n function determineVarIntDataLength(bytes memory _flag) internal pure returns (uint8) {\\n return determineVarIntDataLengthAt(_flag, 0);\\n }\\n\\n /// @notice Determines the length of a VarInt in bytes\\n /// @dev A VarInt of >1 byte is prefixed with a flag indicating its length\\n /// @param _b The byte array containing a VarInt\\n /// @param _at The position of the VarInt in the array\\n /// @return The number of non-flag bytes in the VarInt\\n function determineVarIntDataLengthAt(bytes memory _b, uint256 _at) internal pure returns (uint8) {\\n if (uint8(_b[_at]) == 0xff) {\\n return 8; // one-byte flag, 8 bytes data\\n }\\n if (uint8(_b[_at]) == 0xfe) {\\n return 4; // one-byte flag, 4 bytes data\\n }\\n if (uint8(_b[_at]) == 0xfd) {\\n return 2; // one-byte flag, 2 bytes data\\n }\\n\\n return 0; // flag is data\\n }\\n\\n /// @notice Parse a VarInt into its data length and the number it represents\\n /// @dev Useful for Parsing Vins and Vouts. Returns ERR_BAD_ARG if insufficient bytes.\\n /// Caller SHOULD explicitly handle this case (or bubble it up)\\n /// @param _b A byte-string starting with a VarInt\\n /// @return number of bytes in the encoding (not counting the tag), the encoded int\\n function parseVarInt(bytes memory _b) internal pure returns (uint256, uint256) {\\n return parseVarIntAt(_b, 0);\\n }\\n\\n /// @notice Parse a VarInt into its data length and the number it represents\\n /// @dev Useful for Parsing Vins and Vouts. Returns ERR_BAD_ARG if insufficient bytes.\\n /// Caller SHOULD explicitly handle this case (or bubble it up)\\n /// @param _b A byte-string containing a VarInt\\n /// @param _at The position of the VarInt\\n /// @return number of bytes in the encoding (not counting the tag), the encoded int\\n function parseVarIntAt(bytes memory _b, uint256 _at) internal pure returns (uint256, uint256) {\\n uint8 _dataLen = determineVarIntDataLengthAt(_b, _at);\\n\\n if (_dataLen == 0) {\\n return (0, uint8(_b[_at]));\\n }\\n if (_b.length < 1 + _dataLen + _at) {\\n return (ERR_BAD_ARG, 0);\\n }\\n uint256 _number;\\n if (_dataLen == 2) {\\n _number = reverseUint16(uint16(_b.slice2(1 + _at)));\\n } else if (_dataLen == 4) {\\n _number = reverseUint32(uint32(_b.slice4(1 + _at)));\\n } else if (_dataLen == 8) {\\n _number = reverseUint64(uint64(_b.slice8(1 + _at)));\\n }\\n return (_dataLen, _number);\\n }\\n\\n /// @notice Changes the endianness of a byte array\\n /// @dev Returns a new, backwards, bytes\\n /// @param _b The bytes to reverse\\n /// @return The reversed bytes\\n function reverseEndianness(bytes memory _b) internal pure returns (bytes memory) {\\n bytes memory _newValue = new bytes(_b.length);\\n\\n for (uint i = 0; i < _b.length; i++) {\\n _newValue[_b.length - i - 1] = _b[i];\\n }\\n\\n return _newValue;\\n }\\n\\n /// @notice Changes the endianness of a uint256\\n /// @dev https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel\\n /// @param _b The unsigned integer to reverse\\n /// @return v The reversed value\\n function reverseUint256(uint256 _b) internal pure returns (uint256 v) {\\n v = _b;\\n\\n // swap bytes\\n v = ((v >> 8) & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) |\\n ((v & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\\n // swap 2-byte long pairs\\n v = ((v >> 16) & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) |\\n ((v & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\\n // swap 4-byte long pairs\\n v = ((v >> 32) & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) |\\n ((v & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) << 32);\\n // swap 8-byte long pairs\\n v = ((v >> 64) & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) |\\n ((v & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) << 64);\\n // swap 16-byte long pairs\\n v = (v >> 128) | (v << 128);\\n }\\n\\n /// @notice Changes the endianness of a uint64\\n /// @param _b The unsigned integer to reverse\\n /// @return v The reversed value\\n function reverseUint64(uint64 _b) internal pure returns (uint64 v) {\\n v = _b;\\n\\n // swap bytes\\n v = ((v >> 8) & 0x00FF00FF00FF00FF) |\\n ((v & 0x00FF00FF00FF00FF) << 8);\\n // swap 2-byte long pairs\\n v = ((v >> 16) & 0x0000FFFF0000FFFF) |\\n ((v & 0x0000FFFF0000FFFF) << 16);\\n // swap 4-byte long pairs\\n v = (v >> 32) | (v << 32);\\n }\\n\\n /// @notice Changes the endianness of a uint32\\n /// @param _b The unsigned integer to reverse\\n /// @return v The reversed value\\n function reverseUint32(uint32 _b) internal pure returns (uint32 v) {\\n v = _b;\\n\\n // swap bytes\\n v = ((v >> 8) & 0x00FF00FF) |\\n ((v & 0x00FF00FF) << 8);\\n // swap 2-byte long pairs\\n v = (v >> 16) | (v << 16);\\n }\\n\\n /// @notice Changes the endianness of a uint24\\n /// @param _b The unsigned integer to reverse\\n /// @return v The reversed value\\n function reverseUint24(uint24 _b) internal pure returns (uint24 v) {\\n v = (_b << 16) | (_b & 0x00FF00) | (_b >> 16);\\n }\\n\\n /// @notice Changes the endianness of a uint16\\n /// @param _b The unsigned integer to reverse\\n /// @return v The reversed value\\n function reverseUint16(uint16 _b) internal pure returns (uint16 v) {\\n v = (_b << 8) | (_b >> 8);\\n }\\n\\n\\n /// @notice Converts big-endian bytes to a uint\\n /// @dev Traverses the byte array and sums the bytes\\n /// @param _b The big-endian bytes-encoded integer\\n /// @return The integer representation\\n function bytesToUint(bytes memory _b) internal pure returns (uint256) {\\n uint256 _number;\\n\\n for (uint i = 0; i < _b.length; i++) {\\n _number = _number + uint8(_b[i]) * (2 ** (8 * (_b.length - (i + 1))));\\n }\\n\\n return _number;\\n }\\n\\n /// @notice Get the last _num bytes from a byte array\\n /// @param _b The byte array to slice\\n /// @param _num The number of bytes to extract from the end\\n /// @return The last _num bytes of _b\\n function lastBytes(bytes memory _b, uint256 _num) internal pure returns (bytes memory) {\\n uint256 _start = _b.length.sub(_num);\\n\\n return _b.slice(_start, _num);\\n }\\n\\n /// @notice Implements bitcoin's hash160 (rmd160(sha2()))\\n /// @dev abi.encodePacked changes the return to bytes instead of bytes32\\n /// @param _b The pre-image\\n /// @return The digest\\n function hash160(bytes memory _b) internal pure returns (bytes memory) {\\n return abi.encodePacked(ripemd160(abi.encodePacked(sha256(_b))));\\n }\\n\\n /// @notice Implements bitcoin's hash160 (sha2 + ripemd160)\\n /// @dev sha2 precompile at address(2), ripemd160 at address(3)\\n /// @param _b The pre-image\\n /// @return res The digest\\n function hash160View(bytes memory _b) internal view returns (bytes20 res) {\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n pop(staticcall(gas(), 2, add(_b, 32), mload(_b), 0x00, 32))\\n pop(staticcall(gas(), 3, 0x00, 32, 0x00, 32))\\n // read from position 12 = 0c\\n res := mload(0x0c)\\n }\\n }\\n\\n /// @notice Implements bitcoin's hash256 (double sha2)\\n /// @dev abi.encodePacked changes the return to bytes instead of bytes32\\n /// @param _b The pre-image\\n /// @return The digest\\n function hash256(bytes memory _b) internal pure returns (bytes32) {\\n return sha256(abi.encodePacked(sha256(_b)));\\n }\\n\\n /// @notice Implements bitcoin's hash256 (double sha2)\\n /// @dev sha2 is precompiled smart contract located at address(2)\\n /// @param _b The pre-image\\n /// @return res The digest\\n function hash256View(bytes memory _b) internal view returns (bytes32 res) {\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n pop(staticcall(gas(), 2, add(_b, 32), mload(_b), 0x00, 32))\\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\\n res := mload(0x00)\\n }\\n }\\n\\n /// @notice Implements bitcoin's hash256 on a pair of bytes32\\n /// @dev sha2 is precompiled smart contract located at address(2)\\n /// @param _a The first bytes32 of the pre-image\\n /// @param _b The second bytes32 of the pre-image\\n /// @return res The digest\\n function hash256Pair(bytes32 _a, bytes32 _b) internal view returns (bytes32 res) {\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n mstore(0x00, _a)\\n mstore(0x20, _b)\\n pop(staticcall(gas(), 2, 0x00, 64, 0x00, 32))\\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\\n res := mload(0x00)\\n }\\n }\\n\\n /// @notice Implements bitcoin's hash256 (double sha2)\\n /// @dev sha2 is precompiled smart contract located at address(2)\\n /// @param _b The array containing the pre-image\\n /// @param at The start of the pre-image\\n /// @param len The length of the pre-image\\n /// @return res The digest\\n function hash256Slice(\\n bytes memory _b,\\n uint256 at,\\n uint256 len\\n ) internal view returns (bytes32 res) {\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n pop(staticcall(gas(), 2, add(_b, add(32, at)), len, 0x00, 32))\\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\\n res := mload(0x00)\\n }\\n }\\n\\n /* ************ */\\n /* Legacy Input */\\n /* ************ */\\n\\n /// @notice Extracts the nth input from the vin (0-indexed)\\n /// @dev Iterates over the vin. If you need to extract several, write a custom function\\n /// @param _vin The vin as a tightly-packed byte array\\n /// @param _index The 0-indexed location of the input to extract\\n /// @return The input as a byte array\\n function extractInputAtIndex(bytes memory _vin, uint256 _index) internal pure returns (bytes memory) {\\n uint256 _varIntDataLen;\\n uint256 _nIns;\\n\\n (_varIntDataLen, _nIns) = parseVarInt(_vin);\\n require(_varIntDataLen != ERR_BAD_ARG, \\\"Read overrun during VarInt parsing\\\");\\n require(_index < _nIns, \\\"Vin read overrun\\\");\\n\\n uint256 _len = 0;\\n uint256 _offset = 1 + _varIntDataLen;\\n\\n for (uint256 _i = 0; _i < _index; _i ++) {\\n _len = determineInputLengthAt(_vin, _offset);\\n require(_len != ERR_BAD_ARG, \\\"Bad VarInt in scriptSig\\\");\\n _offset = _offset + _len;\\n }\\n\\n _len = determineInputLengthAt(_vin, _offset);\\n require(_len != ERR_BAD_ARG, \\\"Bad VarInt in scriptSig\\\");\\n return _vin.slice(_offset, _len);\\n }\\n\\n /// @notice Determines whether an input is legacy\\n /// @dev False if no scriptSig, otherwise True\\n /// @param _input The input\\n /// @return True for legacy, False for witness\\n function isLegacyInput(bytes memory _input) internal pure returns (bool) {\\n return _input[36] != hex\\\"00\\\";\\n }\\n\\n /// @notice Determines the length of a scriptSig in an input\\n /// @dev Will return 0 if passed a witness input.\\n /// @param _input The LEGACY input\\n /// @return The length of the script sig\\n function extractScriptSigLen(bytes memory _input) internal pure returns (uint256, uint256) {\\n return extractScriptSigLenAt(_input, 0);\\n }\\n\\n /// @notice Determines the length of a scriptSig in an input\\n /// starting at the specified position\\n /// @dev Will return 0 if passed a witness input.\\n /// @param _input The byte array containing the LEGACY input\\n /// @param _at The position of the input in the array\\n /// @return The length of the script sig\\n function extractScriptSigLenAt(bytes memory _input, uint256 _at) internal pure returns (uint256, uint256) {\\n if (_input.length < 37 + _at) {\\n return (ERR_BAD_ARG, 0);\\n }\\n\\n uint256 _varIntDataLen;\\n uint256 _scriptSigLen;\\n (_varIntDataLen, _scriptSigLen) = parseVarIntAt(_input, _at + 36);\\n\\n return (_varIntDataLen, _scriptSigLen);\\n }\\n\\n /// @notice Determines the length of an input from its scriptSig\\n /// @dev 36 for outpoint, 1 for scriptSig length, 4 for sequence\\n /// @param _input The input\\n /// @return The length of the input in bytes\\n function determineInputLength(bytes memory _input) internal pure returns (uint256) {\\n return determineInputLengthAt(_input, 0);\\n }\\n\\n /// @notice Determines the length of an input from its scriptSig,\\n /// starting at the specified position\\n /// @dev 36 for outpoint, 1 for scriptSig length, 4 for sequence\\n /// @param _input The byte array containing the input\\n /// @param _at The position of the input in the array\\n /// @return The length of the input in bytes\\n function determineInputLengthAt(bytes memory _input, uint256 _at) internal pure returns (uint256) {\\n uint256 _varIntDataLen;\\n uint256 _scriptSigLen;\\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLenAt(_input, _at);\\n if (_varIntDataLen == ERR_BAD_ARG) {\\n return ERR_BAD_ARG;\\n }\\n\\n return 36 + 1 + _varIntDataLen + _scriptSigLen + 4;\\n }\\n\\n /// @notice Extracts the LE sequence bytes from an input\\n /// @dev Sequence is used for relative time locks\\n /// @param _input The LEGACY input\\n /// @return The sequence bytes (LE uint)\\n function extractSequenceLELegacy(bytes memory _input) internal pure returns (bytes4) {\\n uint256 _varIntDataLen;\\n uint256 _scriptSigLen;\\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLen(_input);\\n require(_varIntDataLen != ERR_BAD_ARG, \\\"Bad VarInt in scriptSig\\\");\\n return _input.slice4(36 + 1 + _varIntDataLen + _scriptSigLen);\\n }\\n\\n /// @notice Extracts the sequence from the input\\n /// @dev Sequence is a 4-byte little-endian number\\n /// @param _input The LEGACY input\\n /// @return The sequence number (big-endian uint)\\n function extractSequenceLegacy(bytes memory _input) internal pure returns (uint32) {\\n uint32 _leSeqence = uint32(extractSequenceLELegacy(_input));\\n uint32 _beSequence = reverseUint32(_leSeqence);\\n return _beSequence;\\n }\\n /// @notice Extracts the VarInt-prepended scriptSig from the input in a tx\\n /// @dev Will return hex\\\"00\\\" if passed a witness input\\n /// @param _input The LEGACY input\\n /// @return The length-prepended scriptSig\\n function extractScriptSig(bytes memory _input) internal pure returns (bytes memory) {\\n uint256 _varIntDataLen;\\n uint256 _scriptSigLen;\\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLen(_input);\\n require(_varIntDataLen != ERR_BAD_ARG, \\\"Bad VarInt in scriptSig\\\");\\n return _input.slice(36, 1 + _varIntDataLen + _scriptSigLen);\\n }\\n\\n\\n /* ************* */\\n /* Witness Input */\\n /* ************* */\\n\\n /// @notice Extracts the LE sequence bytes from an input\\n /// @dev Sequence is used for relative time locks\\n /// @param _input The WITNESS input\\n /// @return The sequence bytes (LE uint)\\n function extractSequenceLEWitness(bytes memory _input) internal pure returns (bytes4) {\\n return _input.slice4(37);\\n }\\n\\n /// @notice Extracts the sequence from the input in a tx\\n /// @dev Sequence is a 4-byte little-endian number\\n /// @param _input The WITNESS input\\n /// @return The sequence number (big-endian uint)\\n function extractSequenceWitness(bytes memory _input) internal pure returns (uint32) {\\n uint32 _leSeqence = uint32(extractSequenceLEWitness(_input));\\n uint32 _inputeSequence = reverseUint32(_leSeqence);\\n return _inputeSequence;\\n }\\n\\n /// @notice Extracts the outpoint from the input in a tx\\n /// @dev 32-byte tx id with 4-byte index\\n /// @param _input The input\\n /// @return The outpoint (LE bytes of prev tx hash + LE bytes of prev tx index)\\n function extractOutpoint(bytes memory _input) internal pure returns (bytes memory) {\\n return _input.slice(0, 36);\\n }\\n\\n /// @notice Extracts the outpoint tx id from an input\\n /// @dev 32-byte tx id\\n /// @param _input The input\\n /// @return The tx id (little-endian bytes)\\n function extractInputTxIdLE(bytes memory _input) internal pure returns (bytes32) {\\n return _input.slice32(0);\\n }\\n\\n /// @notice Extracts the outpoint tx id from an input\\n /// starting at the specified position\\n /// @dev 32-byte tx id\\n /// @param _input The byte array containing the input\\n /// @param _at The position of the input\\n /// @return The tx id (little-endian bytes)\\n function extractInputTxIdLeAt(bytes memory _input, uint256 _at) internal pure returns (bytes32) {\\n return _input.slice32(_at);\\n }\\n\\n /// @notice Extracts the LE tx input index from the input in a tx\\n /// @dev 4-byte tx index\\n /// @param _input The input\\n /// @return The tx index (little-endian bytes)\\n function extractTxIndexLE(bytes memory _input) internal pure returns (bytes4) {\\n return _input.slice4(32);\\n }\\n\\n /// @notice Extracts the LE tx input index from the input in a tx\\n /// starting at the specified position\\n /// @dev 4-byte tx index\\n /// @param _input The byte array containing the input\\n /// @param _at The position of the input\\n /// @return The tx index (little-endian bytes)\\n function extractTxIndexLeAt(bytes memory _input, uint256 _at) internal pure returns (bytes4) {\\n return _input.slice4(32 + _at);\\n }\\n\\n /* ****** */\\n /* Output */\\n /* ****** */\\n\\n /// @notice Determines the length of an output\\n /// @dev Works with any properly formatted output\\n /// @param _output The output\\n /// @return The length indicated by the prefix, error if invalid length\\n function determineOutputLength(bytes memory _output) internal pure returns (uint256) {\\n return determineOutputLengthAt(_output, 0);\\n }\\n\\n /// @notice Determines the length of an output\\n /// starting at the specified position\\n /// @dev Works with any properly formatted output\\n /// @param _output The byte array containing the output\\n /// @param _at The position of the output\\n /// @return The length indicated by the prefix, error if invalid length\\n function determineOutputLengthAt(bytes memory _output, uint256 _at) internal pure returns (uint256) {\\n if (_output.length < 9 + _at) {\\n return ERR_BAD_ARG;\\n }\\n uint256 _varIntDataLen;\\n uint256 _scriptPubkeyLength;\\n (_varIntDataLen, _scriptPubkeyLength) = parseVarIntAt(_output, 8 + _at);\\n\\n if (_varIntDataLen == ERR_BAD_ARG) {\\n return ERR_BAD_ARG;\\n }\\n\\n // 8-byte value, 1-byte for tag itself\\n return 8 + 1 + _varIntDataLen + _scriptPubkeyLength;\\n }\\n\\n /// @notice Extracts the output at a given index in the TxOuts vector\\n /// @dev Iterates over the vout. If you need to extract multiple, write a custom function\\n /// @param _vout The _vout to extract from\\n /// @param _index The 0-indexed location of the output to extract\\n /// @return The specified output\\n function extractOutputAtIndex(bytes memory _vout, uint256 _index) internal pure returns (bytes memory) {\\n uint256 _varIntDataLen;\\n uint256 _nOuts;\\n\\n (_varIntDataLen, _nOuts) = parseVarInt(_vout);\\n require(_varIntDataLen != ERR_BAD_ARG, \\\"Read overrun during VarInt parsing\\\");\\n require(_index < _nOuts, \\\"Vout read overrun\\\");\\n\\n uint256 _len = 0;\\n uint256 _offset = 1 + _varIntDataLen;\\n\\n for (uint256 _i = 0; _i < _index; _i ++) {\\n _len = determineOutputLengthAt(_vout, _offset);\\n require(_len != ERR_BAD_ARG, \\\"Bad VarInt in scriptPubkey\\\");\\n _offset += _len;\\n }\\n\\n _len = determineOutputLengthAt(_vout, _offset);\\n require(_len != ERR_BAD_ARG, \\\"Bad VarInt in scriptPubkey\\\");\\n return _vout.slice(_offset, _len);\\n }\\n\\n /// @notice Extracts the value bytes from the output in a tx\\n /// @dev Value is an 8-byte little-endian number\\n /// @param _output The output\\n /// @return The output value as LE bytes\\n function extractValueLE(bytes memory _output) internal pure returns (bytes8) {\\n return _output.slice8(0);\\n }\\n\\n /// @notice Extracts the value from the output in a tx\\n /// @dev Value is an 8-byte little-endian number\\n /// @param _output The output\\n /// @return The output value\\n function extractValue(bytes memory _output) internal pure returns (uint64) {\\n uint64 _leValue = uint64(extractValueLE(_output));\\n uint64 _beValue = reverseUint64(_leValue);\\n return _beValue;\\n }\\n\\n /// @notice Extracts the value from the output in a tx\\n /// @dev Value is an 8-byte little-endian number\\n /// @param _output The byte array containing the output\\n /// @param _at The starting index of the output in the array\\n /// @return The output value\\n function extractValueAt(bytes memory _output, uint256 _at) internal pure returns (uint64) {\\n uint64 _leValue = uint64(_output.slice8(_at));\\n uint64 _beValue = reverseUint64(_leValue);\\n return _beValue;\\n }\\n\\n /// @notice Extracts the data from an op return output\\n /// @dev Returns hex\\\"\\\" if no data or not an op return\\n /// @param _output The output\\n /// @return Any data contained in the opreturn output, null if not an op return\\n function extractOpReturnData(bytes memory _output) internal pure returns (bytes memory) {\\n if (_output[9] != hex\\\"6a\\\") {\\n return hex\\\"\\\";\\n }\\n bytes1 _dataLen = _output[10];\\n return _output.slice(11, uint256(uint8(_dataLen)));\\n }\\n\\n /// @notice Extracts the hash from the output script\\n /// @dev Determines type by the length prefix and validates format\\n /// @param _output The output\\n /// @return The hash committed to by the pk_script, or null for errors\\n function extractHash(bytes memory _output) internal pure returns (bytes memory) {\\n return extractHashAt(_output, 8, _output.length - 8);\\n }\\n\\n /// @notice Extracts the hash from the output script\\n /// @dev Determines type by the length prefix and validates format\\n /// @param _output The byte array containing the output\\n /// @param _at The starting index of the output script in the array\\n /// (output start + 8)\\n /// @param _len The length of the output script\\n /// (output length - 8)\\n /// @return The hash committed to by the pk_script, or null for errors\\n function extractHashAt(\\n bytes memory _output,\\n uint256 _at,\\n uint256 _len\\n ) internal pure returns (bytes memory) {\\n uint8 _scriptLen = uint8(_output[_at]);\\n\\n // don't have to worry about overflow here.\\n // if _scriptLen + 1 overflows, then output length would have to be < 1\\n // for this check to pass. if it's < 1, then we errored when assigning\\n // _scriptLen\\n if (_scriptLen + 1 != _len) {\\n return hex\\\"\\\";\\n }\\n\\n if (uint8(_output[_at + 1]) == 0) {\\n if (_scriptLen < 2) {\\n return hex\\\"\\\";\\n }\\n uint256 _payloadLen = uint8(_output[_at + 2]);\\n // Check for maliciously formatted witness outputs.\\n // No need to worry about underflow as long b/c of the `< 2` check\\n if (_payloadLen != _scriptLen - 2 || (_payloadLen != 0x20 && _payloadLen != 0x14)) {\\n return hex\\\"\\\";\\n }\\n return _output.slice(_at + 3, _payloadLen);\\n } else {\\n bytes3 _tag = _output.slice3(_at);\\n // p2pkh\\n if (_tag == hex\\\"1976a9\\\") {\\n // Check for maliciously formatted p2pkh\\n // No need to worry about underflow, b/c of _scriptLen check\\n if (uint8(_output[_at + 3]) != 0x14 ||\\n _output.slice2(_at + _len - 2) != hex\\\"88ac\\\") {\\n return hex\\\"\\\";\\n }\\n return _output.slice(_at + 4, 20);\\n //p2sh\\n } else if (_tag == hex\\\"17a914\\\") {\\n // Check for maliciously formatted p2sh\\n // No need to worry about underflow, b/c of _scriptLen check\\n if (uint8(_output[_at + _len - 1]) != 0x87) {\\n return hex\\\"\\\";\\n }\\n return _output.slice(_at + 3, 20);\\n }\\n }\\n return hex\\\"\\\"; /* NB: will trigger on OPRETURN and any non-standard that doesn't overrun */\\n }\\n\\n /* ********** */\\n /* Witness TX */\\n /* ********** */\\n\\n\\n /// @notice Checks that the vin passed up is properly formatted\\n /// @dev Consider a vin with a valid vout in its scriptsig\\n /// @param _vin Raw bytes length-prefixed input vector\\n /// @return True if it represents a validly formatted vin\\n function validateVin(bytes memory _vin) internal pure returns (bool) {\\n uint256 _varIntDataLen;\\n uint256 _nIns;\\n\\n (_varIntDataLen, _nIns) = parseVarInt(_vin);\\n\\n // Not valid if it says there are too many or no inputs\\n if (_nIns == 0 || _varIntDataLen == ERR_BAD_ARG) {\\n return false;\\n }\\n\\n uint256 _offset = 1 + _varIntDataLen;\\n\\n for (uint256 i = 0; i < _nIns; i++) {\\n // If we're at the end, but still expect more\\n if (_offset >= _vin.length) {\\n return false;\\n }\\n\\n // Grab the next input and determine its length.\\n uint256 _nextLen = determineInputLengthAt(_vin, _offset);\\n if (_nextLen == ERR_BAD_ARG) {\\n return false;\\n }\\n\\n // Increase the offset by that much\\n _offset += _nextLen;\\n }\\n\\n // Returns false if we're not exactly at the end\\n return _offset == _vin.length;\\n }\\n\\n /// @notice Checks that the vout passed up is properly formatted\\n /// @dev Consider a vout with a valid scriptpubkey\\n /// @param _vout Raw bytes length-prefixed output vector\\n /// @return True if it represents a validly formatted vout\\n function validateVout(bytes memory _vout) internal pure returns (bool) {\\n uint256 _varIntDataLen;\\n uint256 _nOuts;\\n\\n (_varIntDataLen, _nOuts) = parseVarInt(_vout);\\n\\n // Not valid if it says there are too many or no outputs\\n if (_nOuts == 0 || _varIntDataLen == ERR_BAD_ARG) {\\n return false;\\n }\\n\\n uint256 _offset = 1 + _varIntDataLen;\\n\\n for (uint256 i = 0; i < _nOuts; i++) {\\n // If we're at the end, but still expect more\\n if (_offset >= _vout.length) {\\n return false;\\n }\\n\\n // Grab the next output and determine its length.\\n // Increase the offset by that much\\n uint256 _nextLen = determineOutputLengthAt(_vout, _offset);\\n if (_nextLen == ERR_BAD_ARG) {\\n return false;\\n }\\n\\n _offset += _nextLen;\\n }\\n\\n // Returns false if we're not exactly at the end\\n return _offset == _vout.length;\\n }\\n\\n\\n\\n /* ************ */\\n /* Block Header */\\n /* ************ */\\n\\n /// @notice Extracts the transaction merkle root from a block header\\n /// @dev Use verifyHash256Merkle to verify proofs with this root\\n /// @param _header The header\\n /// @return The merkle root (little-endian)\\n function extractMerkleRootLE(bytes memory _header) internal pure returns (bytes32) {\\n return _header.slice32(36);\\n }\\n\\n /// @notice Extracts the target from a block header\\n /// @dev Target is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\\n /// @param _header The header\\n /// @return The target threshold\\n function extractTarget(bytes memory _header) internal pure returns (uint256) {\\n return extractTargetAt(_header, 0);\\n }\\n\\n /// @notice Extracts the target from a block header\\n /// @dev Target is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\\n /// @param _header The array containing the header\\n /// @param at The start of the header\\n /// @return The target threshold\\n function extractTargetAt(bytes memory _header, uint256 at) internal pure returns (uint256) {\\n uint24 _m = uint24(_header.slice3(72 + at));\\n uint8 _e = uint8(_header[75 + at]);\\n uint256 _mantissa = uint256(reverseUint24(_m));\\n uint _exponent = _e - 3;\\n\\n return _mantissa * (256 ** _exponent);\\n }\\n\\n /// @notice Calculate difficulty from the difficulty 1 target and current target\\n /// @dev Difficulty 1 is 0x1d00ffff on mainnet and testnet\\n /// @dev Difficulty 1 is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\\n /// @param _target The current target\\n /// @return The block difficulty (bdiff)\\n function calculateDifficulty(uint256 _target) internal pure returns (uint256) {\\n // Difficulty 1 calculated from 0x1d00ffff\\n return DIFF1_TARGET.div(_target);\\n }\\n\\n /// @notice Extracts the previous block's hash from a block header\\n /// @dev Block headers do NOT include block number :(\\n /// @param _header The header\\n /// @return The previous block's hash (little-endian)\\n function extractPrevBlockLE(bytes memory _header) internal pure returns (bytes32) {\\n return _header.slice32(4);\\n }\\n\\n /// @notice Extracts the previous block's hash from a block header\\n /// @dev Block headers do NOT include block number :(\\n /// @param _header The array containing the header\\n /// @param at The start of the header\\n /// @return The previous block's hash (little-endian)\\n function extractPrevBlockLEAt(\\n bytes memory _header,\\n uint256 at\\n ) internal pure returns (bytes32) {\\n return _header.slice32(4 + at);\\n }\\n\\n /// @notice Extracts the timestamp from a block header\\n /// @dev Time is not 100% reliable\\n /// @param _header The header\\n /// @return The timestamp (little-endian bytes)\\n function extractTimestampLE(bytes memory _header) internal pure returns (bytes4) {\\n return _header.slice4(68);\\n }\\n\\n /// @notice Extracts the timestamp from a block header\\n /// @dev Time is not 100% reliable\\n /// @param _header The header\\n /// @return The timestamp (uint)\\n function extractTimestamp(bytes memory _header) internal pure returns (uint32) {\\n return reverseUint32(uint32(extractTimestampLE(_header)));\\n }\\n\\n /// @notice Extracts the expected difficulty from a block header\\n /// @dev Does NOT verify the work\\n /// @param _header The header\\n /// @return The difficulty as an integer\\n function extractDifficulty(bytes memory _header) internal pure returns (uint256) {\\n return calculateDifficulty(extractTarget(_header));\\n }\\n\\n /// @notice Concatenates and hashes two inputs for merkle proving\\n /// @param _a The first hash\\n /// @param _b The second hash\\n /// @return The double-sha256 of the concatenated hashes\\n function _hash256MerkleStep(bytes memory _a, bytes memory _b) internal view returns (bytes32) {\\n return hash256View(abi.encodePacked(_a, _b));\\n }\\n\\n /// @notice Concatenates and hashes two inputs for merkle proving\\n /// @param _a The first hash\\n /// @param _b The second hash\\n /// @return The double-sha256 of the concatenated hashes\\n function _hash256MerkleStep(bytes32 _a, bytes32 _b) internal view returns (bytes32) {\\n return hash256Pair(_a, _b);\\n }\\n\\n\\n /// @notice Verifies a Bitcoin-style merkle tree\\n /// @dev Leaves are 0-indexed. Inefficient version.\\n /// @param _proof The proof. Tightly packed LE sha256 hashes. The last hash is the root\\n /// @param _index The index of the leaf\\n /// @return true if the proof is valid, else false\\n function verifyHash256Merkle(bytes memory _proof, uint _index) internal view returns (bool) {\\n // Not an even number of hashes\\n if (_proof.length % 32 != 0) {\\n return false;\\n }\\n\\n // Special case for coinbase-only blocks\\n if (_proof.length == 32) {\\n return true;\\n }\\n\\n // Should never occur\\n if (_proof.length == 64) {\\n return false;\\n }\\n\\n bytes32 _root = _proof.slice32(_proof.length - 32);\\n bytes32 _current = _proof.slice32(0);\\n bytes memory _tree = _proof.slice(32, _proof.length - 64);\\n\\n return verifyHash256Merkle(_current, _tree, _root, _index);\\n }\\n\\n /// @notice Verifies a Bitcoin-style merkle tree\\n /// @dev Leaves are 0-indexed. Efficient version.\\n /// @param _leaf The leaf of the proof. LE sha256 hash.\\n /// @param _tree The intermediate nodes in the proof.\\n /// Tightly packed LE sha256 hashes.\\n /// @param _root The root of the proof. LE sha256 hash.\\n /// @param _index The index of the leaf\\n /// @return true if the proof is valid, else false\\n function verifyHash256Merkle(\\n bytes32 _leaf,\\n bytes memory _tree,\\n bytes32 _root,\\n uint _index\\n ) internal view returns (bool) {\\n // Not an even number of hashes\\n if (_tree.length % 32 != 0) {\\n return false;\\n }\\n\\n // Should never occur\\n if (_tree.length == 0) {\\n return false;\\n }\\n\\n uint _idx = _index;\\n bytes32 _current = _leaf;\\n\\n // i moves in increments of 32\\n for (uint i = 0; i < _tree.length; i += 32) {\\n if (_idx % 2 == 1) {\\n _current = _hash256MerkleStep(_tree.slice32(i), _current);\\n } else {\\n _current = _hash256MerkleStep(_current, _tree.slice32(i));\\n }\\n _idx = _idx >> 1;\\n }\\n return _current == _root;\\n }\\n\\n /*\\n NB: https://github.com/bitcoin/bitcoin/blob/78dae8caccd82cfbfd76557f1fb7d7557c7b5edb/src/pow.cpp#L49-L72\\n NB: We get a full-bitlength target from this. For comparison with\\n header-encoded targets we need to mask it with the header target\\n e.g. (full & truncated) == truncated\\n */\\n /// @notice performs the bitcoin difficulty retarget\\n /// @dev implements the Bitcoin algorithm precisely\\n /// @param _previousTarget the target of the previous period\\n /// @param _firstTimestamp the timestamp of the first block in the difficulty period\\n /// @param _secondTimestamp the timestamp of the last block in the difficulty period\\n /// @return the new period's target threshold\\n function retargetAlgorithm(\\n uint256 _previousTarget,\\n uint256 _firstTimestamp,\\n uint256 _secondTimestamp\\n ) internal pure returns (uint256) {\\n uint256 _elapsedTime = _secondTimestamp.sub(_firstTimestamp);\\n\\n // Normalize ratio to factor of 4 if very long or very short\\n if (_elapsedTime < RETARGET_PERIOD.div(4)) {\\n _elapsedTime = RETARGET_PERIOD.div(4);\\n }\\n if (_elapsedTime > RETARGET_PERIOD.mul(4)) {\\n _elapsedTime = RETARGET_PERIOD.mul(4);\\n }\\n\\n /*\\n NB: high targets e.g. ffff0020 can cause overflows here\\n so we divide it by 256**2, then multiply by 256**2 later\\n we know the target is evenly divisible by 256**2, so this isn't an issue\\n */\\n\\n uint256 _adjusted = _previousTarget.div(65536).mul(_elapsedTime);\\n return _adjusted.div(RETARGET_PERIOD).mul(65536);\\n }\\n}\\n\",\"keccak256\":\"0x439eaa97e9239705f3d31e8d39dccbad32311f1f119e295d53c65e0ae3c5a5fc\"},\"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\n/*\\n\\nhttps://github.com/GNSPS/solidity-bytes-utils/\\n\\nThis is free and unencumbered software released into the public domain.\\n\\nAnyone is free to copy, modify, publish, use, compile, sell, or\\ndistribute this software, either in source code form or as a compiled\\nbinary, for any purpose, commercial or non-commercial, and by any\\nmeans.\\n\\nIn jurisdictions that recognize copyright laws, the author or authors\\nof this software dedicate any and all copyright interest in the\\nsoftware to the public domain. We make this dedication for the benefit\\nof the public at large and to the detriment of our heirs and\\nsuccessors. We intend this dedication to be an overt act of\\nrelinquishment in perpetuity of all present and future rights to this\\nsoftware under copyright law.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND,\\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\\nOTHER DEALINGS IN THE SOFTWARE.\\n\\nFor more information, please refer to \\n*/\\n\\n\\n/** @title BytesLib **/\\n/** @author https://github.com/GNSPS **/\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(0x40, and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n ))\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(\\n fslot,\\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\\n ),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory res) {\\n if (_length == 0) {\\n return hex\\\"\\\";\\n }\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\\n res := mload(0x40)\\n mstore(0x40, add(add(res, 64), _length))\\n mstore(res, _length)\\n\\n // Compute distance between source and destination pointers\\n let diff := sub(res, add(_bytes, _start))\\n\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n } {\\n mstore(add(src, diff), mload(src))\\n }\\n }\\n }\\n\\n /// @notice Take a slice of the byte array, overwriting the destination.\\n /// The length of the slice will equal the length of the destination array.\\n /// @dev Make sure the destination array has afterspace if required.\\n /// @param _bytes The source array\\n /// @param _dest The destination array.\\n /// @param _start The location to start in the source array.\\n function sliceInPlace(\\n bytes memory _bytes,\\n bytes memory _dest,\\n uint _start\\n ) internal pure {\\n uint _length = _dest.length;\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let res := add(_dest, 32)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n res := add(res, 32)\\n } {\\n mstore(res, mload(src))\\n }\\n }\\n }\\n\\n // Static slice functions, no bounds checking\\n /// @notice take a 32-byte slice from the specified position\\n function slice32(bytes memory _bytes, uint _start) internal pure returns (bytes32 res) {\\n assembly {\\n res := mload(add(add(_bytes, 32), _start))\\n }\\n }\\n\\n /// @notice take a 20-byte slice from the specified position\\n function slice20(bytes memory _bytes, uint _start) internal pure returns (bytes20) {\\n return bytes20(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 8-byte slice from the specified position\\n function slice8(bytes memory _bytes, uint _start) internal pure returns (bytes8) {\\n return bytes8(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 4-byte slice from the specified position\\n function slice4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {\\n return bytes4(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 3-byte slice from the specified position\\n function slice3(bytes memory _bytes, uint _start) internal pure returns (bytes3) {\\n return bytes3(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 2-byte slice from the specified position\\n function slice2(bytes memory _bytes, uint _start) internal pure returns (bytes2) {\\n return bytes2(slice32(_bytes, _start));\\n }\\n\\n function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {\\n uint _totalLen = _start + 20;\\n require(_totalLen > _start && _bytes.length >= _totalLen, \\\"Address conversion out of bounds.\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {\\n uint _totalLen = _start + 32;\\n require(_totalLen > _start && _bytes.length >= _totalLen, \\\"Uint conversion out of bounds.\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n for {} eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function toBytes32(bytes memory _source) pure internal returns (bytes32 result) {\\n if (_source.length == 0) {\\n return 0x0;\\n }\\n\\n assembly {\\n result := mload(add(_source, 32))\\n }\\n }\\n\\n function keccak256Slice(bytes memory _bytes, uint _start, uint _length) pure internal returns (bytes32 result) {\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n result := keccak256(add(add(_bytes, 32), _start), _length)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1\"},\"@keep-network/bitcoin-spv-sol/contracts/SafeMath.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\n/*\\nThe MIT License (MIT)\\n\\nCopyright (c) 2016 Smart Contract Solutions, Inc.\\n\\nPermission is hereby granted, free of charge, to any person obtaining\\na copy of this software and associated documentation files (the\\n\\\"Software\\\"), to deal in the Software without restriction, including\\nwithout limitation the rights to use, copy, modify, merge, publish,\\ndistribute, sublicense, and/or sell copies of the Software, and to\\npermit persons to whom the Software is furnished to do so, subject to\\nthe following conditions:\\n\\nThe above copyright notice and this permission notice shall be included\\nin all copies or substantial portions of the Software.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n*/\\n\\n\\n/**\\n * @title SafeMath\\n * @dev Math operations with safety checks that throw on error\\n */\\nlibrary SafeMath {\\n\\n /**\\n * @dev Multiplies two numbers, throws on overflow.\\n */\\n function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\\n // Gas optimization: this is cheaper than asserting 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\\n if (_a == 0) {\\n return 0;\\n }\\n\\n c = _a * _b;\\n require(c / _a == _b, \\\"Overflow during multiplication.\\\");\\n return c;\\n }\\n\\n /**\\n * @dev Integer division of two numbers, truncating the quotient.\\n */\\n function div(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n // assert(_b > 0); // Solidity automatically throws when dividing by 0\\n // uint256 c = _a / _b;\\n // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold\\n return _a / _b;\\n }\\n\\n /**\\n * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).\\n */\\n function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {\\n require(_b <= _a, \\\"Underflow during subtraction.\\\");\\n return _a - _b;\\n }\\n\\n /**\\n * @dev Adds two numbers, throws on overflow.\\n */\\n function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\\n c = _a + _b;\\n require(c >= _a, \\\"Overflow during addition.\\\");\\n return c;\\n }\\n}\\n\",\"keccak256\":\"0x35930d982394c7ffde439b82e5e696c5b21a6f09699d44861dfe409ef64084a3\"},\"@keep-network/bitcoin-spv-sol/contracts/ValidateSPV.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\n/** @title ValidateSPV*/\\n/** @author Summa (https://summa.one) */\\n\\nimport {BytesLib} from \\\"./BytesLib.sol\\\";\\nimport {SafeMath} from \\\"./SafeMath.sol\\\";\\nimport {BTCUtils} from \\\"./BTCUtils.sol\\\";\\n\\n\\nlibrary ValidateSPV {\\n\\n using BTCUtils for bytes;\\n using BTCUtils for uint256;\\n using BytesLib for bytes;\\n using SafeMath for uint256;\\n\\n enum InputTypes { NONE, LEGACY, COMPATIBILITY, WITNESS }\\n enum OutputTypes { NONE, WPKH, WSH, OP_RETURN, PKH, SH, NONSTANDARD }\\n\\n uint256 constant ERR_BAD_LENGTH = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\\n uint256 constant ERR_INVALID_CHAIN = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe;\\n uint256 constant ERR_LOW_WORK = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd;\\n\\n function getErrBadLength() internal pure returns (uint256) {\\n return ERR_BAD_LENGTH;\\n }\\n\\n function getErrInvalidChain() internal pure returns (uint256) {\\n return ERR_INVALID_CHAIN;\\n }\\n\\n function getErrLowWork() internal pure returns (uint256) {\\n return ERR_LOW_WORK;\\n }\\n\\n /// @notice Validates a tx inclusion in the block\\n /// @dev `index` is not a reliable indicator of location within a block\\n /// @param _txid The txid (LE)\\n /// @param _merkleRoot The merkle root (as in the block header)\\n /// @param _intermediateNodes The proof's intermediate nodes (digests between leaf and root)\\n /// @param _index The leaf's index in the tree (0-indexed)\\n /// @return true if fully valid, false otherwise\\n function prove(\\n bytes32 _txid,\\n bytes32 _merkleRoot,\\n bytes memory _intermediateNodes,\\n uint _index\\n ) internal view returns (bool) {\\n // Shortcut the empty-block case\\n if (_txid == _merkleRoot && _index == 0 && _intermediateNodes.length == 0) {\\n return true;\\n }\\n\\n // If the Merkle proof failed, bubble up error\\n return BTCUtils.verifyHash256Merkle(\\n _txid,\\n _intermediateNodes,\\n _merkleRoot,\\n _index\\n );\\n }\\n\\n /// @notice Hashes transaction to get txid\\n /// @dev Supports Legacy and Witness\\n /// @param _version 4-bytes version\\n /// @param _vin Raw bytes length-prefixed input vector\\n /// @param _vout Raw bytes length-prefixed output vector\\n /// @param _locktime 4-byte tx locktime\\n /// @return 32-byte transaction id, little endian\\n function calculateTxId(\\n bytes4 _version,\\n bytes memory _vin,\\n bytes memory _vout,\\n bytes4 _locktime\\n ) internal view returns (bytes32) {\\n // Get transaction hash double-Sha256(version + nIns + inputs + nOuts + outputs + locktime)\\n return abi.encodePacked(_version, _vin, _vout, _locktime).hash256View();\\n }\\n\\n /// @notice Checks validity of header chain\\n /// @notice Compares the hash of each header to the prevHash in the next header\\n /// @param headers Raw byte array of header chain\\n /// @return totalDifficulty The total accumulated difficulty of the header chain, or an error code\\n function validateHeaderChain(\\n bytes memory headers\\n ) internal view returns (uint256 totalDifficulty) {\\n\\n // Check header chain length\\n if (headers.length % 80 != 0) {return ERR_BAD_LENGTH;}\\n\\n // Initialize header start index\\n bytes32 digest;\\n\\n totalDifficulty = 0;\\n\\n for (uint256 start = 0; start < headers.length; start += 80) {\\n\\n // After the first header, check that headers are in a chain\\n if (start != 0) {\\n if (!validateHeaderPrevHash(headers, start, digest)) {return ERR_INVALID_CHAIN;}\\n }\\n\\n // ith header target\\n uint256 target = headers.extractTargetAt(start);\\n\\n // Require that the header has sufficient work\\n digest = headers.hash256Slice(start, 80);\\n if(uint256(digest).reverseUint256() > target) {\\n return ERR_LOW_WORK;\\n }\\n\\n // Add ith header difficulty to difficulty sum\\n totalDifficulty = totalDifficulty + target.calculateDifficulty();\\n }\\n }\\n\\n /// @notice Checks validity of header work\\n /// @param digest Header digest\\n /// @param target The target threshold\\n /// @return true if header work is valid, false otherwise\\n function validateHeaderWork(\\n bytes32 digest,\\n uint256 target\\n ) internal pure returns (bool) {\\n if (digest == bytes32(0)) {return false;}\\n return (uint256(digest).reverseUint256() < target);\\n }\\n\\n /// @notice Checks validity of header chain\\n /// @dev Compares current header prevHash to previous header's digest\\n /// @param headers The raw bytes array containing the header\\n /// @param at The position of the header\\n /// @param prevHeaderDigest The previous header's digest\\n /// @return true if the connect is valid, false otherwise\\n function validateHeaderPrevHash(\\n bytes memory headers,\\n uint256 at,\\n bytes32 prevHeaderDigest\\n ) internal pure returns (bool) {\\n\\n // Extract prevHash of current header\\n bytes32 prevHash = headers.extractPrevBlockLEAt(at);\\n\\n // Compare prevHash of current header to previous header's digest\\n if (prevHash != prevHeaderDigest) {return false;}\\n\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xce3febbf3ad3a7ff8a8effd0c7ccaf7ccfa2719578b537d49ea196f0bae8062b\"},\"@keep-network/random-beacon/contracts/Reimbursable.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"./ReimbursementPool.sol\\\";\\n\\nabstract contract Reimbursable {\\n // The variable should be initialized by the implementing contract.\\n // slither-disable-next-line uninitialized-state\\n ReimbursementPool public reimbursementPool;\\n\\n // Reserved storage space in case we need to add more variables,\\n // since there are upgradeable contracts that inherit from this one.\\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n // slither-disable-next-line unused-state\\n uint256[49] private __gap;\\n\\n event ReimbursementPoolUpdated(address newReimbursementPool);\\n\\n modifier refundable(address receiver) {\\n uint256 gasStart = gasleft();\\n _;\\n reimbursementPool.refund(gasStart - gasleft(), receiver);\\n }\\n\\n modifier onlyReimbursableAdmin() virtual {\\n _;\\n }\\n\\n function updateReimbursementPool(ReimbursementPool _reimbursementPool)\\n external\\n onlyReimbursableAdmin\\n {\\n emit ReimbursementPoolUpdated(address(_reimbursementPool));\\n\\n reimbursementPool = _reimbursementPool;\\n }\\n}\\n\",\"keccak256\":\"0x6b01344c1ec13aaab1dc432d3afabe08d6dd0d1a9248be8b36a0747ac22e5d9f\",\"license\":\"GPL-3.0-only\"},\"@keep-network/random-beacon/contracts/ReimbursementPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n//\\n// \\u2593\\u2593\\u258c \\u2593\\u2593 \\u2590\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584\\u2584\\u2584\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\u2580\\u2580\\u2580 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2580\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2580\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2584 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u258c\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2588\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n// \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2590\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593 \\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\u2593\\n//\\n// Trust math, not hardware.\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\n\\ncontract ReimbursementPool is Ownable, ReentrancyGuard {\\n /// @notice Authorized contracts that can interact with the reimbursment pool.\\n /// Authorization can be granted and removed by the owner.\\n mapping(address => bool) public isAuthorized;\\n\\n /// @notice Static gas includes:\\n /// - cost of the refund function\\n /// - base transaction cost\\n uint256 public staticGas;\\n\\n /// @notice Max gas price used to reimburse a transaction submitter. Protects\\n /// against malicious operator-miners.\\n uint256 public maxGasPrice;\\n\\n event StaticGasUpdated(uint256 newStaticGas);\\n\\n event MaxGasPriceUpdated(uint256 newMaxGasPrice);\\n\\n event SendingEtherFailed(uint256 refundAmount, address receiver);\\n\\n event AuthorizedContract(address thirdPartyContract);\\n\\n event UnauthorizedContract(address thirdPartyContract);\\n\\n event FundsWithdrawn(uint256 withdrawnAmount, address receiver);\\n\\n constructor(uint256 _staticGas, uint256 _maxGasPrice) {\\n staticGas = _staticGas;\\n maxGasPrice = _maxGasPrice;\\n }\\n\\n /// @notice Receive ETH\\n receive() external payable {}\\n\\n /// @notice Refunds ETH to a spender for executing specific transactions.\\n /// @dev Ignoring the result of sending ETH to a receiver is made on purpose.\\n /// For EOA receiving ETH should always work. If a receiver is a smart\\n /// contract, then we do not want to fail a transaction, because in some\\n /// cases the refund is done at the very end of multiple calls where all\\n /// the previous calls were already paid off. It is a receiver's smart\\n /// contract resposibility to make sure it can receive ETH.\\n /// @dev Only authorized contracts are allowed calling this function.\\n /// @param gasSpent Gas spent on a transaction that needs to be reimbursed.\\n /// @param receiver Address where the reimbursment is sent.\\n function refund(uint256 gasSpent, address receiver) external nonReentrant {\\n require(\\n isAuthorized[msg.sender],\\n \\\"Contract is not authorized for a refund\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n uint256 gasPrice = tx.gasprice < maxGasPrice\\n ? tx.gasprice\\n : maxGasPrice;\\n\\n uint256 refundAmount = (gasSpent + staticGas) * gasPrice;\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,unchecked-lowlevel\\n (bool sent, ) = receiver.call{value: refundAmount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n if (!sent) {\\n // slither-disable-next-line reentrancy-events\\n emit SendingEtherFailed(refundAmount, receiver);\\n }\\n }\\n\\n /// @notice Authorize a contract that can interact with this reimbursment pool.\\n /// Can be authorized by the owner only.\\n /// @param _contract Authorized contract.\\n function authorize(address _contract) external onlyOwner {\\n isAuthorized[_contract] = true;\\n\\n emit AuthorizedContract(_contract);\\n }\\n\\n /// @notice Unauthorize a contract that was previously authorized to interact\\n /// with this reimbursment pool. Can be unauthorized by the\\n /// owner only.\\n /// @param _contract Authorized contract.\\n function unauthorize(address _contract) external onlyOwner {\\n delete isAuthorized[_contract];\\n\\n emit UnauthorizedContract(_contract);\\n }\\n\\n /// @notice Setting a static gas cost for executing a transaction. Can be set\\n /// by the owner only.\\n /// @param _staticGas Static gas cost.\\n function setStaticGas(uint256 _staticGas) external onlyOwner {\\n staticGas = _staticGas;\\n\\n emit StaticGasUpdated(_staticGas);\\n }\\n\\n /// @notice Setting a max gas price for transactions. Can be set by the\\n /// owner only.\\n /// @param _maxGasPrice Max gas price used to reimburse tx submitters.\\n function setMaxGasPrice(uint256 _maxGasPrice) external onlyOwner {\\n maxGasPrice = _maxGasPrice;\\n\\n emit MaxGasPriceUpdated(_maxGasPrice);\\n }\\n\\n /// @notice Withdraws all ETH from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param receiver An address where ETH is sent.\\n function withdrawAll(address receiver) external onlyOwner {\\n withdraw(address(this).balance, receiver);\\n }\\n\\n /// @notice Withdraws ETH amount from this pool which are sent to a given\\n /// address. Can be set by the owner only.\\n /// @param amount Amount to withdraw from the pool.\\n /// @param receiver An address where ETH is sent.\\n function withdraw(uint256 amount, address receiver) public onlyOwner {\\n require(\\n address(this).balance >= amount,\\n \\\"Insufficient contract balance\\\"\\n );\\n require(receiver != address(0), \\\"Receiver's address cannot be zero\\\");\\n\\n emit FundsWithdrawn(amount, receiver);\\n\\n /* solhint-disable avoid-low-level-calls */\\n // slither-disable-next-line low-level-calls,arbitrary-send\\n (bool sent, ) = receiver.call{value: amount}(\\\"\\\");\\n /* solhint-enable avoid-low-level-calls */\\n require(sent, \\\"Failed to send Ether\\\");\\n }\\n}\\n\",\"keccak256\":\"0xd6c24368cc4c6349b8b614e878ca961cad8254b8e8db1cc0abe452a70022ce50\",\"license\":\"GPL-3.0-only\"},\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../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 * By default, the owner account will be the one that deploys the contract. This\\n * can 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 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\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 require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing 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 require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\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\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x190dd6f8d592b7e4e930feb7f4313aeb8e1c4ad3154c27ce1cf6a512fc30d8cc\",\"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/bridge/IRelay.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity 0.8.17;\\n\\n/// @title Interface for the Bitcoin relay\\n/// @notice Contains only the methods needed by tBTC v2. The Bitcoin relay\\n/// provides the difficulty of the previous and current epoch. One\\n/// difficulty epoch spans 2016 blocks.\\ninterface IRelay {\\n /// @notice Returns the difficulty of the current epoch.\\n function getCurrentEpochDifficulty() external view returns (uint256);\\n\\n /// @notice Returns the difficulty of the previous epoch.\\n function getPrevEpochDifficulty() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xf70c723fc0a1824d92061b5dc76c65c38c22eff6b18ef6a2057f511183ce3c5b\",\"license\":\"GPL-3.0-only\"},\"contracts/relay/LightRelay.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\nimport {BytesLib} from \\\"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\\\";\\nimport {BTCUtils} from \\\"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\\\";\\nimport {ValidateSPV} from \\\"@keep-network/bitcoin-spv-sol/contracts/ValidateSPV.sol\\\";\\n\\nimport \\\"../bridge/IRelay.sol\\\";\\n\\nstruct Epoch {\\n uint32 timestamp;\\n // By definition, bitcoin targets have at least 32 leading zero bits.\\n // Thus we can only store the bits that aren't guaranteed to be 0.\\n uint224 target;\\n}\\n\\ninterface ILightRelay is IRelay {\\n event Genesis(uint256 blockHeight);\\n event Retarget(uint256 oldDifficulty, uint256 newDifficulty);\\n event ProofLengthChanged(uint256 newLength);\\n event AuthorizationRequirementChanged(bool newStatus);\\n event SubmitterAuthorized(address submitter);\\n event SubmitterDeauthorized(address submitter);\\n\\n function retarget(bytes memory headers) external;\\n\\n function validateChain(bytes memory headers)\\n external\\n view\\n returns (uint256 startingHeaderTimestamp, uint256 headerCount);\\n\\n function getBlockDifficulty(uint256 blockNumber)\\n external\\n view\\n returns (uint256);\\n\\n function getEpochDifficulty(uint256 epochNumber)\\n external\\n view\\n returns (uint256);\\n\\n function getRelayRange()\\n external\\n view\\n returns (uint256 relayGenesis, uint256 currentEpochEnd);\\n}\\n\\nlibrary RelayUtils {\\n using BytesLib for bytes;\\n\\n /// @notice Extract the timestamp of the header at the given position.\\n /// @param headers Byte array containing the header of interest.\\n /// @param at The start of the header in the array.\\n /// @return The timestamp of the header.\\n /// @dev Assumes that the specified position contains a valid header.\\n /// Performs no validation whatsoever.\\n function extractTimestampAt(bytes memory headers, uint256 at)\\n internal\\n pure\\n returns (uint32)\\n {\\n return BTCUtils.reverseUint32(uint32(headers.slice4(68 + at)));\\n }\\n}\\n\\n/// @dev THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.\\ncontract LightRelay is Ownable, ILightRelay {\\n using BytesLib for bytes;\\n using BTCUtils for bytes;\\n using ValidateSPV for bytes;\\n using RelayUtils for bytes;\\n\\n bool public ready;\\n // Whether the relay requires the address submitting a retarget to be\\n // authorised in advance by governance.\\n bool public authorizationRequired;\\n // Number of blocks required for each side of a retarget proof:\\n // a retarget must provide `proofLength` blocks before the retarget\\n // and `proofLength` blocks after it.\\n // Governable\\n // Should be set to a fairly high number (e.g. 20-50) in production.\\n uint64 public proofLength;\\n // The number of the first epoch recorded by the relay.\\n // This should equal the height of the block starting the genesis epoch,\\n // divided by 2016, but this is not enforced as the relay has no\\n // information about block numbers.\\n uint64 public genesisEpoch;\\n // The number of the latest epoch whose difficulty is proven to the relay.\\n // If the genesis epoch's number is set correctly, and retargets along the\\n // way have been legitimate, this equals the height of the block starting\\n // the most recent epoch, divided by 2016.\\n uint64 public currentEpoch;\\n\\n uint256 internal currentEpochDifficulty;\\n uint256 internal prevEpochDifficulty;\\n\\n // Each epoch from genesis to the current one, keyed by their numbers.\\n mapping(uint256 => Epoch) internal epochs;\\n\\n mapping(address => bool) public isAuthorized;\\n\\n modifier relayActive() {\\n require(ready, \\\"Relay is not ready for use\\\");\\n _;\\n }\\n\\n /// @notice Establish a starting point for the relay by providing the\\n /// target, timestamp and blockheight of the first block of the relay\\n /// genesis epoch.\\n /// @param genesisHeader The first block header of the genesis epoch.\\n /// @param genesisHeight The block number of the first block of the epoch.\\n /// @param genesisProofLength The number of blocks required to accept a\\n /// proof.\\n /// @dev If the relay is used by querying the current and previous epoch\\n /// difficulty, at least one retarget needs to be provided after genesis;\\n /// otherwise the prevEpochDifficulty will be uninitialised and zero.\\n function genesis(\\n bytes calldata genesisHeader,\\n uint256 genesisHeight,\\n uint64 genesisProofLength\\n ) external onlyOwner {\\n require(!ready, \\\"Genesis already performed\\\");\\n\\n require(genesisHeader.length == 80, \\\"Invalid genesis header length\\\");\\n\\n require(\\n genesisHeight % 2016 == 0,\\n \\\"Invalid height of relay genesis block\\\"\\n );\\n\\n require(genesisProofLength < 2016, \\\"Proof length excessive\\\");\\n require(genesisProofLength > 0, \\\"Proof length may not be zero\\\");\\n\\n genesisEpoch = uint64(genesisHeight / 2016);\\n currentEpoch = genesisEpoch;\\n uint256 genesisTarget = genesisHeader.extractTarget();\\n uint256 genesisTimestamp = genesisHeader.extractTimestamp();\\n epochs[genesisEpoch] = Epoch(\\n uint32(genesisTimestamp),\\n uint224(genesisTarget)\\n );\\n proofLength = genesisProofLength;\\n currentEpochDifficulty = BTCUtils.calculateDifficulty(genesisTarget);\\n ready = true;\\n\\n emit Genesis(genesisHeight);\\n }\\n\\n /// @notice Set the number of blocks required to accept a header chain.\\n /// @param newLength The required number of blocks. Must be less than 2016.\\n /// @dev For production, a high number (e.g. 20-50) is recommended.\\n /// Small numbers are accepted but should only be used for testing.\\n function setProofLength(uint64 newLength) external relayActive onlyOwner {\\n require(newLength < 2016, \\\"Proof length excessive\\\");\\n require(newLength > 0, \\\"Proof length may not be zero\\\");\\n require(newLength != proofLength, \\\"Proof length unchanged\\\");\\n proofLength = newLength;\\n emit ProofLengthChanged(newLength);\\n }\\n\\n /// @notice Set whether the relay requires retarget submitters to be\\n /// pre-authorised by governance.\\n /// @param status True if authorisation is to be required, false if not.\\n function setAuthorizationStatus(bool status) external onlyOwner {\\n authorizationRequired = status;\\n emit AuthorizationRequirementChanged(status);\\n }\\n\\n /// @notice Authorise the given address to submit retarget proofs.\\n /// @param submitter The address to be authorised.\\n function authorize(address submitter) external onlyOwner {\\n isAuthorized[submitter] = true;\\n emit SubmitterAuthorized(submitter);\\n }\\n\\n /// @notice Rescind the authorisation of the submitter to retarget.\\n /// @param submitter The address to be deauthorised.\\n function deauthorize(address submitter) external onlyOwner {\\n isAuthorized[submitter] = false;\\n emit SubmitterDeauthorized(submitter);\\n }\\n\\n /// @notice Add a new epoch to the relay by providing a proof\\n /// of the difficulty before and after the retarget.\\n /// @param headers A chain of headers including the last X blocks before\\n /// the retarget, followed by the first X blocks after the retarget,\\n /// where X equals the current proof length.\\n /// @dev Checks that the first X blocks are valid in the most recent epoch,\\n /// that the difficulty of the new epoch is calculated correctly according\\n /// to the block timestamps, and that the next X blocks would be valid in\\n /// the new epoch.\\n /// We have no information of block heights, so we cannot enforce that\\n /// retargets only happen every 2016 blocks; instead, we assume that this\\n /// is the case if a valid proof of work is provided.\\n /// It is possible to cheat the relay by providing X blocks from earlier in\\n /// the most recent epoch, and then mining X new blocks after them.\\n /// However, each of these malicious blocks would have to be mined to a\\n /// higher difficulty than the legitimate ones.\\n /// Alternatively, if the retarget has not been performed yet, one could\\n /// first mine X blocks in the old difficulty with timestamps set far in\\n /// the future, and then another X blocks at a greatly reduced difficulty.\\n /// In either case, cheating the realy requires more work than mining X\\n /// legitimate blocks.\\n /// Only the most recent epoch is vulnerable to these attacks; once a\\n /// retarget has been proven to the relay, the epoch is immutable even if a\\n /// contradictory proof were to be presented later.\\n function retarget(bytes memory headers) external relayActive {\\n if (authorizationRequired) {\\n require(isAuthorized[msg.sender], \\\"Submitter unauthorized\\\");\\n }\\n\\n require(\\n // Require proofLength headers on both sides of the retarget\\n headers.length == (proofLength * 2 * 80),\\n \\\"Invalid header length\\\"\\n );\\n\\n Epoch storage latest = epochs[currentEpoch];\\n\\n uint256 oldTarget = latest.target;\\n\\n bytes32 previousHeaderDigest = bytes32(0);\\n\\n // Validate old chain\\n for (uint256 i = 0; i < proofLength; i++) {\\n (\\n bytes32 currentDigest,\\n uint256 currentHeaderTarget\\n ) = validateHeader(headers, i * 80, previousHeaderDigest);\\n\\n require(\\n currentHeaderTarget == oldTarget,\\n \\\"Invalid target in pre-retarget headers\\\"\\n );\\n\\n previousHeaderDigest = currentDigest;\\n }\\n\\n // get timestamp of retarget block\\n uint256 epochEndTimestamp = headers.extractTimestampAt(\\n (proofLength - 1) * 80\\n );\\n\\n // An attacker could produce blocks with timestamps in the future,\\n // in an attempt to reduce the difficulty after the retarget\\n // to make mining the second part of the retarget proof easier.\\n // In particular, the attacker could reuse all but one block\\n // from the legitimate chain, and only mine the last block.\\n // To hinder this, require that the epoch end timestamp does not\\n // exceed the ethereum timestamp.\\n // NOTE: both are unix seconds, so this comparison should be valid.\\n require(\\n /* solhint-disable-next-line not-rely-on-time */\\n epochEndTimestamp < block.timestamp,\\n \\\"Epoch cannot end in the future\\\"\\n );\\n\\n // Expected target is the full-length target\\n uint256 expectedTarget = BTCUtils.retargetAlgorithm(\\n oldTarget,\\n latest.timestamp,\\n epochEndTimestamp\\n );\\n\\n // Mined target is the header-encoded target\\n uint256 minedTarget = 0;\\n\\n uint256 epochStartTimestamp = headers.extractTimestampAt(\\n proofLength * 80\\n );\\n\\n // validate new chain\\n for (uint256 j = proofLength; j < proofLength * 2; j++) {\\n (\\n bytes32 _currentDigest,\\n uint256 _currentHeaderTarget\\n ) = validateHeader(headers, j * 80, previousHeaderDigest);\\n\\n if (minedTarget == 0) {\\n // The new target has not been set, so check its correctness\\n minedTarget = _currentHeaderTarget;\\n require(\\n // Although the target is a 256-bit number, there are only 32 bits of\\n // space in the Bitcoin header. Because of that, the version stored in\\n // the header is a less-precise representation of the actual target\\n // using base-256 version of scientific notation.\\n //\\n // The 256-bit unsigned integer returned from BTCUtils.retargetAlgorithm\\n // is the precise target value.\\n // The 256-bit unsigned integer returned from validateHeader is the less\\n // precise target value because it was read from 32 bits of space of\\n // Bitcoin block header.\\n //\\n // We can't compare the precise and less precise representations together\\n // so we first mask them to obtain the less precise version:\\n // (full & truncated) == truncated\\n _currentHeaderTarget ==\\n (expectedTarget & _currentHeaderTarget),\\n \\\"Invalid target in new epoch\\\"\\n );\\n } else {\\n // The new target has been set, so remaining targets should match.\\n require(\\n _currentHeaderTarget == minedTarget,\\n \\\"Unexpected target change after retarget\\\"\\n );\\n }\\n\\n previousHeaderDigest = _currentDigest;\\n }\\n\\n currentEpoch = currentEpoch + 1;\\n\\n epochs[currentEpoch] = Epoch(\\n uint32(epochStartTimestamp),\\n uint224(minedTarget)\\n );\\n\\n uint256 oldDifficulty = currentEpochDifficulty;\\n uint256 newDifficulty = BTCUtils.calculateDifficulty(minedTarget);\\n\\n prevEpochDifficulty = oldDifficulty;\\n currentEpochDifficulty = newDifficulty;\\n\\n emit Retarget(oldDifficulty, newDifficulty);\\n }\\n\\n /// @notice Check whether a given chain of headers should be accepted as\\n /// valid within the rules of the relay.\\n /// If the validation fails, this function throws an exception.\\n /// @param headers A chain of 2 to 2015 bitcoin headers.\\n /// @return startingHeaderTimestamp The timestamp of the first header.\\n /// @return headerCount The number of headers.\\n /// @dev A chain of headers is accepted as valid if:\\n /// - Its length is between 2 and 2015 headers.\\n /// - Headers in the chain are sequential and refer to previous digests.\\n /// - Each header is mined with the correct amount of work.\\n /// - The difficulty in each header matches an epoch of the relay,\\n /// as determined by the headers' timestamps. The headers must be between\\n /// the genesis epoch and the latest proven epoch (inclusive).\\n /// If the chain contains a retarget, it is accepted if the retarget has\\n /// already been proven to the relay.\\n /// If the chain contains blocks of an epoch that has not been proven to\\n /// the relay (after a retarget within the header chain, or when the entire\\n /// chain falls within an epoch that has not been proven yet), it will be\\n /// rejected.\\n /// One exception to this is when two subsequent epochs have exactly the\\n /// same difficulty; headers from the latter epoch will be accepted if the\\n /// previous epoch has been proven to the relay.\\n /// This is because it is not possible to distinguish such headers from\\n /// headers of the previous epoch.\\n ///\\n /// If the difficulty increases significantly between relay genesis and the\\n /// present, creating fraudulent proofs for earlier epochs becomes easier.\\n /// Users of the relay should check the timestamps of valid headers and\\n /// only accept appropriately recent ones.\\n function validateChain(bytes memory headers)\\n external\\n view\\n returns (uint256 startingHeaderTimestamp, uint256 headerCount)\\n {\\n require(headers.length % 80 == 0, \\\"Invalid header length\\\");\\n\\n headerCount = headers.length / 80;\\n\\n require(\\n headerCount > 1 && headerCount < 2016,\\n \\\"Invalid number of headers\\\"\\n );\\n\\n startingHeaderTimestamp = headers.extractTimestamp();\\n\\n // Short-circuit the first header's validation.\\n // We validate the header here to get the target which is needed to\\n // precisely identify the epoch.\\n (\\n bytes32 previousHeaderDigest,\\n uint256 currentHeaderTarget\\n ) = validateHeader(headers, 0, bytes32(0));\\n\\n Epoch memory nullEpoch = Epoch(0, 0);\\n\\n uint256 startingEpochNumber = currentEpoch;\\n Epoch memory startingEpoch = epochs[startingEpochNumber];\\n Epoch memory nextEpoch = nullEpoch;\\n\\n // Find the correct epoch for the given chain\\n // Fastest with recent epochs, but able to handle anything after genesis\\n //\\n // The rules for bitcoin timestamps are:\\n // - must be greater than the median of the last 11 blocks' timestamps\\n // - must be less than the network-adjusted time +2 hours\\n //\\n // Because of this, the timestamp of a header may be smaller than the\\n // starting time, or greater than the ending time of its epoch.\\n // However, a valid timestamp is guaranteed to fall within the window\\n // formed by the epochs immediately before and after its timestamp.\\n // We can identify cases like these by comparing the targets.\\n while (startingHeaderTimestamp < startingEpoch.timestamp) {\\n startingEpochNumber -= 1;\\n nextEpoch = startingEpoch;\\n startingEpoch = epochs[startingEpochNumber];\\n }\\n\\n // We have identified the centre of the window,\\n // by reaching the most recent epoch whose starting timestamp\\n // or reached before the genesis where epoch slots are empty.\\n // Therefore check that the timestamp is nonzero.\\n require(\\n startingEpoch.timestamp > 0,\\n \\\"Cannot validate chains before relay genesis\\\"\\n );\\n\\n // The targets don't match. This could be because the block is invalid,\\n // or it could be because of timestamp inaccuracy.\\n // To cover the latter case, check adjacent epochs.\\n if (currentHeaderTarget != startingEpoch.target) {\\n // The target matches the next epoch.\\n // This means we are right at the beginning of the next epoch,\\n // and retargets during the chain should not be possible.\\n if (currentHeaderTarget == nextEpoch.target) {\\n startingEpoch = nextEpoch;\\n nextEpoch = nullEpoch;\\n }\\n // The target doesn't match the next epoch.\\n // Therefore the only valid epoch is the previous one.\\n // Because the timestamp can't be more than 2 hours into the future\\n // we must be right near the end of the epoch,\\n // so a retarget is possible.\\n else {\\n startingEpochNumber -= 1;\\n nextEpoch = startingEpoch;\\n startingEpoch = epochs[startingEpochNumber];\\n\\n // We have failed to find a match,\\n // therefore the target has to be invalid.\\n require(\\n currentHeaderTarget == startingEpoch.target,\\n \\\"Invalid target in header chain\\\"\\n );\\n }\\n }\\n\\n // We've found the correct epoch for the first header.\\n // Validate the rest.\\n for (uint256 i = 1; i < headerCount; i++) {\\n bytes32 currentDigest;\\n (currentDigest, currentHeaderTarget) = validateHeader(\\n headers,\\n i * 80,\\n previousHeaderDigest\\n );\\n\\n // If the header's target does not match the expected target,\\n // check if a retarget is possible.\\n //\\n // If next epoch timestamp exists, a valid retarget is possible\\n // (if next epoch timestamp doesn't exist, either a retarget has\\n // already happened in this chain, the relay needs a retarget\\n // before this chain can be validated, or a retarget is not allowed\\n // because we know the headers are within a timestamp irregularity\\n // of the previous retarget).\\n //\\n // In this case the target must match the next epoch's target,\\n // and the header's timestamp must match the epoch's start.\\n if (currentHeaderTarget != startingEpoch.target) {\\n uint256 currentHeaderTimestamp = headers.extractTimestampAt(\\n i * 80\\n );\\n\\n require(\\n nextEpoch.timestamp != 0 &&\\n currentHeaderTarget == nextEpoch.target &&\\n currentHeaderTimestamp == nextEpoch.timestamp,\\n \\\"Invalid target in header chain\\\"\\n );\\n\\n startingEpoch = nextEpoch;\\n nextEpoch = nullEpoch;\\n }\\n\\n previousHeaderDigest = currentDigest;\\n }\\n\\n return (startingHeaderTimestamp, headerCount);\\n }\\n\\n /// @notice Get the difficulty of the specified block.\\n /// @param blockNumber The number of the block. Must fall within the relay\\n /// range (at or after the relay genesis, and at or before the end of the\\n /// most recent epoch proven to the relay).\\n /// @return The difficulty of the epoch.\\n function getBlockDifficulty(uint256 blockNumber)\\n external\\n view\\n returns (uint256)\\n {\\n return getEpochDifficulty(blockNumber / 2016);\\n }\\n\\n /// @notice Get the range of blocks the relay can accept proofs for.\\n /// @dev Assumes that the genesis has been set correctly.\\n /// Additionally, if the next epoch after the current one has the exact\\n /// same difficulty, headers for it can be validated as well.\\n /// This function should be used for informative purposes,\\n /// e.g. to determine whether a retarget must be provided before submitting\\n /// a header chain for validation.\\n /// @return relayGenesis The height of the earliest block that can be\\n /// included in header chains for the relay to validate.\\n /// @return currentEpochEnd The height of the last block that can be\\n /// included in header chains for the relay to validate.\\n function getRelayRange()\\n external\\n view\\n returns (uint256 relayGenesis, uint256 currentEpochEnd)\\n {\\n relayGenesis = genesisEpoch * 2016;\\n currentEpochEnd = (currentEpoch * 2016) + 2015;\\n }\\n\\n /// @notice Returns the difficulty of the current epoch.\\n /// @dev returns 0 if the relay is not ready.\\n /// @return The difficulty of the current epoch.\\n function getCurrentEpochDifficulty()\\n external\\n view\\n virtual\\n returns (uint256)\\n {\\n return currentEpochDifficulty;\\n }\\n\\n /// @notice Returns the difficulty of the previous epoch.\\n /// @dev Returns 0 if the relay is not ready or has not had a retarget.\\n /// @return The difficulty of the previous epoch.\\n function getPrevEpochDifficulty() external view virtual returns (uint256) {\\n return prevEpochDifficulty;\\n }\\n\\n function getCurrentAndPrevEpochDifficulty()\\n external\\n view\\n returns (uint256 current, uint256 previous)\\n {\\n return (currentEpochDifficulty, prevEpochDifficulty);\\n }\\n\\n /// @notice Get the difficulty of the specified epoch.\\n /// @param epochNumber The number of the epoch (the height of the first\\n /// block of the epoch, divided by 2016). Must fall within the relay range.\\n /// @return The difficulty of the epoch.\\n function getEpochDifficulty(uint256 epochNumber)\\n public\\n view\\n returns (uint256)\\n {\\n require(epochNumber >= genesisEpoch, \\\"Epoch is before relay genesis\\\");\\n require(\\n epochNumber <= currentEpoch,\\n \\\"Epoch is not proven to the relay yet\\\"\\n );\\n return BTCUtils.calculateDifficulty(epochs[epochNumber].target);\\n }\\n\\n /// @notice Check that the specified header forms a correct chain with the\\n /// digest of the previous header (if provided), and has sufficient work.\\n /// @param headers The byte array containing the header of interest.\\n /// @param start The start of the header in the array.\\n /// @param prevDigest The digest of the previous header\\n /// (optional; providing zeros for the digest skips the check).\\n /// @return digest The digest of the current header.\\n /// @return target The PoW target of the header.\\n /// @dev Throws an exception if the header's chain or PoW are invalid.\\n /// Performs no other validation.\\n function validateHeader(\\n bytes memory headers,\\n uint256 start,\\n bytes32 prevDigest\\n ) internal view returns (bytes32 digest, uint256 target) {\\n // If previous block digest has been provided, require that it matches\\n if (prevDigest != bytes32(0)) {\\n require(\\n headers.validateHeaderPrevHash(start, prevDigest),\\n \\\"Invalid chain\\\"\\n );\\n }\\n\\n // Require that the header has sufficient work for its stated target\\n target = headers.extractTargetAt(start);\\n digest = headers.hash256Slice(start, 80);\\n require(ValidateSPV.validateHeaderWork(digest, target), \\\"Invalid work\\\");\\n\\n return (digest, target);\\n }\\n}\\n\",\"keccak256\":\"0x5329ba57ec3db13128ba0a90569682b16211f7fbc3fbab764fd0cd60386a7441\",\"license\":\"GPL-3.0-only\"},\"contracts/relay/LightRelayMaintainerProxy.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@keep-network/random-beacon/contracts/Reimbursable.sol\\\";\\nimport \\\"@keep-network/random-beacon/contracts/ReimbursementPool.sol\\\";\\n\\nimport \\\"./LightRelay.sol\\\";\\n\\n/// @title LightRelayMaintainerProxy\\n/// @notice The proxy contract that allows the relay maintainers to be refunded\\n/// for the spent gas from the `ReimbursementPool`. When proving the\\n/// next Bitcoin difficulty epoch, the maintainer calls the\\n/// `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay`\\n/// contract.\\ncontract LightRelayMaintainerProxy is Ownable, Reimbursable {\\n ILightRelay public lightRelay;\\n\\n /// @notice Stores the addresses that can maintain the relay. Those\\n /// addresses are attested by the DAO.\\n /// @dev The goal is to prevent a griefing attack by frontrunning relay\\n /// maintainer which is responsible for retargetting the relay in the\\n /// given round. The maintainer's transaction would revert with no gas\\n /// refund. Having the ability to restrict maintainer addresses is also\\n /// important in case the underlying relay contract has authorization\\n /// requirements for callers.\\n mapping(address => bool) public isAuthorized;\\n\\n /// @notice Gas that is meant to balance the retarget overall cost. Can be\\n // updated by the governance based on the current market conditions.\\n uint256 public retargetGasOffset;\\n\\n event LightRelayUpdated(address newRelay);\\n\\n event MaintainerAuthorized(address indexed maintainer);\\n\\n event MaintainerDeauthorized(address indexed maintainer);\\n\\n event RetargetGasOffsetUpdated(uint256 retargetGasOffset);\\n\\n modifier onlyRelayMaintainer() {\\n require(isAuthorized[msg.sender], \\\"Caller is not authorized\\\");\\n _;\\n }\\n\\n modifier onlyReimbursableAdmin() override {\\n require(owner() == msg.sender, \\\"Caller is not the owner\\\");\\n _;\\n }\\n\\n constructor(ILightRelay _lightRelay, ReimbursementPool _reimbursementPool) {\\n require(\\n address(_lightRelay) != address(0),\\n \\\"Light relay must not be zero address\\\"\\n );\\n require(\\n address(_reimbursementPool) != address(0),\\n \\\"Reimbursement pool must not be zero address\\\"\\n );\\n\\n lightRelay = _lightRelay;\\n reimbursementPool = _reimbursementPool;\\n\\n retargetGasOffset = 54000;\\n }\\n\\n /// @notice Allows the governance to upgrade the `LightRelay` address.\\n /// @dev The function does not implement any governance delay and does not\\n /// check the status of the `LightRelay`. The Governance implementation\\n /// needs to ensure all requirements for the upgrade are satisfied\\n /// before executing this function.\\n function updateLightRelay(ILightRelay _lightRelay) external onlyOwner {\\n require(\\n address(_lightRelay) != address(0),\\n \\\"New light relay must not be zero address\\\"\\n );\\n\\n lightRelay = _lightRelay;\\n emit LightRelayUpdated(address(_lightRelay));\\n }\\n\\n /// @notice Authorizes the given address as a maintainer. Can only be called\\n /// by the owner and the address of the maintainer must not be\\n /// already authorized.\\n /// @dev The function does not implement any governance delay.\\n /// @param maintainer The address of the maintainer to be authorized.\\n function authorize(address maintainer) external onlyOwner {\\n require(!isAuthorized[maintainer], \\\"Maintainer is already authorized\\\");\\n\\n isAuthorized[maintainer] = true;\\n emit MaintainerAuthorized(maintainer);\\n }\\n\\n /// @notice Deauthorizes the given address as a maintainer. Can only be\\n /// called by the owner and the address of the maintainer must be\\n /// authorized.\\n /// @dev The function does not implement any governance delay.\\n /// @param maintainer The address of the maintainer to be deauthorized.\\n function deauthorize(address maintainer) external onlyOwner {\\n require(isAuthorized[maintainer], \\\"Maintainer is not authorized\\\");\\n\\n isAuthorized[maintainer] = false;\\n emit MaintainerDeauthorized(maintainer);\\n }\\n\\n /// @notice Updates the values of retarget gas offset.\\n /// @dev Can be called only by the contract owner. The caller is responsible\\n /// for validating the parameter. The function does not implement any\\n /// governance delay.\\n /// @param newRetargetGasOffset New retarget gas offset.\\n function updateRetargetGasOffset(uint256 newRetargetGasOffset)\\n external\\n onlyOwner\\n {\\n retargetGasOffset = newRetargetGasOffset;\\n emit RetargetGasOffsetUpdated(retargetGasOffset);\\n }\\n\\n /// @notice Wraps `LightRelay.retarget` call and reimburses the caller's\\n /// transaction cost. Can only be called by an authorized relay\\n /// maintainer.\\n /// @dev See `LightRelay.retarget` function documentation.\\n function retarget(bytes memory headers) external onlyRelayMaintainer {\\n uint256 gasStart = gasleft();\\n\\n lightRelay.retarget(headers);\\n\\n reimbursementPool.refund(\\n (gasStart - gasleft()) + retargetGasOffset,\\n msg.sender\\n );\\n }\\n}\\n\",\"keccak256\":\"0x600209d75d154bd879a06c65279ab14d3165fc7e3a0989db34199390963de9ae\",\"license\":\"GPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610c2c380380610c2c83398101604081905261002f916101a8565b61003833610140565b6001600160a01b03821661009f5760405162461bcd60e51b8152602060048201526024808201527f4c696768742072656c6179206d757374206e6f74206265207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b6001600160a01b0381166101095760405162461bcd60e51b815260206004820152602b60248201527f5265696d62757273656d656e7420706f6f6c206d757374206e6f74206265207a60448201526a65726f206164647265737360a81b6064820152608401610096565b603380546001600160a01b039384166001600160a01b0319918216179091556001805492909316911617905561d2f06035556101e2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146101a557600080fd5b50565b600080604083850312156101bb57600080fd5b82516101c681610190565b60208401519092506101d781610190565b809150509250929050565b610a3b806101f16000396000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063b6a5d7de11610066578063b6a5d7de146101a5578063c09975cd146101b8578063f2fde38b146101cb578063fe9fbb80146101de57600080fd5b80638da5cb5b1461016e5780639d5f29df1461017f578063b214b4981461019257600080fd5b80637b35b4e6116100bd5780637b35b4e61461011d5780637ca5b1dd1461013057806384dc44091461014357600080fd5b806327c97fa5146100e4578063293aa4a2146100f9578063715018a614610115575b600080fd5b6100f76100f2366004610871565b610211565b005b61010260355481565b6040519081526020015b60405180910390f35b6100f76102cf565b6100f761012b366004610871565b6102e3565b6100f761013e3660046108ab565b6103b7565b603354610156906001600160a01b031681565b6040516001600160a01b03909116815260200161010c565b6000546001600160a01b0316610156565b6100f761018d366004610871565b610535565b6100f76101a036600461095c565b61061b565b6100f76101b3366004610871565b610658565b600154610156906001600160a01b031681565b6100f76101d9366004610871565b610715565b6102016101ec366004610871565b60346020526000908152604090205460ff1681565b604051901515815260200161010c565b6102196107a5565b6001600160a01b03811660009081526034602052604090205460ff166102865760405162461bcd60e51b815260206004820152601c60248201527f4d61696e7461696e6572206973206e6f7420617574686f72697a65640000000060448201526064015b60405180910390fd5b6001600160a01b038116600081815260346020526040808220805460ff19169055517fc74b7e7972a420ccf708a44401a97c1bcaacb21a25a1e0f83ee40841654b2ec89190a250565b6102d76107a5565b6102e160006107ff565b565b336102f66000546001600160a01b031690565b6001600160a01b03161461034c5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000604482015260640161027d565b6040516001600160a01b03821681527f0e2d2343d31b085b7c4e56d1c8a6ec79f7ab07460386f1c9a1756239fe2533ac9060200160405180910390a16001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b3360009081526034602052604090205460ff166104165760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420617574686f72697a65640000000000000000604482015260640161027d565b60005a6033546040517f7ca5b1dd0000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690637ca5b1dd90610463908590600401610975565b600060405180830381600087803b15801561047d57600080fd5b505af1158015610491573d6000803e3d6000fd5b50506001546035546001600160a01b039091169250637ad226dc91505a6104b890856109d9565b6104c291906109f2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152336024820152604401600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505050505050565b61053d6107a5565b6001600160a01b0381166105b95760405162461bcd60e51b815260206004820152602860248201527f4e6577206c696768742072656c6179206d757374206e6f74206265207a65726f60448201527f2061646472657373000000000000000000000000000000000000000000000000606482015260840161027d565b6033805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fa46f2602ab8b56454b3c3f2ac8bbad3a47d901cc73f0d800b2d607eb68743428906020015b60405180910390a150565b6106236107a5565b60358190556040518181527f47498a8064df4e0fae8efc492d7ce3222dc1dc415d1e1ff688a327ff101940fd90602001610610565b6106606107a5565b6001600160a01b03811660009081526034602052604090205460ff16156106c95760405162461bcd60e51b815260206004820181905260248201527f4d61696e7461696e657220697320616c726561647920617574686f72697a6564604482015260640161027d565b6001600160a01b038116600081815260346020526040808220805460ff19166001179055517fd47aed730622d4816ba8c667c5644d30d0042568ce573955dfa5cafd60ecba4b9190a250565b61071d6107a5565b6001600160a01b0381166107995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161027d565b6107a2816107ff565b50565b6000546001600160a01b031633146102e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161027d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146107a257600080fd5b60006020828403121561088357600080fd5b813561088e8161085c565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156108bd57600080fd5b813567ffffffffffffffff808211156108d557600080fd5b818401915084601f8301126108e957600080fd5b8135818111156108fb576108fb610895565b604051601f8201601f19908116603f0116810190838211818310171561092357610923610895565b8160405282815287602084870101111561093c57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561096e57600080fd5b5035919050565b600060208083528351808285015260005b818110156109a257858101830151858201604001528201610986565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156109ec576109ec6109c3565b92915050565b808201808211156109ec576109ec6109c356fea26469706673582212204c1db717ea81f3512cc4bba5e616ce0d380223671e65b946c7b271b3c789ec1064736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c80638da5cb5b1161008c578063b6a5d7de11610066578063b6a5d7de146101a5578063c09975cd146101b8578063f2fde38b146101cb578063fe9fbb80146101de57600080fd5b80638da5cb5b1461016e5780639d5f29df1461017f578063b214b4981461019257600080fd5b80637b35b4e6116100bd5780637b35b4e61461011d5780637ca5b1dd1461013057806384dc44091461014357600080fd5b806327c97fa5146100e4578063293aa4a2146100f9578063715018a614610115575b600080fd5b6100f76100f2366004610871565b610211565b005b61010260355481565b6040519081526020015b60405180910390f35b6100f76102cf565b6100f761012b366004610871565b6102e3565b6100f761013e3660046108ab565b6103b7565b603354610156906001600160a01b031681565b6040516001600160a01b03909116815260200161010c565b6000546001600160a01b0316610156565b6100f761018d366004610871565b610535565b6100f76101a036600461095c565b61061b565b6100f76101b3366004610871565b610658565b600154610156906001600160a01b031681565b6100f76101d9366004610871565b610715565b6102016101ec366004610871565b60346020526000908152604090205460ff1681565b604051901515815260200161010c565b6102196107a5565b6001600160a01b03811660009081526034602052604090205460ff166102865760405162461bcd60e51b815260206004820152601c60248201527f4d61696e7461696e6572206973206e6f7420617574686f72697a65640000000060448201526064015b60405180910390fd5b6001600160a01b038116600081815260346020526040808220805460ff19169055517fc74b7e7972a420ccf708a44401a97c1bcaacb21a25a1e0f83ee40841654b2ec89190a250565b6102d76107a5565b6102e160006107ff565b565b336102f66000546001600160a01b031690565b6001600160a01b03161461034c5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420746865206f776e6572000000000000000000604482015260640161027d565b6040516001600160a01b03821681527f0e2d2343d31b085b7c4e56d1c8a6ec79f7ab07460386f1c9a1756239fe2533ac9060200160405180910390a16001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b3360009081526034602052604090205460ff166104165760405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206973206e6f7420617574686f72697a65640000000000000000604482015260640161027d565b60005a6033546040517f7ca5b1dd0000000000000000000000000000000000000000000000000000000081529192506001600160a01b031690637ca5b1dd90610463908590600401610975565b600060405180830381600087803b15801561047d57600080fd5b505af1158015610491573d6000803e3d6000fd5b50506001546035546001600160a01b039091169250637ad226dc91505a6104b890856109d9565b6104c291906109f2565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526004810191909152336024820152604401600060405180830381600087803b15801561051957600080fd5b505af115801561052d573d6000803e3d6000fd5b505050505050565b61053d6107a5565b6001600160a01b0381166105b95760405162461bcd60e51b815260206004820152602860248201527f4e6577206c696768742072656c6179206d757374206e6f74206265207a65726f60448201527f2061646472657373000000000000000000000000000000000000000000000000606482015260840161027d565b6033805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fa46f2602ab8b56454b3c3f2ac8bbad3a47d901cc73f0d800b2d607eb68743428906020015b60405180910390a150565b6106236107a5565b60358190556040518181527f47498a8064df4e0fae8efc492d7ce3222dc1dc415d1e1ff688a327ff101940fd90602001610610565b6106606107a5565b6001600160a01b03811660009081526034602052604090205460ff16156106c95760405162461bcd60e51b815260206004820181905260248201527f4d61696e7461696e657220697320616c726561647920617574686f72697a6564604482015260640161027d565b6001600160a01b038116600081815260346020526040808220805460ff19166001179055517fd47aed730622d4816ba8c667c5644d30d0042568ce573955dfa5cafd60ecba4b9190a250565b61071d6107a5565b6001600160a01b0381166107995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161027d565b6107a2816107ff565b50565b6000546001600160a01b031633146102e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161027d565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146107a257600080fd5b60006020828403121561088357600080fd5b813561088e8161085c565b9392505050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156108bd57600080fd5b813567ffffffffffffffff808211156108d557600080fd5b818401915084601f8301126108e957600080fd5b8135818111156108fb576108fb610895565b604051601f8201601f19908116603f0116810190838211818310171561092357610923610895565b8160405282815287602084870101111561093c57600080fd5b826020860160208301376000928101602001929092525095945050505050565b60006020828403121561096e57600080fd5b5035919050565b600060208083528351808285015260005b818110156109a257858101830151858201604001528201610986565b506000604082860101526040601f19601f8301168501019250505092915050565b634e487b7160e01b600052601160045260246000fd5b818103818111156109ec576109ec6109c3565b92915050565b808201808211156109ec576109ec6109c356fea26469706673582212204c1db717ea81f3512cc4bba5e616ce0d380223671e65b946c7b271b3c789ec1064736f6c63430008110033", + "devdoc": { + "kind": "dev", + "methods": { + "authorize(address)": { + "details": "The function does not implement any governance delay.", + "params": { + "maintainer": "The address of the maintainer to be authorized." + } + }, + "deauthorize(address)": { + "details": "The function does not implement any governance delay.", + "params": { + "maintainer": "The address of the maintainer to be deauthorized." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "retarget(bytes)": { + "details": "See `LightRelay.retarget` function documentation." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateLightRelay(address)": { + "details": "The function does not implement any governance delay and does not check the status of the `LightRelay`. The Governance implementation needs to ensure all requirements for the upgrade are satisfied before executing this function." + }, + "updateRetargetGasOffset(uint256)": { + "details": "Can be called only by the contract owner. The caller is responsible for validating the parameter. The function does not implement any governance delay.", + "params": { + "newRetargetGasOffset": "New retarget gas offset." + } + } + }, + "stateVariables": { + "isAuthorized": { + "details": "The goal is to prevent a griefing attack by frontrunning relay maintainer which is responsible for retargetting the relay in the given round. The maintainer's transaction would revert with no gas refund. Having the ability to restrict maintainer addresses is also important in case the underlying relay contract has authorization requirements for callers." + } + }, + "title": "LightRelayMaintainerProxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "authorize(address)": { + "notice": "Authorizes the given address as a maintainer. Can only be called by the owner and the address of the maintainer must not be already authorized." + }, + "deauthorize(address)": { + "notice": "Deauthorizes the given address as a maintainer. Can only be called by the owner and the address of the maintainer must be authorized." + }, + "isAuthorized(address)": { + "notice": "Stores the addresses that can maintain the relay. Those addresses are attested by the DAO." + }, + "retarget(bytes)": { + "notice": "Wraps `LightRelay.retarget` call and reimburses the caller's transaction cost. Can only be called by an authorized relay maintainer." + }, + "retargetGasOffset()": { + "notice": "Gas that is meant to balance the retarget overall cost. Can be" + }, + "updateLightRelay(address)": { + "notice": "Allows the governance to upgrade the `LightRelay` address." + }, + "updateRetargetGasOffset(uint256)": { + "notice": "Updates the values of retarget gas offset." + } + }, + "notice": "The proxy contract that allows the relay maintainers to be refunded for the spent gas from the `ReimbursementPool`. When proving the next Bitcoin difficulty epoch, the maintainer calls the `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay` contract.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 12076, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 5151, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "reimbursementPool", + "offset": 0, + "slot": "1", + "type": "t_contract(ReimbursementPool)5481" + }, + { + "astId": 5155, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "__gap", + "offset": 0, + "slot": "2", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25082, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "lightRelay", + "offset": 0, + "slot": "51", + "type": "t_contract(ILightRelay)24165" + }, + { + "astId": 25087, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "isAuthorized", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_bool)" + }, + { + "astId": 25090, + "contract": "contracts/relay/LightRelayMaintainerProxy.sol:LightRelayMaintainerProxy", + "label": "retargetGasOffset", + "offset": 0, + "slot": "53", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(ILightRelay)24165": { + "encoding": "inplace", + "label": "contract ILightRelay", + "numberOfBytes": "20" + }, + "t_contract(ReimbursementPool)5481": { + "encoding": "inplace", + "label": "contract ReimbursementPool", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/solidity/deployments/mainnet/solcInputs/d71d4b4434e6669852eaf643ebd2a7bc.json b/solidity/deployments/mainnet/solcInputs/d71d4b4434e6669852eaf643ebd2a7bc.json new file mode 100644 index 000000000..af2eb0fa4 --- /dev/null +++ b/solidity/deployments/mainnet/solcInputs/d71d4b4434e6669852eaf643ebd2a7bc.json @@ -0,0 +1,209 @@ +{ + "language": "Solidity", + "sources": { + "@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol": { + "content": "pragma solidity ^0.8.4;\n\n/** @title BitcoinSPV */\n/** @author Summa (https://summa.one) */\n\nimport {BytesLib} from \"./BytesLib.sol\";\nimport {SafeMath} from \"./SafeMath.sol\";\n\nlibrary BTCUtils {\n using BytesLib for bytes;\n using SafeMath for uint256;\n\n // The target at minimum Difficulty. Also the target of the genesis block\n uint256 public constant DIFF1_TARGET = 0xffff0000000000000000000000000000000000000000000000000000;\n\n uint256 public constant RETARGET_PERIOD = 2 * 7 * 24 * 60 * 60; // 2 weeks in seconds\n uint256 public constant RETARGET_PERIOD_BLOCKS = 2016; // 2 weeks in blocks\n\n uint256 public constant ERR_BAD_ARG = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n\n /* ***** */\n /* UTILS */\n /* ***** */\n\n /// @notice Determines the length of a VarInt in bytes\n /// @dev A VarInt of >1 byte is prefixed with a flag indicating its length\n /// @param _flag The first byte of a VarInt\n /// @return The number of non-flag bytes in the VarInt\n function determineVarIntDataLength(bytes memory _flag) internal pure returns (uint8) {\n return determineVarIntDataLengthAt(_flag, 0);\n }\n\n /// @notice Determines the length of a VarInt in bytes\n /// @dev A VarInt of >1 byte is prefixed with a flag indicating its length\n /// @param _b The byte array containing a VarInt\n /// @param _at The position of the VarInt in the array\n /// @return The number of non-flag bytes in the VarInt\n function determineVarIntDataLengthAt(bytes memory _b, uint256 _at) internal pure returns (uint8) {\n if (uint8(_b[_at]) == 0xff) {\n return 8; // one-byte flag, 8 bytes data\n }\n if (uint8(_b[_at]) == 0xfe) {\n return 4; // one-byte flag, 4 bytes data\n }\n if (uint8(_b[_at]) == 0xfd) {\n return 2; // one-byte flag, 2 bytes data\n }\n\n return 0; // flag is data\n }\n\n /// @notice Parse a VarInt into its data length and the number it represents\n /// @dev Useful for Parsing Vins and Vouts. Returns ERR_BAD_ARG if insufficient bytes.\n /// Caller SHOULD explicitly handle this case (or bubble it up)\n /// @param _b A byte-string starting with a VarInt\n /// @return number of bytes in the encoding (not counting the tag), the encoded int\n function parseVarInt(bytes memory _b) internal pure returns (uint256, uint256) {\n return parseVarIntAt(_b, 0);\n }\n\n /// @notice Parse a VarInt into its data length and the number it represents\n /// @dev Useful for Parsing Vins and Vouts. Returns ERR_BAD_ARG if insufficient bytes.\n /// Caller SHOULD explicitly handle this case (or bubble it up)\n /// @param _b A byte-string containing a VarInt\n /// @param _at The position of the VarInt\n /// @return number of bytes in the encoding (not counting the tag), the encoded int\n function parseVarIntAt(bytes memory _b, uint256 _at) internal pure returns (uint256, uint256) {\n uint8 _dataLen = determineVarIntDataLengthAt(_b, _at);\n\n if (_dataLen == 0) {\n return (0, uint8(_b[_at]));\n }\n if (_b.length < 1 + _dataLen + _at) {\n return (ERR_BAD_ARG, 0);\n }\n uint256 _number;\n if (_dataLen == 2) {\n _number = reverseUint16(uint16(_b.slice2(1 + _at)));\n } else if (_dataLen == 4) {\n _number = reverseUint32(uint32(_b.slice4(1 + _at)));\n } else if (_dataLen == 8) {\n _number = reverseUint64(uint64(_b.slice8(1 + _at)));\n }\n return (_dataLen, _number);\n }\n\n /// @notice Changes the endianness of a byte array\n /// @dev Returns a new, backwards, bytes\n /// @param _b The bytes to reverse\n /// @return The reversed bytes\n function reverseEndianness(bytes memory _b) internal pure returns (bytes memory) {\n bytes memory _newValue = new bytes(_b.length);\n\n for (uint i = 0; i < _b.length; i++) {\n _newValue[_b.length - i - 1] = _b[i];\n }\n\n return _newValue;\n }\n\n /// @notice Changes the endianness of a uint256\n /// @dev https://graphics.stanford.edu/~seander/bithacks.html#ReverseParallel\n /// @param _b The unsigned integer to reverse\n /// @return v The reversed value\n function reverseUint256(uint256 _b) internal pure returns (uint256 v) {\n v = _b;\n\n // swap bytes\n v = ((v >> 8) & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) |\n ((v & 0x00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF) << 8);\n // swap 2-byte long pairs\n v = ((v >> 16) & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) |\n ((v & 0x0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF) << 16);\n // swap 4-byte long pairs\n v = ((v >> 32) & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) |\n ((v & 0x00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF00000000FFFFFFFF) << 32);\n // swap 8-byte long pairs\n v = ((v >> 64) & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) |\n ((v & 0x0000000000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF) << 64);\n // swap 16-byte long pairs\n v = (v >> 128) | (v << 128);\n }\n\n /// @notice Changes the endianness of a uint64\n /// @param _b The unsigned integer to reverse\n /// @return v The reversed value\n function reverseUint64(uint64 _b) internal pure returns (uint64 v) {\n v = _b;\n\n // swap bytes\n v = ((v >> 8) & 0x00FF00FF00FF00FF) |\n ((v & 0x00FF00FF00FF00FF) << 8);\n // swap 2-byte long pairs\n v = ((v >> 16) & 0x0000FFFF0000FFFF) |\n ((v & 0x0000FFFF0000FFFF) << 16);\n // swap 4-byte long pairs\n v = (v >> 32) | (v << 32);\n }\n\n /// @notice Changes the endianness of a uint32\n /// @param _b The unsigned integer to reverse\n /// @return v The reversed value\n function reverseUint32(uint32 _b) internal pure returns (uint32 v) {\n v = _b;\n\n // swap bytes\n v = ((v >> 8) & 0x00FF00FF) |\n ((v & 0x00FF00FF) << 8);\n // swap 2-byte long pairs\n v = (v >> 16) | (v << 16);\n }\n\n /// @notice Changes the endianness of a uint24\n /// @param _b The unsigned integer to reverse\n /// @return v The reversed value\n function reverseUint24(uint24 _b) internal pure returns (uint24 v) {\n v = (_b << 16) | (_b & 0x00FF00) | (_b >> 16);\n }\n\n /// @notice Changes the endianness of a uint16\n /// @param _b The unsigned integer to reverse\n /// @return v The reversed value\n function reverseUint16(uint16 _b) internal pure returns (uint16 v) {\n v = (_b << 8) | (_b >> 8);\n }\n\n\n /// @notice Converts big-endian bytes to a uint\n /// @dev Traverses the byte array and sums the bytes\n /// @param _b The big-endian bytes-encoded integer\n /// @return The integer representation\n function bytesToUint(bytes memory _b) internal pure returns (uint256) {\n uint256 _number;\n\n for (uint i = 0; i < _b.length; i++) {\n _number = _number + uint8(_b[i]) * (2 ** (8 * (_b.length - (i + 1))));\n }\n\n return _number;\n }\n\n /// @notice Get the last _num bytes from a byte array\n /// @param _b The byte array to slice\n /// @param _num The number of bytes to extract from the end\n /// @return The last _num bytes of _b\n function lastBytes(bytes memory _b, uint256 _num) internal pure returns (bytes memory) {\n uint256 _start = _b.length.sub(_num);\n\n return _b.slice(_start, _num);\n }\n\n /// @notice Implements bitcoin's hash160 (rmd160(sha2()))\n /// @dev abi.encodePacked changes the return to bytes instead of bytes32\n /// @param _b The pre-image\n /// @return The digest\n function hash160(bytes memory _b) internal pure returns (bytes memory) {\n return abi.encodePacked(ripemd160(abi.encodePacked(sha256(_b))));\n }\n\n /// @notice Implements bitcoin's hash160 (sha2 + ripemd160)\n /// @dev sha2 precompile at address(2), ripemd160 at address(3)\n /// @param _b The pre-image\n /// @return res The digest\n function hash160View(bytes memory _b) internal view returns (bytes20 res) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n pop(staticcall(gas(), 2, add(_b, 32), mload(_b), 0x00, 32))\n pop(staticcall(gas(), 3, 0x00, 32, 0x00, 32))\n // read from position 12 = 0c\n res := mload(0x0c)\n }\n }\n\n /// @notice Implements bitcoin's hash256 (double sha2)\n /// @dev abi.encodePacked changes the return to bytes instead of bytes32\n /// @param _b The pre-image\n /// @return The digest\n function hash256(bytes memory _b) internal pure returns (bytes32) {\n return sha256(abi.encodePacked(sha256(_b)));\n }\n\n /// @notice Implements bitcoin's hash256 (double sha2)\n /// @dev sha2 is precompiled smart contract located at address(2)\n /// @param _b The pre-image\n /// @return res The digest\n function hash256View(bytes memory _b) internal view returns (bytes32 res) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n pop(staticcall(gas(), 2, add(_b, 32), mload(_b), 0x00, 32))\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\n res := mload(0x00)\n }\n }\n\n /// @notice Implements bitcoin's hash256 on a pair of bytes32\n /// @dev sha2 is precompiled smart contract located at address(2)\n /// @param _a The first bytes32 of the pre-image\n /// @param _b The second bytes32 of the pre-image\n /// @return res The digest\n function hash256Pair(bytes32 _a, bytes32 _b) internal view returns (bytes32 res) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n mstore(0x00, _a)\n mstore(0x20, _b)\n pop(staticcall(gas(), 2, 0x00, 64, 0x00, 32))\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\n res := mload(0x00)\n }\n }\n\n /// @notice Implements bitcoin's hash256 (double sha2)\n /// @dev sha2 is precompiled smart contract located at address(2)\n /// @param _b The array containing the pre-image\n /// @param at The start of the pre-image\n /// @param len The length of the pre-image\n /// @return res The digest\n function hash256Slice(\n bytes memory _b,\n uint256 at,\n uint256 len\n ) internal view returns (bytes32 res) {\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n pop(staticcall(gas(), 2, add(_b, add(32, at)), len, 0x00, 32))\n pop(staticcall(gas(), 2, 0x00, 32, 0x00, 32))\n res := mload(0x00)\n }\n }\n\n /* ************ */\n /* Legacy Input */\n /* ************ */\n\n /// @notice Extracts the nth input from the vin (0-indexed)\n /// @dev Iterates over the vin. If you need to extract several, write a custom function\n /// @param _vin The vin as a tightly-packed byte array\n /// @param _index The 0-indexed location of the input to extract\n /// @return The input as a byte array\n function extractInputAtIndex(bytes memory _vin, uint256 _index) internal pure returns (bytes memory) {\n uint256 _varIntDataLen;\n uint256 _nIns;\n\n (_varIntDataLen, _nIns) = parseVarInt(_vin);\n require(_varIntDataLen != ERR_BAD_ARG, \"Read overrun during VarInt parsing\");\n require(_index < _nIns, \"Vin read overrun\");\n\n uint256 _len = 0;\n uint256 _offset = 1 + _varIntDataLen;\n\n for (uint256 _i = 0; _i < _index; _i ++) {\n _len = determineInputLengthAt(_vin, _offset);\n require(_len != ERR_BAD_ARG, \"Bad VarInt in scriptSig\");\n _offset = _offset + _len;\n }\n\n _len = determineInputLengthAt(_vin, _offset);\n require(_len != ERR_BAD_ARG, \"Bad VarInt in scriptSig\");\n return _vin.slice(_offset, _len);\n }\n\n /// @notice Determines whether an input is legacy\n /// @dev False if no scriptSig, otherwise True\n /// @param _input The input\n /// @return True for legacy, False for witness\n function isLegacyInput(bytes memory _input) internal pure returns (bool) {\n return _input[36] != hex\"00\";\n }\n\n /// @notice Determines the length of a scriptSig in an input\n /// @dev Will return 0 if passed a witness input.\n /// @param _input The LEGACY input\n /// @return The length of the script sig\n function extractScriptSigLen(bytes memory _input) internal pure returns (uint256, uint256) {\n return extractScriptSigLenAt(_input, 0);\n }\n\n /// @notice Determines the length of a scriptSig in an input\n /// starting at the specified position\n /// @dev Will return 0 if passed a witness input.\n /// @param _input The byte array containing the LEGACY input\n /// @param _at The position of the input in the array\n /// @return The length of the script sig\n function extractScriptSigLenAt(bytes memory _input, uint256 _at) internal pure returns (uint256, uint256) {\n if (_input.length < 37 + _at) {\n return (ERR_BAD_ARG, 0);\n }\n\n uint256 _varIntDataLen;\n uint256 _scriptSigLen;\n (_varIntDataLen, _scriptSigLen) = parseVarIntAt(_input, _at + 36);\n\n return (_varIntDataLen, _scriptSigLen);\n }\n\n /// @notice Determines the length of an input from its scriptSig\n /// @dev 36 for outpoint, 1 for scriptSig length, 4 for sequence\n /// @param _input The input\n /// @return The length of the input in bytes\n function determineInputLength(bytes memory _input) internal pure returns (uint256) {\n return determineInputLengthAt(_input, 0);\n }\n\n /// @notice Determines the length of an input from its scriptSig,\n /// starting at the specified position\n /// @dev 36 for outpoint, 1 for scriptSig length, 4 for sequence\n /// @param _input The byte array containing the input\n /// @param _at The position of the input in the array\n /// @return The length of the input in bytes\n function determineInputLengthAt(bytes memory _input, uint256 _at) internal pure returns (uint256) {\n uint256 _varIntDataLen;\n uint256 _scriptSigLen;\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLenAt(_input, _at);\n if (_varIntDataLen == ERR_BAD_ARG) {\n return ERR_BAD_ARG;\n }\n\n return 36 + 1 + _varIntDataLen + _scriptSigLen + 4;\n }\n\n /// @notice Extracts the LE sequence bytes from an input\n /// @dev Sequence is used for relative time locks\n /// @param _input The LEGACY input\n /// @return The sequence bytes (LE uint)\n function extractSequenceLELegacy(bytes memory _input) internal pure returns (bytes4) {\n uint256 _varIntDataLen;\n uint256 _scriptSigLen;\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLen(_input);\n require(_varIntDataLen != ERR_BAD_ARG, \"Bad VarInt in scriptSig\");\n return _input.slice4(36 + 1 + _varIntDataLen + _scriptSigLen);\n }\n\n /// @notice Extracts the sequence from the input\n /// @dev Sequence is a 4-byte little-endian number\n /// @param _input The LEGACY input\n /// @return The sequence number (big-endian uint)\n function extractSequenceLegacy(bytes memory _input) internal pure returns (uint32) {\n uint32 _leSeqence = uint32(extractSequenceLELegacy(_input));\n uint32 _beSequence = reverseUint32(_leSeqence);\n return _beSequence;\n }\n /// @notice Extracts the VarInt-prepended scriptSig from the input in a tx\n /// @dev Will return hex\"00\" if passed a witness input\n /// @param _input The LEGACY input\n /// @return The length-prepended scriptSig\n function extractScriptSig(bytes memory _input) internal pure returns (bytes memory) {\n uint256 _varIntDataLen;\n uint256 _scriptSigLen;\n (_varIntDataLen, _scriptSigLen) = extractScriptSigLen(_input);\n require(_varIntDataLen != ERR_BAD_ARG, \"Bad VarInt in scriptSig\");\n return _input.slice(36, 1 + _varIntDataLen + _scriptSigLen);\n }\n\n\n /* ************* */\n /* Witness Input */\n /* ************* */\n\n /// @notice Extracts the LE sequence bytes from an input\n /// @dev Sequence is used for relative time locks\n /// @param _input The WITNESS input\n /// @return The sequence bytes (LE uint)\n function extractSequenceLEWitness(bytes memory _input) internal pure returns (bytes4) {\n return _input.slice4(37);\n }\n\n /// @notice Extracts the sequence from the input in a tx\n /// @dev Sequence is a 4-byte little-endian number\n /// @param _input The WITNESS input\n /// @return The sequence number (big-endian uint)\n function extractSequenceWitness(bytes memory _input) internal pure returns (uint32) {\n uint32 _leSeqence = uint32(extractSequenceLEWitness(_input));\n uint32 _inputeSequence = reverseUint32(_leSeqence);\n return _inputeSequence;\n }\n\n /// @notice Extracts the outpoint from the input in a tx\n /// @dev 32-byte tx id with 4-byte index\n /// @param _input The input\n /// @return The outpoint (LE bytes of prev tx hash + LE bytes of prev tx index)\n function extractOutpoint(bytes memory _input) internal pure returns (bytes memory) {\n return _input.slice(0, 36);\n }\n\n /// @notice Extracts the outpoint tx id from an input\n /// @dev 32-byte tx id\n /// @param _input The input\n /// @return The tx id (little-endian bytes)\n function extractInputTxIdLE(bytes memory _input) internal pure returns (bytes32) {\n return _input.slice32(0);\n }\n\n /// @notice Extracts the outpoint tx id from an input\n /// starting at the specified position\n /// @dev 32-byte tx id\n /// @param _input The byte array containing the input\n /// @param _at The position of the input\n /// @return The tx id (little-endian bytes)\n function extractInputTxIdLeAt(bytes memory _input, uint256 _at) internal pure returns (bytes32) {\n return _input.slice32(_at);\n }\n\n /// @notice Extracts the LE tx input index from the input in a tx\n /// @dev 4-byte tx index\n /// @param _input The input\n /// @return The tx index (little-endian bytes)\n function extractTxIndexLE(bytes memory _input) internal pure returns (bytes4) {\n return _input.slice4(32);\n }\n\n /// @notice Extracts the LE tx input index from the input in a tx\n /// starting at the specified position\n /// @dev 4-byte tx index\n /// @param _input The byte array containing the input\n /// @param _at The position of the input\n /// @return The tx index (little-endian bytes)\n function extractTxIndexLeAt(bytes memory _input, uint256 _at) internal pure returns (bytes4) {\n return _input.slice4(32 + _at);\n }\n\n /* ****** */\n /* Output */\n /* ****** */\n\n /// @notice Determines the length of an output\n /// @dev Works with any properly formatted output\n /// @param _output The output\n /// @return The length indicated by the prefix, error if invalid length\n function determineOutputLength(bytes memory _output) internal pure returns (uint256) {\n return determineOutputLengthAt(_output, 0);\n }\n\n /// @notice Determines the length of an output\n /// starting at the specified position\n /// @dev Works with any properly formatted output\n /// @param _output The byte array containing the output\n /// @param _at The position of the output\n /// @return The length indicated by the prefix, error if invalid length\n function determineOutputLengthAt(bytes memory _output, uint256 _at) internal pure returns (uint256) {\n if (_output.length < 9 + _at) {\n return ERR_BAD_ARG;\n }\n uint256 _varIntDataLen;\n uint256 _scriptPubkeyLength;\n (_varIntDataLen, _scriptPubkeyLength) = parseVarIntAt(_output, 8 + _at);\n\n if (_varIntDataLen == ERR_BAD_ARG) {\n return ERR_BAD_ARG;\n }\n\n // 8-byte value, 1-byte for tag itself\n return 8 + 1 + _varIntDataLen + _scriptPubkeyLength;\n }\n\n /// @notice Extracts the output at a given index in the TxOuts vector\n /// @dev Iterates over the vout. If you need to extract multiple, write a custom function\n /// @param _vout The _vout to extract from\n /// @param _index The 0-indexed location of the output to extract\n /// @return The specified output\n function extractOutputAtIndex(bytes memory _vout, uint256 _index) internal pure returns (bytes memory) {\n uint256 _varIntDataLen;\n uint256 _nOuts;\n\n (_varIntDataLen, _nOuts) = parseVarInt(_vout);\n require(_varIntDataLen != ERR_BAD_ARG, \"Read overrun during VarInt parsing\");\n require(_index < _nOuts, \"Vout read overrun\");\n\n uint256 _len = 0;\n uint256 _offset = 1 + _varIntDataLen;\n\n for (uint256 _i = 0; _i < _index; _i ++) {\n _len = determineOutputLengthAt(_vout, _offset);\n require(_len != ERR_BAD_ARG, \"Bad VarInt in scriptPubkey\");\n _offset += _len;\n }\n\n _len = determineOutputLengthAt(_vout, _offset);\n require(_len != ERR_BAD_ARG, \"Bad VarInt in scriptPubkey\");\n return _vout.slice(_offset, _len);\n }\n\n /// @notice Extracts the value bytes from the output in a tx\n /// @dev Value is an 8-byte little-endian number\n /// @param _output The output\n /// @return The output value as LE bytes\n function extractValueLE(bytes memory _output) internal pure returns (bytes8) {\n return _output.slice8(0);\n }\n\n /// @notice Extracts the value from the output in a tx\n /// @dev Value is an 8-byte little-endian number\n /// @param _output The output\n /// @return The output value\n function extractValue(bytes memory _output) internal pure returns (uint64) {\n uint64 _leValue = uint64(extractValueLE(_output));\n uint64 _beValue = reverseUint64(_leValue);\n return _beValue;\n }\n\n /// @notice Extracts the value from the output in a tx\n /// @dev Value is an 8-byte little-endian number\n /// @param _output The byte array containing the output\n /// @param _at The starting index of the output in the array\n /// @return The output value\n function extractValueAt(bytes memory _output, uint256 _at) internal pure returns (uint64) {\n uint64 _leValue = uint64(_output.slice8(_at));\n uint64 _beValue = reverseUint64(_leValue);\n return _beValue;\n }\n\n /// @notice Extracts the data from an op return output\n /// @dev Returns hex\"\" if no data or not an op return\n /// @param _output The output\n /// @return Any data contained in the opreturn output, null if not an op return\n function extractOpReturnData(bytes memory _output) internal pure returns (bytes memory) {\n if (_output[9] != hex\"6a\") {\n return hex\"\";\n }\n bytes1 _dataLen = _output[10];\n return _output.slice(11, uint256(uint8(_dataLen)));\n }\n\n /// @notice Extracts the hash from the output script\n /// @dev Determines type by the length prefix and validates format\n /// @param _output The output\n /// @return The hash committed to by the pk_script, or null for errors\n function extractHash(bytes memory _output) internal pure returns (bytes memory) {\n return extractHashAt(_output, 8, _output.length - 8);\n }\n\n /// @notice Extracts the hash from the output script\n /// @dev Determines type by the length prefix and validates format\n /// @param _output The byte array containing the output\n /// @param _at The starting index of the output script in the array\n /// (output start + 8)\n /// @param _len The length of the output script\n /// (output length - 8)\n /// @return The hash committed to by the pk_script, or null for errors\n function extractHashAt(\n bytes memory _output,\n uint256 _at,\n uint256 _len\n ) internal pure returns (bytes memory) {\n uint8 _scriptLen = uint8(_output[_at]);\n\n // don't have to worry about overflow here.\n // if _scriptLen + 1 overflows, then output length would have to be < 1\n // for this check to pass. if it's < 1, then we errored when assigning\n // _scriptLen\n if (_scriptLen + 1 != _len) {\n return hex\"\";\n }\n\n if (uint8(_output[_at + 1]) == 0) {\n if (_scriptLen < 2) {\n return hex\"\";\n }\n uint256 _payloadLen = uint8(_output[_at + 2]);\n // Check for maliciously formatted witness outputs.\n // No need to worry about underflow as long b/c of the `< 2` check\n if (_payloadLen != _scriptLen - 2 || (_payloadLen != 0x20 && _payloadLen != 0x14)) {\n return hex\"\";\n }\n return _output.slice(_at + 3, _payloadLen);\n } else {\n bytes3 _tag = _output.slice3(_at);\n // p2pkh\n if (_tag == hex\"1976a9\") {\n // Check for maliciously formatted p2pkh\n // No need to worry about underflow, b/c of _scriptLen check\n if (uint8(_output[_at + 3]) != 0x14 ||\n _output.slice2(_at + _len - 2) != hex\"88ac\") {\n return hex\"\";\n }\n return _output.slice(_at + 4, 20);\n //p2sh\n } else if (_tag == hex\"17a914\") {\n // Check for maliciously formatted p2sh\n // No need to worry about underflow, b/c of _scriptLen check\n if (uint8(_output[_at + _len - 1]) != 0x87) {\n return hex\"\";\n }\n return _output.slice(_at + 3, 20);\n }\n }\n return hex\"\"; /* NB: will trigger on OPRETURN and any non-standard that doesn't overrun */\n }\n\n /* ********** */\n /* Witness TX */\n /* ********** */\n\n\n /// @notice Checks that the vin passed up is properly formatted\n /// @dev Consider a vin with a valid vout in its scriptsig\n /// @param _vin Raw bytes length-prefixed input vector\n /// @return True if it represents a validly formatted vin\n function validateVin(bytes memory _vin) internal pure returns (bool) {\n uint256 _varIntDataLen;\n uint256 _nIns;\n\n (_varIntDataLen, _nIns) = parseVarInt(_vin);\n\n // Not valid if it says there are too many or no inputs\n if (_nIns == 0 || _varIntDataLen == ERR_BAD_ARG) {\n return false;\n }\n\n uint256 _offset = 1 + _varIntDataLen;\n\n for (uint256 i = 0; i < _nIns; i++) {\n // If we're at the end, but still expect more\n if (_offset >= _vin.length) {\n return false;\n }\n\n // Grab the next input and determine its length.\n uint256 _nextLen = determineInputLengthAt(_vin, _offset);\n if (_nextLen == ERR_BAD_ARG) {\n return false;\n }\n\n // Increase the offset by that much\n _offset += _nextLen;\n }\n\n // Returns false if we're not exactly at the end\n return _offset == _vin.length;\n }\n\n /// @notice Checks that the vout passed up is properly formatted\n /// @dev Consider a vout with a valid scriptpubkey\n /// @param _vout Raw bytes length-prefixed output vector\n /// @return True if it represents a validly formatted vout\n function validateVout(bytes memory _vout) internal pure returns (bool) {\n uint256 _varIntDataLen;\n uint256 _nOuts;\n\n (_varIntDataLen, _nOuts) = parseVarInt(_vout);\n\n // Not valid if it says there are too many or no outputs\n if (_nOuts == 0 || _varIntDataLen == ERR_BAD_ARG) {\n return false;\n }\n\n uint256 _offset = 1 + _varIntDataLen;\n\n for (uint256 i = 0; i < _nOuts; i++) {\n // If we're at the end, but still expect more\n if (_offset >= _vout.length) {\n return false;\n }\n\n // Grab the next output and determine its length.\n // Increase the offset by that much\n uint256 _nextLen = determineOutputLengthAt(_vout, _offset);\n if (_nextLen == ERR_BAD_ARG) {\n return false;\n }\n\n _offset += _nextLen;\n }\n\n // Returns false if we're not exactly at the end\n return _offset == _vout.length;\n }\n\n\n\n /* ************ */\n /* Block Header */\n /* ************ */\n\n /// @notice Extracts the transaction merkle root from a block header\n /// @dev Use verifyHash256Merkle to verify proofs with this root\n /// @param _header The header\n /// @return The merkle root (little-endian)\n function extractMerkleRootLE(bytes memory _header) internal pure returns (bytes32) {\n return _header.slice32(36);\n }\n\n /// @notice Extracts the target from a block header\n /// @dev Target is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\n /// @param _header The header\n /// @return The target threshold\n function extractTarget(bytes memory _header) internal pure returns (uint256) {\n return extractTargetAt(_header, 0);\n }\n\n /// @notice Extracts the target from a block header\n /// @dev Target is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\n /// @param _header The array containing the header\n /// @param at The start of the header\n /// @return The target threshold\n function extractTargetAt(bytes memory _header, uint256 at) internal pure returns (uint256) {\n uint24 _m = uint24(_header.slice3(72 + at));\n uint8 _e = uint8(_header[75 + at]);\n uint256 _mantissa = uint256(reverseUint24(_m));\n uint _exponent = _e - 3;\n\n return _mantissa * (256 ** _exponent);\n }\n\n /// @notice Calculate difficulty from the difficulty 1 target and current target\n /// @dev Difficulty 1 is 0x1d00ffff on mainnet and testnet\n /// @dev Difficulty 1 is a 256-bit number encoded as a 3-byte mantissa and 1-byte exponent\n /// @param _target The current target\n /// @return The block difficulty (bdiff)\n function calculateDifficulty(uint256 _target) internal pure returns (uint256) {\n // Difficulty 1 calculated from 0x1d00ffff\n return DIFF1_TARGET.div(_target);\n }\n\n /// @notice Extracts the previous block's hash from a block header\n /// @dev Block headers do NOT include block number :(\n /// @param _header The header\n /// @return The previous block's hash (little-endian)\n function extractPrevBlockLE(bytes memory _header) internal pure returns (bytes32) {\n return _header.slice32(4);\n }\n\n /// @notice Extracts the previous block's hash from a block header\n /// @dev Block headers do NOT include block number :(\n /// @param _header The array containing the header\n /// @param at The start of the header\n /// @return The previous block's hash (little-endian)\n function extractPrevBlockLEAt(\n bytes memory _header,\n uint256 at\n ) internal pure returns (bytes32) {\n return _header.slice32(4 + at);\n }\n\n /// @notice Extracts the timestamp from a block header\n /// @dev Time is not 100% reliable\n /// @param _header The header\n /// @return The timestamp (little-endian bytes)\n function extractTimestampLE(bytes memory _header) internal pure returns (bytes4) {\n return _header.slice4(68);\n }\n\n /// @notice Extracts the timestamp from a block header\n /// @dev Time is not 100% reliable\n /// @param _header The header\n /// @return The timestamp (uint)\n function extractTimestamp(bytes memory _header) internal pure returns (uint32) {\n return reverseUint32(uint32(extractTimestampLE(_header)));\n }\n\n /// @notice Extracts the expected difficulty from a block header\n /// @dev Does NOT verify the work\n /// @param _header The header\n /// @return The difficulty as an integer\n function extractDifficulty(bytes memory _header) internal pure returns (uint256) {\n return calculateDifficulty(extractTarget(_header));\n }\n\n /// @notice Concatenates and hashes two inputs for merkle proving\n /// @param _a The first hash\n /// @param _b The second hash\n /// @return The double-sha256 of the concatenated hashes\n function _hash256MerkleStep(bytes memory _a, bytes memory _b) internal view returns (bytes32) {\n return hash256View(abi.encodePacked(_a, _b));\n }\n\n /// @notice Concatenates and hashes two inputs for merkle proving\n /// @param _a The first hash\n /// @param _b The second hash\n /// @return The double-sha256 of the concatenated hashes\n function _hash256MerkleStep(bytes32 _a, bytes32 _b) internal view returns (bytes32) {\n return hash256Pair(_a, _b);\n }\n\n\n /// @notice Verifies a Bitcoin-style merkle tree\n /// @dev Leaves are 0-indexed. Inefficient version.\n /// @param _proof The proof. Tightly packed LE sha256 hashes. The last hash is the root\n /// @param _index The index of the leaf\n /// @return true if the proof is valid, else false\n function verifyHash256Merkle(bytes memory _proof, uint _index) internal view returns (bool) {\n // Not an even number of hashes\n if (_proof.length % 32 != 0) {\n return false;\n }\n\n // Special case for coinbase-only blocks\n if (_proof.length == 32) {\n return true;\n }\n\n // Should never occur\n if (_proof.length == 64) {\n return false;\n }\n\n bytes32 _root = _proof.slice32(_proof.length - 32);\n bytes32 _current = _proof.slice32(0);\n bytes memory _tree = _proof.slice(32, _proof.length - 64);\n\n return verifyHash256Merkle(_current, _tree, _root, _index);\n }\n\n /// @notice Verifies a Bitcoin-style merkle tree\n /// @dev Leaves are 0-indexed. Efficient version.\n /// @param _leaf The leaf of the proof. LE sha256 hash.\n /// @param _tree The intermediate nodes in the proof.\n /// Tightly packed LE sha256 hashes.\n /// @param _root The root of the proof. LE sha256 hash.\n /// @param _index The index of the leaf\n /// @return true if the proof is valid, else false\n function verifyHash256Merkle(\n bytes32 _leaf,\n bytes memory _tree,\n bytes32 _root,\n uint _index\n ) internal view returns (bool) {\n // Not an even number of hashes\n if (_tree.length % 32 != 0) {\n return false;\n }\n\n // Should never occur\n if (_tree.length == 0) {\n return false;\n }\n\n uint _idx = _index;\n bytes32 _current = _leaf;\n\n // i moves in increments of 32\n for (uint i = 0; i < _tree.length; i += 32) {\n if (_idx % 2 == 1) {\n _current = _hash256MerkleStep(_tree.slice32(i), _current);\n } else {\n _current = _hash256MerkleStep(_current, _tree.slice32(i));\n }\n _idx = _idx >> 1;\n }\n return _current == _root;\n }\n\n /*\n NB: https://github.com/bitcoin/bitcoin/blob/78dae8caccd82cfbfd76557f1fb7d7557c7b5edb/src/pow.cpp#L49-L72\n NB: We get a full-bitlength target from this. For comparison with\n header-encoded targets we need to mask it with the header target\n e.g. (full & truncated) == truncated\n */\n /// @notice performs the bitcoin difficulty retarget\n /// @dev implements the Bitcoin algorithm precisely\n /// @param _previousTarget the target of the previous period\n /// @param _firstTimestamp the timestamp of the first block in the difficulty period\n /// @param _secondTimestamp the timestamp of the last block in the difficulty period\n /// @return the new period's target threshold\n function retargetAlgorithm(\n uint256 _previousTarget,\n uint256 _firstTimestamp,\n uint256 _secondTimestamp\n ) internal pure returns (uint256) {\n uint256 _elapsedTime = _secondTimestamp.sub(_firstTimestamp);\n\n // Normalize ratio to factor of 4 if very long or very short\n if (_elapsedTime < RETARGET_PERIOD.div(4)) {\n _elapsedTime = RETARGET_PERIOD.div(4);\n }\n if (_elapsedTime > RETARGET_PERIOD.mul(4)) {\n _elapsedTime = RETARGET_PERIOD.mul(4);\n }\n\n /*\n NB: high targets e.g. ffff0020 can cause overflows here\n so we divide it by 256**2, then multiply by 256**2 later\n we know the target is evenly divisible by 256**2, so this isn't an issue\n */\n\n uint256 _adjusted = _previousTarget.div(65536).mul(_elapsedTime);\n return _adjusted.div(RETARGET_PERIOD).mul(65536);\n }\n}\n" + }, + "@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol": { + "content": "pragma solidity ^0.8.4;\n\n/*\n\nhttps://github.com/GNSPS/solidity-bytes-utils/\n\nThis is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to \n*/\n\n\n/** @title BytesLib **/\n/** @author https://github.com/GNSPS **/\n\nlibrary BytesLib {\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(0x40, and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n ))\n }\n\n return tempBytes;\n }\n\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(\n fslot,\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n ),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let mlengthmod := mod(mlength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function slice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory res) {\n if (_length == 0) {\n return hex\"\";\n }\n uint _end = _start + _length;\n require(_end > _start && _bytes.length >= _end, \"Slice out of bounds\");\n\n assembly {\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\n res := mload(0x40)\n mstore(0x40, add(add(res, 64), _length))\n mstore(res, _length)\n\n // Compute distance between source and destination pointers\n let diff := sub(res, add(_bytes, _start))\n\n for {\n let src := add(add(_bytes, 32), _start)\n let end := add(src, _length)\n } lt(src, end) {\n src := add(src, 32)\n } {\n mstore(add(src, diff), mload(src))\n }\n }\n }\n\n /// @notice Take a slice of the byte array, overwriting the destination.\n /// The length of the slice will equal the length of the destination array.\n /// @dev Make sure the destination array has afterspace if required.\n /// @param _bytes The source array\n /// @param _dest The destination array.\n /// @param _start The location to start in the source array.\n function sliceInPlace(\n bytes memory _bytes,\n bytes memory _dest,\n uint _start\n ) internal pure {\n uint _length = _dest.length;\n uint _end = _start + _length;\n require(_end > _start && _bytes.length >= _end, \"Slice out of bounds\");\n\n assembly {\n for {\n let src := add(add(_bytes, 32), _start)\n let res := add(_dest, 32)\n let end := add(src, _length)\n } lt(src, end) {\n src := add(src, 32)\n res := add(res, 32)\n } {\n mstore(res, mload(src))\n }\n }\n }\n\n // Static slice functions, no bounds checking\n /// @notice take a 32-byte slice from the specified position\n function slice32(bytes memory _bytes, uint _start) internal pure returns (bytes32 res) {\n assembly {\n res := mload(add(add(_bytes, 32), _start))\n }\n }\n\n /// @notice take a 20-byte slice from the specified position\n function slice20(bytes memory _bytes, uint _start) internal pure returns (bytes20) {\n return bytes20(slice32(_bytes, _start));\n }\n\n /// @notice take a 8-byte slice from the specified position\n function slice8(bytes memory _bytes, uint _start) internal pure returns (bytes8) {\n return bytes8(slice32(_bytes, _start));\n }\n\n /// @notice take a 4-byte slice from the specified position\n function slice4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {\n return bytes4(slice32(_bytes, _start));\n }\n\n /// @notice take a 3-byte slice from the specified position\n function slice3(bytes memory _bytes, uint _start) internal pure returns (bytes3) {\n return bytes3(slice32(_bytes, _start));\n }\n\n /// @notice take a 2-byte slice from the specified position\n function slice2(bytes memory _bytes, uint _start) internal pure returns (bytes2) {\n return bytes2(slice32(_bytes, _start));\n }\n\n function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {\n uint _totalLen = _start + 20;\n require(_totalLen > _start && _bytes.length >= _totalLen, \"Address conversion out of bounds.\");\n address tempAddress;\n\n assembly {\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\n }\n\n return tempAddress;\n }\n\n function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {\n uint _totalLen = _start + 32;\n require(_totalLen > _start && _bytes.length >= _totalLen, \"Uint conversion out of bounds.\");\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint(mc < end) + cb == 2)\n for {} eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function toBytes32(bytes memory _source) pure internal returns (bytes32 result) {\n if (_source.length == 0) {\n return 0x0;\n }\n\n assembly {\n result := mload(add(_source, 32))\n }\n }\n\n function keccak256Slice(bytes memory _bytes, uint _start, uint _length) pure internal returns (bytes32 result) {\n uint _end = _start + _length;\n require(_end > _start && _bytes.length >= _end, \"Slice out of bounds\");\n\n assembly {\n result := keccak256(add(add(_bytes, 32), _start), _length)\n }\n }\n}\n" + }, + "@keep-network/bitcoin-spv-sol/contracts/CheckBitcoinSigs.sol": { + "content": "pragma solidity ^0.8.4;\n\n/** @title CheckBitcoinSigs */\n/** @author Summa (https://summa.one) */\n\nimport {BytesLib} from \"./BytesLib.sol\";\nimport {BTCUtils} from \"./BTCUtils.sol\";\n\n\nlibrary CheckBitcoinSigs {\n\n using BytesLib for bytes;\n using BTCUtils for bytes;\n\n /// @notice Derives an Ethereum Account address from a pubkey\n /// @dev The address is the last 20 bytes of the keccak256 of the address\n /// @param _pubkey The public key X & Y. Unprefixed, as a 64-byte array\n /// @return The account address\n function accountFromPubkey(bytes memory _pubkey) internal pure returns (address) {\n require(_pubkey.length == 64, \"Pubkey must be 64-byte raw, uncompressed key.\");\n\n // keccak hash of uncompressed unprefixed pubkey\n bytes32 _digest = keccak256(_pubkey);\n return address(uint160(uint256(_digest)));\n }\n\n /// @notice Calculates the p2wpkh output script of a pubkey\n /// @dev Compresses keys to 33 bytes as required by Bitcoin\n /// @param _pubkey The public key, compressed or uncompressed\n /// @return The p2wkph output script\n function p2wpkhFromPubkey(bytes memory _pubkey) internal view returns (bytes memory) {\n bytes memory _compressedPubkey;\n uint8 _prefix;\n\n if (_pubkey.length == 64) {\n _prefix = uint8(_pubkey[_pubkey.length - 1]) % 2 == 1 ? 3 : 2;\n _compressedPubkey = abi.encodePacked(_prefix, _pubkey.slice32(0));\n } else if (_pubkey.length == 65) {\n _prefix = uint8(_pubkey[_pubkey.length - 1]) % 2 == 1 ? 3 : 2;\n _compressedPubkey = abi.encodePacked(_prefix, _pubkey.slice32(1));\n } else {\n _compressedPubkey = _pubkey;\n }\n\n require(_compressedPubkey.length == 33, \"Witness PKH requires compressed keys\");\n\n bytes20 _pubkeyHash = _compressedPubkey.hash160View();\n return abi.encodePacked(hex\"0014\", _pubkeyHash);\n }\n\n /// @notice checks a signed message's validity under a pubkey\n /// @dev does this using ecrecover because Ethereum has no soul\n /// @param _pubkey the public key to check (64 bytes)\n /// @param _digest the message digest signed\n /// @param _v the signature recovery value\n /// @param _r the signature r value\n /// @param _s the signature s value\n /// @return true if signature is valid, else false\n function checkSig(\n bytes memory _pubkey,\n bytes32 _digest,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) internal pure returns (bool) {\n require(_pubkey.length == 64, \"Requires uncompressed unprefixed pubkey\");\n address _expected = accountFromPubkey(_pubkey);\n address _actual = ecrecover(_digest, _v, _r, _s);\n return _actual == _expected;\n }\n\n /// @notice checks a signed message against a bitcoin p2wpkh output script\n /// @dev does this my verifying the p2wpkh matches an ethereum account\n /// @param _p2wpkhOutputScript the bitcoin output script\n /// @param _pubkey the uncompressed, unprefixed public key to check\n /// @param _digest the message digest signed\n /// @param _v the signature recovery value\n /// @param _r the signature r value\n /// @param _s the signature s value\n /// @return true if signature is valid, else false\n function checkBitcoinSig(\n bytes memory _p2wpkhOutputScript,\n bytes memory _pubkey,\n bytes32 _digest,\n uint8 _v,\n bytes32 _r,\n bytes32 _s\n ) internal view returns (bool) {\n require(_pubkey.length == 64, \"Requires uncompressed unprefixed pubkey\");\n\n bool _isExpectedSigner = keccak256(p2wpkhFromPubkey(_pubkey)) == keccak256(_p2wpkhOutputScript); // is it the expected signer?\n if (!_isExpectedSigner) {return false;}\n\n bool _sigResult = checkSig(_pubkey, _digest, _v, _r, _s);\n return _sigResult;\n }\n\n /// @notice checks if a message is the sha256 preimage of a digest\n /// @dev this is NOT the hash256! this step is necessary for ECDSA security!\n /// @param _digest the digest\n /// @param _candidate the purported preimage\n /// @return true if the preimage matches the digest, else false\n function isSha256Preimage(\n bytes memory _candidate,\n bytes32 _digest\n ) internal pure returns (bool) {\n return sha256(_candidate) == _digest;\n }\n\n /// @notice checks if a message is the keccak256 preimage of a digest\n /// @dev this step is necessary for ECDSA security!\n /// @param _digest the digest\n /// @param _candidate the purported preimage\n /// @return true if the preimage matches the digest, else false\n function isKeccak256Preimage(\n bytes memory _candidate,\n bytes32 _digest\n ) internal pure returns (bool) {\n return keccak256(_candidate) == _digest;\n }\n\n /// @notice calculates the signature hash of a Bitcoin transaction with the provided details\n /// @dev documented in bip143. many values are hardcoded here\n /// @param _outpoint the bitcoin UTXO id (32-byte txid + 4-byte output index)\n /// @param _inputPKH the input pubkeyhash (hash160(sender_pubkey))\n /// @param _inputValue the value of the input in satoshi\n /// @param _outputValue the value of the output in satoshi\n /// @param _outputScript the length-prefixed output script\n /// @return the double-sha256 (hash256) signature hash as defined by bip143\n function wpkhSpendSighash(\n bytes memory _outpoint, // 36-byte UTXO id\n bytes20 _inputPKH, // 20-byte hash160\n bytes8 _inputValue, // 8-byte LE\n bytes8 _outputValue, // 8-byte LE\n bytes memory _outputScript // lenght-prefixed output script\n ) internal view returns (bytes32) {\n // Fixes elements to easily make a 1-in 1-out sighash digest\n // Does not support timelocks\n // bytes memory _scriptCode = abi.encodePacked(\n // hex\"1976a914\", // length, dup, hash160, pkh_length\n // _inputPKH,\n // hex\"88ac\"); // equal, checksig\n\n bytes32 _hashOutputs = abi.encodePacked(\n _outputValue, // 8-byte LE\n _outputScript).hash256View();\n\n bytes memory _sighashPreimage = abi.encodePacked(\n hex\"01000000\", // version\n _outpoint.hash256View(), // hashPrevouts\n hex\"8cb9012517c817fead650287d61bdd9c68803b6bf9c64133dcab3e65b5a50cb9\", // hashSequence(00000000)\n _outpoint, // outpoint\n // p2wpkh script code\n hex\"1976a914\", // length, dup, hash160, pkh_length\n _inputPKH,\n hex\"88ac\", // equal, checksig\n // end script code\n _inputValue, // value of the input in 8-byte LE\n hex\"00000000\", // input nSequence\n _hashOutputs, // hash of the single output\n hex\"00000000\", // nLockTime\n hex\"01000000\" // SIGHASH_ALL\n );\n return _sighashPreimage.hash256View();\n }\n\n /// @notice calculates the signature hash of a Bitcoin transaction with the provided details\n /// @dev documented in bip143. many values are hardcoded here\n /// @param _outpoint the bitcoin UTXO id (32-byte txid + 4-byte output index)\n /// @param _inputPKH the input pubkeyhash (hash160(sender_pubkey))\n /// @param _inputValue the value of the input in satoshi\n /// @param _outputValue the value of the output in satoshi\n /// @param _outputPKH the output pubkeyhash (hash160(recipient_pubkey))\n /// @return the double-sha256 (hash256) signature hash as defined by bip143\n function wpkhToWpkhSighash(\n bytes memory _outpoint, // 36-byte UTXO id\n bytes20 _inputPKH, // 20-byte hash160\n bytes8 _inputValue, // 8-byte LE\n bytes8 _outputValue, // 8-byte LE\n bytes20 _outputPKH // 20-byte hash160\n ) internal view returns (bytes32) {\n return wpkhSpendSighash(\n _outpoint,\n _inputPKH,\n _inputValue,\n _outputValue,\n abi.encodePacked(\n hex\"160014\", // wpkh tag\n _outputPKH)\n );\n }\n\n /// @notice Preserved for API compatibility with older version\n /// @dev documented in bip143. many values are hardcoded here\n /// @param _outpoint the bitcoin UTXO id (32-byte txid + 4-byte output index)\n /// @param _inputPKH the input pubkeyhash (hash160(sender_pubkey))\n /// @param _inputValue the value of the input in satoshi\n /// @param _outputValue the value of the output in satoshi\n /// @param _outputPKH the output pubkeyhash (hash160(recipient_pubkey))\n /// @return the double-sha256 (hash256) signature hash as defined by bip143\n function oneInputOneOutputSighash(\n bytes memory _outpoint, // 36-byte UTXO id\n bytes20 _inputPKH, // 20-byte hash160\n bytes8 _inputValue, // 8-byte LE\n bytes8 _outputValue, // 8-byte LE\n bytes20 _outputPKH // 20-byte hash160\n ) internal view returns (bytes32) {\n return wpkhToWpkhSighash(_outpoint, _inputPKH, _inputValue, _outputValue, _outputPKH);\n }\n\n}\n" + }, + "@keep-network/bitcoin-spv-sol/contracts/SafeMath.sol": { + "content": "pragma solidity ^0.8.4;\n\n/*\nThe MIT License (MIT)\n\nCopyright (c) 2016 Smart Contract Solutions, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks that throw on error\n */\nlibrary SafeMath {\n\n /**\n * @dev Multiplies two numbers, throws on overflow.\n */\n function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\n // Gas optimization: this is cheaper than asserting 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (_a == 0) {\n return 0;\n }\n\n c = _a * _b;\n require(c / _a == _b, \"Overflow during multiplication.\");\n return c;\n }\n\n /**\n * @dev Integer division of two numbers, truncating the quotient.\n */\n function div(uint256 _a, uint256 _b) internal pure returns (uint256) {\n // assert(_b > 0); // Solidity automatically throws when dividing by 0\n // uint256 c = _a / _b;\n // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold\n return _a / _b;\n }\n\n /**\n * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {\n require(_b <= _a, \"Underflow during subtraction.\");\n return _a - _b;\n }\n\n /**\n * @dev Adds two numbers, throws on overflow.\n */\n function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\n c = _a + _b;\n require(c >= _a, \"Overflow during addition.\");\n return c;\n }\n}\n" + }, + "@keep-network/bitcoin-spv-sol/contracts/ValidateSPV.sol": { + "content": "pragma solidity ^0.8.4;\n\n/** @title ValidateSPV*/\n/** @author Summa (https://summa.one) */\n\nimport {BytesLib} from \"./BytesLib.sol\";\nimport {SafeMath} from \"./SafeMath.sol\";\nimport {BTCUtils} from \"./BTCUtils.sol\";\n\n\nlibrary ValidateSPV {\n\n using BTCUtils for bytes;\n using BTCUtils for uint256;\n using BytesLib for bytes;\n using SafeMath for uint256;\n\n enum InputTypes { NONE, LEGACY, COMPATIBILITY, WITNESS }\n enum OutputTypes { NONE, WPKH, WSH, OP_RETURN, PKH, SH, NONSTANDARD }\n\n uint256 constant ERR_BAD_LENGTH = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\n uint256 constant ERR_INVALID_CHAIN = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe;\n uint256 constant ERR_LOW_WORK = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd;\n\n function getErrBadLength() internal pure returns (uint256) {\n return ERR_BAD_LENGTH;\n }\n\n function getErrInvalidChain() internal pure returns (uint256) {\n return ERR_INVALID_CHAIN;\n }\n\n function getErrLowWork() internal pure returns (uint256) {\n return ERR_LOW_WORK;\n }\n\n /// @notice Validates a tx inclusion in the block\n /// @dev `index` is not a reliable indicator of location within a block\n /// @param _txid The txid (LE)\n /// @param _merkleRoot The merkle root (as in the block header)\n /// @param _intermediateNodes The proof's intermediate nodes (digests between leaf and root)\n /// @param _index The leaf's index in the tree (0-indexed)\n /// @return true if fully valid, false otherwise\n function prove(\n bytes32 _txid,\n bytes32 _merkleRoot,\n bytes memory _intermediateNodes,\n uint _index\n ) internal view returns (bool) {\n // Shortcut the empty-block case\n if (_txid == _merkleRoot && _index == 0 && _intermediateNodes.length == 0) {\n return true;\n }\n\n // If the Merkle proof failed, bubble up error\n return BTCUtils.verifyHash256Merkle(\n _txid,\n _intermediateNodes,\n _merkleRoot,\n _index\n );\n }\n\n /// @notice Hashes transaction to get txid\n /// @dev Supports Legacy and Witness\n /// @param _version 4-bytes version\n /// @param _vin Raw bytes length-prefixed input vector\n /// @param _vout Raw bytes length-prefixed output vector\n /// @param _locktime 4-byte tx locktime\n /// @return 32-byte transaction id, little endian\n function calculateTxId(\n bytes4 _version,\n bytes memory _vin,\n bytes memory _vout,\n bytes4 _locktime\n ) internal view returns (bytes32) {\n // Get transaction hash double-Sha256(version + nIns + inputs + nOuts + outputs + locktime)\n return abi.encodePacked(_version, _vin, _vout, _locktime).hash256View();\n }\n\n /// @notice Checks validity of header chain\n /// @notice Compares the hash of each header to the prevHash in the next header\n /// @param headers Raw byte array of header chain\n /// @return totalDifficulty The total accumulated difficulty of the header chain, or an error code\n function validateHeaderChain(\n bytes memory headers\n ) internal view returns (uint256 totalDifficulty) {\n\n // Check header chain length\n if (headers.length % 80 != 0) {return ERR_BAD_LENGTH;}\n\n // Initialize header start index\n bytes32 digest;\n\n totalDifficulty = 0;\n\n for (uint256 start = 0; start < headers.length; start += 80) {\n\n // After the first header, check that headers are in a chain\n if (start != 0) {\n if (!validateHeaderPrevHash(headers, start, digest)) {return ERR_INVALID_CHAIN;}\n }\n\n // ith header target\n uint256 target = headers.extractTargetAt(start);\n\n // Require that the header has sufficient work\n digest = headers.hash256Slice(start, 80);\n if(uint256(digest).reverseUint256() > target) {\n return ERR_LOW_WORK;\n }\n\n // Add ith header difficulty to difficulty sum\n totalDifficulty = totalDifficulty + target.calculateDifficulty();\n }\n }\n\n /// @notice Checks validity of header work\n /// @param digest Header digest\n /// @param target The target threshold\n /// @return true if header work is valid, false otherwise\n function validateHeaderWork(\n bytes32 digest,\n uint256 target\n ) internal pure returns (bool) {\n if (digest == bytes32(0)) {return false;}\n return (uint256(digest).reverseUint256() < target);\n }\n\n /// @notice Checks validity of header chain\n /// @dev Compares current header prevHash to previous header's digest\n /// @param headers The raw bytes array containing the header\n /// @param at The position of the header\n /// @param prevHeaderDigest The previous header's digest\n /// @return true if the connect is valid, false otherwise\n function validateHeaderPrevHash(\n bytes memory headers,\n uint256 at,\n bytes32 prevHeaderDigest\n ) internal pure returns (bool) {\n\n // Extract prevHash of current header\n bytes32 prevHash = headers.extractPrevBlockLEAt(at);\n\n // Compare prevHash of current header to previous header's digest\n if (prevHash != prevHeaderDigest) {return false;}\n\n return true;\n }\n}\n" + }, + "@keep-network/ecdsa/contracts/api/IWalletOwner.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity 0.8.17;\n\ninterface IWalletOwner {\n /// @notice Callback function executed once a new wallet is created.\n /// @dev Should be callable only by the Wallet Registry.\n /// @param walletID Wallet's unique identifier.\n /// @param publicKeyY Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n function __ecdsaWalletCreatedCallback(\n bytes32 walletID,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external;\n\n /// @notice Callback function executed once a wallet heartbeat failure\n /// is detected.\n /// @dev Should be callable only by the Wallet Registry.\n /// @param walletID Wallet's unique identifier.\n /// @param publicKeyY Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n function __ecdsaWalletHeartbeatFailedCallback(\n bytes32 walletID,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external;\n}\n" + }, + "@keep-network/ecdsa/contracts/api/IWalletRegistry.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity 0.8.17;\n\nimport \"../libraries/EcdsaDkg.sol\";\n\ninterface IWalletRegistry {\n /// @notice Requests a new wallet creation.\n /// @dev Only the Wallet Owner can call this function.\n function requestNewWallet() external;\n\n /// @notice Closes an existing wallet.\n /// @param walletID ID of the wallet.\n /// @dev Only the Wallet Owner can call this function.\n function closeWallet(bytes32 walletID) external;\n\n /// @notice Adds all signing group members of the wallet with the given ID\n /// to the slashing queue of the staking contract. The notifier will\n /// receive reward per each group member from the staking contract\n /// notifiers treasury. The reward is scaled by the\n /// `rewardMultiplier` provided as a parameter.\n /// @param amount Amount of tokens to seize from each signing group member\n /// @param rewardMultiplier Fraction of the staking contract notifiers\n /// reward the notifier should receive; should be between [0, 100]\n /// @param notifier Address of the misbehavior notifier\n /// @param walletID ID of the wallet\n /// @param walletMembersIDs Identifiers of the wallet signing group members\n /// @dev Only the Wallet Owner can call this function.\n /// Requirements:\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events.\n /// - `rewardMultiplier` must be between [0, 100].\n /// - This function does revert if staking contract call reverts.\n /// The calling code needs to handle the potential revert.\n function seize(\n uint96 amount,\n uint256 rewardMultiplier,\n address notifier,\n bytes32 walletID,\n uint32[] calldata walletMembersIDs\n ) external;\n\n /// @notice Gets public key of a wallet with a given wallet ID.\n /// The public key is returned in an uncompressed format as a 64-byte\n /// concatenation of X and Y coordinates.\n /// @param walletID ID of the wallet.\n /// @return Uncompressed public key of the wallet.\n function getWalletPublicKey(bytes32 walletID)\n external\n view\n returns (bytes memory);\n\n /// @notice Check current wallet creation state.\n function getWalletCreationState() external view returns (EcdsaDkg.State);\n\n /// @notice Checks whether the given operator is a member of the given\n /// wallet signing group.\n /// @param walletID ID of the wallet\n /// @param walletMembersIDs Identifiers of the wallet signing group members\n /// @param operator Address of the checked operator\n /// @param walletMemberIndex Position of the operator in the wallet signing\n /// group members list\n /// @return True - if the operator is a member of the given wallet signing\n /// group. False - otherwise.\n /// @dev Requirements:\n /// - The `operator` parameter must be an actual sortition pool operator.\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events.\n /// - The `walletMemberIndex` must be in range [1, walletMembersIDs.length]\n function isWalletMember(\n bytes32 walletID,\n uint32[] calldata walletMembersIDs,\n address operator,\n uint256 walletMemberIndex\n ) external view returns (bool);\n}\n" + }, + "@keep-network/ecdsa/contracts/EcdsaDkgValidator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\n// Initial version copied from Keep Network Random Beacon:\n// https://github.com/keep-network/keep-core/blob/5138c7628868dbeed3ae2164f76fccc6c1fbb9e8/solidity/random-beacon/contracts/DKGValidator.sol\n//\n// With the following differences:\n// - group public key length,\n// - group size and related thresholds,\n// - documentation.\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@keep-network/random-beacon/contracts/libraries/BytesLib.sol\";\nimport \"@keep-network/sortition-pools/contracts/SortitionPool.sol\";\nimport \"./libraries/EcdsaDkg.sol\";\n\n/// @title DKG result validator\n/// @notice EcdsaDkgValidator allows performing a full validation of DKG result,\n/// including checking the format of fields in the result, declared\n/// selected group members, and signatures of operators supporting the\n/// result. The operator submitting the result should perform the\n/// validation using a free contract call before submitting the result\n/// to ensure their result is valid and can not be challenged. All other\n/// network operators should perform validation of the submitted result\n/// using a free contract call and challenge the result if the\n/// validation fails.\ncontract EcdsaDkgValidator {\n using BytesLib for bytes;\n using ECDSA for bytes32;\n\n /// @dev Size of a group in DKG.\n uint256 public constant groupSize = 100;\n\n /// @dev The minimum number of group members needed to interact according to\n /// the protocol to produce a signature. The adversary can not learn\n /// anything about the key as long as it does not break into\n /// groupThreshold+1 of members.\n uint256 public constant groupThreshold = 51;\n\n /// @dev The minimum number of active and properly behaving group members\n /// during the DKG needed to accept the result. This number is higher\n /// than `groupThreshold` to keep a safety margin for members becoming\n /// inactive after DKG so that the group can still produce signature.\n uint256 public constant activeThreshold = 90; // 90% of groupSize\n\n /// @dev Size in bytes of a public key produced by group members during the\n /// the DKG. The length assumes uncompressed ECDSA public key.\n uint256 public constant publicKeyByteSize = 64;\n\n /// @dev Size in bytes of a single signature produced by operator supporting\n /// DKG result.\n uint256 public constant signatureByteSize = 65;\n\n SortitionPool public immutable sortitionPool;\n\n constructor(SortitionPool _sortitionPool) {\n sortitionPool = _sortitionPool;\n }\n\n /// @notice Performs a full validation of DKG result, including checking the\n /// format of fields in the result, declared selected group members,\n /// and signatures of operators supporting the result.\n /// @param seed seed used to start the DKG and select group members\n /// @param startBlock DKG start block\n /// @return isValid true if the result is valid, false otherwise\n /// @return errorMsg validation error message; empty for a valid result\n function validate(\n EcdsaDkg.Result calldata result,\n uint256 seed,\n uint256 startBlock\n ) external view returns (bool isValid, string memory errorMsg) {\n (bool hasValidFields, string memory error) = validateFields(result);\n if (!hasValidFields) {\n return (false, error);\n }\n\n if (!validateSignatures(result, startBlock)) {\n return (false, \"Invalid signatures\");\n }\n\n if (!validateGroupMembers(result, seed)) {\n return (false, \"Invalid group members\");\n }\n\n // At this point all group members and misbehaved members were verified\n if (!validateMembersHash(result)) {\n return (false, \"Invalid members hash\");\n }\n\n return (true, \"\");\n }\n\n /// @notice Performs a static validation of DKG result fields: lengths,\n /// ranges, and order of arrays.\n /// @return isValid true if the result is valid, false otherwise\n /// @return errorMsg validation error message; empty for a valid result\n function validateFields(EcdsaDkg.Result calldata result)\n public\n pure\n returns (bool isValid, string memory errorMsg)\n {\n if (result.groupPubKey.length != publicKeyByteSize) {\n return (false, \"Malformed group public key\");\n }\n\n // The number of misbehaved members can not exceed the threshold.\n // Misbehaved member indices needs to be unique, between [1, groupSize],\n // and sorted in ascending order.\n uint8[] calldata misbehavedMembersIndices = result\n .misbehavedMembersIndices;\n if (groupSize - misbehavedMembersIndices.length < activeThreshold) {\n return (false, \"Too many members misbehaving during DKG\");\n }\n if (misbehavedMembersIndices.length > 1) {\n if (\n misbehavedMembersIndices[0] < 1 ||\n misbehavedMembersIndices[misbehavedMembersIndices.length - 1] >\n groupSize\n ) {\n return (false, \"Corrupted misbehaved members indices\");\n }\n for (uint256 i = 1; i < misbehavedMembersIndices.length; i++) {\n if (\n misbehavedMembersIndices[i - 1] >=\n misbehavedMembersIndices[i]\n ) {\n return (false, \"Corrupted misbehaved members indices\");\n }\n }\n }\n\n // Each signature needs to have a correct length and signatures need to\n // be provided.\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\n if (result.signatures.length == 0) {\n return (false, \"No signatures provided\");\n }\n if (result.signatures.length % signatureByteSize != 0) {\n return (false, \"Malformed signatures array\");\n }\n\n // We expect the same amount of signatures as the number of declared\n // group member indices that signed the result.\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\n if (signaturesCount != signingMembersIndices.length) {\n return (false, \"Unexpected signatures count\");\n }\n if (signaturesCount < groupThreshold) {\n return (false, \"Too few signatures\");\n }\n if (signaturesCount > groupSize) {\n return (false, \"Too many signatures\");\n }\n\n // Signing member indices needs to be unique, between [1,groupSize],\n // and sorted in ascending order.\n if (\n signingMembersIndices[0] < 1 ||\n signingMembersIndices[signingMembersIndices.length - 1] > groupSize\n ) {\n return (false, \"Corrupted signing member indices\");\n }\n for (uint256 i = 1; i < signingMembersIndices.length; i++) {\n if (signingMembersIndices[i - 1] >= signingMembersIndices[i]) {\n return (false, \"Corrupted signing member indices\");\n }\n }\n\n return (true, \"\");\n }\n\n /// @notice Performs validation of group members as declared in DKG\n /// result against group members selected by the sortition pool.\n /// @param seed seed used to start the DKG and select group members\n /// @return true if group members matches; false otherwise\n function validateGroupMembers(EcdsaDkg.Result calldata result, uint256 seed)\n public\n view\n returns (bool)\n {\n uint32[] calldata resultMembers = result.members;\n uint32[] memory actualGroupMembers = sortitionPool.selectGroup(\n groupSize,\n bytes32(seed)\n );\n if (resultMembers.length != actualGroupMembers.length) {\n return false;\n }\n for (uint256 i = 0; i < resultMembers.length; i++) {\n if (resultMembers[i] != actualGroupMembers[i]) {\n return false;\n }\n }\n return true;\n }\n\n /// @notice Performs validation of signatures supplied in DKG result.\n /// Note that this function does not check if addresses which\n /// supplied signatures supporting the result are the ones selected\n /// to the group by sortition pool. This function should be used\n /// together with `validateGroupMembers`.\n /// @param startBlock DKG start block\n /// @return true if group members matches; false otherwise\n function validateSignatures(\n EcdsaDkg.Result calldata result,\n uint256 startBlock\n ) public view returns (bool) {\n bytes32 hash = keccak256(\n abi.encode(\n block.chainid,\n result.groupPubKey,\n result.misbehavedMembersIndices,\n startBlock\n )\n ).toEthSignedMessageHash();\n\n uint256[] calldata signingMembersIndices = result.signingMembersIndices;\n uint32[] memory signingMemberIds = new uint32[](\n signingMembersIndices.length\n );\n for (uint256 i = 0; i < signingMembersIndices.length; i++) {\n signingMemberIds[i] = result.members[signingMembersIndices[i] - 1];\n }\n\n address[] memory signingMemberAddresses = sortitionPool.getIDOperators(\n signingMemberIds\n );\n\n bytes memory current; // Current signature to be checked.\n\n uint256 signaturesCount = result.signatures.length / signatureByteSize;\n for (uint256 i = 0; i < signaturesCount; i++) {\n current = result.signatures.slice(\n signatureByteSize * i,\n signatureByteSize\n );\n address recoveredAddress = hash.recover(current);\n\n if (signingMemberAddresses[i] != recoveredAddress) {\n return false;\n }\n }\n\n return true;\n }\n\n /// @notice Performs validation of hashed group members that actively took\n /// part in DKG.\n /// @param result DKG result\n /// @return true if calculated result's group members hash matches with the\n /// one that is challenged.\n function validateMembersHash(EcdsaDkg.Result calldata result)\n public\n pure\n returns (bool)\n {\n if (result.misbehavedMembersIndices.length > 0) {\n // members that generated a group signing key\n uint32[] memory groupMembers = new uint32[](\n result.members.length - result.misbehavedMembersIndices.length\n );\n uint256 k = 0; // misbehaved members counter\n uint256 j = 0; // group members counter\n for (uint256 i = 0; i < result.members.length; i++) {\n // misbehaved member indices start from 1, so we need to -1 on misbehaved\n if (i != result.misbehavedMembersIndices[k] - 1) {\n groupMembers[j] = result.members[i];\n j++;\n } else if (k < result.misbehavedMembersIndices.length - 1) {\n k++;\n }\n }\n\n return keccak256(abi.encode(groupMembers)) == result.membersHash;\n }\n\n return keccak256(abi.encode(result.members)) == result.membersHash;\n }\n}\n" + }, + "@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n//\n\n// Initial version copied from Keep Network Random Beacon:\n// https://github.com/keep-network/keep-core/blob/5138c7628868dbeed3ae2164f76fccc6c1fbb9e8/solidity/random-beacon/contracts/libraries/DKG.sol\n//\n// With the following differences:\n// - the group size was set to 100,\n// - offchainDkgTimeout was removed,\n// - submission eligibility verification is not performed on-chain,\n// - submission eligibility delay was replaced with a submission timeout,\n// - seed timeout notification requires seedTimeout period to pass.\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\";\nimport \"@keep-network/sortition-pools/contracts/SortitionPool.sol\";\nimport \"@keep-network/random-beacon/contracts/libraries/BytesLib.sol\";\nimport \"../EcdsaDkgValidator.sol\";\n\nlibrary EcdsaDkg {\n using BytesLib for bytes;\n using ECDSAUpgradeable for bytes32;\n\n struct Parameters {\n // Time in blocks during which a seed is expected to be delivered.\n // DKG starts only after a seed is delivered. The time the contract\n // awaits for a seed is not included in the DKG timeout.\n uint256 seedTimeout;\n // Time in blocks during which a submitted result can be challenged.\n uint256 resultChallengePeriodLength;\n // Extra gas required to be left at the end of the challenge DKG result\n // transaction.\n uint256 resultChallengeExtraGas;\n // Time in blocks during which a result is expected to be submitted.\n uint256 resultSubmissionTimeout;\n // Time in blocks during which only the result submitter is allowed to\n // approve it. Once this period ends and the submitter have not approved\n // the result, anyone can do it.\n uint256 submitterPrecedencePeriodLength;\n // This struct doesn't contain `__gap` property as the structure is\n // stored inside `Data` struct, that already have a gap that can be used\n // on upgrade.\n }\n\n struct Data {\n // Address of the Sortition Pool contract.\n SortitionPool sortitionPool;\n // Address of the EcdsaDkgValidator contract.\n EcdsaDkgValidator dkgValidator;\n // DKG parameters. The parameters should persist between DKG executions.\n // They should be updated with dedicated set functions only when DKG is not\n // in progress.\n Parameters parameters;\n // Time in block at which DKG state was locked.\n uint256 stateLockBlock;\n // Time in blocks at which DKG started.\n uint256 startBlock;\n // Seed used to start DKG.\n uint256 seed;\n // Time in blocks that should be added to result submission eligibility\n // delay calculation. It is used in case of a challenge to adjust\n // DKG timeout calculation.\n uint256 resultSubmissionStartBlockOffset;\n // Hash of submitted DKG result.\n bytes32 submittedResultHash;\n // Block number from the moment of the DKG result submission.\n uint256 submittedResultBlock;\n // Reserved storage space in case we need to add more variables.\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n // slither-disable-next-line unused-state\n uint256[38] __gap;\n }\n\n /// @notice DKG result.\n struct Result {\n // Claimed submitter candidate group member index.\n // Must be in range [1, groupSize].\n uint256 submitterMemberIndex;\n // Generated candidate group public key\n bytes groupPubKey;\n // Array of misbehaved members indices (disqualified or inactive).\n // Indices must be in range [1, groupSize], unique, and sorted in ascending\n // order.\n uint8[] misbehavedMembersIndices;\n // Concatenation of signatures from members supporting the result.\n // The message to be signed by each member is keccak256 hash of the\n // calculated group public key, misbehaved members indices and DKG\n // start block. The calculated hash should be prefixed with prefixed with\n // `\\x19Ethereum signed message:\\n` before signing, so the message to\n // sign is:\n // `\\x19Ethereum signed message:\\n${keccak256(\n // groupPubKey, misbehavedMembersIndices, dkgStartBlock\n // )}`\n bytes signatures;\n // Indices of members corresponding to each signature. Indices must be\n // be in range [1, groupSize], unique, and sorted in ascending order.\n uint256[] signingMembersIndices;\n // Identifiers of candidate group members as outputted by the group\n // selection protocol.\n uint32[] members;\n // Keccak256 hash of group members identifiers that actively took part\n // in DKG (excluding IA/DQ members).\n bytes32 membersHash;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice States for phases of group creation. The states doesn't include\n /// timeouts which should be tracked and notified individually.\n enum State {\n // Group creation is not in progress. It is a state set after group creation\n // completion either by timeout or by a result approval.\n IDLE,\n // Group creation is awaiting the seed and sortition pool is locked.\n AWAITING_SEED,\n // DKG protocol execution is in progress. A result is being calculated\n // by the clients in this state and the contract awaits a result submission.\n // This is a state to which group creation returns in case of a result\n // challenge notification.\n AWAITING_RESULT,\n // DKG result was submitted and awaits an approval or a challenge. If a result\n // gets challenge the state returns to `AWAITING_RESULT`. If a result gets\n // approval the state changes to `IDLE`.\n CHALLENGE\n }\n\n /// @dev Size of a group in ECDSA wallet.\n uint256 public constant groupSize = 100;\n\n event DkgStarted(uint256 indexed seed);\n\n // To recreate the members that actively took part in dkg, the selected members\n // array should be filtered out from misbehavedMembersIndices.\n event DkgResultSubmitted(\n bytes32 indexed resultHash,\n uint256 indexed seed,\n Result result\n );\n\n event DkgTimedOut();\n\n event DkgResultApproved(\n bytes32 indexed resultHash,\n address indexed approver\n );\n\n event DkgResultChallenged(\n bytes32 indexed resultHash,\n address indexed challenger,\n string reason\n );\n\n event DkgStateLocked();\n\n event DkgSeedTimedOut();\n\n /// @notice Initializes SortitionPool and EcdsaDkgValidator addresses.\n /// Can be performed only once.\n /// @param _sortitionPool Sortition Pool reference\n /// @param _dkgValidator EcdsaDkgValidator reference\n function init(\n Data storage self,\n SortitionPool _sortitionPool,\n EcdsaDkgValidator _dkgValidator\n ) internal {\n require(\n address(self.sortitionPool) == address(0),\n \"Sortition Pool address already set\"\n );\n\n require(\n address(self.dkgValidator) == address(0),\n \"DKG Validator address already set\"\n );\n\n self.sortitionPool = _sortitionPool;\n self.dkgValidator = _dkgValidator;\n }\n\n /// @notice Determines the current state of group creation. It doesn't take\n /// timeouts into consideration. The timeouts should be tracked and\n /// notified separately.\n function currentState(Data storage self)\n internal\n view\n returns (State state)\n {\n state = State.IDLE;\n\n if (self.sortitionPool.isLocked()) {\n state = State.AWAITING_SEED;\n\n if (self.startBlock > 0) {\n state = State.AWAITING_RESULT;\n\n if (self.submittedResultBlock > 0) {\n state = State.CHALLENGE;\n }\n }\n }\n }\n\n /// @notice Locks the sortition pool and starts awaiting for the\n /// group creation seed.\n function lockState(Data storage self) internal {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n emit DkgStateLocked();\n\n self.sortitionPool.lock();\n\n self.stateLockBlock = block.number;\n }\n\n function start(Data storage self, uint256 seed) internal {\n require(\n currentState(self) == State.AWAITING_SEED,\n \"Current state is not AWAITING_SEED\"\n );\n\n emit DkgStarted(seed);\n\n self.startBlock = block.number;\n self.seed = seed;\n }\n\n /// @notice Allows to submit a DKG result. The submitted result does not go\n /// through a validation and before it gets accepted, it needs to\n /// wait through the challenge period during which everyone has\n /// a chance to challenge the result as invalid one. Submitter of\n /// the result needs to be in the sortition pool and if the result\n /// gets challenged, the submitter will get slashed.\n function submitResult(Data storage self, Result calldata result) internal {\n require(\n currentState(self) == State.AWAITING_RESULT,\n \"Current state is not AWAITING_RESULT\"\n );\n require(!hasDkgTimedOut(self), \"DKG timeout already passed\");\n\n SortitionPool sortitionPool = self.sortitionPool;\n\n // Submitter must be an operator in the sortition pool.\n // Declared submitter's member index in the DKG result needs to match\n // the address calling this function.\n require(\n sortitionPool.isOperatorInPool(msg.sender),\n \"Submitter not in the sortition pool\"\n );\n require(\n sortitionPool.getIDOperator(\n result.members[result.submitterMemberIndex - 1]\n ) == msg.sender,\n \"Unexpected submitter index\"\n );\n\n self.submittedResultHash = keccak256(abi.encode(result));\n self.submittedResultBlock = block.number;\n\n emit DkgResultSubmitted(self.submittedResultHash, self.seed, result);\n }\n\n /// @notice Checks if awaiting seed timed out.\n /// @return True if awaiting seed timed out, false otherwise.\n function hasSeedTimedOut(Data storage self) internal view returns (bool) {\n return\n currentState(self) == State.AWAITING_SEED &&\n block.number > (self.stateLockBlock + self.parameters.seedTimeout);\n }\n\n /// @notice Checks if DKG timed out. The DKG timeout period includes time required\n /// for off-chain protocol execution and time for the result publication.\n /// After this time a result cannot be submitted and DKG can be notified\n /// about the timeout. DKG period is adjusted by result submission\n /// offset that include blocks that were mined while invalid result\n /// has been registered until it got challenged.\n /// @return True if DKG timed out, false otherwise.\n function hasDkgTimedOut(Data storage self) internal view returns (bool) {\n return\n currentState(self) == State.AWAITING_RESULT &&\n block.number >\n (self.startBlock +\n self.resultSubmissionStartBlockOffset +\n self.parameters.resultSubmissionTimeout);\n }\n\n /// @notice Notifies about the seed was not delivered and restores the\n /// initial DKG state (IDLE).\n function notifySeedTimeout(Data storage self) internal {\n require(hasSeedTimedOut(self), \"Awaiting seed has not timed out\");\n\n emit DkgSeedTimedOut();\n\n complete(self);\n }\n\n /// @notice Notifies about DKG timeout.\n function notifyDkgTimeout(Data storage self) internal {\n require(hasDkgTimedOut(self), \"DKG has not timed out\");\n\n emit DkgTimedOut();\n\n complete(self);\n }\n\n /// @notice Approves DKG result. Can be called when the challenge period for\n /// the submitted result is finished. Considers the submitted result\n /// as valid. For the first `submitterPrecedencePeriodLength`\n /// blocks after the end of the challenge period can be called only\n /// by the DKG result submitter. After that time, can be called by\n /// anyone.\n /// @dev Can be called after a challenge period for the submitted result.\n /// @param result Result to approve. Must match the submitted result stored\n /// during `submitResult`.\n /// @return misbehavedMembers Identifiers of members who misbehaved during DKG.\n function approveResult(Data storage self, Result calldata result)\n internal\n returns (uint32[] memory misbehavedMembers)\n {\n require(\n currentState(self) == State.CHALLENGE,\n \"Current state is not CHALLENGE\"\n );\n\n uint256 challengePeriodEnd = self.submittedResultBlock +\n self.parameters.resultChallengePeriodLength;\n\n require(\n block.number > challengePeriodEnd,\n \"Challenge period has not passed yet\"\n );\n\n require(\n keccak256(abi.encode(result)) == self.submittedResultHash,\n \"Result under approval is different than the submitted one\"\n );\n\n // Extract submitter member address. Submitter member index is in\n // range [1, groupSize] so we need to -1 when fetching identifier from members\n // array.\n address submitterMember = self.sortitionPool.getIDOperator(\n result.members[result.submitterMemberIndex - 1]\n );\n\n require(\n msg.sender == submitterMember ||\n block.number >\n challengePeriodEnd +\n self.parameters.submitterPrecedencePeriodLength,\n \"Only the DKG result submitter can approve the result at this moment\"\n );\n\n // Extract misbehaved members identifiers. Misbehaved members indices\n // are in range [1, groupSize], so we need to -1 when fetching identifiers from\n // members array.\n misbehavedMembers = new uint32[](\n result.misbehavedMembersIndices.length\n );\n for (uint256 i = 0; i < result.misbehavedMembersIndices.length; i++) {\n misbehavedMembers[i] = result.members[\n result.misbehavedMembersIndices[i] - 1\n ];\n }\n\n emit DkgResultApproved(self.submittedResultHash, msg.sender);\n\n return misbehavedMembers;\n }\n\n /// @notice Challenges DKG result. If the submitted result is proved to be\n /// invalid it reverts the DKG back to the result submission phase.\n /// @dev Can be called during a challenge period for the submitted result.\n /// @param result Result to challenge. Must match the submitted result\n /// stored during `submitResult`.\n /// @return maliciousResultHash Hash of the malicious result.\n /// @return maliciousSubmitter Identifier of the malicious submitter.\n function challengeResult(Data storage self, Result calldata result)\n internal\n returns (bytes32 maliciousResultHash, uint32 maliciousSubmitter)\n {\n require(\n currentState(self) == State.CHALLENGE,\n \"Current state is not CHALLENGE\"\n );\n\n require(\n block.number <=\n self.submittedResultBlock +\n self.parameters.resultChallengePeriodLength,\n \"Challenge period has already passed\"\n );\n\n require(\n keccak256(abi.encode(result)) == self.submittedResultHash,\n \"Result under challenge is different than the submitted one\"\n );\n\n // https://github.com/crytic/slither/issues/982\n // slither-disable-next-line unused-return\n try\n self.dkgValidator.validate(result, self.seed, self.startBlock)\n returns (\n // slither-disable-next-line uninitialized-local,variable-scope\n bool isValid,\n // slither-disable-next-line uninitialized-local,variable-scope\n string memory errorMsg\n ) {\n if (isValid) {\n revert(\"unjustified challenge\");\n }\n\n emit DkgResultChallenged(\n self.submittedResultHash,\n msg.sender,\n errorMsg\n );\n } catch {\n // if the validation reverted we consider the DKG result as invalid\n emit DkgResultChallenged(\n self.submittedResultHash,\n msg.sender,\n \"validation reverted\"\n );\n }\n\n // Consider result hash as malicious.\n maliciousResultHash = self.submittedResultHash;\n maliciousSubmitter = result.members[result.submitterMemberIndex - 1];\n\n // Adjust DKG result submission block start, so submission stage starts\n // from the beginning.\n self.resultSubmissionStartBlockOffset = block.number - self.startBlock;\n\n submittedResultCleanup(self);\n\n return (maliciousResultHash, maliciousSubmitter);\n }\n\n /// @notice Due to EIP150, 1/64 of the gas is not forwarded to the call, and\n /// will be kept to execute the remaining operations in the function\n /// after the call inside the try-catch.\n ///\n /// To ensure there is no way for the caller to manipulate gas limit\n /// in such a way that the call inside try-catch fails with out-of-gas\n /// and the rest of the function is executed with the remaining\n /// 1/64 of gas, we require an extra gas amount to be left at the\n /// end of the call to the function challenging DKG result and\n /// wrapping the call to EcdsaDkgValidator and TokenStaking\n /// contracts inside a try-catch.\n function requireChallengeExtraGas(Data storage self) internal view {\n require(\n gasleft() >= self.parameters.resultChallengeExtraGas,\n \"Not enough extra gas left\"\n );\n }\n\n /// @notice Checks if DKG result is valid for the current DKG.\n /// @param result DKG result.\n /// @return True if the result is valid. If the result is invalid it returns\n /// false and an error message.\n function isResultValid(Data storage self, Result calldata result)\n internal\n view\n returns (bool, string memory)\n {\n require(self.startBlock > 0, \"DKG has not been started\");\n\n return self.dkgValidator.validate(result, self.seed, self.startBlock);\n }\n\n /// @notice Set setSeedTimeout parameter.\n function setSeedTimeout(Data storage self, uint256 newSeedTimeout)\n internal\n {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n require(newSeedTimeout > 0, \"New value should be greater than zero\");\n\n self.parameters.seedTimeout = newSeedTimeout;\n }\n\n /// @notice Set resultChallengePeriodLength parameter.\n function setResultChallengePeriodLength(\n Data storage self,\n uint256 newResultChallengePeriodLength\n ) internal {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n require(\n newResultChallengePeriodLength > 0,\n \"New value should be greater than zero\"\n );\n\n self\n .parameters\n .resultChallengePeriodLength = newResultChallengePeriodLength;\n }\n\n /// @notice Set resultChallengeExtraGas parameter.\n function setResultChallengeExtraGas(\n Data storage self,\n uint256 newResultChallengeExtraGas\n ) internal {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n self.parameters.resultChallengeExtraGas = newResultChallengeExtraGas;\n }\n\n /// @notice Set resultSubmissionTimeout parameter.\n function setResultSubmissionTimeout(\n Data storage self,\n uint256 newResultSubmissionTimeout\n ) internal {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n require(\n newResultSubmissionTimeout > 0,\n \"New value should be greater than zero\"\n );\n\n self.parameters.resultSubmissionTimeout = newResultSubmissionTimeout;\n }\n\n /// @notice Set submitterPrecedencePeriodLength parameter.\n function setSubmitterPrecedencePeriodLength(\n Data storage self,\n uint256 newSubmitterPrecedencePeriodLength\n ) internal {\n require(currentState(self) == State.IDLE, \"Current state is not IDLE\");\n\n require(\n newSubmitterPrecedencePeriodLength <\n self.parameters.resultSubmissionTimeout,\n \"New value should be less than result submission period length\"\n );\n\n self\n .parameters\n .submitterPrecedencePeriodLength = newSubmitterPrecedencePeriodLength;\n }\n\n /// @notice Completes DKG by cleaning up state.\n /// @dev Should be called after DKG times out or a result is approved.\n function complete(Data storage self) internal {\n delete self.startBlock;\n delete self.seed;\n delete self.resultSubmissionStartBlockOffset;\n submittedResultCleanup(self);\n self.sortitionPool.unlock();\n }\n\n /// @notice Cleans up submitted result state either after DKG completion\n /// (as part of `complete` method) or after justified challenge.\n function submittedResultCleanup(Data storage self) private {\n delete self.submittedResultHash;\n delete self.submittedResultBlock;\n }\n}\n" + }, + "@keep-network/random-beacon/contracts/Governable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity 0.8.17;\n\n/// @notice Governable contract.\n/// @dev A constructor is not defined, which makes the contract compatible with\n/// upgradable proxies. This requires calling explicitly `_transferGovernance`\n/// function in a child contract.\nabstract contract Governable {\n // Governance of the contract\n // The variable should be initialized by the implementing contract.\n // slither-disable-next-line uninitialized-state\n address public governance;\n\n // Reserved storage space in case we need to add more variables,\n // since there are upgradeable contracts that inherit from this one.\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n // slither-disable-next-line unused-state\n uint256[49] private __gap;\n\n event GovernanceTransferred(address oldGovernance, address newGovernance);\n\n modifier onlyGovernance() virtual {\n require(governance == msg.sender, \"Caller is not the governance\");\n _;\n }\n\n /// @notice Transfers governance of the contract to `newGovernance`.\n function transferGovernance(address newGovernance)\n external\n virtual\n onlyGovernance\n {\n require(\n newGovernance != address(0),\n \"New governance is the zero address\"\n );\n _transferGovernance(newGovernance);\n }\n\n function _transferGovernance(address newGovernance) internal virtual {\n address oldGovernance = governance;\n governance = newGovernance;\n emit GovernanceTransferred(oldGovernance, newGovernance);\n }\n}\n" + }, + "@keep-network/random-beacon/contracts/libraries/BytesLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n//\n\npragma solidity 0.8.17;\n\n/*\nVersion pulled from keep-core v1:\nhttps://github.com/keep-network/keep-core/blob/f297202db00c027978ad8e7103a356503de5773c/solidity-v1/contracts/utils/BytesLib.sol\n\nTo compile it with solidity 0.8 `_preBytes_slot` was replaced with `_preBytes.slot`.\n*/\n\n/*\nhttps://github.com/GNSPS/solidity-bytes-utils/\nThis is free and unencumbered software released into the public domain.\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\nFor more information, please refer to \n*/\n\n/** @title BytesLib **/\n/** @author https://github.com/GNSPS **/\n\nlibrary BytesLib {\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes)\n internal\n {\n assembly {\n // Read the first 32 bytes of _preBytes storage, which is the length\n // of the array. (We don't need to use the offset into the slot\n // because arrays use the entire slot.)\n let fslot := sload(_preBytes.slot)\n // Arrays of 31 bytes or less have an even value in their slot,\n // while longer arrays have an odd value. The actual length is\n // the slot divided by two for odd values, and the lowest order\n // byte divided by two for even values.\n // If the slot is even, bitwise and the slot with 255 and divide by\n // two to get the length. If the slot is odd, bitwise and the slot\n // with -1 and divide by two.\n let slength := div(\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\n 2\n )\n let mlength := mload(_postBytes)\n let newlength := add(slength, mlength)\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n switch add(lt(slength, 32), lt(newlength, 32))\n case 2 {\n // Since the new array still fits in the slot, we just need to\n // update the contents of the slot.\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\n sstore(\n _preBytes.slot,\n // all the modifications to the slot are inside this\n // next block\n add(\n // we can just add to the slot contents because the\n // bytes we want to change are the LSBs\n fslot,\n add(\n mul(\n div(\n // load the bytes from memory\n mload(add(_postBytes, 0x20)),\n // zero all bytes to the right\n exp(0x100, sub(32, mlength))\n ),\n // and now shift left the number of bytes to\n // leave space for the length in the slot\n exp(0x100, sub(32, newlength))\n ),\n // increase length by the double of the memory\n // bytes length\n mul(mlength, 2)\n )\n )\n )\n }\n case 1 {\n // The stored value fits in the slot, but the combined value\n // will exceed it.\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // The contents of the _postBytes array start 32 bytes into\n // the structure. Our first read should obtain the `submod`\n // bytes that can fit into the unused space in the last word\n // of the stored array. To get this, we read 32 bytes starting\n // from `submod`, so the data we read overlaps with the array\n // contents by `submod` bytes. Masking the lowest-order\n // `submod` bytes allows us to add that value directly to the\n // stored value.\n\n let submod := sub(32, slength)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(\n sc,\n add(\n and(\n fslot,\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\n ),\n and(mload(mc), mask)\n )\n )\n\n for {\n mc := add(mc, 0x20)\n sc := add(sc, 1)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n default {\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n // Start copying to the last used word of the stored array.\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\n\n // save new length\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\n\n // Copy over the first `submod` bytes of the new data as in\n // case 1 above.\n let slengthmod := mod(slength, 32)\n let submod := sub(32, slengthmod)\n let mc := add(_postBytes, submod)\n let end := add(_postBytes, mlength)\n let mask := sub(exp(0x100, submod), 1)\n\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\n\n for {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } lt(mc, end) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n sstore(sc, mload(mc))\n }\n\n mask := exp(0x100, sub(mc, end))\n\n sstore(sc, mul(div(mload(mc), mask), mask))\n }\n }\n }\n\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes)\n internal\n view\n returns (bool)\n {\n bool success = true;\n\n assembly {\n // we know _preBytes_offset is 0\n let fslot := sload(_preBytes.slot)\n // Decode the length of the stored array like in concatStorage().\n let slength := div(\n and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)),\n 2\n )\n let mlength := mload(_postBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(slength, mlength)\n case 1 {\n // slength can contain both the length and contents of the array\n // if length < 32 bytes so let's prepare for that\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\n if iszero(iszero(slength)) {\n switch lt(slength, 32)\n case 1 {\n // blank the last byte which is the length\n fslot := mul(div(fslot, 0x100), 0x100)\n\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\n // unsuccess:\n success := 0\n }\n }\n default {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n // get the keccak hash to get the contents of the array\n mstore(0x0, _preBytes.slot)\n let sc := keccak256(0x0, 0x20)\n\n let mc := add(_postBytes, 0x20)\n let end := add(mc, mlength)\n\n // the next line is the loop condition:\n // while(uint(mc < end) + cb == 2)\n for {\n\n } eq(add(lt(mc, end), cb), 2) {\n sc := add(sc, 1)\n mc := add(mc, 0x20)\n } {\n if iszero(eq(sload(sc), mload(mc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function concat(bytes memory _preBytes, bytes memory _postBytes)\n internal\n pure\n returns (bytes memory)\n {\n bytes memory tempBytes;\n\n assembly {\n // Get a location of some free memory and store it in tempBytes as\n // Solidity does for memory variables.\n tempBytes := mload(0x40)\n\n // Store the length of the first bytes array at the beginning of\n // the memory for tempBytes.\n let length := mload(_preBytes)\n mstore(tempBytes, length)\n\n // Maintain a memory counter for the current write location in the\n // temp bytes array by adding the 32 bytes for the array length to\n // the starting location.\n let mc := add(tempBytes, 0x20)\n // Stop copying when the memory counter reaches the length of the\n // first bytes array.\n let end := add(mc, length)\n\n for {\n // Initialize a copy counter to the start of the _preBytes data,\n // 32 bytes into its memory.\n let cc := add(_preBytes, 0x20)\n } lt(mc, end) {\n // Increase both counters by 32 bytes each iteration.\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // Write the _preBytes data into the tempBytes memory 32 bytes\n // at a time.\n mstore(mc, mload(cc))\n }\n\n // Add the length of _postBytes to the current length of tempBytes\n // and store it as the new length in the first 32 bytes of the\n // tempBytes memory.\n length := mload(_postBytes)\n mstore(tempBytes, add(length, mload(tempBytes)))\n\n // Move the memory counter back from a multiple of 0x20 to the\n // actual end of the _preBytes data.\n mc := end\n // Stop copying when the memory counter reaches the new combined\n // length of the arrays.\n end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n } lt(mc, end) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n mstore(mc, mload(cc))\n }\n\n // Update the free-memory pointer by padding our last write location\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\n // next 32 byte block, then round down to the nearest multiple of\n // 32. If the sum of the length of the two arrays is zero then add\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\n mstore(\n 0x40,\n and(\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\n not(31) // Round down to the nearest 32 bytes.\n )\n )\n }\n\n return tempBytes;\n }\n\n function slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) internal pure returns (bytes memory res) {\n uint256 _end = _start + _length;\n require(_end > _start && _bytes.length >= _end, \"Slice out of bounds\");\n\n assembly {\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\n res := mload(0x40)\n mstore(0x40, add(add(res, 64), _length))\n mstore(res, _length)\n\n // Compute distance between source and destination pointers\n let diff := sub(res, add(_bytes, _start))\n\n for {\n let src := add(add(_bytes, 32), _start)\n let end := add(src, _length)\n } lt(src, end) {\n src := add(src, 32)\n } {\n mstore(add(src, diff), mload(src))\n }\n }\n }\n\n function toAddress(bytes memory _bytes, uint256 _start)\n internal\n pure\n returns (address)\n {\n uint256 _totalLen = _start + 20;\n require(\n _totalLen > _start && _bytes.length >= _totalLen,\n \"Address conversion out of bounds.\"\n );\n address tempAddress;\n\n assembly {\n tempAddress := div(\n mload(add(add(_bytes, 0x20), _start)),\n 0x1000000000000000000000000\n )\n }\n\n return tempAddress;\n }\n\n function toUint8(bytes memory _bytes, uint256 _start)\n internal\n pure\n returns (uint8)\n {\n require(\n _bytes.length >= (_start + 1),\n \"Uint8 conversion out of bounds.\"\n );\n uint8 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x1), _start))\n }\n\n return tempUint;\n }\n\n function toUint(bytes memory _bytes, uint256 _start)\n internal\n pure\n returns (uint256)\n {\n uint256 _totalLen = _start + 32;\n require(\n _totalLen > _start && _bytes.length >= _totalLen,\n \"Uint conversion out of bounds.\"\n );\n uint256 tempUint;\n\n assembly {\n tempUint := mload(add(add(_bytes, 0x20), _start))\n }\n\n return tempUint;\n }\n\n function equal(bytes memory _preBytes, bytes memory _postBytes)\n internal\n pure\n returns (bool)\n {\n bool success = true;\n\n assembly {\n let length := mload(_preBytes)\n\n // if lengths don't match the arrays are not equal\n switch eq(length, mload(_postBytes))\n case 1 {\n // cb is a circuit breaker in the for loop since there's\n // no said feature for inline assembly loops\n // cb = 1 - don't breaker\n // cb = 0 - break\n let cb := 1\n\n let mc := add(_preBytes, 0x20)\n let end := add(mc, length)\n\n for {\n let cc := add(_postBytes, 0x20)\n // the next line is the loop condition:\n // while(uint(mc < end) + cb == 2)\n } eq(add(lt(mc, end), cb), 2) {\n mc := add(mc, 0x20)\n cc := add(cc, 0x20)\n } {\n // if any of these checks fails then arrays are not equal\n if iszero(eq(mload(mc), mload(cc))) {\n // unsuccess:\n success := 0\n cb := 0\n }\n }\n }\n default {\n // unsuccess:\n success := 0\n }\n }\n\n return success;\n }\n\n function toBytes32(bytes memory _source)\n internal\n pure\n returns (bytes32 result)\n {\n if (_source.length == 0) {\n return 0x0;\n }\n\n assembly {\n result := mload(add(_source, 32))\n }\n }\n\n function keccak256Slice(\n bytes memory _bytes,\n uint256 _start,\n uint256 _length\n ) internal pure returns (bytes32 result) {\n uint256 _end = _start + _length;\n require(_end > _start && _bytes.length >= _end, \"Slice out of bounds\");\n\n assembly {\n result := keccak256(add(add(_bytes, 32), _start), _length)\n }\n }\n}\n" + }, + "@keep-network/random-beacon/contracts/Reimbursable.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity 0.8.17;\n\nimport \"./ReimbursementPool.sol\";\n\nabstract contract Reimbursable {\n // The variable should be initialized by the implementing contract.\n // slither-disable-next-line uninitialized-state\n ReimbursementPool public reimbursementPool;\n\n // Reserved storage space in case we need to add more variables,\n // since there are upgradeable contracts that inherit from this one.\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n // slither-disable-next-line unused-state\n uint256[49] private __gap;\n\n event ReimbursementPoolUpdated(address newReimbursementPool);\n\n modifier refundable(address receiver) {\n uint256 gasStart = gasleft();\n _;\n reimbursementPool.refund(gasStart - gasleft(), receiver);\n }\n\n modifier onlyReimbursableAdmin() virtual {\n _;\n }\n\n function updateReimbursementPool(ReimbursementPool _reimbursementPool)\n external\n onlyReimbursableAdmin\n {\n emit ReimbursementPoolUpdated(address(_reimbursementPool));\n\n reimbursementPool = _reimbursementPool;\n }\n}\n" + }, + "@keep-network/random-beacon/contracts/ReimbursementPool.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n//\n// ▓▓▌ ▓▓ ▐▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▌▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓ ▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓ ▐▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▄▄▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▄▄▄▄ ▓▓▓▓▓▓▄▄▄▄ ▐▓▓▓▓▓▌ ▐▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▐▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▀▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓▀▀▀▀ ▓▓▓▓▓▓▀▀▀▀ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀\n// ▓▓▓▓▓▓ ▀▓▓▓▓▓▓▄ ▐▓▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓▓ ▓▓▓▓▓ ▐▓▓▓▓▓▌\n// ▓▓▓▓▓▓▓▓▓▓ █▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n// ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓\n//\n// Trust math, not hardware.\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\n\ncontract ReimbursementPool is Ownable, ReentrancyGuard {\n /// @notice Authorized contracts that can interact with the reimbursment pool.\n /// Authorization can be granted and removed by the owner.\n mapping(address => bool) public isAuthorized;\n\n /// @notice Static gas includes:\n /// - cost of the refund function\n /// - base transaction cost\n uint256 public staticGas;\n\n /// @notice Max gas price used to reimburse a transaction submitter. Protects\n /// against malicious operator-miners.\n uint256 public maxGasPrice;\n\n event StaticGasUpdated(uint256 newStaticGas);\n\n event MaxGasPriceUpdated(uint256 newMaxGasPrice);\n\n event SendingEtherFailed(uint256 refundAmount, address receiver);\n\n event AuthorizedContract(address thirdPartyContract);\n\n event UnauthorizedContract(address thirdPartyContract);\n\n event FundsWithdrawn(uint256 withdrawnAmount, address receiver);\n\n constructor(uint256 _staticGas, uint256 _maxGasPrice) {\n staticGas = _staticGas;\n maxGasPrice = _maxGasPrice;\n }\n\n /// @notice Receive ETH\n receive() external payable {}\n\n /// @notice Refunds ETH to a spender for executing specific transactions.\n /// @dev Ignoring the result of sending ETH to a receiver is made on purpose.\n /// For EOA receiving ETH should always work. If a receiver is a smart\n /// contract, then we do not want to fail a transaction, because in some\n /// cases the refund is done at the very end of multiple calls where all\n /// the previous calls were already paid off. It is a receiver's smart\n /// contract resposibility to make sure it can receive ETH.\n /// @dev Only authorized contracts are allowed calling this function.\n /// @param gasSpent Gas spent on a transaction that needs to be reimbursed.\n /// @param receiver Address where the reimbursment is sent.\n function refund(uint256 gasSpent, address receiver) external nonReentrant {\n require(\n isAuthorized[msg.sender],\n \"Contract is not authorized for a refund\"\n );\n require(receiver != address(0), \"Receiver's address cannot be zero\");\n\n uint256 gasPrice = tx.gasprice < maxGasPrice\n ? tx.gasprice\n : maxGasPrice;\n\n uint256 refundAmount = (gasSpent + staticGas) * gasPrice;\n\n /* solhint-disable avoid-low-level-calls */\n // slither-disable-next-line low-level-calls,unchecked-lowlevel\n (bool sent, ) = receiver.call{value: refundAmount}(\"\");\n /* solhint-enable avoid-low-level-calls */\n if (!sent) {\n // slither-disable-next-line reentrancy-events\n emit SendingEtherFailed(refundAmount, receiver);\n }\n }\n\n /// @notice Authorize a contract that can interact with this reimbursment pool.\n /// Can be authorized by the owner only.\n /// @param _contract Authorized contract.\n function authorize(address _contract) external onlyOwner {\n isAuthorized[_contract] = true;\n\n emit AuthorizedContract(_contract);\n }\n\n /// @notice Unauthorize a contract that was previously authorized to interact\n /// with this reimbursment pool. Can be unauthorized by the\n /// owner only.\n /// @param _contract Authorized contract.\n function unauthorize(address _contract) external onlyOwner {\n delete isAuthorized[_contract];\n\n emit UnauthorizedContract(_contract);\n }\n\n /// @notice Setting a static gas cost for executing a transaction. Can be set\n /// by the owner only.\n /// @param _staticGas Static gas cost.\n function setStaticGas(uint256 _staticGas) external onlyOwner {\n staticGas = _staticGas;\n\n emit StaticGasUpdated(_staticGas);\n }\n\n /// @notice Setting a max gas price for transactions. Can be set by the\n /// owner only.\n /// @param _maxGasPrice Max gas price used to reimburse tx submitters.\n function setMaxGasPrice(uint256 _maxGasPrice) external onlyOwner {\n maxGasPrice = _maxGasPrice;\n\n emit MaxGasPriceUpdated(_maxGasPrice);\n }\n\n /// @notice Withdraws all ETH from this pool which are sent to a given\n /// address. Can be set by the owner only.\n /// @param receiver An address where ETH is sent.\n function withdrawAll(address receiver) external onlyOwner {\n withdraw(address(this).balance, receiver);\n }\n\n /// @notice Withdraws ETH amount from this pool which are sent to a given\n /// address. Can be set by the owner only.\n /// @param amount Amount to withdraw from the pool.\n /// @param receiver An address where ETH is sent.\n function withdraw(uint256 amount, address receiver) public onlyOwner {\n require(\n address(this).balance >= amount,\n \"Insufficient contract balance\"\n );\n require(receiver != address(0), \"Receiver's address cannot be zero\");\n\n emit FundsWithdrawn(amount, receiver);\n\n /* solhint-disable avoid-low-level-calls */\n // slither-disable-next-line low-level-calls,arbitrary-send\n (bool sent, ) = receiver.call{value: amount}(\"\");\n /* solhint-enable avoid-low-level-calls */\n require(sent, \"Failed to send Ether\");\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/Branch.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"./Constants.sol\";\n\n/// @notice The implicit 8-ary trees of the sortition pool\n/// rely on packing 8 \"slots\" of 32-bit values into each uint256.\n/// The Branch library permits efficient calculations on these slots.\nlibrary Branch {\n /// @notice Calculate the right shift required\n /// to make the 32 least significant bits of an uint256\n /// be the bits of the `position`th slot\n /// when treating the uint256 as a uint32[8].\n ///\n /// @dev Not used for efficiency reasons,\n /// but left to illustrate the meaning of a common pattern.\n /// I wish solidity had macros, even C macros.\n function slotShift(uint256 position) internal pure returns (uint256) {\n unchecked {\n return position * Constants.SLOT_WIDTH;\n }\n }\n\n /// @notice Return the `position`th slot of the `node`,\n /// treating `node` as a uint32[32].\n function getSlot(uint256 node, uint256 position)\n internal\n pure\n returns (uint256)\n {\n unchecked {\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\n // Doing a bitwise AND with `SLOT_MAX`\n // clears all but the 32 least significant bits.\n // Because of the right shift by `slotShift(position)` bits,\n // those 32 bits contain the 32 bits in the `position`th slot of `node`.\n return (node >> shiftBits) & Constants.SLOT_MAX;\n }\n }\n\n /// @notice Return `node` with the `position`th slot set to zero.\n function clearSlot(uint256 node, uint256 position)\n internal\n pure\n returns (uint256)\n {\n unchecked {\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\n // Shifting `SLOT_MAX` left by `slotShift(position)` bits\n // gives us a number where all bits of the `position`th slot are set,\n // and all other bits are unset.\n //\n // Using a bitwise NOT on this number,\n // we get a uint256 where all bits are set\n // except for those of the `position`th slot.\n //\n // Bitwise ANDing the original `node` with this number\n // sets the bits of `position`th slot to zero,\n // leaving all other bits unchanged.\n return node & ~(Constants.SLOT_MAX << shiftBits);\n }\n }\n\n /// @notice Return `node` with the `position`th slot set to `weight`.\n ///\n /// @param weight The weight of of the node.\n /// Safely truncated to a 32-bit number,\n /// but this should never be called with an overflowing weight regardless.\n function setSlot(\n uint256 node,\n uint256 position,\n uint256 weight\n ) internal pure returns (uint256) {\n unchecked {\n uint256 shiftBits = position * Constants.SLOT_WIDTH;\n // Clear the `position`th slot like in `clearSlot()`.\n uint256 clearedNode = node & ~(Constants.SLOT_MAX << shiftBits);\n // Bitwise AND `weight` with `SLOT_MAX`\n // to clear all but the 32 least significant bits.\n //\n // Shift this left by `slotShift(position)` bits\n // to obtain a uint256 with all bits unset\n // except in the `position`th slot\n // which contains the 32-bit value of `weight`.\n uint256 shiftedWeight = (weight & Constants.SLOT_MAX) << shiftBits;\n // When we bitwise OR these together,\n // all other slots except the `position`th one come from the left argument,\n // and the `position`th gets filled with `weight` from the right argument.\n return clearedNode | shiftedWeight;\n }\n }\n\n /// @notice Calculate the summed weight of all slots in the `node`.\n function sumWeight(uint256 node) internal pure returns (uint256 sum) {\n unchecked {\n sum = node & Constants.SLOT_MAX;\n // Iterate through each slot\n // by shifting `node` right in increments of 32 bits,\n // and adding the 32 least significant bits to the `sum`.\n uint256 newNode = node >> Constants.SLOT_WIDTH;\n while (newNode > 0) {\n sum += (newNode & Constants.SLOT_MAX);\n newNode = newNode >> Constants.SLOT_WIDTH;\n }\n return sum;\n }\n }\n\n /// @notice Pick a slot in `node` that corresponds to `index`.\n /// Treats the node like an array of virtual stakers,\n /// the number of virtual stakers in each slot corresponding to its weight,\n /// and picks which slot contains the `index`th virtual staker.\n ///\n /// @dev Requires that `index` be lower than `sumWeight(node)`.\n /// However, this is not enforced for performance reasons.\n /// If `index` exceeds the permitted range,\n /// `pickWeightedSlot()` returns the rightmost slot\n /// and an excessively high `newIndex`.\n ///\n /// @return slot The slot of `node` containing the `index`th virtual staker.\n ///\n /// @return newIndex The index of the `index`th virtual staker of `node`\n /// within the returned slot.\n function pickWeightedSlot(uint256 node, uint256 index)\n internal\n pure\n returns (uint256 slot, uint256 newIndex)\n {\n unchecked {\n newIndex = index;\n uint256 newNode = node;\n uint256 currentSlotWeight = newNode & Constants.SLOT_MAX;\n while (newIndex >= currentSlotWeight) {\n newIndex -= currentSlotWeight;\n slot++;\n newNode = newNode >> Constants.SLOT_WIDTH;\n currentSlotWeight = newNode & Constants.SLOT_MAX;\n }\n return (slot, newIndex);\n }\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/Chaosnet.sol": { + "content": "pragma solidity 0.8.17;\n\n/// @title Chaosnet\n/// @notice This is a beta staker program for stakers willing to go the extra\n/// mile with monitoring, share their logs with the dev team, and allow to more\n/// carefully monitor the bootstrapping network. As the network matures, the\n/// beta program will be ended.\ncontract Chaosnet {\n /// @notice Indicates if the chaosnet is active. The chaosnet is active\n /// after the contract deployment and can be ended with a call to\n /// `deactivateChaosnet()`. Once deactivated chaosnet can not be activated\n /// again.\n bool public isChaosnetActive;\n\n /// @notice Indicates if the given operator is a beta operator for chaosnet.\n mapping(address => bool) public isBetaOperator;\n\n /// @notice Address controlling chaosnet status and beta operator addresses.\n address public chaosnetOwner;\n\n event BetaOperatorsAdded(address[] operators);\n\n event ChaosnetOwnerRoleTransferred(\n address oldChaosnetOwner,\n address newChaosnetOwner\n );\n\n event ChaosnetDeactivated();\n\n constructor() {\n _transferChaosnetOwner(msg.sender);\n isChaosnetActive = true;\n }\n\n modifier onlyChaosnetOwner() {\n require(msg.sender == chaosnetOwner, \"Not the chaosnet owner\");\n _;\n }\n\n modifier onlyOnChaosnet() {\n require(isChaosnetActive, \"Chaosnet is not active\");\n _;\n }\n\n /// @notice Adds beta operator to chaosnet. Can be called only by the\n /// chaosnet owner when the chaosnet is active. Once the operator is added\n /// as a beta operator, it can not be removed.\n function addBetaOperators(address[] calldata operators)\n public\n onlyOnChaosnet\n onlyChaosnetOwner\n {\n for (uint256 i = 0; i < operators.length; i++) {\n isBetaOperator[operators[i]] = true;\n }\n\n emit BetaOperatorsAdded(operators);\n }\n\n /// @notice Deactivates the chaosnet. Can be called only by the chaosnet\n /// owner. Once deactivated chaosnet can not be activated again.\n function deactivateChaosnet() public onlyOnChaosnet onlyChaosnetOwner {\n isChaosnetActive = false;\n emit ChaosnetDeactivated();\n }\n\n /// @notice Transfers the chaosnet owner role to another non-zero address.\n function transferChaosnetOwnerRole(address newChaosnetOwner)\n public\n onlyChaosnetOwner\n {\n require(\n newChaosnetOwner != address(0),\n \"New chaosnet owner must not be zero address\"\n );\n _transferChaosnetOwner(newChaosnetOwner);\n }\n\n function _transferChaosnetOwner(address newChaosnetOwner) internal {\n address oldChaosnetOwner = chaosnetOwner;\n chaosnetOwner = newChaosnetOwner;\n emit ChaosnetOwnerRoleTransferred(oldChaosnetOwner, newChaosnetOwner);\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/Constants.sol": { + "content": "pragma solidity 0.8.17;\n\nlibrary Constants {\n ////////////////////////////////////////////////////////////////////////////\n // Parameters for configuration\n\n // How many bits a position uses per level of the tree;\n // each branch of the tree contains 2**SLOT_BITS slots.\n uint256 constant SLOT_BITS = 3;\n uint256 constant LEVELS = 7;\n ////////////////////////////////////////////////////////////////////////////\n\n ////////////////////////////////////////////////////////////////////////////\n // Derived constants, do not touch\n uint256 constant SLOT_COUNT = 2**SLOT_BITS;\n uint256 constant SLOT_WIDTH = 256 / SLOT_COUNT;\n uint256 constant LAST_SLOT = SLOT_COUNT - 1;\n uint256 constant SLOT_MAX = (2**SLOT_WIDTH) - 1;\n uint256 constant POOL_CAPACITY = SLOT_COUNT**LEVELS;\n\n uint256 constant ID_WIDTH = SLOT_WIDTH;\n uint256 constant ID_MAX = SLOT_MAX;\n\n uint256 constant BLOCKHEIGHT_WIDTH = 96 - ID_WIDTH;\n uint256 constant BLOCKHEIGHT_MAX = (2**BLOCKHEIGHT_WIDTH) - 1;\n\n uint256 constant SLOT_POINTER_MAX = (2**SLOT_BITS) - 1;\n uint256 constant LEAF_FLAG = 1 << 255;\n\n uint256 constant WEIGHT_WIDTH = 256 / SLOT_COUNT;\n ////////////////////////////////////////////////////////////////////////////\n}\n" + }, + "@keep-network/sortition-pools/contracts/Leaf.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"./Constants.sol\";\n\nlibrary Leaf {\n function make(\n address _operator,\n uint256 _creationBlock,\n uint256 _id\n ) internal pure returns (uint256) {\n assert(_creationBlock <= type(uint64).max);\n assert(_id <= type(uint32).max);\n // Converting a bytesX type into a larger type\n // adds zero bytes on the right.\n uint256 op = uint256(bytes32(bytes20(_operator)));\n // Bitwise AND the id to erase\n // all but the 32 least significant bits\n uint256 uid = _id & Constants.ID_MAX;\n // Erase all but the 64 least significant bits,\n // then shift left by 32 bits to make room for the id\n uint256 cb = (_creationBlock & Constants.BLOCKHEIGHT_MAX) <<\n Constants.ID_WIDTH;\n // Bitwise OR them all together to get\n // [address operator || uint64 creationBlock || uint32 id]\n return (op | cb | uid);\n }\n\n function operator(uint256 leaf) internal pure returns (address) {\n // Converting a bytesX type into a smaller type\n // truncates it on the right.\n return address(bytes20(bytes32(leaf)));\n }\n\n /// @notice Return the block number the leaf was created in.\n function creationBlock(uint256 leaf) internal pure returns (uint256) {\n return ((leaf >> Constants.ID_WIDTH) & Constants.BLOCKHEIGHT_MAX);\n }\n\n function id(uint256 leaf) internal pure returns (uint32) {\n // Id is stored in the 32 least significant bits.\n // Bitwise AND ensures that we only get the contents of those bits.\n return uint32(leaf & Constants.ID_MAX);\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/Position.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"./Constants.sol\";\n\nlibrary Position {\n // Return the last 3 bits of a position number,\n // corresponding to its slot in its parent\n function slot(uint256 a) internal pure returns (uint256) {\n return a & Constants.SLOT_POINTER_MAX;\n }\n\n // Return the parent of a position number\n function parent(uint256 a) internal pure returns (uint256) {\n return a >> Constants.SLOT_BITS;\n }\n\n // Return the location of the child of a at the given slot\n function child(uint256 a, uint256 s) internal pure returns (uint256) {\n return (a << Constants.SLOT_BITS) | (s & Constants.SLOT_POINTER_MAX); // slot(s)\n }\n\n // Return the uint p as a flagged position uint:\n // the least significant 21 bits contain the position\n // and the 22nd bit is set as a flag\n // to distinguish the position 0x000000 from an empty field.\n function setFlag(uint256 p) internal pure returns (uint256) {\n return p | Constants.LEAF_FLAG;\n }\n\n // Turn a flagged position into an unflagged position\n // by removing the flag at the 22nd least significant bit.\n //\n // We shouldn't _actually_ need this\n // as all position-manipulating code should ignore non-position bits anyway\n // but it's cheap to call so might as well do it.\n function unsetFlag(uint256 p) internal pure returns (uint256) {\n return p & (~Constants.LEAF_FLAG);\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/Rewards.sol": { + "content": "pragma solidity 0.8.17;\n\n/// @title Rewards\n/// @notice Rewards are allocated proportionally to operators\n/// present in the pool at payout based on their weight in the pool.\n///\n/// To facilitate this, we use a global accumulator value\n/// to track the total rewards one unit of weight would've earned\n/// since the creation of the pool.\n///\n/// Whenever a reward is paid, the accumulator is increased\n/// by the size of the reward divided by the total weight\n/// of all eligible operators in the pool.\n///\n/// Each operator has an individual accumulator value,\n/// set to equal the global accumulator when the operator joins the pool.\n/// This accumulator reflects the amount of rewards\n/// that have already been accounted for with that operator.\n///\n/// Whenever an operator's weight in the pool changes,\n/// we can update the amount of rewards the operator has earned\n/// by subtracting the operator's accumulator from the global accumulator.\n/// This gives us the amount of rewards one unit of weight has earned\n/// since the last time the operator's rewards have been updated.\n/// Then we multiply that by the operator's previous (pre-change) weight\n/// to determine how much rewards in total the operator has earned,\n/// and add this to the operator's earned rewards.\n/// Finally, we set the operator's accumulator to the global accumulator value.\ncontract Rewards {\n struct OperatorRewards {\n // The state of the global accumulator\n // when the operator's rewards were last updated\n uint96 accumulated;\n // The amount of rewards collected by the operator after the latest update.\n // The amount the operator could withdraw may equal `available`\n // or it may be greater, if more rewards have been paid in since then.\n // To evaulate the most recent amount including rewards potentially paid\n // since the last update, use `availableRewards` function.\n uint96 available;\n // If nonzero, the operator is ineligible for rewards\n // and may only re-enable rewards after the specified timestamp.\n // XXX: unsigned 32-bit integer unix seconds, will break around 2106\n uint32 ineligibleUntil;\n // Locally cached weight of the operator,\n // used to reduce the cost of setting operators ineligible.\n uint32 weight;\n }\n\n // The global accumulator of how much rewards\n // a hypothetical operator of weight 1 would have earned\n // since the creation of the pool.\n uint96 internal globalRewardAccumulator;\n // If the amount of reward tokens paid in\n // does not divide cleanly by pool weight,\n // the difference is recorded as rounding dust\n // and added to the next reward.\n uint96 internal rewardRoundingDust;\n\n // The amount of rewards that would've been earned by ineligible operators\n // had they not been ineligible.\n uint96 public ineligibleEarnedRewards;\n\n // Ineligibility times are calculated from this offset,\n // set at contract creation.\n uint256 internal immutable ineligibleOffsetStart;\n\n mapping(uint32 => OperatorRewards) internal operatorRewards;\n\n constructor() {\n // solhint-disable-next-line not-rely-on-time\n ineligibleOffsetStart = block.timestamp;\n }\n\n /// @notice Return whether the operator is eligible for rewards or not.\n function isEligibleForRewards(uint32 operator) internal view returns (bool) {\n return operatorRewards[operator].ineligibleUntil == 0;\n }\n\n /// @notice Return the time the operator's reward eligibility can be restored.\n function rewardsEligibilityRestorableAt(uint32 operator)\n internal\n view\n returns (uint256)\n {\n uint32 until = operatorRewards[operator].ineligibleUntil;\n require(until != 0, \"Operator already eligible\");\n return (uint256(until) + ineligibleOffsetStart);\n }\n\n /// @notice Return whether the operator is able to restore their eligibility\n /// for rewards right away.\n function canRestoreRewardEligibility(uint32 operator)\n internal\n view\n returns (bool)\n {\n // solhint-disable-next-line not-rely-on-time\n return rewardsEligibilityRestorableAt(operator) <= block.timestamp;\n }\n\n /// @notice Internal function for updating the global state of rewards.\n function addRewards(uint96 rewardAmount, uint32 currentPoolWeight) internal {\n require(currentPoolWeight > 0, \"No recipients in pool\");\n\n uint96 totalAmount = rewardAmount + rewardRoundingDust;\n uint96 perWeightReward = totalAmount / currentPoolWeight;\n uint96 newRoundingDust = totalAmount % currentPoolWeight;\n\n globalRewardAccumulator += perWeightReward;\n rewardRoundingDust = newRoundingDust;\n }\n\n /// @notice Internal function for updating the operator's reward state.\n function updateOperatorRewards(uint32 operator, uint32 newWeight) internal {\n uint96 acc = globalRewardAccumulator;\n OperatorRewards memory o = operatorRewards[operator];\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\n if (o.ineligibleUntil == 0) {\n // If operator is not ineligible, update their earned rewards\n o.available += accruedRewards;\n } else {\n // If ineligible, put the rewards into the ineligible pot\n ineligibleEarnedRewards += accruedRewards;\n }\n // In any case, update their accumulator and weight\n o.accumulated = acc;\n o.weight = newWeight;\n operatorRewards[operator] = o;\n }\n\n /// @notice Set the amount of withdrawable tokens to zero\n /// and return the previous withdrawable amount.\n /// @dev Does not update the withdrawable amount,\n /// but should usually be accompanied by an update.\n function withdrawOperatorRewards(uint32 operator)\n internal\n returns (uint96 withdrawable)\n {\n OperatorRewards storage o = operatorRewards[operator];\n withdrawable = o.available;\n o.available = 0;\n }\n\n /// @notice Set the amount of ineligible-earned tokens to zero\n /// and return the previous amount.\n function withdrawIneligibleRewards() internal returns (uint96 withdrawable) {\n withdrawable = ineligibleEarnedRewards;\n ineligibleEarnedRewards = 0;\n }\n\n /// @notice Set the given operators as ineligible for rewards.\n /// The operators can restore their eligibility at the given time.\n function setIneligible(uint32[] memory operators, uint256 until) internal {\n OperatorRewards memory o = OperatorRewards(0, 0, 0, 0);\n uint96 globalAcc = globalRewardAccumulator;\n uint96 accrued = 0;\n // Record ineligibility as seconds after contract creation\n uint32 _until = uint32(until - ineligibleOffsetStart);\n\n for (uint256 i = 0; i < operators.length; i++) {\n uint32 operator = operators[i];\n OperatorRewards storage r = operatorRewards[operator];\n o.available = r.available;\n o.accumulated = r.accumulated;\n o.ineligibleUntil = r.ineligibleUntil;\n o.weight = r.weight;\n\n if (o.ineligibleUntil != 0) {\n // If operator is already ineligible,\n // don't earn rewards or shorten its ineligibility\n if (o.ineligibleUntil < _until) {\n o.ineligibleUntil = _until;\n }\n } else {\n // The operator becomes ineligible -> earn rewards\n o.ineligibleUntil = _until;\n accrued = (globalAcc - o.accumulated) * uint96(o.weight);\n o.available += accrued;\n }\n o.accumulated = globalAcc;\n\n r.available = o.available;\n r.accumulated = o.accumulated;\n r.ineligibleUntil = o.ineligibleUntil;\n r.weight = o.weight;\n }\n }\n\n /// @notice Restore the given operator's eligibility for rewards.\n function restoreEligibility(uint32 operator) internal {\n // solhint-disable-next-line not-rely-on-time\n require(canRestoreRewardEligibility(operator), \"Operator still ineligible\");\n uint96 acc = globalRewardAccumulator;\n OperatorRewards memory o = operatorRewards[operator];\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\n ineligibleEarnedRewards += accruedRewards;\n o.accumulated = acc;\n o.ineligibleUntil = 0;\n operatorRewards[operator] = o;\n }\n\n /// @notice Returns the amount of rewards currently available for withdrawal\n /// for the given operator.\n function availableRewards(uint32 operator) internal view returns (uint96) {\n uint96 acc = globalRewardAccumulator;\n OperatorRewards memory o = operatorRewards[operator];\n if (o.ineligibleUntil == 0) {\n // If operator is not ineligible, calculate newly accrued rewards and add\n // them to the available ones, calculated during the last update.\n uint96 accruedRewards = (acc - o.accumulated) * uint96(o.weight);\n return o.available + accruedRewards;\n } else {\n // If ineligible, return only the rewards calculated during the last\n // update.\n return o.available;\n }\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/RNG.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"./Leaf.sol\";\nimport \"./Constants.sol\";\n\nlibrary RNG {\n /// @notice Get an index in the range `[0 .. range-1]`\n /// and the new state of the RNG,\n /// using the provided `state` of the RNG.\n ///\n /// @param range The upper bound of the index, exclusive.\n ///\n /// @param state The previous state of the RNG.\n /// The initial state needs to be obtained\n /// from a trusted randomness oracle (the random beacon),\n /// or from a chain of earlier calls to `RNG.getIndex()`\n /// on an originally trusted seed.\n ///\n /// @dev Calculates the number of bits required for the desired range,\n /// takes the least significant bits of `state`\n /// and checks if the obtained index is within the desired range.\n /// The original state is hashed with `keccak256` to get a new state.\n /// If the index is outside the range,\n /// the function retries until it gets a suitable index.\n ///\n /// @return index A random integer between `0` and `range - 1`, inclusive.\n ///\n /// @return newState The new state of the RNG.\n /// When `getIndex()` is called one or more times,\n /// care must be taken to always use the output `state`\n /// of the most recent call as the input `state` of a subsequent call.\n /// At the end of a transaction calling `RNG.getIndex()`,\n /// the previous stored state must be overwritten with the latest output.\n function getIndex(\n uint256 range,\n bytes32 state,\n uint256 bits\n ) internal view returns (uint256, bytes32) {\n bool found = false;\n uint256 index = 0;\n bytes32 newState = state;\n while (!found) {\n index = truncate(bits, uint256(newState));\n newState = keccak256(abi.encodePacked(newState, address(this)));\n if (index < range) {\n found = true;\n }\n }\n return (index, newState);\n }\n\n /// @notice Calculate how many bits are required\n /// for an index in the range `[0 .. range-1]`.\n ///\n /// @param range The upper bound of the desired range, exclusive.\n ///\n /// @return uint The smallest number of bits\n /// that can contain the number `range-1`.\n function bitsRequired(uint256 range) internal pure returns (uint256) {\n unchecked {\n if (range == 1) {\n return 0;\n }\n\n uint256 bits = Constants.WEIGHT_WIDTH - 1;\n\n // Left shift by `bits`,\n // so we have a 1 in the (bits + 1)th least significant bit\n // and 0 in other bits.\n // If this number is equal or greater than `range`,\n // the range [0, range-1] fits in `bits` bits.\n //\n // Because we loop from high bits to low bits,\n // we find the highest number of bits that doesn't fit the range,\n // and return that number + 1.\n while (1 << bits >= range) {\n bits--;\n }\n\n return bits + 1;\n }\n }\n\n /// @notice Truncate `input` to the `bits` least significant bits.\n function truncate(uint256 bits, uint256 input)\n internal\n pure\n returns (uint256)\n {\n unchecked {\n return input & ((1 << bits) - 1);\n }\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/SortitionPool.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol\";\nimport \"@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol\";\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./RNG.sol\";\nimport \"./SortitionTree.sol\";\nimport \"./Rewards.sol\";\nimport \"./Chaosnet.sol\";\n\n/// @title Sortition Pool\n/// @notice A logarithmic data structure used to store the pool of eligible\n/// operators weighted by their stakes. It allows to select a group of operators\n/// based on the provided pseudo-random seed.\ncontract SortitionPool is\n SortitionTree,\n Rewards,\n Ownable,\n Chaosnet,\n IReceiveApproval\n{\n using Branch for uint256;\n using Leaf for uint256;\n using Position for uint256;\n\n IERC20WithPermit public immutable rewardToken;\n\n uint256 public immutable poolWeightDivisor;\n\n bool public isLocked;\n\n event IneligibleForRewards(uint32[] ids, uint256 until);\n\n event RewardEligibilityRestored(address indexed operator, uint32 indexed id);\n\n /// @notice Reverts if called while pool is locked.\n modifier onlyUnlocked() {\n require(!isLocked, \"Sortition pool locked\");\n _;\n }\n\n /// @notice Reverts if called while pool is unlocked.\n modifier onlyLocked() {\n require(isLocked, \"Sortition pool unlocked\");\n _;\n }\n\n constructor(IERC20WithPermit _rewardToken, uint256 _poolWeightDivisor) {\n rewardToken = _rewardToken;\n poolWeightDivisor = _poolWeightDivisor;\n }\n\n function receiveApproval(\n address sender,\n uint256 amount,\n address token,\n bytes calldata\n ) external override {\n require(token == address(rewardToken), \"Unsupported token\");\n rewardToken.transferFrom(sender, address(this), amount);\n Rewards.addRewards(uint96(amount), uint32(root.sumWeight()));\n }\n\n /// @notice Withdraws all available rewards for the given operator to the\n /// given beneficiary.\n /// @dev Can be called only be the owner. Does not validate if the provided\n /// beneficiary is associated with the provided operator - this needs to\n /// be done by the owner calling this function.\n /// @return The amount of rewards withdrawn in this call.\n function withdrawRewards(address operator, address beneficiary)\n public\n onlyOwner\n returns (uint96)\n {\n uint32 id = getOperatorID(operator);\n Rewards.updateOperatorRewards(id, uint32(getPoolWeight(operator)));\n uint96 earned = Rewards.withdrawOperatorRewards(id);\n rewardToken.transfer(beneficiary, uint256(earned));\n return earned;\n }\n\n /// @notice Withdraws rewards not allocated to operators marked as ineligible\n /// to the given recipient address.\n /// @dev Can be called only by the owner.\n function withdrawIneligible(address recipient) public onlyOwner {\n uint96 earned = Rewards.withdrawIneligibleRewards();\n rewardToken.transfer(recipient, uint256(earned));\n }\n\n /// @notice Locks the sortition pool. In locked state, members cannot be\n /// inserted and removed from the pool. Members statuses cannot\n /// be updated as well.\n /// @dev Can be called only by the contract owner.\n function lock() public onlyOwner {\n isLocked = true;\n }\n\n /// @notice Unlocks the sortition pool. Removes all restrictions set by\n /// the `lock` method.\n /// @dev Can be called only by the contract owner.\n function unlock() public onlyOwner {\n isLocked = false;\n }\n\n /// @notice Inserts an operator to the pool. Reverts if the operator is\n /// already present. Reverts if the operator is not eligible because of their\n /// authorized stake. Reverts if the chaosnet is active and the operator is\n /// not a beta operator.\n /// @dev Can be called only by the contract owner.\n /// @param operator Address of the inserted operator.\n /// @param authorizedStake Inserted operator's authorized stake for the application.\n function insertOperator(address operator, uint256 authorizedStake)\n public\n onlyOwner\n onlyUnlocked\n {\n uint256 weight = getWeight(authorizedStake);\n require(weight > 0, \"Operator not eligible\");\n\n if (isChaosnetActive) {\n require(isBetaOperator[operator], \"Not beta operator for chaosnet\");\n }\n\n _insertOperator(operator, weight);\n uint32 id = getOperatorID(operator);\n Rewards.updateOperatorRewards(id, uint32(weight));\n }\n\n /// @notice Update the operator's weight if present and eligible,\n /// or remove from the pool if present and ineligible.\n /// @dev Can be called only by the contract owner.\n /// @param operator Address of the updated operator.\n /// @param authorizedStake Operator's authorized stake for the application.\n function updateOperatorStatus(address operator, uint256 authorizedStake)\n public\n onlyOwner\n onlyUnlocked\n {\n uint256 weight = getWeight(authorizedStake);\n\n uint32 id = getOperatorID(operator);\n Rewards.updateOperatorRewards(id, uint32(weight));\n\n if (weight == 0) {\n _removeOperator(operator);\n } else {\n updateOperator(operator, weight);\n }\n }\n\n /// @notice Set the given operators as ineligible for rewards.\n /// The operators can restore their eligibility at the given time.\n function setRewardIneligibility(uint32[] calldata operators, uint256 until)\n public\n onlyOwner\n {\n Rewards.setIneligible(operators, until);\n emit IneligibleForRewards(operators, until);\n }\n\n /// @notice Restores reward eligibility for the operator.\n function restoreRewardEligibility(address operator) public {\n uint32 id = getOperatorID(operator);\n Rewards.restoreEligibility(id);\n emit RewardEligibilityRestored(operator, id);\n }\n\n /// @notice Returns whether the operator is eligible for rewards or not.\n function isEligibleForRewards(address operator) public view returns (bool) {\n uint32 id = getOperatorID(operator);\n return Rewards.isEligibleForRewards(id);\n }\n\n /// @notice Returns the time the operator's reward eligibility can be restored.\n function rewardsEligibilityRestorableAt(address operator)\n public\n view\n returns (uint256)\n {\n uint32 id = getOperatorID(operator);\n return Rewards.rewardsEligibilityRestorableAt(id);\n }\n\n /// @notice Returns whether the operator is able to restore their eligibility\n /// for rewards right away.\n function canRestoreRewardEligibility(address operator)\n public\n view\n returns (bool)\n {\n uint32 id = getOperatorID(operator);\n return Rewards.canRestoreRewardEligibility(id);\n }\n\n /// @notice Returns the amount of rewards withdrawable for the given operator.\n function getAvailableRewards(address operator) public view returns (uint96) {\n uint32 id = getOperatorID(operator);\n return availableRewards(id);\n }\n\n /// @notice Return whether the operator is present in the pool.\n function isOperatorInPool(address operator) public view returns (bool) {\n return getFlaggedLeafPosition(operator) != 0;\n }\n\n /// @notice Return whether the operator's weight in the pool\n /// matches their eligible weight.\n function isOperatorUpToDate(address operator, uint256 authorizedStake)\n public\n view\n returns (bool)\n {\n return getWeight(authorizedStake) == getPoolWeight(operator);\n }\n\n /// @notice Return the weight of the operator in the pool,\n /// which may or may not be out of date.\n function getPoolWeight(address operator) public view returns (uint256) {\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\n if (flaggedPosition == 0) {\n return 0;\n } else {\n uint256 leafPosition = flaggedPosition.unsetFlag();\n uint256 leafWeight = getLeafWeight(leafPosition);\n return leafWeight;\n }\n }\n\n /// @notice Selects a new group of operators of the provided size based on\n /// the provided pseudo-random seed. At least one operator has to be\n /// registered in the pool, otherwise the function fails reverting the\n /// transaction.\n /// @param groupSize Size of the requested group\n /// @param seed Pseudo-random number used to select operators to group\n /// @return selected Members of the selected group\n function selectGroup(uint256 groupSize, bytes32 seed)\n public\n view\n onlyLocked\n returns (uint32[] memory)\n {\n uint256 _root = root;\n\n bytes32 rngState = seed;\n uint256 rngRange = _root.sumWeight();\n require(rngRange > 0, \"Not enough operators in pool\");\n uint256 currentIndex;\n\n uint256 bits = RNG.bitsRequired(rngRange);\n\n uint32[] memory selected = new uint32[](groupSize);\n\n for (uint256 i = 0; i < groupSize; i++) {\n (currentIndex, rngState) = RNG.getIndex(rngRange, rngState, bits);\n\n uint256 leafPosition = pickWeightedLeaf(currentIndex, _root);\n\n uint256 leaf = leaves[leafPosition];\n selected[i] = leaf.id();\n }\n return selected;\n }\n\n function getWeight(uint256 authorization) internal view returns (uint256) {\n return authorization / poolWeightDivisor;\n }\n}\n" + }, + "@keep-network/sortition-pools/contracts/SortitionTree.sol": { + "content": "pragma solidity 0.8.17;\n\nimport \"./Branch.sol\";\nimport \"./Position.sol\";\nimport \"./Leaf.sol\";\nimport \"./Constants.sol\";\n\ncontract SortitionTree {\n using Branch for uint256;\n using Position for uint256;\n using Leaf for uint256;\n\n // implicit tree\n // root 8\n // level2 64\n // level3 512\n // level4 4k\n // level5 32k\n // level6 256k\n // level7 2M\n uint256 internal root;\n\n // A 2-index mapping from layer => (index (0-index) => branch). For example,\n // to access the 6th branch in the 2nd layer (right below the root node; the\n // first branch layer), call branches[2][5]. Mappings are used in place of\n // arrays for efficiency. The root is the first layer, the branches occupy\n // layers 2 through 7, and layer 8 is for the leaves. Following this\n // convention, the first index in `branches` is `2`, and the last index is\n // `7`.\n mapping(uint256 => mapping(uint256 => uint256)) internal branches;\n\n // A 0-index mapping from index => leaf, acting as an array. For example, to\n // access the 42nd leaf, call leaves[41].\n mapping(uint256 => uint256) internal leaves;\n\n // the flagged (see setFlag() and unsetFlag() in Position.sol) positions\n // of all operators present in the pool\n mapping(address => uint256) internal flaggedLeafPosition;\n\n // the leaf after the rightmost occupied leaf of each stack\n uint256 internal rightmostLeaf;\n\n // the empty leaves in each stack\n // between 0 and the rightmost occupied leaf\n uint256[] internal emptyLeaves;\n\n // Each operator has an uint32 ID number\n // which is allocated when they first join the pool\n // and remains unchanged even if they leave and rejoin the pool.\n mapping(address => uint32) internal operatorID;\n\n // The idAddress array records the address corresponding to each ID number.\n // The ID number 0 is initialized with a zero address and is not used.\n address[] internal idAddress;\n\n constructor() {\n root = 0;\n rightmostLeaf = 0;\n idAddress.push();\n }\n\n /// @notice Return the ID number of the given operator address. An ID number\n /// of 0 means the operator has not been allocated an ID number yet.\n /// @param operator Address of the operator.\n /// @return the ID number of the given operator address\n function getOperatorID(address operator) public view returns (uint32) {\n return operatorID[operator];\n }\n\n /// @notice Get the operator address corresponding to the given ID number. A\n /// zero address means the ID number has not been allocated yet.\n /// @param id ID of the operator\n /// @return the address of the operator\n function getIDOperator(uint32 id) public view returns (address) {\n return idAddress.length > id ? idAddress[id] : address(0);\n }\n\n /// @notice Gets the operator addresses corresponding to the given ID\n /// numbers. A zero address means the ID number has not been allocated yet.\n /// This function works just like getIDOperator except that it allows to fetch\n /// operator addresses for multiple IDs in one call.\n /// @param ids the array of the operator ids\n /// @return an array of the associated operator addresses\n function getIDOperators(uint32[] calldata ids)\n public\n view\n returns (address[] memory)\n {\n uint256 idCount = idAddress.length;\n\n address[] memory operators = new address[](ids.length);\n for (uint256 i = 0; i < ids.length; i++) {\n uint32 id = ids[i];\n operators[i] = idCount > id ? idAddress[id] : address(0);\n }\n return operators;\n }\n\n /// @notice Checks if operator is already registered in the pool.\n /// @param operator the address of the operator\n /// @return whether or not the operator is already registered in the pool\n function isOperatorRegistered(address operator) public view returns (bool) {\n return getFlaggedLeafPosition(operator) != 0;\n }\n\n /// @notice Sum the number of operators in each trunk.\n /// @return the number of operators in the pool\n function operatorsInPool() public view returns (uint256) {\n // Get the number of leaves that might be occupied;\n // if `rightmostLeaf` equals `firstLeaf()` the tree must be empty,\n // otherwise the difference between these numbers\n // gives the number of leaves that may be occupied.\n uint256 nPossiblyUsedLeaves = rightmostLeaf;\n // Get the number of empty leaves\n // not accounted for by the `rightmostLeaf`\n uint256 nEmptyLeaves = emptyLeaves.length;\n\n return (nPossiblyUsedLeaves - nEmptyLeaves);\n }\n\n /// @notice Convenience method to return the total weight of the pool\n /// @return the total weight of the pool\n function totalWeight() public view returns (uint256) {\n return root.sumWeight();\n }\n\n /// @notice Give the operator a new ID number.\n /// Does not check if the operator already has an ID number.\n /// @param operator the address of the operator\n /// @return a new ID for that operator\n function allocateOperatorID(address operator) internal returns (uint256) {\n uint256 id = idAddress.length;\n\n require(id <= type(uint32).max, \"Pool capacity exceeded\");\n\n operatorID[operator] = uint32(id);\n idAddress.push(operator);\n return id;\n }\n\n /// @notice Inserts an operator into the sortition pool\n /// @param operator the address of an operator to insert\n /// @param weight how much weight that operator has in the pool\n function _insertOperator(address operator, uint256 weight) internal {\n require(\n !isOperatorRegistered(operator),\n \"Operator is already registered in the pool\"\n );\n\n // Fetch the operator's ID, and if they don't have one, allocate them one.\n uint256 id = getOperatorID(operator);\n if (id == 0) {\n id = allocateOperatorID(operator);\n }\n\n // Determine which leaf to insert them into\n uint256 position = getEmptyLeafPosition();\n // Record the block the operator was inserted in\n uint256 theLeaf = Leaf.make(operator, block.number, id);\n\n // Update the leaf, and propagate the weight changes all the way up to the\n // root.\n root = setLeaf(position, theLeaf, weight, root);\n\n // Without position flags,\n // the position 0x000000 would be treated as empty\n flaggedLeafPosition[operator] = position.setFlag();\n }\n\n /// @notice Remove an operator (and their weight) from the pool.\n /// @param operator the address of the operator to remove\n function _removeOperator(address operator) internal {\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\n require(flaggedPosition != 0, \"Operator is not registered in the pool\");\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\n\n // Update the leaf, and propagate the weight changes all the way up to the\n // root.\n root = removeLeaf(unflaggedPosition, root);\n removeLeafPositionRecord(operator);\n }\n\n /// @notice Update an operator's weight in the pool.\n /// @param operator the address of the operator to update\n /// @param weight the new weight\n function updateOperator(address operator, uint256 weight) internal {\n require(\n isOperatorRegistered(operator),\n \"Operator is not registered in the pool\"\n );\n\n uint256 flaggedPosition = getFlaggedLeafPosition(operator);\n uint256 unflaggedPosition = flaggedPosition.unsetFlag();\n root = updateLeaf(unflaggedPosition, weight, root);\n }\n\n /// @notice Helper method to remove a leaf position record for an operator.\n /// @param operator the address of the operator to remove the record for\n function removeLeafPositionRecord(address operator) internal {\n flaggedLeafPosition[operator] = 0;\n }\n\n /// @notice Removes the data and weight from a particular leaf.\n /// @param position the leaf index to remove\n /// @param _root the root node containing the leaf\n /// @return the updated root node\n function removeLeaf(uint256 position, uint256 _root)\n internal\n returns (uint256)\n {\n uint256 rightmostSubOne = rightmostLeaf - 1;\n bool isRightmost = position == rightmostSubOne;\n\n // Clears out the data in the leaf node, and then propagates the weight\n // changes all the way up to the root.\n uint256 newRoot = setLeaf(position, 0, 0, _root);\n\n // Infer if need to fall back on emptyLeaves yet\n if (isRightmost) {\n rightmostLeaf = rightmostSubOne;\n } else {\n emptyLeaves.push(position);\n }\n return newRoot;\n }\n\n /// @notice Updates the tree to give a particular leaf a new weight.\n /// @param position the index of the leaf to update\n /// @param weight the new weight\n /// @param _root the root node containing the leaf\n /// @return the updated root node\n function updateLeaf(\n uint256 position,\n uint256 weight,\n uint256 _root\n ) internal returns (uint256) {\n if (getLeafWeight(position) != weight) {\n return updateTree(position, weight, _root);\n } else {\n return _root;\n }\n }\n\n /// @notice Places a leaf into a particular position, with a given weight and\n /// propagates that change.\n /// @param position the index to place the leaf in\n /// @param theLeaf the new leaf to place in the position\n /// @param leafWeight the weight of the leaf\n /// @param _root the root containing the new leaf\n /// @return the updated root node\n function setLeaf(\n uint256 position,\n uint256 theLeaf,\n uint256 leafWeight,\n uint256 _root\n ) internal returns (uint256) {\n // set leaf\n leaves[position] = theLeaf;\n\n return (updateTree(position, leafWeight, _root));\n }\n\n /// @notice Propagates a weight change at a position through the tree,\n /// eventually returning the updated root.\n /// @param position the index of leaf to update\n /// @param weight the new weight of the leaf\n /// @param _root the root node containing the leaf\n /// @return the updated root node\n function updateTree(\n uint256 position,\n uint256 weight,\n uint256 _root\n ) internal returns (uint256) {\n uint256 childSlot;\n uint256 treeNode;\n uint256 newNode;\n uint256 nodeWeight = weight;\n\n uint256 parent = position;\n // set levels 7 to 2\n for (uint256 level = Constants.LEVELS; level >= 2; level--) {\n childSlot = parent.slot();\n parent = parent.parent();\n treeNode = branches[level][parent];\n newNode = treeNode.setSlot(childSlot, nodeWeight);\n branches[level][parent] = newNode;\n nodeWeight = newNode.sumWeight();\n }\n\n // set level Root\n childSlot = parent.slot();\n return _root.setSlot(childSlot, nodeWeight);\n }\n\n /// @notice Retrieves the next available empty leaf position. Tries to fill\n /// left to right first, ignoring leaf removals, and then fills\n /// most-recent-removals first.\n /// @return the position of the empty leaf\n function getEmptyLeafPosition() internal returns (uint256) {\n uint256 rLeaf = rightmostLeaf;\n bool spaceOnRight = (rLeaf + 1) < Constants.POOL_CAPACITY;\n if (spaceOnRight) {\n rightmostLeaf = rLeaf + 1;\n return rLeaf;\n } else {\n uint256 emptyLeafCount = emptyLeaves.length;\n require(emptyLeafCount > 0, \"Pool is full\");\n uint256 emptyLeaf = emptyLeaves[emptyLeafCount - 1];\n emptyLeaves.pop();\n return emptyLeaf;\n }\n }\n\n /// @notice Gets the flagged leaf position for an operator.\n /// @param operator the address of the operator\n /// @return the leaf position of that operator\n function getFlaggedLeafPosition(address operator)\n internal\n view\n returns (uint256)\n {\n return flaggedLeafPosition[operator];\n }\n\n /// @notice Gets the weight of a leaf at a particular position.\n /// @param position the index of the leaf\n /// @return the weight of the leaf at that position\n function getLeafWeight(uint256 position) internal view returns (uint256) {\n uint256 slot = position.slot();\n uint256 parent = position.parent();\n\n // A leaf's weight information is stored a 32-bit slot in the branch layer\n // directly above the leaf layer. To access it, we calculate that slot and\n // parent position, and always know the hard-coded layer index.\n uint256 node = branches[Constants.LEVELS][parent];\n return node.getSlot(slot);\n }\n\n /// @notice Picks a leaf given a random index.\n /// @param index a number in `[0, _root.totalWeight())` used to decide\n /// between leaves\n /// @param _root the root of the tree\n function pickWeightedLeaf(uint256 index, uint256 _root)\n internal\n view\n returns (uint256 leafPosition)\n {\n uint256 currentIndex = index;\n uint256 currentNode = _root;\n uint256 currentPosition = 0;\n uint256 currentSlot;\n\n require(index < currentNode.sumWeight(), \"Index exceeds weight\");\n\n // get root slot\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\n\n // get slots from levels 2 to 7\n for (uint256 level = 2; level <= Constants.LEVELS; level++) {\n currentPosition = currentPosition.child(currentSlot);\n currentNode = branches[level][currentPosition];\n (currentSlot, currentIndex) = currentNode.pickWeightedSlot(currentIndex);\n }\n\n // get leaf position\n leafPosition = currentPosition.child(currentSlot);\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.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 * By default, the owner account will be the one that deploys the contract. This\n * can 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 OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\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 require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing 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 require(newOwner != address(0), \"Ownable: new owner is the zero address\");\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 /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\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 /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../StringsUpgradeable.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSAUpgradeable {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", StringsUpgradeable.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.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 MathUpgradeable {\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-upgradeable/utils/math/SafeCastUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX 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 *\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\n * all math on `uint256` and `int256` and then downcasting.\n */\nlibrary SafeCastUpgradeable {\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 * _Available since v4.7._\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n require(value <= type(uint248).max, \"SafeCast: value doesn't fit in 248 bits\");\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 * _Available since v4.7._\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n require(value <= type(uint240).max, \"SafeCast: value doesn't fit in 240 bits\");\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 * _Available since v4.7._\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n require(value <= type(uint232).max, \"SafeCast: value doesn't fit in 232 bits\");\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 * _Available since v4.2._\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n require(value <= type(uint224).max, \"SafeCast: value doesn't fit in 224 bits\");\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 * _Available since v4.7._\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n require(value <= type(uint216).max, \"SafeCast: value doesn't fit in 216 bits\");\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 * _Available since v4.7._\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n require(value <= type(uint208).max, \"SafeCast: value doesn't fit in 208 bits\");\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 * _Available since v4.7._\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n require(value <= type(uint200).max, \"SafeCast: value doesn't fit in 200 bits\");\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 * _Available since v4.7._\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n require(value <= type(uint192).max, \"SafeCast: value doesn't fit in 192 bits\");\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 * _Available since v4.7._\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n require(value <= type(uint184).max, \"SafeCast: value doesn't fit in 184 bits\");\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 * _Available since v4.7._\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n require(value <= type(uint176).max, \"SafeCast: value doesn't fit in 176 bits\");\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 * _Available since v4.7._\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n require(value <= type(uint168).max, \"SafeCast: value doesn't fit in 168 bits\");\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 * _Available since v4.7._\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n require(value <= type(uint160).max, \"SafeCast: value doesn't fit in 160 bits\");\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 * _Available since v4.7._\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n require(value <= type(uint152).max, \"SafeCast: value doesn't fit in 152 bits\");\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 * _Available since v4.7._\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n require(value <= type(uint144).max, \"SafeCast: value doesn't fit in 144 bits\");\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 * _Available since v4.7._\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n require(value <= type(uint136).max, \"SafeCast: value doesn't fit in 136 bits\");\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 * _Available since v2.5._\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value <= type(uint128).max, \"SafeCast: value doesn't fit in 128 bits\");\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 * _Available since v4.7._\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n require(value <= type(uint120).max, \"SafeCast: value doesn't fit in 120 bits\");\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 * _Available since v4.7._\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n require(value <= type(uint112).max, \"SafeCast: value doesn't fit in 112 bits\");\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 * _Available since v4.7._\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n require(value <= type(uint104).max, \"SafeCast: value doesn't fit in 104 bits\");\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 * _Available since v4.2._\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n require(value <= type(uint96).max, \"SafeCast: value doesn't fit in 96 bits\");\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 * _Available since v4.7._\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n require(value <= type(uint88).max, \"SafeCast: value doesn't fit in 88 bits\");\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 * _Available since v4.7._\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n require(value <= type(uint80).max, \"SafeCast: value doesn't fit in 80 bits\");\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 * _Available since v4.7._\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n require(value <= type(uint72).max, \"SafeCast: value doesn't fit in 72 bits\");\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 * _Available since v2.5._\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n require(value <= type(uint64).max, \"SafeCast: value doesn't fit in 64 bits\");\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 * _Available since v4.7._\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n require(value <= type(uint56).max, \"SafeCast: value doesn't fit in 56 bits\");\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 * _Available since v4.7._\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n require(value <= type(uint48).max, \"SafeCast: value doesn't fit in 48 bits\");\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 * _Available since v4.7._\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n require(value <= type(uint40).max, \"SafeCast: value doesn't fit in 40 bits\");\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 * _Available since v2.5._\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n require(value <= type(uint32).max, \"SafeCast: value doesn't fit in 32 bits\");\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 * _Available since v4.7._\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n require(value <= type(uint24).max, \"SafeCast: value doesn't fit in 24 bits\");\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 * _Available since v2.5._\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n require(value <= type(uint16).max, \"SafeCast: value doesn't fit in 16 bits\");\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 * _Available since v2.5._\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value <= type(uint8).max, \"SafeCast: value doesn't fit in 8 bits\");\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 * _Available since v3.0._\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n require(value >= 0, \"SafeCast: value must be positive\");\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 * _Available since v4.7._\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 248 bits\");\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 * _Available since v4.7._\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 240 bits\");\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 * _Available since v4.7._\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 232 bits\");\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 * _Available since v4.7._\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 224 bits\");\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 * _Available since v4.7._\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 216 bits\");\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 * _Available since v4.7._\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 208 bits\");\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 * _Available since v4.7._\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 200 bits\");\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 * _Available since v4.7._\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 192 bits\");\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 * _Available since v4.7._\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 184 bits\");\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 * _Available since v4.7._\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 176 bits\");\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 * _Available since v4.7._\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 168 bits\");\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 * _Available since v4.7._\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 160 bits\");\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 * _Available since v4.7._\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 152 bits\");\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 * _Available since v4.7._\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 144 bits\");\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 * _Available since v4.7._\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 136 bits\");\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 * _Available since v3.1._\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 128 bits\");\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 * _Available since v4.7._\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 120 bits\");\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 * _Available since v4.7._\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 112 bits\");\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 * _Available since v4.7._\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 104 bits\");\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 * _Available since v4.7._\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 96 bits\");\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 * _Available since v4.7._\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 88 bits\");\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 * _Available since v4.7._\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 80 bits\");\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 * _Available since v4.7._\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 72 bits\");\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 * _Available since v3.1._\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 64 bits\");\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 * _Available since v4.7._\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 56 bits\");\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 * _Available since v4.7._\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 48 bits\");\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 * _Available since v4.7._\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 40 bits\");\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 * _Available since v3.1._\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 32 bits\");\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 * _Available since v4.7._\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 24 bits\");\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 * _Available since v3.1._\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 16 bits\");\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 * _Available since v3.1._\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n require(downcasted == value, \"SafeCast: value doesn't fit in 8 bits\");\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 * _Available since v3.0._\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 require(value <= uint256(type(int256).max), \"SafeCast: value doesn't fit in an int256\");\n return int256(value);\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/MathUpgradeable.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary StringsUpgradeable {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = MathUpgradeable.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, MathUpgradeable.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../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 * By default, the owner account will be the one that deploys the contract. This\n * can 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 event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\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 require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing 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 require(newOwner != address(0), \"Ownable: new owner is the zero address\");\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/security/ReentrancyGuard.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\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/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\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/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" + }, + "@thesis/solidity-contracts/contracts/token/IApproveAndCall.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.4;\n\n/// @notice An interface that should be implemented by tokens supporting\n/// `approveAndCall`/`receiveApproval` pattern.\ninterface IApproveAndCall {\n /// @notice Executes `receiveApproval` function on spender as specified in\n /// `IReceiveApproval` interface. Approves spender to withdraw from\n /// the caller multiple times, up to the `amount`. If this\n /// function is called again, it overwrites the current allowance\n /// with `amount`. Reverts if the approval reverted or if\n /// `receiveApproval` call on the spender reverted.\n function approveAndCall(\n address spender,\n uint256 amount,\n bytes memory extraData\n ) external returns (bool);\n}\n" + }, + "@thesis/solidity-contracts/contracts/token/IERC20WithPermit.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.4;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\nimport \"./IApproveAndCall.sol\";\n\n/// @title IERC20WithPermit\n/// @notice Burnable ERC20 token with EIP2612 permit functionality. User can\n/// authorize a transfer of their token with a signature conforming\n/// EIP712 standard instead of an on-chain transaction from their\n/// address. Anyone can submit this signature on the user's behalf by\n/// calling the permit function, as specified in EIP2612 standard,\n/// paying gas fees, and possibly performing other actions in the same\n/// transaction.\ninterface IERC20WithPermit is IERC20, IERC20Metadata, IApproveAndCall {\n /// @notice EIP2612 approval made with secp256k1 signature.\n /// Users can authorize a transfer of their tokens with a signature\n /// conforming EIP712 standard, rather than an on-chain transaction\n /// from their address. Anyone can submit this signature on the\n /// user's behalf by calling the permit function, paying gas fees,\n /// and possibly performing other actions in the same transaction.\n /// @dev The deadline argument can be set to `type(uint256).max to create\n /// permits that effectively never expire.\n function permit(\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /// @notice Destroys `amount` tokens from the caller.\n function burn(uint256 amount) external;\n\n /// @notice Destroys `amount` of tokens from `account`, deducting the amount\n /// from caller's allowance.\n function burnFrom(address account, uint256 amount) external;\n\n /// @notice Returns hash of EIP712 Domain struct with the token name as\n /// a signing domain and token contract as a verifying contract.\n /// Used to construct EIP2612 signature provided to `permit`\n /// function.\n /* solhint-disable-next-line func-name-mixedcase */\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n /// @notice Returns the current nonce for EIP2612 permission for the\n /// provided token owner for a replay protection. Used to construct\n /// EIP2612 signature provided to `permit` function.\n function nonce(address owner) external view returns (uint256);\n\n /// @notice Returns EIP2612 Permit message hash. Used to construct EIP2612\n /// signature provided to `permit` function.\n /* solhint-disable-next-line func-name-mixedcase */\n function PERMIT_TYPEHASH() external pure returns (bytes32);\n}\n" + }, + "@thesis/solidity-contracts/contracts/token/IReceiveApproval.sol": { + "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.4;\n\n/// @notice An interface that should be implemented by contracts supporting\n/// `approveAndCall`/`receiveApproval` pattern.\ninterface IReceiveApproval {\n /// @notice Receives approval to spend tokens. Called as a result of\n /// `approveAndCall` call on the token.\n function receiveApproval(\n address from,\n uint256 amount,\n address token,\n bytes calldata extraData\n ) external;\n}\n" + }, + "contracts/bank/Bank.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport \"./IReceiveBalanceApproval.sol\";\nimport \"../vault/IVault.sol\";\n\n/// @title Bitcoin Bank\n/// @notice Bank is a central component tracking Bitcoin balances. Balances can\n/// be transferred between balance owners, and balance owners can\n/// approve their balances to be spent by others. Balances in the Bank\n/// are updated for depositors who deposited their Bitcoin into the\n/// Bridge and only the Bridge can increase balances.\n/// @dev Bank is a governable contract and the Governance can upgrade the Bridge\n/// address.\ncontract Bank is Ownable {\n address public bridge;\n\n /// @notice The balance of the given account in the Bank. Zero by default.\n mapping(address => uint256) public balanceOf;\n\n /// @notice The remaining amount of balance a spender will be\n /// allowed to transfer on behalf of an owner using\n /// `transferBalanceFrom`. Zero by default.\n mapping(address => mapping(address => uint256)) public allowance;\n\n /// @notice Returns the current nonce for an EIP2612 permission for the\n /// provided balance owner to protect against replay attacks. Used\n /// to construct an EIP2612 signature provided to the `permit`\n /// function.\n mapping(address => uint256) public nonces;\n\n uint256 public immutable cachedChainId;\n bytes32 public immutable cachedDomainSeparator;\n\n /// @notice Returns an EIP2612 Permit message hash. Used to construct\n /// an EIP2612 signature provided to the `permit` function.\n bytes32 public constant PERMIT_TYPEHASH =\n keccak256(\n \"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\"\n );\n\n event BalanceTransferred(\n address indexed from,\n address indexed to,\n uint256 amount\n );\n\n event BalanceApproved(\n address indexed owner,\n address indexed spender,\n uint256 amount\n );\n\n event BalanceIncreased(address indexed owner, uint256 amount);\n\n event BalanceDecreased(address indexed owner, uint256 amount);\n\n event BridgeUpdated(address newBridge);\n\n modifier onlyBridge() {\n require(msg.sender == address(bridge), \"Caller is not the bridge\");\n _;\n }\n\n constructor() {\n cachedChainId = block.chainid;\n cachedDomainSeparator = buildDomainSeparator();\n }\n\n /// @notice Allows the Governance to upgrade the Bridge address.\n /// @dev The function does not implement any governance delay and does not\n /// check the status of the Bridge. The Governance implementation needs\n /// to ensure all requirements for the upgrade are satisfied before\n /// executing this function.\n /// Requirements:\n /// - The new Bridge address must not be zero.\n /// @param _bridge The new Bridge address.\n function updateBridge(address _bridge) external onlyOwner {\n require(_bridge != address(0), \"Bridge address must not be 0x0\");\n bridge = _bridge;\n emit BridgeUpdated(_bridge);\n }\n\n /// @notice Moves the given `amount` of balance from the caller to\n /// `recipient`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - the caller must have a balance of at least `amount`.\n /// @param recipient The recipient of the balance.\n /// @param amount The amount of the balance transferred.\n function transferBalance(address recipient, uint256 amount) external {\n _transferBalance(msg.sender, recipient, amount);\n }\n\n /// @notice Sets `amount` as the allowance of `spender` over the caller's\n /// balance. Does not allow updating an existing allowance to\n /// a value that is non-zero to avoid someone using both the old and\n /// the new allowance by unfortunate transaction ordering. To update\n /// an allowance to a non-zero value please set it to zero first or\n /// use `increaseBalanceAllowance` or `decreaseBalanceAllowance` for\n /// an atomic update.\n /// @dev If the `amount` is set to `type(uint256).max`,\n /// `transferBalanceFrom` will not reduce an allowance.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n function approveBalance(address spender, uint256 amount) external {\n require(\n amount == 0 || allowance[msg.sender][spender] == 0,\n \"Non-atomic allowance change not allowed\"\n );\n _approveBalance(msg.sender, spender, amount);\n }\n\n /// @notice Sets the `amount` as an allowance of a smart contract `spender`\n /// over the caller's balance and calls the `spender` via\n /// `receiveBalanceApproval`.\n /// @dev If the `amount` is set to `type(uint256).max`, the potential\n /// `transferBalanceFrom` executed in `receiveBalanceApproval` of\n /// `spender` will not reduce an allowance. Beware that changing an\n /// allowance with this function brings the risk that `spender` may use\n /// both the old and the new allowance by unfortunate transaction\n /// ordering. Please use `increaseBalanceAllowance` and\n /// `decreaseBalanceAllowance` to eliminate the risk.\n /// @param spender The smart contract that will be allowed to spend the\n /// balance.\n /// @param amount The amount the spender contract is allowed to spend.\n /// @param extraData Extra data passed to the `spender` contract via\n /// `receiveBalanceApproval` call.\n function approveBalanceAndCall(\n address spender,\n uint256 amount,\n bytes calldata extraData\n ) external {\n _approveBalance(msg.sender, spender, amount);\n IReceiveBalanceApproval(spender).receiveBalanceApproval(\n msg.sender,\n amount,\n extraData\n );\n }\n\n /// @notice Atomically increases the caller's balance allowance granted to\n /// `spender` by the given `addedValue`.\n /// @param spender The spender address for which the allowance is increased.\n /// @param addedValue The amount by which the allowance is increased.\n function increaseBalanceAllowance(address spender, uint256 addedValue)\n external\n {\n _approveBalance(\n msg.sender,\n spender,\n allowance[msg.sender][spender] + addedValue\n );\n }\n\n /// @notice Atomically decreases the caller's balance allowance granted to\n /// `spender` by the given `subtractedValue`.\n /// @dev Requirements:\n /// - `spender` must not be the zero address,\n /// - the current allowance for `spender` must not be lower than\n /// the `subtractedValue`.\n /// @param spender The spender address for which the allowance is decreased.\n /// @param subtractedValue The amount by which the allowance is decreased.\n function decreaseBalanceAllowance(address spender, uint256 subtractedValue)\n external\n {\n uint256 currentAllowance = allowance[msg.sender][spender];\n require(\n currentAllowance >= subtractedValue,\n \"Can not decrease balance allowance below zero\"\n );\n unchecked {\n _approveBalance(\n msg.sender,\n spender,\n currentAllowance - subtractedValue\n );\n }\n }\n\n /// @notice Moves `amount` of balance from `spender` to `recipient` using the\n /// allowance mechanism. `amount` is then deducted from the caller's\n /// allowance unless the allowance was made for `type(uint256).max`.\n /// @dev Requirements:\n /// - `recipient` cannot be the zero address,\n /// - `spender` must have a balance of at least `amount`,\n /// - the caller must have an allowance for `spender`'s balance of at\n /// least `amount`.\n /// @param spender The address from which the balance is transferred.\n /// @param recipient The address to which the balance is transferred.\n /// @param amount The amount of balance that is transferred.\n function transferBalanceFrom(\n address spender,\n address recipient,\n uint256 amount\n ) external {\n uint256 currentAllowance = allowance[spender][msg.sender];\n if (currentAllowance != type(uint256).max) {\n require(\n currentAllowance >= amount,\n \"Transfer amount exceeds allowance\"\n );\n unchecked {\n _approveBalance(spender, msg.sender, currentAllowance - amount);\n }\n }\n _transferBalance(spender, recipient, amount);\n }\n\n /// @notice An EIP2612 approval made with secp256k1 signature. Users can\n /// authorize a transfer of their balance with a signature\n /// conforming to the EIP712 standard, rather than an on-chain\n /// transaction from their address. Anyone can submit this signature\n /// on the user's behalf by calling the `permit` function, paying\n /// gas fees, and possibly performing other actions in the same\n /// transaction.\n /// @dev The deadline argument can be set to `type(uint256).max to create\n /// permits that effectively never expire. If the `amount` is set\n /// to `type(uint256).max` then `transferBalanceFrom` will not\n /// reduce an allowance. Beware that changing an allowance with this\n /// function brings the risk that someone may use both the old and the\n /// new allowance by unfortunate transaction ordering. Please use\n /// `increaseBalanceAllowance` and `decreaseBalanceAllowance` to\n /// eliminate the risk.\n /// @param owner The balance owner who signed the permission.\n /// @param spender The address that will be allowed to spend the balance.\n /// @param amount The amount the spender is allowed to spend.\n /// @param deadline The UNIX time until which the permit is valid.\n /// @param v V part of the permit signature.\n /// @param r R part of the permit signature.\n /// @param s S part of the permit signature.\n function permit(\n address owner,\n address spender,\n uint256 amount,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external {\n /* solhint-disable-next-line not-rely-on-time */\n require(deadline >= block.timestamp, \"Permission expired\");\n\n // Validate `s` and `v` values for a malleability concern described in EIP2.\n // Only signatures with `s` value in the lower half of the secp256k1\n // curve's order and `v` value of 27 or 28 are considered valid.\n require(\n uint256(s) <=\n 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,\n \"Invalid signature 's' value\"\n );\n require(v == 27 || v == 28, \"Invalid signature 'v' value\");\n\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR(),\n keccak256(\n abi.encode(\n PERMIT_TYPEHASH,\n owner,\n spender,\n amount,\n nonces[owner]++,\n deadline\n )\n )\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(\n recoveredAddress != address(0) && recoveredAddress == owner,\n \"Invalid signature\"\n );\n _approveBalance(owner, spender, amount);\n }\n\n /// @notice Increases balances of the provided `recipients` by the provided\n /// `amounts`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - length of `recipients` and `amounts` must be the same,\n /// - none of `recipients` addresses must point to the Bank.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalances(\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n for (uint256 i = 0; i < recipients.length; i++) {\n _increaseBalance(recipients[i], amounts[i]);\n }\n }\n\n /// @notice Increases balance of the provided `recipient` by the provided\n /// `amount`. Can only be called by the Bridge.\n /// @dev Requirements:\n /// - `recipient` address must not point to the Bank.\n /// @param recipient Balance increase recipient.\n /// @param amount Amount by which the balance is increased.\n function increaseBalance(address recipient, uint256 amount)\n external\n onlyBridge\n {\n _increaseBalance(recipient, amount);\n }\n\n /// @notice Increases the given smart contract `vault`'s balance and\n /// notifies the `vault` contract about it.\n /// Can be called only by the Bridge.\n /// @dev Requirements:\n /// - `vault` must implement `IVault` interface,\n /// - length of `recipients` and `amounts` must be the same.\n /// @param vault Address of `IVault` recipient contract.\n /// @param recipients Balance increase recipients.\n /// @param amounts Amounts by which balances are increased.\n function increaseBalanceAndCall(\n address vault,\n address[] calldata recipients,\n uint256[] calldata amounts\n ) external onlyBridge {\n require(\n recipients.length == amounts.length,\n \"Arrays must have the same length\"\n );\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < amounts.length; i++) {\n totalAmount += amounts[i];\n }\n _increaseBalance(vault, totalAmount);\n IVault(vault).receiveBalanceIncrease(recipients, amounts);\n }\n\n /// @notice Decreases caller's balance by the provided `amount`. There is no\n /// way to restore the balance so do not call this function unless\n /// you really know what you are doing!\n /// @dev Requirements:\n /// - The caller must have a balance of at least `amount`.\n /// @param amount The amount by which the balance is decreased.\n function decreaseBalance(uint256 amount) external {\n balanceOf[msg.sender] -= amount;\n emit BalanceDecreased(msg.sender, amount);\n }\n\n /// @notice Returns hash of EIP712 Domain struct with `TBTC Bank` as\n /// a signing domain and Bank contract as a verifying contract.\n /// Used to construct an EIP2612 signature provided to the `permit`\n /// function.\n /* solhint-disable-next-line func-name-mixedcase */\n function DOMAIN_SEPARATOR() public view returns (bytes32) {\n // As explained in EIP-2612, if the DOMAIN_SEPARATOR contains the\n // chainId and is defined at contract deployment instead of\n // reconstructed for every signature, there is a risk of possible replay\n // attacks between chains in the event of a future chain split.\n // To address this issue, we check the cached chain ID against the\n // current one and in case they are different, we build domain separator\n // from scratch.\n if (block.chainid == cachedChainId) {\n return cachedDomainSeparator;\n } else {\n return buildDomainSeparator();\n }\n }\n\n function _increaseBalance(address recipient, uint256 amount) internal {\n require(\n recipient != address(this),\n \"Can not increase balance for Bank\"\n );\n balanceOf[recipient] += amount;\n emit BalanceIncreased(recipient, amount);\n }\n\n function _transferBalance(\n address spender,\n address recipient,\n uint256 amount\n ) private {\n require(\n recipient != address(0),\n \"Can not transfer to the zero address\"\n );\n require(\n recipient != address(this),\n \"Can not transfer to the Bank address\"\n );\n\n uint256 spenderBalance = balanceOf[spender];\n require(spenderBalance >= amount, \"Transfer amount exceeds balance\");\n unchecked {\n balanceOf[spender] = spenderBalance - amount;\n }\n balanceOf[recipient] += amount;\n emit BalanceTransferred(spender, recipient, amount);\n }\n\n function _approveBalance(\n address owner,\n address spender,\n uint256 amount\n ) private {\n require(spender != address(0), \"Can not approve to the zero address\");\n allowance[owner][spender] = amount;\n emit BalanceApproved(owner, spender, amount);\n }\n\n function buildDomainSeparator() private view returns (bytes32) {\n return\n keccak256(\n abi.encode(\n keccak256(\n \"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\"\n ),\n keccak256(bytes(\"TBTC Bank\")),\n keccak256(bytes(\"1\")),\n block.chainid,\n address(this)\n )\n );\n }\n}\n" + }, + "contracts/bank/IReceiveBalanceApproval.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\n/// @title IReceiveBalanceApproval\n/// @notice `IReceiveBalanceApproval` is an interface for a smart contract\n/// consuming Bank balances approved to them in the same transaction by\n/// other contracts or externally owned accounts (EOA).\ninterface IReceiveBalanceApproval {\n /// @notice Called by the Bank in `approveBalanceAndCall` function after\n /// the balance `owner` approved `amount` of their balance in the\n /// Bank for the contract. This way, the depositor can approve\n /// balance and call the contract to use the approved balance in\n /// a single transaction.\n /// @param owner Address of the Bank balance owner who approved their\n /// balance to be used by the contract.\n /// @param amount The amount of the Bank balance approved by the owner\n /// to be used by the contract.\n /// @param extraData The `extraData` passed to `Bank.approveBalanceAndCall`.\n /// @dev The implementation must ensure this function can only be called\n /// by the Bank. The Bank does _not_ guarantee that the `amount`\n /// approved by the `owner` currently exists on their balance. That is,\n /// the `owner` could approve more balance than they currently have.\n /// This works the same as `Bank.approve` function. The contract must\n /// ensure the actual balance is checked before performing any action\n /// based on it.\n function receiveBalanceApproval(\n address owner,\n uint256 amount,\n bytes calldata extraData\n ) external;\n}\n" + }, + "contracts/bridge/BitcoinTx.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\nimport {ValidateSPV} from \"@keep-network/bitcoin-spv-sol/contracts/ValidateSPV.sol\";\n\nimport \"./BridgeState.sol\";\n\n/// @title Bitcoin transaction\n/// @notice Allows to reference Bitcoin raw transaction in Solidity.\n/// @dev See https://developer.bitcoin.org/reference/transactions.html#raw-transaction-format\n///\n/// Raw Bitcoin transaction data:\n///\n/// | Bytes | Name | BTC type | Description |\n/// |--------|--------------|------------------------|---------------------------|\n/// | 4 | version | int32_t (LE) | TX version number |\n/// | varies | tx_in_count | compactSize uint (LE) | Number of TX inputs |\n/// | varies | tx_in | txIn[] | TX inputs |\n/// | varies | tx_out_count | compactSize uint (LE) | Number of TX outputs |\n/// | varies | tx_out | txOut[] | TX outputs |\n/// | 4 | lock_time | uint32_t (LE) | Unix time or block number |\n///\n//\n/// Non-coinbase transaction input (txIn):\n///\n/// | Bytes | Name | BTC type | Description |\n/// |--------|------------------|------------------------|---------------------------------------------|\n/// | 36 | previous_output | outpoint | The previous outpoint being spent |\n/// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the signature script |\n/// | varies | signature_script | char[] | The signature script, empty for P2WSH |\n/// | 4 | sequence | uint32_t (LE) | Sequence number |\n///\n///\n/// The reference to transaction being spent (outpoint):\n///\n/// | Bytes | Name | BTC type | Description |\n/// |-------|-------|---------------|------------------------------------------|\n/// | 32 | hash | char[32] | Hash of the transaction to spend |\n/// | 4 | index | uint32_t (LE) | Index of the specific output from the TX |\n///\n///\n/// Transaction output (txOut):\n///\n/// | Bytes | Name | BTC type | Description |\n/// |--------|-----------------|-----------------------|--------------------------------------|\n/// | 8 | value | int64_t (LE) | Number of satoshis to spend |\n/// | 1+ | pk_script_bytes | compactSize uint (LE) | Number of bytes in the pubkey script |\n/// | varies | pk_script | char[] | Pubkey script |\n///\n/// compactSize uint format:\n///\n/// | Value | Bytes | Format |\n/// |-----------------------------------------|-------|----------------------------------------------|\n/// | >= 0 && <= 252 | 1 | uint8_t |\n/// | >= 253 && <= 0xffff | 3 | 0xfd followed by the number as uint16_t (LE) |\n/// | >= 0x10000 && <= 0xffffffff | 5 | 0xfe followed by the number as uint32_t (LE) |\n/// | >= 0x100000000 && <= 0xffffffffffffffff | 9 | 0xff followed by the number as uint64_t (LE) |\n///\n/// (*) compactSize uint is often references as VarInt)\n///\n/// Coinbase transaction input (txIn):\n///\n/// | Bytes | Name | BTC type | Description |\n/// |--------|------------------|------------------------|---------------------------------------------|\n/// | 32 | hash | char[32] | A 32-byte 0x0 null (no previous_outpoint) |\n/// | 4 | index | uint32_t (LE) | 0xffffffff (no previous_outpoint) |\n/// | varies | script_bytes | compactSize uint (LE) | The number of bytes in the coinbase script |\n/// | varies | height | char[] | The block height of this block (BIP34) (*) |\n/// | varies | coinbase_script | none | Arbitrary data, max 100 bytes |\n/// | 4 | sequence | uint32_t (LE) | Sequence number\n///\n/// (*) Uses script language: starts with a data-pushing opcode that indicates how many bytes to push to\n/// the stack followed by the block height as a little-endian unsigned integer. This script must be as\n/// short as possible, otherwise it may be rejected. The data-pushing opcode will be 0x03 and the total\n/// size four bytes until block 16,777,216 about 300 years from now.\nlibrary BitcoinTx {\n using BTCUtils for bytes;\n using BTCUtils for uint256;\n using BytesLib for bytes;\n using ValidateSPV for bytes;\n using ValidateSPV for bytes32;\n\n /// @notice Represents Bitcoin transaction data.\n struct Info {\n /// @notice Bitcoin transaction version.\n /// @dev `version` from raw Bitcoin transaction data.\n /// Encoded as 4-bytes signed integer, little endian.\n bytes4 version;\n /// @notice All Bitcoin transaction inputs, prepended by the number of\n /// transaction inputs.\n /// @dev `tx_in_count | tx_in` from raw Bitcoin transaction data.\n ///\n /// The number of transaction inputs encoded as compactSize\n /// unsigned integer, little-endian.\n ///\n /// Note that some popular block explorers reverse the order of\n /// bytes from `outpoint`'s `hash` and display it as big-endian.\n /// Solidity code of Bridge expects hashes in little-endian, just\n /// like they are represented in a raw Bitcoin transaction.\n bytes inputVector;\n /// @notice All Bitcoin transaction outputs prepended by the number of\n /// transaction outputs.\n /// @dev `tx_out_count | tx_out` from raw Bitcoin transaction data.\n ///\n /// The number of transaction outputs encoded as a compactSize\n /// unsigned integer, little-endian.\n bytes outputVector;\n /// @notice Bitcoin transaction locktime.\n ///\n /// @dev `lock_time` from raw Bitcoin transaction data.\n /// Encoded as 4-bytes unsigned integer, little endian.\n bytes4 locktime;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice Represents data needed to perform a Bitcoin SPV proof.\n struct Proof {\n /// @notice The merkle proof of transaction inclusion in a block.\n bytes merkleProof;\n /// @notice Transaction index in the block (0-indexed).\n uint256 txIndexInBlock;\n /// @notice Single byte-string of 80-byte bitcoin headers,\n /// lowest height first.\n bytes bitcoinHeaders;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice Represents info about an unspent transaction output.\n struct UTXO {\n /// @notice Hash of the transaction the output belongs to.\n /// @dev Byte order corresponds to the Bitcoin internal byte order.\n bytes32 txHash;\n /// @notice Index of the transaction output (0-indexed).\n uint32 txOutputIndex;\n /// @notice Value of the transaction output.\n uint64 txOutputValue;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice Represents Bitcoin signature in the R/S/V format.\n struct RSVSignature {\n /// @notice Signature r value.\n bytes32 r;\n /// @notice Signature s value.\n bytes32 s;\n /// @notice Signature recovery value.\n uint8 v;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice Validates the SPV proof of the Bitcoin transaction.\n /// Reverts in case the validation or proof verification fail.\n /// @param txInfo Bitcoin transaction data.\n /// @param proof Bitcoin proof data.\n /// @return txHash Proven 32-byte transaction hash.\n function validateProof(\n BridgeState.Storage storage self,\n Info calldata txInfo,\n Proof calldata proof\n ) internal view returns (bytes32 txHash) {\n require(\n txInfo.inputVector.validateVin(),\n \"Invalid input vector provided\"\n );\n require(\n txInfo.outputVector.validateVout(),\n \"Invalid output vector provided\"\n );\n\n txHash = abi\n .encodePacked(\n txInfo.version,\n txInfo.inputVector,\n txInfo.outputVector,\n txInfo.locktime\n )\n .hash256View();\n\n require(\n txHash.prove(\n proof.bitcoinHeaders.extractMerkleRootLE(),\n proof.merkleProof,\n proof.txIndexInBlock\n ),\n \"Tx merkle proof is not valid for provided header and tx hash\"\n );\n\n evaluateProofDifficulty(self, proof.bitcoinHeaders);\n\n return txHash;\n }\n\n /// @notice Evaluates the given Bitcoin proof difficulty against the actual\n /// Bitcoin chain difficulty provided by the relay oracle.\n /// Reverts in case the evaluation fails.\n /// @param bitcoinHeaders Bitcoin headers chain being part of the SPV\n /// proof. Used to extract the observed proof difficulty.\n function evaluateProofDifficulty(\n BridgeState.Storage storage self,\n bytes memory bitcoinHeaders\n ) internal view {\n IRelay relay = self.relay;\n uint256 currentEpochDifficulty = relay.getCurrentEpochDifficulty();\n uint256 previousEpochDifficulty = relay.getPrevEpochDifficulty();\n\n uint256 requestedDiff = 0;\n uint256 firstHeaderDiff = bitcoinHeaders\n .extractTarget()\n .calculateDifficulty();\n\n if (firstHeaderDiff == currentEpochDifficulty) {\n requestedDiff = currentEpochDifficulty;\n } else if (firstHeaderDiff == previousEpochDifficulty) {\n requestedDiff = previousEpochDifficulty;\n } else {\n revert(\"Not at current or previous difficulty\");\n }\n\n uint256 observedDiff = bitcoinHeaders.validateHeaderChain();\n\n require(\n observedDiff != ValidateSPV.getErrBadLength(),\n \"Invalid length of the headers chain\"\n );\n require(\n observedDiff != ValidateSPV.getErrInvalidChain(),\n \"Invalid headers chain\"\n );\n require(\n observedDiff != ValidateSPV.getErrLowWork(),\n \"Insufficient work in a header\"\n );\n\n require(\n observedDiff >= requestedDiff * self.txProofDifficultyFactor,\n \"Insufficient accumulated difficulty in header chain\"\n );\n }\n\n /// @notice Extracts public key hash from the provided P2PKH or P2WPKH output.\n /// Reverts if the validation fails.\n /// @param output The transaction output.\n /// @return pubKeyHash 20-byte public key hash the output locks funds on.\n /// @dev Requirements:\n /// - The output must be of P2PKH or P2WPKH type and lock the funds\n /// on a 20-byte public key hash.\n function extractPubKeyHash(BridgeState.Storage storage, bytes memory output)\n internal\n pure\n returns (bytes20 pubKeyHash)\n {\n bytes memory pubKeyHashBytes = output.extractHash();\n\n require(\n pubKeyHashBytes.length == 20,\n \"Output's public key hash must have 20 bytes\"\n );\n\n pubKeyHash = pubKeyHashBytes.slice20(0);\n\n // The output consists of an 8-byte value and a variable length script.\n // To extract just the script, we ignore the first 8 bytes.\n uint256 scriptLen = output.length - 8;\n\n // The P2PKH script is 26 bytes long.\n // The P2WPKH script is 23 bytes long.\n // A valid script must have one of these lengths,\n // and we can identify the expected script type by the length.\n require(\n scriptLen == 26 || scriptLen == 23,\n \"Output must be P2PKH or P2WPKH\"\n );\n\n if (scriptLen == 26) {\n // Compare to the expected P2PKH script.\n bytes26 script = bytes26(output.slice32(8));\n\n require(\n script == makeP2PKHScript(pubKeyHash),\n \"Invalid P2PKH script\"\n );\n }\n\n if (scriptLen == 23) {\n // Compare to the expected P2WPKH script.\n bytes23 script = bytes23(output.slice32(8));\n\n require(\n script == makeP2WPKHScript(pubKeyHash),\n \"Invalid P2WPKH script\"\n );\n }\n\n return pubKeyHash;\n }\n\n /// @notice Build the P2PKH script from the given public key hash.\n /// @param pubKeyHash The 20-byte public key hash.\n /// @return The P2PKH script.\n /// @dev The P2PKH script has the following byte format:\n /// <0x1976a914> <20-byte PKH> <0x88ac>. According to\n /// https://en.bitcoin.it/wiki/Script#Opcodes this translates to:\n /// - 0x19: Byte length of the entire script\n /// - 0x76: OP_DUP\n /// - 0xa9: OP_HASH160\n /// - 0x14: Byte length of the public key hash\n /// - 0x88: OP_EQUALVERIFY\n /// - 0xac: OP_CHECKSIG\n /// which matches the P2PKH structure as per:\n /// https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash\n function makeP2PKHScript(bytes20 pubKeyHash)\n internal\n pure\n returns (bytes26)\n {\n bytes26 P2PKHScriptMask = hex\"1976a914000000000000000000000000000000000000000088ac\";\n\n return ((bytes26(pubKeyHash) >> 32) | P2PKHScriptMask);\n }\n\n /// @notice Build the P2WPKH script from the given public key hash.\n /// @param pubKeyHash The 20-byte public key hash.\n /// @return The P2WPKH script.\n /// @dev The P2WPKH script has the following format:\n /// <0x160014> <20-byte PKH>. According to\n /// https://en.bitcoin.it/wiki/Script#Opcodes this translates to:\n /// - 0x16: Byte length of the entire script\n /// - 0x00: OP_0\n /// - 0x14: Byte length of the public key hash\n /// which matches the P2WPKH structure as per:\n /// https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH\n function makeP2WPKHScript(bytes20 pubKeyHash)\n internal\n pure\n returns (bytes23)\n {\n bytes23 P2WPKHScriptMask = hex\"1600140000000000000000000000000000000000000000\";\n\n return ((bytes23(pubKeyHash) >> 24) | P2WPKHScriptMask);\n }\n}\n" + }, + "contracts/bridge/Bridge.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"@keep-network/random-beacon/contracts/Governable.sol\";\nimport \"@keep-network/random-beacon/contracts/ReimbursementPool.sol\";\nimport {IWalletOwner as EcdsaWalletOwner} from \"@keep-network/ecdsa/contracts/api/IWalletOwner.sol\";\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol\";\n\nimport \"./IRelay.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Deposit.sol\";\nimport \"./DepositSweep.sol\";\nimport \"./Redemption.sol\";\nimport \"./BitcoinTx.sol\";\nimport \"./EcdsaLib.sol\";\nimport \"./Wallets.sol\";\nimport \"./Fraud.sol\";\nimport \"./MovingFunds.sol\";\n\nimport \"../bank/IReceiveBalanceApproval.sol\";\nimport \"../bank/Bank.sol\";\n\n/// @title Bitcoin Bridge\n/// @notice Bridge manages BTC deposit and redemption flow and is increasing and\n/// decreasing balances in the Bank as a result of BTC deposit and\n/// redemption operations performed by depositors and redeemers.\n///\n/// Depositors send BTC funds to the most recently created off-chain\n/// ECDSA wallet of the bridge using pay-to-script-hash (P2SH) or\n/// pay-to-witness-script-hash (P2WSH) containing hashed information\n/// about the depositor’s Ethereum address. Then, the depositor reveals\n/// their Ethereum address along with their deposit blinding factor,\n/// refund public key hash and refund locktime to the Bridge on Ethereum\n/// chain. The off-chain ECDSA wallet listens for these sorts of\n/// messages and when it gets one, it checks the Bitcoin network to make\n/// sure the deposit lines up. If it does, the off-chain ECDSA wallet\n/// may decide to pick the deposit transaction for sweeping, and when\n/// the sweep operation is confirmed on the Bitcoin network, the ECDSA\n/// wallet informs the Bridge about the sweep increasing appropriate\n/// balances in the Bank.\n/// @dev Bridge is an upgradeable component of the Bank. The order of\n/// functionalities in this contract is: deposit, sweep, redemption,\n/// moving funds, wallet lifecycle, frauds, parameters.\ncontract Bridge is\n Governable,\n EcdsaWalletOwner,\n Initializable,\n IReceiveBalanceApproval\n{\n using BridgeState for BridgeState.Storage;\n using Deposit for BridgeState.Storage;\n using DepositSweep for BridgeState.Storage;\n using Redemption for BridgeState.Storage;\n using MovingFunds for BridgeState.Storage;\n using Wallets for BridgeState.Storage;\n using Fraud for BridgeState.Storage;\n\n BridgeState.Storage internal self;\n\n event DepositRevealed(\n bytes32 fundingTxHash,\n uint32 fundingOutputIndex,\n address indexed depositor,\n uint64 amount,\n bytes8 blindingFactor,\n bytes20 indexed walletPubKeyHash,\n bytes20 refundPubKeyHash,\n bytes4 refundLocktime,\n address vault\n );\n\n event DepositsSwept(bytes20 walletPubKeyHash, bytes32 sweepTxHash);\n\n event RedemptionRequested(\n bytes20 indexed walletPubKeyHash,\n bytes redeemerOutputScript,\n address indexed redeemer,\n uint64 requestedAmount,\n uint64 treasuryFee,\n uint64 txMaxFee\n );\n\n event RedemptionsCompleted(\n bytes20 indexed walletPubKeyHash,\n bytes32 redemptionTxHash\n );\n\n event RedemptionTimedOut(\n bytes20 indexed walletPubKeyHash,\n bytes redeemerOutputScript\n );\n\n event WalletMovingFunds(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event MovingFundsCommitmentSubmitted(\n bytes20 indexed walletPubKeyHash,\n bytes20[] targetWallets,\n address submitter\n );\n\n event MovingFundsTimeoutReset(bytes20 indexed walletPubKeyHash);\n\n event MovingFundsCompleted(\n bytes20 indexed walletPubKeyHash,\n bytes32 movingFundsTxHash\n );\n\n event MovingFundsTimedOut(bytes20 indexed walletPubKeyHash);\n\n event MovingFundsBelowDustReported(bytes20 indexed walletPubKeyHash);\n\n event MovedFundsSwept(\n bytes20 indexed walletPubKeyHash,\n bytes32 sweepTxHash\n );\n\n event MovedFundsSweepTimedOut(\n bytes20 indexed walletPubKeyHash,\n bytes32 movingFundsTxHash,\n uint32 movingFundsTxOutputIndex\n );\n\n event NewWalletRequested();\n\n event NewWalletRegistered(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletClosing(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletClosed(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletTerminated(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event FraudChallengeSubmitted(\n bytes20 indexed walletPubKeyHash,\n bytes32 sighash,\n uint8 v,\n bytes32 r,\n bytes32 s\n );\n\n event FraudChallengeDefeated(\n bytes20 indexed walletPubKeyHash,\n bytes32 sighash\n );\n\n event FraudChallengeDefeatTimedOut(\n bytes20 indexed walletPubKeyHash,\n bytes32 sighash\n );\n\n event VaultStatusUpdated(address indexed vault, bool isTrusted);\n\n event SpvMaintainerStatusUpdated(\n address indexed spvMaintainer,\n bool isTrusted\n );\n\n event DepositParametersUpdated(\n uint64 depositDustThreshold,\n uint64 depositTreasuryFeeDivisor,\n uint64 depositTxMaxFee,\n uint32 depositRevealAheadPeriod\n );\n\n event RedemptionParametersUpdated(\n uint64 redemptionDustThreshold,\n uint64 redemptionTreasuryFeeDivisor,\n uint64 redemptionTxMaxFee,\n uint64 redemptionTxMaxTotalFee,\n uint32 redemptionTimeout,\n uint96 redemptionTimeoutSlashingAmount,\n uint32 redemptionTimeoutNotifierRewardMultiplier\n );\n\n event MovingFundsParametersUpdated(\n uint64 movingFundsTxMaxTotalFee,\n uint64 movingFundsDustThreshold,\n uint32 movingFundsTimeoutResetDelay,\n uint32 movingFundsTimeout,\n uint96 movingFundsTimeoutSlashingAmount,\n uint32 movingFundsTimeoutNotifierRewardMultiplier,\n uint16 movingFundsCommitmentGasOffset,\n uint64 movedFundsSweepTxMaxTotalFee,\n uint32 movedFundsSweepTimeout,\n uint96 movedFundsSweepTimeoutSlashingAmount,\n uint32 movedFundsSweepTimeoutNotifierRewardMultiplier\n );\n\n event WalletParametersUpdated(\n uint32 walletCreationPeriod,\n uint64 walletCreationMinBtcBalance,\n uint64 walletCreationMaxBtcBalance,\n uint64 walletClosureMinBtcBalance,\n uint32 walletMaxAge,\n uint64 walletMaxBtcTransfer,\n uint32 walletClosingPeriod\n );\n\n event FraudParametersUpdated(\n uint96 fraudChallengeDepositAmount,\n uint32 fraudChallengeDefeatTimeout,\n uint96 fraudSlashingAmount,\n uint32 fraudNotifierRewardMultiplier\n );\n\n event TreasuryUpdated(address treasury);\n\n modifier onlySpvMaintainer() {\n require(\n self.isSpvMaintainer[msg.sender],\n \"Caller is not SPV maintainer\"\n );\n _;\n }\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n _disableInitializers();\n }\n\n /// @dev Initializes upgradable contract on deployment.\n /// @param _bank Address of the Bank the Bridge belongs to.\n /// @param _relay Address of the Bitcoin relay providing the current Bitcoin\n /// network difficulty.\n /// @param _treasury Address where the deposit and redemption treasury fees\n /// will be sent to.\n /// @param _ecdsaWalletRegistry Address of the ECDSA Wallet Registry contract.\n /// @param _reimbursementPool Address of the Reimbursement Pool contract.\n /// @param _txProofDifficultyFactor The number of confirmations on the Bitcoin\n /// chain required to successfully evaluate an SPV proof.\n function initialize(\n address _bank,\n address _relay,\n address _treasury,\n address _ecdsaWalletRegistry,\n address payable _reimbursementPool,\n uint96 _txProofDifficultyFactor\n ) external initializer {\n require(_bank != address(0), \"Bank address cannot be zero\");\n self.bank = Bank(_bank);\n\n require(_relay != address(0), \"Relay address cannot be zero\");\n self.relay = IRelay(_relay);\n\n require(\n _ecdsaWalletRegistry != address(0),\n \"ECDSA Wallet Registry address cannot be zero\"\n );\n self.ecdsaWalletRegistry = EcdsaWalletRegistry(_ecdsaWalletRegistry);\n\n require(\n _reimbursementPool != address(0),\n \"Reimbursement Pool address cannot be zero\"\n );\n self.reimbursementPool = ReimbursementPool(_reimbursementPool);\n\n require(_treasury != address(0), \"Treasury address cannot be zero\");\n self.treasury = _treasury;\n\n self.txProofDifficultyFactor = _txProofDifficultyFactor;\n\n //\n // All parameters set in the constructor are initial ones, used at the\n // moment contracts were deployed for the first time. Parameters are\n // governable and values assigned in the constructor do not need to\n // reflect the current ones. Keep in mind the initial parameters are\n // pretty forgiving and valid only for the early stage of the network.\n //\n\n self.depositDustThreshold = 1000000; // 1000000 satoshi = 0.01 BTC\n self.depositTxMaxFee = 100000; // 100000 satoshi = 0.001 BTC\n self.depositRevealAheadPeriod = 15 days;\n self.depositTreasuryFeeDivisor = 2000; // 1/2000 == 5bps == 0.05% == 0.0005\n self.redemptionDustThreshold = 1000000; // 1000000 satoshi = 0.01 BTC\n self.redemptionTreasuryFeeDivisor = 2000; // 1/2000 == 5bps == 0.05% == 0.0005\n self.redemptionTxMaxFee = 100000; // 100000 satoshi = 0.001 BTC\n self.redemptionTxMaxTotalFee = 1000000; // 1000000 satoshi = 0.01 BTC\n self.redemptionTimeout = 5 days;\n self.redemptionTimeoutSlashingAmount = 100 * 1e18; // 100 T\n self.redemptionTimeoutNotifierRewardMultiplier = 100; // 100%\n self.movingFundsTxMaxTotalFee = 100000; // 100000 satoshi = 0.001 BTC\n self.movingFundsDustThreshold = 200000; // 200000 satoshi = 0.002 BTC\n self.movingFundsTimeoutResetDelay = 6 days;\n self.movingFundsTimeout = 7 days;\n self.movingFundsTimeoutSlashingAmount = 100 * 1e18; // 100 T\n self.movingFundsTimeoutNotifierRewardMultiplier = 100; //100%\n self.movingFundsCommitmentGasOffset = 15000;\n self.movedFundsSweepTxMaxTotalFee = 100000; // 100000 satoshi = 0.001 BTC\n self.movedFundsSweepTimeout = 7 days;\n self.movedFundsSweepTimeoutSlashingAmount = 100 * 1e18; // 100 T\n self.movedFundsSweepTimeoutNotifierRewardMultiplier = 100; //100%\n self.fraudChallengeDepositAmount = 5 ether;\n self.fraudChallengeDefeatTimeout = 7 days;\n self.fraudSlashingAmount = 100 * 1e18; // 100 T\n self.fraudNotifierRewardMultiplier = 100; // 100%\n self.walletCreationPeriod = 1 weeks;\n self.walletCreationMinBtcBalance = 1e8; // 1 BTC\n self.walletCreationMaxBtcBalance = 100e8; // 100 BTC\n self.walletClosureMinBtcBalance = 5 * 1e7; // 0.5 BTC\n self.walletMaxAge = 26 weeks; // ~6 months\n self.walletMaxBtcTransfer = 10e8; // 10 BTC\n self.walletClosingPeriod = 40 days;\n\n _transferGovernance(msg.sender);\n }\n\n /// @notice Used by the depositor to reveal information about their P2(W)SH\n /// Bitcoin deposit to the Bridge on Ethereum chain. The off-chain\n /// wallet listens for revealed deposit events and may decide to\n /// include the revealed deposit in the next executed sweep.\n /// Information about the Bitcoin deposit can be revealed before or\n /// after the Bitcoin transaction with P2(W)SH deposit is mined on\n /// the Bitcoin chain. Worth noting, the gas cost of this function\n /// scales with the number of P2(W)SH transaction inputs and\n /// outputs. The deposit may be routed to one of the trusted vaults.\n /// When a deposit is routed to a vault, vault gets notified when\n /// the deposit gets swept and it may execute the appropriate action.\n /// @param fundingTx Bitcoin funding transaction data, see `BitcoinTx.Info`.\n /// @param reveal Deposit reveal data, see `RevealInfo struct.\n /// @dev Requirements:\n /// - This function must be called by the same Ethereum address as the\n /// one used in the P2(W)SH BTC deposit transaction as a depositor,\n /// - `reveal.walletPubKeyHash` must identify a `Live` wallet,\n /// - `reveal.vault` must be 0x0 or point to a trusted vault,\n /// - `reveal.fundingOutputIndex` must point to the actual P2(W)SH\n /// output of the BTC deposit transaction,\n /// - `reveal.blindingFactor` must be the blinding factor used in the\n /// P2(W)SH BTC deposit transaction,\n /// - `reveal.walletPubKeyHash` must be the wallet pub key hash used in\n /// the P2(W)SH BTC deposit transaction,\n /// - `reveal.refundPubKeyHash` must be the refund pub key hash used in\n /// the P2(W)SH BTC deposit transaction,\n /// - `reveal.refundLocktime` must be the refund locktime used in the\n /// P2(W)SH BTC deposit transaction,\n /// - BTC deposit for the given `fundingTxHash`, `fundingOutputIndex`\n /// can be revealed only one time.\n ///\n /// If any of these requirements is not met, the wallet _must_ refuse\n /// to sweep the deposit and the depositor has to wait until the\n /// deposit script unlocks to receive their BTC back.\n function revealDeposit(\n BitcoinTx.Info calldata fundingTx,\n Deposit.DepositRevealInfo calldata reveal\n ) external {\n self.revealDeposit(fundingTx, reveal);\n }\n\n /// @notice Used by the wallet to prove the BTC deposit sweep transaction\n /// and to update Bank balances accordingly. Sweep is only accepted\n /// if it satisfies SPV proof.\n ///\n /// The function is performing Bank balance updates by first\n /// computing the Bitcoin fee for the sweep transaction. The fee is\n /// divided evenly between all swept deposits. Each depositor\n /// receives a balance in the bank equal to the amount inferred\n /// during the reveal transaction, minus their fee share.\n ///\n /// It is possible to prove the given sweep only one time.\n /// @param sweepTx Bitcoin sweep transaction data.\n /// @param sweepProof Bitcoin sweep proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain. If no main UTXO exists for the given wallet,\n /// this parameter is ignored.\n /// @param vault Optional address of the vault where all swept deposits\n /// should be routed to. All deposits swept as part of the transaction\n /// must have their `vault` parameters set to the same address.\n /// If this parameter is set to an address of a trusted vault, swept\n /// deposits are routed to that vault.\n /// If this parameter is set to the zero address or to an address\n /// of a non-trusted vault, swept deposits are not routed to a\n /// vault but depositors' balances are increased in the Bank\n /// individually.\n /// @dev Requirements:\n /// - `sweepTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `sweepTx` should represent a Bitcoin transaction with 1..n\n /// inputs. If the wallet has no main UTXO, all n inputs should\n /// correspond to P2(W)SH revealed deposits UTXOs. If the wallet has\n /// an existing main UTXO, one of the n inputs must point to that\n /// main UTXO and remaining n-1 inputs should correspond to P2(W)SH\n /// revealed deposits UTXOs. That transaction must have only\n /// one P2(W)PKH output locking funds on the 20-byte wallet public\n /// key hash,\n /// - All revealed deposits that are swept by `sweepTx` must have\n /// their `vault` parameters set to the same address as the address\n /// passed in the `vault` function parameter,\n /// - `sweepProof` components must match the expected structure. See\n /// `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// If there is no main UTXO, this parameter is ignored.\n function submitDepositSweepProof(\n BitcoinTx.Info calldata sweepTx,\n BitcoinTx.Proof calldata sweepProof,\n BitcoinTx.UTXO calldata mainUtxo,\n address vault\n ) external onlySpvMaintainer {\n self.submitDepositSweepProof(sweepTx, sweepProof, mainUtxo, vault);\n }\n\n /// @notice Requests redemption of the given amount from the specified\n /// wallet to the redeemer Bitcoin output script. Handles the\n /// simplest case in which the redeemer's balance is decreased in\n /// the Bank.\n /// @param walletPubKeyHash The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key).\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC.\n /// @param amount Requested amount in satoshi. This is also the Bank balance\n /// that is taken from the `balanceOwner` upon request.\n /// Once the request is handled, the actual amount of BTC locked\n /// on the redeemer output script will be always lower than this value\n /// since the treasury and Bitcoin transaction fees must be incurred.\n /// The minimal amount satisfying the request can be computed as:\n /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.\n /// Fees values are taken at the moment of request creation.\n /// @dev Requirements:\n /// - Wallet behind `walletPubKeyHash` must be live,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain,\n /// - `redeemerOutputScript` must be a proper Bitcoin script,\n /// - `redeemerOutputScript` cannot have wallet PKH as payload,\n /// - `amount` must be above or equal the `redemptionDustThreshold`,\n /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be\n /// used for only one pending request at the same time,\n /// - Wallet must have enough Bitcoin balance to process the request,\n /// - Redeemer must make an allowance in the Bank that the Bridge\n /// contract can spend the given `amount`.\n function requestRedemption(\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo,\n bytes calldata redeemerOutputScript,\n uint64 amount\n ) external {\n self.requestRedemption(\n walletPubKeyHash,\n mainUtxo,\n msg.sender,\n redeemerOutputScript,\n amount\n );\n }\n\n /// @notice Requests redemption of the given amount from the specified\n /// wallet to the redeemer Bitcoin output script. Used by\n /// `Bank.approveBalanceAndCall`. Can handle more complex cases\n /// where balance owner may be someone else than the redeemer.\n /// For example, vault redeeming its balance for some depositor.\n /// @param balanceOwner The address of the Bank balance owner whose balance\n /// is getting redeemed.\n /// @param amount Requested amount in satoshi. This is also the Bank balance\n /// that is taken from the `balanceOwner` upon request.\n /// Once the request is handled, the actual amount of BTC locked\n /// on the redeemer output script will be always lower than this value\n /// since the treasury and Bitcoin transaction fees must be incurred.\n /// The minimal amount satisfying the request can be computed as:\n /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.\n /// Fees values are taken at the moment of request creation.\n /// @param redemptionData ABI-encoded redemption data:\n /// [\n /// address redeemer,\n /// bytes20 walletPubKeyHash,\n /// bytes32 mainUtxoTxHash,\n /// uint32 mainUtxoTxOutputIndex,\n /// uint64 mainUtxoTxOutputValue,\n /// bytes redeemerOutputScript\n /// ]\n ///\n /// - redeemer: The Ethereum address of the redeemer who will be able\n /// to claim Bank balance if anything goes wrong during the redemption.\n /// In the most basic case, when someone redeems their balance\n /// from the Bank, `balanceOwner` is the same as `redeemer`.\n /// However, when a Vault is redeeming part of its balance for some\n /// redeemer address (for example, someone who has earlier deposited\n /// into that Vault), `balanceOwner` is the Vault, and `redeemer` is\n /// the address for which the vault is redeeming its balance to,\n /// - walletPubKeyHash: The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key),\n /// - mainUtxoTxHash: Data of the wallet's main UTXO TX hash, as\n /// currently known on the Ethereum chain,\n /// - mainUtxoTxOutputIndex: Data of the wallet's main UTXO output\n /// index, as currently known on Ethereum chain,\n /// - mainUtxoTxOutputValue: Data of the wallet's main UTXO output\n /// value, as currently known on Ethereum chain,\n /// - redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC.\n /// @dev Requirements:\n /// - The caller must be the Bank,\n /// - Wallet behind `walletPubKeyHash` must be live,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain,\n /// - `redeemerOutputScript` must be a proper Bitcoin script,\n /// - `redeemerOutputScript` cannot have wallet PKH as payload,\n /// - `amount` must be above or equal the `redemptionDustThreshold`,\n /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be\n /// used for only one pending request at the same time,\n /// - Wallet must have enough Bitcoin balance to process the request.\n ///\n /// Note on upgradeability:\n /// Bridge is an upgradeable contract deployed behind\n /// a TransparentUpgradeableProxy. Accepting redemption data as bytes\n /// provides great flexibility. The Bridge is just like any other\n /// contract with a balance approved in the Bank and can be upgraded\n /// to another version without being bound to a particular interface\n /// forever. This flexibility comes with the cost - developers\n /// integrating their vaults and dApps with `Bridge` using\n /// `approveBalanceAndCall` need to pay extra attention to\n /// `redemptionData` and adjust the code in case the expected structure\n /// of `redemptionData` changes.\n function receiveBalanceApproval(\n address balanceOwner,\n uint256 amount,\n bytes calldata redemptionData\n ) external override {\n require(msg.sender == address(self.bank), \"Caller is not the bank\");\n\n self.requestRedemption(\n balanceOwner,\n SafeCastUpgradeable.toUint64(amount),\n redemptionData\n );\n }\n\n /// @notice Used by the wallet to prove the BTC redemption transaction\n /// and to make the necessary bookkeeping. Redemption is only\n /// accepted if it satisfies SPV proof.\n ///\n /// The function is performing Bank balance updates by burning\n /// the total redeemed Bitcoin amount from Bridge balance and\n /// transferring the treasury fee sum to the treasury address.\n ///\n /// It is possible to prove the given redemption only one time.\n /// @param redemptionTx Bitcoin redemption transaction data.\n /// @param redemptionProof Bitcoin redemption proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet which\n /// performed the redemption transaction.\n /// @dev Requirements:\n /// - `redemptionTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `redemptionTx` should represent a Bitcoin transaction with\n /// exactly 1 input that refers to the wallet's main UTXO. That\n /// transaction should have 1..n outputs handling existing pending\n /// redemption requests or pointing to reported timed out requests.\n /// There can be also 1 optional output representing the\n /// change and pointing back to the 20-byte wallet public key hash.\n /// The change should be always present if the redeemed value sum\n /// is lower than the total wallet's BTC balance,\n /// - `redemptionProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// Additionally, the recent main UTXO on Ethereum must be set,\n /// - `walletPubKeyHash` must be connected with the main UTXO used\n /// as transaction single input.\n /// Other remarks:\n /// - Putting the change output as the first transaction output can\n /// save some gas because the output processing loop begins each\n /// iteration by checking whether the given output is the change\n /// thus uses some gas for making the comparison. Once the change\n /// is identified, that check is omitted in further iterations.\n function submitRedemptionProof(\n BitcoinTx.Info calldata redemptionTx,\n BitcoinTx.Proof calldata redemptionProof,\n BitcoinTx.UTXO calldata mainUtxo,\n bytes20 walletPubKeyHash\n ) external onlySpvMaintainer {\n self.submitRedemptionProof(\n redemptionTx,\n redemptionProof,\n mainUtxo,\n walletPubKeyHash\n );\n }\n\n /// @notice Notifies that there is a pending redemption request associated\n /// with the given wallet, that has timed out. The redemption\n /// request is identified by the key built as\n /// `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n /// The results of calling this function:\n /// - The pending redemptions value for the wallet will be decreased\n /// by the requested amount (minus treasury fee),\n /// - The tokens taken from the redeemer on redemption request will\n /// be returned to the redeemer,\n /// - The request will be moved from pending redemptions to\n /// timed-out redemptions,\n /// - If the state of the wallet is `Live` or `MovingFunds`, the\n /// wallet operators will be slashed and the notifier will be\n /// rewarded,\n /// - If the state of wallet is `Live`, the wallet will be closed or\n /// marked as `MovingFunds` (depending on the presence or absence\n /// of the wallet's main UTXO) and the wallet will no longer be\n /// marked as the active wallet (if it was marked as such).\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @param redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH).\n /// @dev Requirements:\n /// - The wallet must be in the Live or MovingFunds or Terminated state,\n /// - The redemption request identified by `walletPubKeyHash` and\n /// `redeemerOutputScript` must exist,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract,\n /// - The amount of time defined by `redemptionTimeout` must have\n /// passed since the redemption was requested (the request must be\n /// timed-out).\n function notifyRedemptionTimeout(\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs,\n bytes calldata redeemerOutputScript\n ) external {\n self.notifyRedemptionTimeout(\n walletPubKeyHash,\n walletMembersIDs,\n redeemerOutputScript\n );\n }\n\n /// @notice Submits the moving funds target wallets commitment.\n /// Once all requirements are met, that function registers the\n /// target wallets commitment and opens the way for moving funds\n /// proof submission.\n /// The caller is reimbursed for the transaction costs.\n /// @param walletPubKeyHash 20-byte public key hash of the source wallet.\n /// @param walletMainUtxo Data of the source wallet's main UTXO, as\n /// currently known on the Ethereum chain.\n /// @param walletMembersIDs Identifiers of the source wallet signing group\n /// members.\n /// @param walletMemberIndex Position of the caller in the source wallet\n /// signing group members list.\n /// @param targetWallets List of 20-byte public key hashes of the target\n /// wallets that the source wallet commits to move the funds to.\n /// @dev Requirements:\n /// - The source wallet must be in the MovingFunds state,\n /// - The source wallet must not have pending redemption requests,\n /// - The source wallet must not have pending moved funds sweep requests,\n /// - The source wallet must not have submitted its commitment already,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given source wallet in the ECDSA registry. Those IDs are\n /// not directly stored in the contract for gas efficiency purposes\n /// but they can be read from appropriate `DkgResultSubmitted`\n /// and `DkgResultApproved` events,\n /// - The `walletMemberIndex` must be in range [1, walletMembersIDs.length],\n /// - The caller must be the member of the source wallet signing group\n /// at the position indicated by `walletMemberIndex` parameter,\n /// - The `walletMainUtxo` components must point to the recent main\n /// UTXO of the source wallet, as currently known on the Ethereum\n /// chain,\n /// - Source wallet BTC balance must be greater than zero,\n /// - At least one Live wallet must exist in the system,\n /// - Submitted target wallets count must match the expected count\n /// `N = min(liveWalletsCount, ceil(walletBtcBalance / walletMaxBtcTransfer))`\n /// where `N > 0`,\n /// - Each target wallet must be not equal to the source wallet,\n /// - Each target wallet must follow the expected order i.e. all\n /// target wallets 20-byte public key hashes represented as numbers\n /// must form a strictly increasing sequence without duplicates,\n /// - Each target wallet must be in Live state.\n function submitMovingFundsCommitment(\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata walletMainUtxo,\n uint32[] calldata walletMembersIDs,\n uint256 walletMemberIndex,\n bytes20[] calldata targetWallets\n ) external {\n uint256 gasStart = gasleft();\n\n self.submitMovingFundsCommitment(\n walletPubKeyHash,\n walletMainUtxo,\n walletMembersIDs,\n walletMemberIndex,\n targetWallets\n );\n\n self.reimbursementPool.refund(\n (gasStart - gasleft()) + self.movingFundsCommitmentGasOffset,\n msg.sender\n );\n }\n\n /// @notice Resets the moving funds timeout for the given wallet if the\n /// target wallet commitment cannot be submitted due to a lack\n /// of live wallets in the system.\n /// @param walletPubKeyHash 20-byte public key hash of the moving funds wallet.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The target wallets commitment must not be already submitted for\n /// the given moving funds wallet,\n /// - Live wallets count must be zero,\n /// - The moving funds timeout reset delay must be elapsed.\n function resetMovingFundsTimeout(bytes20 walletPubKeyHash) external {\n self.resetMovingFundsTimeout(walletPubKeyHash);\n }\n\n /// @notice Used by the wallet to prove the BTC moving funds transaction\n /// and to make the necessary state changes. Moving funds is only\n /// accepted if it satisfies SPV proof.\n ///\n /// The function validates the moving funds transaction structure\n /// by checking if it actually spends the main UTXO of the declared\n /// wallet and locks the value on the pre-committed target wallets\n /// using a reasonable transaction fee. If all preconditions are\n /// met, this functions closes the source wallet.\n ///\n /// It is possible to prove the given moving funds transaction only\n /// one time.\n /// @param movingFundsTx Bitcoin moving funds transaction data.\n /// @param movingFundsProof Bitcoin moving funds proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet\n /// which performed the moving funds transaction.\n /// @dev Requirements:\n /// - `movingFundsTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `movingFundsTx` should represent a Bitcoin transaction with\n /// exactly 1 input that refers to the wallet's main UTXO. That\n /// transaction should have 1..n outputs corresponding to the\n /// pre-committed target wallets. Outputs must be ordered in the\n /// same way as their corresponding target wallets are ordered\n /// within the target wallets commitment,\n /// - `movingFundsProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// Additionally, the recent main UTXO on Ethereum must be set,\n /// - `walletPubKeyHash` must be connected with the main UTXO used\n /// as transaction single input,\n /// - The wallet that `walletPubKeyHash` points to must be in the\n /// MovingFunds state,\n /// - The target wallets commitment must be submitted by the wallet\n /// that `walletPubKeyHash` points to,\n /// - The total Bitcoin transaction fee must be lesser or equal\n /// to `movingFundsTxMaxTotalFee` governable parameter.\n function submitMovingFundsProof(\n BitcoinTx.Info calldata movingFundsTx,\n BitcoinTx.Proof calldata movingFundsProof,\n BitcoinTx.UTXO calldata mainUtxo,\n bytes20 walletPubKeyHash\n ) external onlySpvMaintainer {\n self.submitMovingFundsProof(\n movingFundsTx,\n movingFundsProof,\n mainUtxo,\n walletPubKeyHash\n );\n }\n\n /// @notice Notifies about a timed out moving funds process. Terminates\n /// the wallet and slashes signing group members as a result.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The moving funds timeout must be actually exceeded,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract.\n function notifyMovingFundsTimeout(\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs\n ) external {\n self.notifyMovingFundsTimeout(walletPubKeyHash, walletMembersIDs);\n }\n\n /// @notice Notifies about a moving funds wallet whose BTC balance is\n /// below the moving funds dust threshold. Ends the moving funds\n /// process and begins wallet closing immediately.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known\n /// on the Ethereum chain.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// If the wallet has no main UTXO, this parameter can be empty as it\n /// is ignored,\n /// - The wallet BTC balance must be below the moving funds threshold.\n function notifyMovingFundsBelowDust(\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo\n ) external {\n self.notifyMovingFundsBelowDust(walletPubKeyHash, mainUtxo);\n }\n\n /// @notice Used by the wallet to prove the BTC moved funds sweep\n /// transaction and to make the necessary state changes. Moved\n /// funds sweep is only accepted if it satisfies SPV proof.\n ///\n /// The function validates the sweep transaction structure by\n /// checking if it actually spends the moved funds UTXO and the\n /// sweeping wallet's main UTXO (optionally), and if it locks the\n /// value on the sweeping wallet's 20-byte public key hash using a\n /// reasonable transaction fee. If all preconditions are\n /// met, this function updates the sweeping wallet main UTXO, thus\n /// their BTC balance.\n ///\n /// It is possible to prove the given sweep transaction only\n /// one time.\n /// @param sweepTx Bitcoin sweep funds transaction data.\n /// @param sweepProof Bitcoin sweep funds proof data.\n /// @param mainUtxo Data of the sweeping wallet's main UTXO, as currently\n /// known on the Ethereum chain.\n /// @dev Requirements:\n /// - `sweepTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `sweepTx` should represent a Bitcoin transaction with\n /// the first input pointing to a moved funds sweep request targeted\n /// to the wallet, and optionally, the second input pointing to the\n /// wallet's main UTXO, if the sweeping wallet has a main UTXO set.\n /// There should be only one output locking funds on the sweeping\n /// wallet 20-byte public key hash,\n /// - `sweepProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the sweeping wallet, as currently known on the Ethereum chain.\n /// If there is no main UTXO, this parameter is ignored,\n /// - The sweeping wallet must be in the Live or MovingFunds state,\n /// - The total Bitcoin transaction fee must be lesser or equal\n /// to `movedFundsSweepTxMaxTotalFee` governable parameter.\n function submitMovedFundsSweepProof(\n BitcoinTx.Info calldata sweepTx,\n BitcoinTx.Proof calldata sweepProof,\n BitcoinTx.UTXO calldata mainUtxo\n ) external onlySpvMaintainer {\n self.submitMovedFundsSweepProof(sweepTx, sweepProof, mainUtxo);\n }\n\n /// @notice Notifies about a timed out moved funds sweep process. If the\n /// wallet is not terminated yet, that function terminates\n /// the wallet and slashes signing group members as a result.\n /// Marks the given sweep request as TimedOut.\n /// @param movingFundsTxHash 32-byte hash of the moving funds transaction\n /// that caused the sweep request to be created.\n /// @param movingFundsTxOutputIndex Index of the moving funds transaction\n /// output that is subject of the sweep request.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The moved funds sweep request must be in the Pending state,\n /// - The moved funds sweep timeout must be actually exceeded,\n /// - The wallet must be either in the Live or MovingFunds or\n /// Terminated state,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract.\n function notifyMovedFundsSweepTimeout(\n bytes32 movingFundsTxHash,\n uint32 movingFundsTxOutputIndex,\n uint32[] calldata walletMembersIDs\n ) external {\n self.notifyMovedFundsSweepTimeout(\n movingFundsTxHash,\n movingFundsTxOutputIndex,\n walletMembersIDs\n );\n }\n\n /// @notice Requests creation of a new wallet. This function just\n /// forms a request and the creation process is performed\n /// asynchronously. Once a wallet is created, the ECDSA Wallet\n /// Registry will notify this contract by calling the\n /// `__ecdsaWalletCreatedCallback` function.\n /// @param activeWalletMainUtxo Data of the active wallet's main UTXO, as\n /// currently known on the Ethereum chain.\n /// @dev Requirements:\n /// - `activeWalletMainUtxo` components must point to the recent main\n /// UTXO of the given active wallet, as currently known on the\n /// Ethereum chain. If there is no active wallet at the moment, or\n /// the active wallet has no main UTXO, this parameter can be\n /// empty as it is ignored,\n /// - Wallet creation must not be in progress,\n /// - If the active wallet is set, one of the following\n /// conditions must be true:\n /// - The active wallet BTC balance is above the minimum threshold\n /// and the active wallet is old enough, i.e. the creation period\n /// was elapsed since its creation time,\n /// - The active wallet BTC balance is above the maximum threshold.\n function requestNewWallet(BitcoinTx.UTXO calldata activeWalletMainUtxo)\n external\n {\n self.requestNewWallet(activeWalletMainUtxo);\n }\n\n /// @notice A callback function that is called by the ECDSA Wallet Registry\n /// once a new ECDSA wallet is created.\n /// @param ecdsaWalletID Wallet's unique identifier.\n /// @param publicKeyX Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n /// @dev Requirements:\n /// - The only caller authorized to call this function is `registry`,\n /// - Given wallet data must not belong to an already registered wallet.\n function __ecdsaWalletCreatedCallback(\n bytes32 ecdsaWalletID,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external override {\n self.registerNewWallet(ecdsaWalletID, publicKeyX, publicKeyY);\n }\n\n /// @notice A callback function that is called by the ECDSA Wallet Registry\n /// once a wallet heartbeat failure is detected.\n /// @param publicKeyX Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n /// @dev Requirements:\n /// - The only caller authorized to call this function is `registry`,\n /// - Wallet must be in Live state.\n function __ecdsaWalletHeartbeatFailedCallback(\n bytes32,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external override {\n self.notifyWalletHeartbeatFailed(publicKeyX, publicKeyY);\n }\n\n /// @notice Notifies that the wallet is either old enough or has too few\n /// satoshi left and qualifies to be closed.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMainUtxo Data of the wallet's main UTXO, as currently\n /// known on the Ethereum chain.\n /// @dev Requirements:\n /// - Wallet must not be set as the current active wallet,\n /// - Wallet must exceed the wallet maximum age OR the wallet BTC\n /// balance must be lesser than the minimum threshold. If the latter\n /// case is true, the `walletMainUtxo` components must point to the\n /// recent main UTXO of the given wallet, as currently known on the\n /// Ethereum chain. If the wallet has no main UTXO, this parameter\n /// can be empty as it is ignored since the wallet balance is\n /// assumed to be zero,\n /// - Wallet must be in Live state.\n function notifyWalletCloseable(\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata walletMainUtxo\n ) external {\n self.notifyWalletCloseable(walletPubKeyHash, walletMainUtxo);\n }\n\n /// @notice Notifies about the end of the closing period for the given wallet.\n /// Closes the wallet ultimately and notifies the ECDSA registry\n /// about this fact.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The wallet must be in the Closing state,\n /// - The wallet closing period must have elapsed.\n function notifyWalletClosingPeriodElapsed(bytes20 walletPubKeyHash)\n external\n {\n self.notifyWalletClosingPeriodElapsed(walletPubKeyHash);\n }\n\n /// @notice Submits a fraud challenge indicating that a UTXO being under\n /// wallet control was unlocked by the wallet but was not used\n /// according to the protocol rules. That means the wallet signed\n /// a transaction input pointing to that UTXO and there is a unique\n /// sighash and signature pair associated with that input. This\n /// function uses those parameters to create a fraud accusation that\n /// proves a given transaction input unlocking the given UTXO was\n /// actually signed by the wallet. This function cannot determine\n /// whether the transaction was actually broadcast and the input was\n /// consumed in a fraudulent way so it just opens a challenge period\n /// during which the wallet can defeat the challenge by submitting\n /// proof of a transaction that consumes the given input according\n /// to protocol rules. To prevent spurious allegations, the caller\n /// must deposit ETH that is returned back upon justified fraud\n /// challenge or confiscated otherwise.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param preimageSha256 The hash that was generated by applying SHA-256\n /// one time over the preimage used during input signing. The preimage\n /// is a serialized subset of the transaction and its structure\n /// depends on the transaction input (see BIP-143 for reference).\n /// Notice that applying SHA-256 over the `preimageSha256` results\n /// in `sighash`. The path from `preimage` to `sighash` looks like\n /// this:\n /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.\n /// @param signature Bitcoin signature in the R/S/V format.\n /// @dev Requirements:\n /// - Wallet behind `walletPublicKey` must be in Live or MovingFunds\n /// or Closing state,\n /// - The challenger must send appropriate amount of ETH used as\n /// fraud challenge deposit,\n /// - The signature (represented by r, s and v) must be generated by\n /// the wallet behind `walletPubKey` during signing of `sighash`\n /// which was calculated from `preimageSha256`,\n /// - Wallet can be challenged for the given signature only once.\n function submitFraudChallenge(\n bytes calldata walletPublicKey,\n bytes memory preimageSha256,\n BitcoinTx.RSVSignature calldata signature\n ) external payable {\n self.submitFraudChallenge(walletPublicKey, preimageSha256, signature);\n }\n\n /// @notice Allows to defeat a pending fraud challenge against a wallet if\n /// the transaction that spends the UTXO follows the protocol rules.\n /// In order to defeat the challenge the same `walletPublicKey` and\n /// signature (represented by `r`, `s` and `v`) must be provided as\n /// were used to calculate the sighash during input signing.\n /// The fraud challenge defeat attempt will only succeed if the\n /// inputs in the preimage are considered honestly spent by the\n /// wallet. Therefore the transaction spending the UTXO must be\n /// proven in the Bridge before a challenge defeat is called.\n /// If successfully defeated, the fraud challenge is marked as\n /// resolved and the amount of ether deposited by the challenger is\n /// sent to the treasury.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param preimage The preimage which produces sighash used to generate the\n /// ECDSA signature that is the subject of the fraud claim. It is a\n /// serialized subset of the transaction. The exact subset used as\n /// the preimage depends on the transaction input the signature is\n /// produced for. See BIP-143 for reference.\n /// @param witness Flag indicating whether the preimage was produced for a\n /// witness input. True for witness, false for non-witness input.\n /// @dev Requirements:\n /// - `walletPublicKey` and `sighash` calculated as `hash256(preimage)`\n /// must identify an open fraud challenge,\n /// - the preimage must be a valid preimage of a transaction generated\n /// according to the protocol rules and already proved in the Bridge,\n /// - before a defeat attempt is made the transaction that spends the\n /// given UTXO must be proven in the Bridge.\n function defeatFraudChallenge(\n bytes calldata walletPublicKey,\n bytes calldata preimage,\n bool witness\n ) external {\n self.defeatFraudChallenge(walletPublicKey, preimage, witness);\n }\n\n /// @notice Allows to defeat a pending fraud challenge against a wallet by\n /// proving the sighash and signature were produced for an off-chain\n /// wallet heartbeat message following a strict format.\n /// In order to defeat the challenge the same `walletPublicKey` and\n /// signature (represented by `r`, `s` and `v`) must be provided as\n /// were used to calculate the sighash during heartbeat message\n /// signing. The fraud challenge defeat attempt will only succeed if\n /// the signed message follows a strict format required for\n /// heartbeat messages. If successfully defeated, the fraud\n /// challenge is marked as resolved and the amount of ether\n /// deposited by the challenger is sent to the treasury.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param heartbeatMessage Off-chain heartbeat message meeting the heartbeat\n /// message format requirements which produces sighash used to\n /// generate the ECDSA signature that is the subject of the fraud\n /// claim.\n /// @dev Requirements:\n /// - `walletPublicKey` and `sighash` calculated as\n /// `hash256(heartbeatMessage)` must identify an open fraud challenge,\n /// - `heartbeatMessage` must follow a strict format of heartbeat\n /// messages.\n function defeatFraudChallengeWithHeartbeat(\n bytes calldata walletPublicKey,\n bytes calldata heartbeatMessage\n ) external {\n self.defeatFraudChallengeWithHeartbeat(\n walletPublicKey,\n heartbeatMessage\n );\n }\n\n /// @notice Notifies about defeat timeout for the given fraud challenge.\n /// Can be called only if there was a fraud challenge identified by\n /// the provided `walletPublicKey` and `sighash` and it was not\n /// defeated on time. The amount of time that needs to pass after\n /// a fraud challenge is reported is indicated by the\n /// `challengeDefeatTimeout`. After a successful fraud challenge\n /// defeat timeout notification the fraud challenge is marked as\n /// resolved, the stake of each operator is slashed, the ether\n /// deposited is returned to the challenger and the challenger is\n /// rewarded.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @param preimageSha256 The hash that was generated by applying SHA-256\n /// one time over the preimage used during input signing. The preimage\n /// is a serialized subset of the transaction and its structure\n /// depends on the transaction input (see BIP-143 for reference).\n /// Notice that applying SHA-256 over the `preimageSha256` results\n /// in `sighash`. The path from `preimage` to `sighash` looks like\n /// this:\n /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.\n /// @dev Requirements:\n /// - The wallet must be in the Live or MovingFunds or Closing or\n /// Terminated state,\n /// - The `walletPublicKey` and `sighash` calculated from\n /// `preimageSha256` must identify an open fraud challenge,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract,\n /// - The amount of time indicated by `challengeDefeatTimeout` must pass\n /// after the challenge was reported.\n function notifyFraudChallengeDefeatTimeout(\n bytes calldata walletPublicKey,\n uint32[] calldata walletMembersIDs,\n bytes memory preimageSha256\n ) external {\n self.notifyFraudChallengeDefeatTimeout(\n walletPublicKey,\n walletMembersIDs,\n preimageSha256\n );\n }\n\n /// @notice Allows the Governance to mark the given vault address as trusted\n /// or no longer trusted. Vaults are not trusted by default.\n /// Trusted vault must meet the following criteria:\n /// - `IVault.receiveBalanceIncrease` must have a known, low gas\n /// cost,\n /// - `IVault.receiveBalanceIncrease` must never revert.\n /// @dev Without restricting reveal only to trusted vaults, malicious\n /// vaults not meeting the criteria would be able to nuke sweep proof\n /// transactions executed by ECDSA wallet with deposits routed to\n /// them.\n /// @param vault The address of the vault.\n /// @param isTrusted flag indicating whether the vault is trusted or not.\n /// @dev Can only be called by the Governance.\n function setVaultStatus(address vault, bool isTrusted)\n external\n onlyGovernance\n {\n self.isVaultTrusted[vault] = isTrusted;\n emit VaultStatusUpdated(vault, isTrusted);\n }\n\n /// @notice Allows the Governance to mark the given address as trusted\n /// or no longer trusted SPV maintainer. Addresses are not trusted\n /// as SPV maintainers by default.\n /// @dev The SPV proof does not check whether the transaction is a part of\n /// the Bitcoin mainnet, it only checks whether the transaction has been\n /// mined performing the required amount of work as on Bitcoin mainnet.\n /// The possibility of submitting SPV proofs is limited to trusted SPV\n /// maintainers. The system expects transaction confirmations with the\n /// required work accumulated, so trusted SPV maintainers can not prove\n /// the transaction without providing the required Bitcoin proof of work.\n /// Trusted maintainers address the issue of an economic game between\n /// tBTC and Bitcoin mainnet where large Bitcoin mining pools can decide\n /// to use their hash power to mine fake Bitcoin blocks to prove them in\n /// tBTC instead of receiving Bitcoin miner rewards.\n /// @param spvMaintainer The address of the SPV maintainer.\n /// @param isTrusted flag indicating whether the address is trusted or not.\n /// @dev Can only be called by the Governance.\n function setSpvMaintainerStatus(address spvMaintainer, bool isTrusted)\n external\n onlyGovernance\n {\n self.isSpvMaintainer[spvMaintainer] = isTrusted;\n emit SpvMaintainerStatusUpdated(spvMaintainer, isTrusted);\n }\n\n /// @notice Updates parameters of deposits.\n /// @param depositDustThreshold New value of the deposit dust threshold in\n /// satoshis. It is the minimal amount that can be requested to\n //// deposit. Value of this parameter must take into account the value\n /// of `depositTreasuryFeeDivisor` and `depositTxMaxFee` parameters\n /// in order to make requests that can incur the treasury and\n /// transaction fee and still satisfy the depositor.\n /// @param depositTreasuryFeeDivisor New value of the treasury fee divisor.\n /// It is the divisor used to compute the treasury fee taken from\n /// each deposit and transferred to the treasury upon sweep proof\n /// submission. That fee is computed as follows:\n /// `treasuryFee = depositedAmount / depositTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each deposit,\n /// the `depositTreasuryFeeDivisor` should be set to `50`\n /// because `1/50 = 0.02 = 2%`.\n /// @param depositTxMaxFee New value of the deposit tx max fee in satoshis.\n /// It is the maximum amount of BTC transaction fee that can\n /// be incurred by each swept deposit being part of the given sweep\n /// transaction. If the maximum BTC transaction fee is exceeded,\n /// such transaction is considered a fraud.\n /// @param depositRevealAheadPeriod New value of the deposit reveal ahead\n /// period parameter in seconds. It defines the length of the period\n /// that must be preserved between the deposit reveal time and the\n /// deposit refund locktime.\n /// @dev Requirements:\n /// - Deposit dust threshold must be greater than zero,\n /// - Deposit dust threshold must be greater than deposit TX max fee,\n /// - Deposit transaction max fee must be greater than zero.\n function updateDepositParameters(\n uint64 depositDustThreshold,\n uint64 depositTreasuryFeeDivisor,\n uint64 depositTxMaxFee,\n uint32 depositRevealAheadPeriod\n ) external onlyGovernance {\n self.updateDepositParameters(\n depositDustThreshold,\n depositTreasuryFeeDivisor,\n depositTxMaxFee,\n depositRevealAheadPeriod\n );\n }\n\n /// @notice Updates parameters of redemptions.\n /// @param redemptionDustThreshold New value of the redemption dust\n /// threshold in satoshis. It is the minimal amount that can be\n /// requested for redemption. Value of this parameter must take into\n /// account the value of `redemptionTreasuryFeeDivisor` and\n /// `redemptionTxMaxFee` parameters in order to make requests that\n /// can incur the treasury and transaction fee and still satisfy the\n /// redeemer.\n /// @param redemptionTreasuryFeeDivisor New value of the redemption\n /// treasury fee divisor. It is the divisor used to compute the\n /// treasury fee taken from each redemption request and transferred\n /// to the treasury upon successful request finalization. That fee is\n /// computed as follows:\n /// `treasuryFee = requestedAmount / redemptionTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each\n /// redemption request, the `redemptionTreasuryFeeDivisor` should\n /// be set to `50` because `1/50 = 0.02 = 2%`.\n /// @param redemptionTxMaxFee New value of the redemption transaction max\n /// fee in satoshis. It is the maximum amount of BTC transaction fee\n /// that can be incurred by each redemption request being part of the\n /// given redemption transaction. If the maximum BTC transaction fee\n /// is exceeded, such transaction is considered a fraud.\n /// This is a per-redemption output max fee for the redemption\n /// transaction.\n /// @param redemptionTxMaxTotalFee New value of the redemption transaction\n /// max total fee in satoshis. It is the maximum amount of the total\n /// BTC transaction fee that is acceptable in a single redemption\n /// transaction. This is a _total_ max fee for the entire redemption\n /// transaction.\n /// @param redemptionTimeout New value of the redemption timeout in seconds.\n /// It is the time after which the redemption request can be reported\n /// as timed out. It is counted from the moment when the redemption\n /// request was created via `requestRedemption` call. Reported timed\n /// out requests are cancelled and locked balance is returned to the\n /// redeemer in full amount.\n /// @param redemptionTimeoutSlashingAmount New value of the redemption\n /// timeout slashing amount in T, it is the amount slashed from each\n /// wallet member for redemption timeout.\n /// @param redemptionTimeoutNotifierRewardMultiplier New value of the\n /// redemption timeout notifier reward multiplier as percentage,\n /// it determines the percentage of the notifier reward from the\n /// staking contact the notifier of a redemption timeout receives.\n /// The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Redemption dust threshold must be greater than moving funds dust\n /// threshold,\n /// - Redemption dust threshold must be greater than the redemption TX\n /// max fee,\n /// - Redemption transaction max fee must be greater than zero,\n /// - Redemption transaction max total fee must be greater than or\n /// equal to the redemption transaction per-request max fee,\n /// - Redemption timeout must be greater than zero,\n /// - Redemption timeout notifier reward multiplier must be in the\n /// range [0, 100].\n function updateRedemptionParameters(\n uint64 redemptionDustThreshold,\n uint64 redemptionTreasuryFeeDivisor,\n uint64 redemptionTxMaxFee,\n uint64 redemptionTxMaxTotalFee,\n uint32 redemptionTimeout,\n uint96 redemptionTimeoutSlashingAmount,\n uint32 redemptionTimeoutNotifierRewardMultiplier\n ) external onlyGovernance {\n self.updateRedemptionParameters(\n redemptionDustThreshold,\n redemptionTreasuryFeeDivisor,\n redemptionTxMaxFee,\n redemptionTxMaxTotalFee,\n redemptionTimeout,\n redemptionTimeoutSlashingAmount,\n redemptionTimeoutNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates parameters of moving funds.\n /// @param movingFundsTxMaxTotalFee New value of the moving funds transaction\n /// max total fee in satoshis. It is the maximum amount of the total\n /// BTC transaction fee that is acceptable in a single moving funds\n /// transaction. This is a _total_ max fee for the entire moving\n /// funds transaction.\n /// @param movingFundsDustThreshold New value of the moving funds dust\n /// threshold. It is the minimal satoshi amount that makes sense to\n /// be transferred during the moving funds process. Moving funds\n /// wallets having their BTC balance below that value can begin\n /// closing immediately as transferring such a low value may not be\n /// possible due to BTC network fees.\n /// @param movingFundsTimeoutResetDelay New value of the moving funds\n /// timeout reset delay in seconds. It is the time after which the\n /// moving funds timeout can be reset in case the target wallet\n /// commitment cannot be submitted due to a lack of live wallets\n /// in the system. It is counted from the moment when the wallet\n /// was requested to move their funds and switched to the MovingFunds\n /// state or from the moment the timeout was reset the last time.\n /// @param movingFundsTimeout New value of the moving funds timeout in\n /// seconds. It is the time after which the moving funds process can\n /// be reported as timed out. It is counted from the moment when the\n /// wallet was requested to move their funds and switched to the\n /// MovingFunds state.\n /// @param movingFundsTimeoutSlashingAmount New value of the moving funds\n /// timeout slashing amount in T, it is the amount slashed from each\n /// wallet member for moving funds timeout.\n /// @param movingFundsTimeoutNotifierRewardMultiplier New value of the\n /// moving funds timeout notifier reward multiplier as percentage,\n /// it determines the percentage of the notifier reward from the\n /// staking contact the notifier of a moving funds timeout receives.\n /// The value must be in the range [0, 100].\n /// @param movingFundsCommitmentGasOffset New value of the gas offset for\n /// moving funds target wallet commitment transaction gas costs\n /// reimbursement.\n /// @param movedFundsSweepTxMaxTotalFee New value of the moved funds sweep\n /// transaction max total fee in satoshis. It is the maximum amount\n /// of the total BTC transaction fee that is acceptable in a single\n /// moved funds sweep transaction. This is a _total_ max fee for the\n /// entire moved funds sweep transaction.\n /// @param movedFundsSweepTimeout New value of the moved funds sweep\n /// timeout in seconds. It is the time after which the moved funds\n /// sweep process can be reported as timed out. It is counted from\n /// the moment when the wallet was requested to sweep the received\n /// funds.\n /// @param movedFundsSweepTimeoutSlashingAmount New value of the moved\n /// funds sweep timeout slashing amount in T, it is the amount\n /// slashed from each wallet member for moved funds sweep timeout.\n /// @param movedFundsSweepTimeoutNotifierRewardMultiplier New value of\n /// the moved funds sweep timeout notifier reward multiplier as\n /// percentage, it determines the percentage of the notifier reward\n /// from the staking contact the notifier of a moved funds sweep\n /// timeout receives. The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Moving funds transaction max total fee must be greater than zero,\n /// - Moving funds dust threshold must be greater than zero and lower\n /// than the redemption dust threshold,\n /// - Moving funds timeout reset delay must be greater than zero,\n /// - Moving funds timeout must be greater than the moving funds\n /// timeout reset delay,\n /// - Moving funds timeout notifier reward multiplier must be in the\n /// range [0, 100],\n /// - Moved funds sweep transaction max total fee must be greater than zero,\n /// - Moved funds sweep timeout must be greater than zero,\n /// - Moved funds sweep timeout notifier reward multiplier must be in the\n /// range [0, 100].\n function updateMovingFundsParameters(\n uint64 movingFundsTxMaxTotalFee,\n uint64 movingFundsDustThreshold,\n uint32 movingFundsTimeoutResetDelay,\n uint32 movingFundsTimeout,\n uint96 movingFundsTimeoutSlashingAmount,\n uint32 movingFundsTimeoutNotifierRewardMultiplier,\n uint16 movingFundsCommitmentGasOffset,\n uint64 movedFundsSweepTxMaxTotalFee,\n uint32 movedFundsSweepTimeout,\n uint96 movedFundsSweepTimeoutSlashingAmount,\n uint32 movedFundsSweepTimeoutNotifierRewardMultiplier\n ) external onlyGovernance {\n self.updateMovingFundsParameters(\n movingFundsTxMaxTotalFee,\n movingFundsDustThreshold,\n movingFundsTimeoutResetDelay,\n movingFundsTimeout,\n movingFundsTimeoutSlashingAmount,\n movingFundsTimeoutNotifierRewardMultiplier,\n movingFundsCommitmentGasOffset,\n movedFundsSweepTxMaxTotalFee,\n movedFundsSweepTimeout,\n movedFundsSweepTimeoutSlashingAmount,\n movedFundsSweepTimeoutNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates parameters of wallets.\n /// @param walletCreationPeriod New value of the wallet creation period in\n /// seconds, determines how frequently a new wallet creation can be\n /// requested.\n /// @param walletCreationMinBtcBalance New value of the wallet minimum BTC\n /// balance in satoshi, used to decide about wallet creation.\n /// @param walletCreationMaxBtcBalance New value of the wallet maximum BTC\n /// balance in satoshi, used to decide about wallet creation.\n /// @param walletClosureMinBtcBalance New value of the wallet minimum BTC\n /// balance in satoshi, used to decide about wallet closure.\n /// @param walletMaxAge New value of the wallet maximum age in seconds,\n /// indicates the maximum age of a wallet in seconds, after which\n /// the wallet moving funds process can be requested.\n /// @param walletMaxBtcTransfer New value of the wallet maximum BTC transfer\n /// in satoshi, determines the maximum amount that can be transferred\n // to a single target wallet during the moving funds process.\n /// @param walletClosingPeriod New value of the wallet closing period in\n /// seconds, determines the length of the wallet closing period,\n // i.e. the period when the wallet remains in the Closing state\n // and can be subject of deposit fraud challenges.\n /// @dev Requirements:\n /// - Wallet maximum BTC balance must be greater than the wallet\n /// minimum BTC balance,\n /// - Wallet maximum BTC transfer must be greater than zero,\n /// - Wallet closing period must be greater than zero.\n function updateWalletParameters(\n uint32 walletCreationPeriod,\n uint64 walletCreationMinBtcBalance,\n uint64 walletCreationMaxBtcBalance,\n uint64 walletClosureMinBtcBalance,\n uint32 walletMaxAge,\n uint64 walletMaxBtcTransfer,\n uint32 walletClosingPeriod\n ) external onlyGovernance {\n self.updateWalletParameters(\n walletCreationPeriod,\n walletCreationMinBtcBalance,\n walletCreationMaxBtcBalance,\n walletClosureMinBtcBalance,\n walletMaxAge,\n walletMaxBtcTransfer,\n walletClosingPeriod\n );\n }\n\n /// @notice Updates parameters related to frauds.\n /// @param fraudChallengeDepositAmount New value of the fraud challenge\n /// deposit amount in wei, it is the amount of ETH the party\n /// challenging the wallet for fraud needs to deposit.\n /// @param fraudChallengeDefeatTimeout New value of the challenge defeat\n /// timeout in seconds, it is the amount of time the wallet has to\n /// defeat a fraud challenge. The value must be greater than zero.\n /// @param fraudSlashingAmount New value of the fraud slashing amount in T,\n /// it is the amount slashed from each wallet member for committing\n /// a fraud.\n /// @param fraudNotifierRewardMultiplier New value of the fraud notifier\n /// reward multiplier as percentage, it determines the percentage of\n /// the notifier reward from the staking contact the notifier of\n /// a fraud receives. The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Fraud challenge defeat timeout must be greater than 0,\n /// - Fraud notifier reward multiplier must be in the range [0, 100].\n function updateFraudParameters(\n uint96 fraudChallengeDepositAmount,\n uint32 fraudChallengeDefeatTimeout,\n uint96 fraudSlashingAmount,\n uint32 fraudNotifierRewardMultiplier\n ) external onlyGovernance {\n self.updateFraudParameters(\n fraudChallengeDepositAmount,\n fraudChallengeDefeatTimeout,\n fraudSlashingAmount,\n fraudNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates treasury address. The treasury receives the system fees.\n /// @param treasury New value of the treasury address.\n /// @dev The treasury address must not be 0x0.\n // slither-disable-next-line shadowing-local\n function updateTreasury(address treasury) external onlyGovernance {\n self.updateTreasury(treasury);\n }\n\n /// @notice Collection of all revealed deposits indexed by\n /// keccak256(fundingTxHash | fundingOutputIndex).\n /// The fundingTxHash is bytes32 (ordered as in Bitcoin internally)\n /// and fundingOutputIndex an uint32. This mapping may contain valid\n /// and invalid deposits and the wallet is responsible for\n /// validating them before attempting to execute a sweep.\n function deposits(uint256 depositKey)\n external\n view\n returns (Deposit.DepositRequest memory)\n {\n return self.deposits[depositKey];\n }\n\n /// @notice Collection of all pending redemption requests indexed by\n /// redemption key built as\n /// `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n /// The walletPubKeyHash is the 20-byte wallet's public key hash\n /// (computed using Bitcoin HASH160 over the compressed ECDSA\n /// public key) and `redeemerOutputScript` is a Bitcoin script\n /// (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC as requested by the redeemer. Requests are added\n /// to this mapping by the `requestRedemption` method (duplicates\n /// not allowed) and are removed by one of the following methods:\n /// - `submitRedemptionProof` in case the request was handled\n /// successfully,\n /// - `notifyRedemptionTimeout` in case the request was reported\n /// to be timed out.\n function pendingRedemptions(uint256 redemptionKey)\n external\n view\n returns (Redemption.RedemptionRequest memory)\n {\n return self.pendingRedemptions[redemptionKey];\n }\n\n /// @notice Collection of all timed out redemptions requests indexed by\n /// redemption key built as\n /// `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n /// The walletPubKeyHash is the 20-byte wallet's public key hash\n /// (computed using Bitcoin HASH160 over the compressed ECDSA\n /// public key) and `redeemerOutputScript` is the Bitcoin script\n /// (P2PKH, P2WPKH, P2SH or P2WSH) that is involved in the timed\n /// out request.\n /// Only one method can add to this mapping:\n /// - `notifyRedemptionTimeout` which puts the redemption key\n /// to this mapping based on a timed out request stored\n /// previously in `pendingRedemptions` mapping.\n /// Only one method can remove entries from this mapping:\n /// - `submitRedemptionProof` in case the timed out redemption\n /// request was a part of the proven transaction.\n function timedOutRedemptions(uint256 redemptionKey)\n external\n view\n returns (Redemption.RedemptionRequest memory)\n {\n return self.timedOutRedemptions[redemptionKey];\n }\n\n /// @notice Collection of main UTXOs that are honestly spent indexed by\n /// keccak256(fundingTxHash | fundingOutputIndex). The fundingTxHash\n /// is bytes32 (ordered as in Bitcoin internally) and\n /// fundingOutputIndex an uint32. A main UTXO is considered honestly\n /// spent if it was used as an input of a transaction that have been\n /// proven in the Bridge.\n function spentMainUTXOs(uint256 utxoKey) external view returns (bool) {\n return self.spentMainUTXOs[utxoKey];\n }\n\n /// @notice Gets details about a registered wallet.\n /// @param walletPubKeyHash The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key).\n /// @return Wallet details.\n function wallets(bytes20 walletPubKeyHash)\n external\n view\n returns (Wallets.Wallet memory)\n {\n return self.registeredWallets[walletPubKeyHash];\n }\n\n /// @notice Gets the public key hash of the active wallet.\n /// @return The 20-byte public key hash (computed using Bitcoin HASH160\n /// over the compressed ECDSA public key) of the active wallet.\n /// Returns bytes20(0) if there is no active wallet at the moment.\n function activeWalletPubKeyHash() external view returns (bytes20) {\n return self.activeWalletPubKeyHash;\n }\n\n /// @notice Gets the live wallets count.\n /// @return The current count of wallets being in the Live state.\n function liveWalletsCount() external view returns (uint32) {\n return self.liveWalletsCount;\n }\n\n /// @notice Returns the fraud challenge identified by the given key built\n /// as keccak256(walletPublicKey|sighash).\n function fraudChallenges(uint256 challengeKey)\n external\n view\n returns (Fraud.FraudChallenge memory)\n {\n return self.fraudChallenges[challengeKey];\n }\n\n /// @notice Collection of all moved funds sweep requests indexed by\n /// `keccak256(movingFundsTxHash | movingFundsOutputIndex)`.\n /// The `movingFundsTxHash` is `bytes32` (ordered as in Bitcoin\n /// internally) and `movingFundsOutputIndex` an `uint32`. Each entry\n /// is actually an UTXO representing the moved funds and is supposed\n /// to be swept with the current main UTXO of the recipient wallet.\n /// @param requestKey Request key built as\n /// `keccak256(movingFundsTxHash | movingFundsOutputIndex)`.\n /// @return Details of the moved funds sweep request.\n function movedFundsSweepRequests(uint256 requestKey)\n external\n view\n returns (MovingFunds.MovedFundsSweepRequest memory)\n {\n return self.movedFundsSweepRequests[requestKey];\n }\n\n /// @notice Indicates if the vault with the given address is trusted or not.\n /// Depositors can route their revealed deposits only to trusted\n /// vaults and have trusted vaults notified about new deposits as\n /// soon as these deposits get swept. Vaults not trusted by the\n /// Bridge can still be used by Bank balance owners on their own\n /// responsibility - anyone can approve their Bank balance to any\n /// address.\n function isVaultTrusted(address vault) external view returns (bool) {\n return self.isVaultTrusted[vault];\n }\n\n /// @notice Returns the current values of Bridge deposit parameters.\n /// @return depositDustThreshold The minimal amount that can be requested\n /// to deposit. Value of this parameter must take into account the\n /// value of `depositTreasuryFeeDivisor` and `depositTxMaxFee`\n /// parameters in order to make requests that can incur the\n /// treasury and transaction fee and still satisfy the depositor.\n /// @return depositTreasuryFeeDivisor Divisor used to compute the treasury\n /// fee taken from each deposit and transferred to the treasury upon\n /// sweep proof submission. That fee is computed as follows:\n /// `treasuryFee = depositedAmount / depositTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each deposit,\n /// the `depositTreasuryFeeDivisor` should be set to `50`\n /// because `1/50 = 0.02 = 2%`.\n /// @return depositTxMaxFee Maximum amount of BTC transaction fee that can\n /// be incurred by each swept deposit being part of the given sweep\n /// transaction. If the maximum BTC transaction fee is exceeded,\n /// such transaction is considered a fraud.\n /// @return depositRevealAheadPeriod Defines the length of the period that\n /// must be preserved between the deposit reveal time and the\n /// deposit refund locktime. For example, if the deposit become\n /// refundable on August 1st, and the ahead period is 7 days, the\n /// latest moment for deposit reveal is July 25th. Value in seconds.\n function depositParameters()\n external\n view\n returns (\n uint64 depositDustThreshold,\n uint64 depositTreasuryFeeDivisor,\n uint64 depositTxMaxFee,\n uint32 depositRevealAheadPeriod\n )\n {\n depositDustThreshold = self.depositDustThreshold;\n depositTreasuryFeeDivisor = self.depositTreasuryFeeDivisor;\n depositTxMaxFee = self.depositTxMaxFee;\n depositRevealAheadPeriod = self.depositRevealAheadPeriod;\n }\n\n /// @notice Returns the current values of Bridge redemption parameters.\n /// @return redemptionDustThreshold The minimal amount that can be requested\n /// for redemption. Value of this parameter must take into account\n /// the value of `redemptionTreasuryFeeDivisor` and `redemptionTxMaxFee`\n /// parameters in order to make requests that can incur the\n /// treasury and transaction fee and still satisfy the redeemer.\n /// @return redemptionTreasuryFeeDivisor Divisor used to compute the treasury\n /// fee taken from each redemption request and transferred to the\n /// treasury upon successful request finalization. That fee is\n /// computed as follows:\n /// `treasuryFee = requestedAmount / redemptionTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each\n /// redemption request, the `redemptionTreasuryFeeDivisor` should\n /// be set to `50` because `1/50 = 0.02 = 2%`.\n /// @return redemptionTxMaxFee Maximum amount of BTC transaction fee that\n /// can be incurred by each redemption request being part of the\n /// given redemption transaction. If the maximum BTC transaction\n /// fee is exceeded, such transaction is considered a fraud.\n /// This is a per-redemption output max fee for the redemption\n /// transaction.\n /// @return redemptionTxMaxTotalFee Maximum amount of the total BTC\n /// transaction fee that is acceptable in a single redemption\n /// transaction. This is a _total_ max fee for the entire redemption\n /// transaction.\n /// @return redemptionTimeout Time after which the redemption request can be\n /// reported as timed out. It is counted from the moment when the\n /// redemption request was created via `requestRedemption` call.\n /// Reported timed out requests are cancelled and locked balance is\n /// returned to the redeemer in full amount.\n /// @return redemptionTimeoutSlashingAmount The amount of stake slashed\n /// from each member of a wallet for a redemption timeout.\n /// @return redemptionTimeoutNotifierRewardMultiplier The percentage of the\n /// notifier reward from the staking contract the notifier of a\n /// redemption timeout receives. The value is in the range [0, 100].\n function redemptionParameters()\n external\n view\n returns (\n uint64 redemptionDustThreshold,\n uint64 redemptionTreasuryFeeDivisor,\n uint64 redemptionTxMaxFee,\n uint64 redemptionTxMaxTotalFee,\n uint32 redemptionTimeout,\n uint96 redemptionTimeoutSlashingAmount,\n uint32 redemptionTimeoutNotifierRewardMultiplier\n )\n {\n redemptionDustThreshold = self.redemptionDustThreshold;\n redemptionTreasuryFeeDivisor = self.redemptionTreasuryFeeDivisor;\n redemptionTxMaxFee = self.redemptionTxMaxFee;\n redemptionTxMaxTotalFee = self.redemptionTxMaxTotalFee;\n redemptionTimeout = self.redemptionTimeout;\n redemptionTimeoutSlashingAmount = self.redemptionTimeoutSlashingAmount;\n redemptionTimeoutNotifierRewardMultiplier = self\n .redemptionTimeoutNotifierRewardMultiplier;\n }\n\n /// @notice Returns the current values of Bridge moving funds between\n /// wallets parameters.\n /// @return movingFundsTxMaxTotalFee Maximum amount of the total BTC\n /// transaction fee that is acceptable in a single moving funds\n /// transaction. This is a _total_ max fee for the entire moving\n /// funds transaction.\n /// @return movingFundsDustThreshold The minimal satoshi amount that makes\n /// sense to be transferred during the moving funds process. Moving\n /// funds wallets having their BTC balance below that value can\n /// begin closing immediately as transferring such a low value may\n /// not be possible due to BTC network fees.\n /// @return movingFundsTimeoutResetDelay Time after which the moving funds\n /// timeout can be reset in case the target wallet commitment\n /// cannot be submitted due to a lack of live wallets in the system.\n /// It is counted from the moment when the wallet was requested to\n /// move their funds and switched to the MovingFunds state or from\n /// the moment the timeout was reset the last time. Value in seconds\n /// This value should be lower than the value of the\n /// `movingFundsTimeout`.\n /// @return movingFundsTimeout Time after which the moving funds process\n /// can be reported as timed out. It is counted from the moment\n /// when the wallet was requested to move their funds and switched\n /// to the MovingFunds state. Value in seconds.\n /// @return movingFundsTimeoutSlashingAmount The amount of stake slashed\n /// from each member of a wallet for a moving funds timeout.\n /// @return movingFundsTimeoutNotifierRewardMultiplier The percentage of the\n /// notifier reward from the staking contract the notifier of a\n /// moving funds timeout receives. The value is in the range [0, 100].\n /// @return movingFundsCommitmentGasOffset The gas offset used for the\n /// moving funds target wallet commitment transaction cost\n /// reimbursement.\n /// @return movedFundsSweepTxMaxTotalFee Maximum amount of the total BTC\n /// transaction fee that is acceptable in a single moved funds\n /// sweep transaction. This is a _total_ max fee for the entire\n /// moved funds sweep transaction.\n /// @return movedFundsSweepTimeout Time after which the moved funds sweep\n /// process can be reported as timed out. It is counted from the\n /// moment when the wallet was requested to sweep the received funds.\n /// Value in seconds.\n /// @return movedFundsSweepTimeoutSlashingAmount The amount of stake slashed\n /// from each member of a wallet for a moved funds sweep timeout.\n /// @return movedFundsSweepTimeoutNotifierRewardMultiplier The percentage\n /// of the notifier reward from the staking contract the notifier\n /// of a moved funds sweep timeout receives. The value is in the\n /// range [0, 100].\n function movingFundsParameters()\n external\n view\n returns (\n uint64 movingFundsTxMaxTotalFee,\n uint64 movingFundsDustThreshold,\n uint32 movingFundsTimeoutResetDelay,\n uint32 movingFundsTimeout,\n uint96 movingFundsTimeoutSlashingAmount,\n uint32 movingFundsTimeoutNotifierRewardMultiplier,\n uint16 movingFundsCommitmentGasOffset,\n uint64 movedFundsSweepTxMaxTotalFee,\n uint32 movedFundsSweepTimeout,\n uint96 movedFundsSweepTimeoutSlashingAmount,\n uint32 movedFundsSweepTimeoutNotifierRewardMultiplier\n )\n {\n movingFundsTxMaxTotalFee = self.movingFundsTxMaxTotalFee;\n movingFundsDustThreshold = self.movingFundsDustThreshold;\n movingFundsTimeoutResetDelay = self.movingFundsTimeoutResetDelay;\n movingFundsTimeout = self.movingFundsTimeout;\n movingFundsTimeoutSlashingAmount = self\n .movingFundsTimeoutSlashingAmount;\n movingFundsTimeoutNotifierRewardMultiplier = self\n .movingFundsTimeoutNotifierRewardMultiplier;\n movingFundsCommitmentGasOffset = self.movingFundsCommitmentGasOffset;\n movedFundsSweepTxMaxTotalFee = self.movedFundsSweepTxMaxTotalFee;\n movedFundsSweepTimeout = self.movedFundsSweepTimeout;\n movedFundsSweepTimeoutSlashingAmount = self\n .movedFundsSweepTimeoutSlashingAmount;\n movedFundsSweepTimeoutNotifierRewardMultiplier = self\n .movedFundsSweepTimeoutNotifierRewardMultiplier;\n }\n\n /// @return walletCreationPeriod Determines how frequently a new wallet\n /// creation can be requested. Value in seconds.\n /// @return walletCreationMinBtcBalance The minimum BTC threshold in satoshi\n /// that is used to decide about wallet creation.\n /// @return walletCreationMaxBtcBalance The maximum BTC threshold in satoshi\n /// that is used to decide about wallet creation.\n /// @return walletClosureMinBtcBalance The minimum BTC threshold in satoshi\n /// that is used to decide about wallet closure.\n /// @return walletMaxAge The maximum age of a wallet in seconds, after which\n /// the wallet moving funds process can be requested.\n /// @return walletMaxBtcTransfer The maximum BTC amount in satoshi than\n /// can be transferred to a single target wallet during the moving\n /// funds process.\n /// @return walletClosingPeriod Determines the length of the wallet closing\n /// period, i.e. the period when the wallet remains in the Closing\n /// state and can be subject of deposit fraud challenges. Value\n /// in seconds.\n function walletParameters()\n external\n view\n returns (\n uint32 walletCreationPeriod,\n uint64 walletCreationMinBtcBalance,\n uint64 walletCreationMaxBtcBalance,\n uint64 walletClosureMinBtcBalance,\n uint32 walletMaxAge,\n uint64 walletMaxBtcTransfer,\n uint32 walletClosingPeriod\n )\n {\n walletCreationPeriod = self.walletCreationPeriod;\n walletCreationMinBtcBalance = self.walletCreationMinBtcBalance;\n walletCreationMaxBtcBalance = self.walletCreationMaxBtcBalance;\n walletClosureMinBtcBalance = self.walletClosureMinBtcBalance;\n walletMaxAge = self.walletMaxAge;\n walletMaxBtcTransfer = self.walletMaxBtcTransfer;\n walletClosingPeriod = self.walletClosingPeriod;\n }\n\n /// @notice Returns the current values of Bridge fraud parameters.\n /// @return fraudChallengeDepositAmount The amount of ETH in wei the party\n /// challenging the wallet for fraud needs to deposit.\n /// @return fraudChallengeDefeatTimeout The amount of time the wallet has to\n /// defeat a fraud challenge.\n /// @return fraudSlashingAmount The amount slashed from each wallet member\n /// for committing a fraud.\n /// @return fraudNotifierRewardMultiplier The percentage of the notifier\n /// reward from the staking contract the notifier of a fraud\n /// receives. The value is in the range [0, 100].\n function fraudParameters()\n external\n view\n returns (\n uint96 fraudChallengeDepositAmount,\n uint32 fraudChallengeDefeatTimeout,\n uint96 fraudSlashingAmount,\n uint32 fraudNotifierRewardMultiplier\n )\n {\n fraudChallengeDepositAmount = self.fraudChallengeDepositAmount;\n fraudChallengeDefeatTimeout = self.fraudChallengeDefeatTimeout;\n fraudSlashingAmount = self.fraudSlashingAmount;\n fraudNotifierRewardMultiplier = self.fraudNotifierRewardMultiplier;\n }\n\n /// @notice Returns the addresses of contracts Bridge is interacting with.\n /// @return bank Address of the Bank the Bridge belongs to.\n /// @return relay Address of the Bitcoin relay providing the current Bitcoin\n /// network difficulty.\n /// @return ecdsaWalletRegistry Address of the ECDSA Wallet Registry.\n /// @return reimbursementPool Address of the Reimbursement Pool.\n function contractReferences()\n external\n view\n returns (\n Bank bank,\n IRelay relay,\n EcdsaWalletRegistry ecdsaWalletRegistry,\n ReimbursementPool reimbursementPool\n )\n {\n bank = self.bank;\n relay = self.relay;\n ecdsaWalletRegistry = self.ecdsaWalletRegistry;\n reimbursementPool = self.reimbursementPool;\n }\n\n /// @notice Address where the deposit treasury fees will be sent to.\n /// Treasury takes part in the operators rewarding process.\n function treasury() external view returns (address) {\n return self.treasury;\n }\n\n /// @notice The number of confirmations on the Bitcoin chain required to\n /// successfully evaluate an SPV proof.\n function txProofDifficultyFactor() external view returns (uint256) {\n return self.txProofDifficultyFactor;\n }\n}\n" + }, + "contracts/bridge/BridgeState.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {IWalletRegistry as EcdsaWalletRegistry} from \"@keep-network/ecdsa/contracts/api/IWalletRegistry.sol\";\nimport \"@keep-network/random-beacon/contracts/ReimbursementPool.sol\";\n\nimport \"./IRelay.sol\";\nimport \"./Deposit.sol\";\nimport \"./Redemption.sol\";\nimport \"./Fraud.sol\";\nimport \"./Wallets.sol\";\nimport \"./MovingFunds.sol\";\n\nimport \"../bank/Bank.sol\";\n\nlibrary BridgeState {\n struct Storage {\n // Address of the Bank the Bridge belongs to.\n Bank bank;\n // Bitcoin relay providing the current Bitcoin network difficulty.\n IRelay relay;\n // The number of confirmations on the Bitcoin chain required to\n // successfully evaluate an SPV proof.\n uint96 txProofDifficultyFactor;\n // ECDSA Wallet Registry contract handle.\n EcdsaWalletRegistry ecdsaWalletRegistry;\n // Reimbursement Pool contract handle.\n ReimbursementPool reimbursementPool;\n // Address where the deposit and redemption treasury fees will be sent\n // to. Treasury takes part in the operators rewarding process.\n address treasury;\n // Move depositDustThreshold to the next storage slot for a more\n // efficient variable layout in the storage.\n // slither-disable-next-line unused-state\n bytes32 __treasuryAlignmentGap;\n // The minimal amount that can be requested to deposit.\n // Value of this parameter must take into account the value of\n // `depositTreasuryFeeDivisor` and `depositTxMaxFee` parameters in order\n // to make requests that can incur the treasury and transaction fee and\n // still satisfy the depositor.\n uint64 depositDustThreshold;\n // Divisor used to compute the treasury fee taken from each deposit and\n // transferred to the treasury upon sweep proof submission. That fee is\n // computed as follows:\n // `treasuryFee = depositedAmount / depositTreasuryFeeDivisor`\n // For example, if the treasury fee needs to be 2% of each deposit,\n // the `depositTreasuryFeeDivisor` should be set to `50` because\n // `1/50 = 0.02 = 2%`.\n uint64 depositTreasuryFeeDivisor;\n // Maximum amount of BTC transaction fee that can be incurred by each\n // swept deposit being part of the given sweep transaction. If the\n // maximum BTC transaction fee is exceeded, such transaction is\n // considered a fraud.\n //\n // This is a per-deposit input max fee for the sweep transaction.\n uint64 depositTxMaxFee;\n // Defines the length of the period that must be preserved between\n // the deposit reveal time and the deposit refund locktime. For example,\n // if the deposit become refundable on August 1st, and the ahead period\n // is 7 days, the latest moment for deposit reveal is July 25th.\n // Value in seconds. The value equal to zero disables the validation\n // of this parameter.\n uint32 depositRevealAheadPeriod;\n // Move movingFundsTxMaxTotalFee to the next storage slot for a more\n // efficient variable layout in the storage.\n // slither-disable-next-line unused-state\n bytes32 __depositAlignmentGap;\n // Maximum amount of the total BTC transaction fee that is acceptable in\n // a single moving funds transaction.\n //\n // This is a TOTAL max fee for the moving funds transaction. Note\n // that `depositTxMaxFee` is per single deposit and `redemptionTxMaxFee`\n // is per single redemption. `movingFundsTxMaxTotalFee` is a total\n // fee for the entire transaction.\n uint64 movingFundsTxMaxTotalFee;\n // The minimal satoshi amount that makes sense to be transferred during\n // the moving funds process. Moving funds wallets having their BTC\n // balance below that value can begin closing immediately as\n // transferring such a low value may not be possible due to\n // BTC network fees. The value of this parameter must always be lower\n // than `redemptionDustThreshold` in order to prevent redemption requests\n // with values lower or equal to `movingFundsDustThreshold`.\n uint64 movingFundsDustThreshold;\n // Time after which the moving funds timeout can be reset in case the\n // target wallet commitment cannot be submitted due to a lack of live\n // wallets in the system. It is counted from the moment when the wallet\n // was requested to move their funds and switched to the MovingFunds\n // state or from the moment the timeout was reset the last time.\n // Value in seconds. This value should be lower than the value\n // of the `movingFundsTimeout`.\n uint32 movingFundsTimeoutResetDelay;\n // Time after which the moving funds process can be reported as\n // timed out. It is counted from the moment when the wallet\n // was requested to move their funds and switched to the MovingFunds\n // state. Value in seconds.\n uint32 movingFundsTimeout;\n // The amount of stake slashed from each member of a wallet for a moving\n // funds timeout.\n uint96 movingFundsTimeoutSlashingAmount;\n // The percentage of the notifier reward from the staking contract\n // the notifier of a moving funds timeout receives. The value is in the\n // range [0, 100].\n uint32 movingFundsTimeoutNotifierRewardMultiplier;\n // The gas offset used for the target wallet commitment transaction cost\n // reimbursement.\n uint16 movingFundsCommitmentGasOffset;\n // Move movedFundsSweepTxMaxTotalFee to the next storage slot for a more\n // efficient variable layout in the storage.\n // slither-disable-next-line unused-state\n bytes32 __movingFundsAlignmentGap;\n // Maximum amount of the total BTC transaction fee that is acceptable in\n // a single moved funds sweep transaction.\n //\n // This is a TOTAL max fee for the moved funds sweep transaction. Note\n // that `depositTxMaxFee` is per single deposit and `redemptionTxMaxFee`\n // is per single redemption. `movedFundsSweepTxMaxTotalFee` is a total\n // fee for the entire transaction.\n uint64 movedFundsSweepTxMaxTotalFee;\n // Time after which the moved funds sweep process can be reported as\n // timed out. It is counted from the moment when the recipient wallet\n // was requested to sweep the received funds. Value in seconds.\n uint32 movedFundsSweepTimeout;\n // The amount of stake slashed from each member of a wallet for a moved\n // funds sweep timeout.\n uint96 movedFundsSweepTimeoutSlashingAmount;\n // The percentage of the notifier reward from the staking contract\n // the notifier of a moved funds sweep timeout receives. The value is\n // in the range [0, 100].\n uint32 movedFundsSweepTimeoutNotifierRewardMultiplier;\n // The minimal amount that can be requested for redemption.\n // Value of this parameter must take into account the value of\n // `redemptionTreasuryFeeDivisor` and `redemptionTxMaxFee`\n // parameters in order to make requests that can incur the\n // treasury and transaction fee and still satisfy the redeemer.\n // Additionally, the value of this parameter must always be greater\n // than `movingFundsDustThreshold` in order to prevent redemption\n // requests with values lower or equal to `movingFundsDustThreshold`.\n uint64 redemptionDustThreshold;\n // Divisor used to compute the treasury fee taken from each\n // redemption request and transferred to the treasury upon\n // successful request finalization. That fee is computed as follows:\n // `treasuryFee = requestedAmount / redemptionTreasuryFeeDivisor`\n // For example, if the treasury fee needs to be 2% of each\n // redemption request, the `redemptionTreasuryFeeDivisor` should\n // be set to `50` because `1/50 = 0.02 = 2%`.\n uint64 redemptionTreasuryFeeDivisor;\n // Maximum amount of BTC transaction fee that can be incurred by\n // each redemption request being part of the given redemption\n // transaction. If the maximum BTC transaction fee is exceeded, such\n // transaction is considered a fraud.\n //\n // This is a per-redemption output max fee for the redemption\n // transaction.\n uint64 redemptionTxMaxFee;\n // Maximum amount of the total BTC transaction fee that is acceptable in\n // a single redemption transaction.\n //\n // This is a TOTAL max fee for the redemption transaction. Note\n // that the `redemptionTxMaxFee` is per single redemption.\n // `redemptionTxMaxTotalFee` is a total fee for the entire transaction.\n uint64 redemptionTxMaxTotalFee;\n // Move redemptionTimeout to the next storage slot for a more efficient\n // variable layout in the storage.\n // slither-disable-next-line unused-state\n bytes32 __redemptionAlignmentGap;\n // Time after which the redemption request can be reported as\n // timed out. It is counted from the moment when the redemption\n // request was created via `requestRedemption` call. Reported\n // timed out requests are cancelled and locked TBTC is returned\n // to the redeemer in full amount.\n uint32 redemptionTimeout;\n // The amount of stake slashed from each member of a wallet for a\n // redemption timeout.\n uint96 redemptionTimeoutSlashingAmount;\n // The percentage of the notifier reward from the staking contract\n // the notifier of a redemption timeout receives. The value is in the\n // range [0, 100].\n uint32 redemptionTimeoutNotifierRewardMultiplier;\n // The amount of ETH in wei the party challenging the wallet for fraud\n // needs to deposit.\n uint96 fraudChallengeDepositAmount;\n // The amount of time the wallet has to defeat a fraud challenge.\n uint32 fraudChallengeDefeatTimeout;\n // The amount of stake slashed from each member of a wallet for a fraud.\n uint96 fraudSlashingAmount;\n // The percentage of the notifier reward from the staking contract\n // the notifier of a fraud receives. The value is in the range [0, 100].\n uint32 fraudNotifierRewardMultiplier;\n // Determines how frequently a new wallet creation can be requested.\n // Value in seconds.\n uint32 walletCreationPeriod;\n // The minimum BTC threshold in satoshi that is used to decide about\n // wallet creation. Specifically, we allow for the creation of a new\n // wallet if the active wallet is old enough and their amount of BTC\n // is greater than or equal this threshold.\n uint64 walletCreationMinBtcBalance;\n // The maximum BTC threshold in satoshi that is used to decide about\n // wallet creation. Specifically, we allow for the creation of a new\n // wallet if the active wallet's amount of BTC is greater than or equal\n // this threshold, regardless of the active wallet's age.\n uint64 walletCreationMaxBtcBalance;\n // The minimum BTC threshold in satoshi that is used to decide about\n // wallet closing. Specifically, we allow for the closure of the given\n // wallet if their amount of BTC is lesser than this threshold,\n // regardless of the wallet's age.\n uint64 walletClosureMinBtcBalance;\n // The maximum age of a wallet in seconds, after which the wallet\n // moving funds process can be requested.\n uint32 walletMaxAge;\n // 20-byte wallet public key hash being reference to the currently\n // active wallet. Can be unset to the zero value under certain\n // circumstances.\n bytes20 activeWalletPubKeyHash;\n // The current number of wallets in the Live state.\n uint32 liveWalletsCount;\n // The maximum BTC amount in satoshi than can be transferred to a single\n // target wallet during the moving funds process.\n uint64 walletMaxBtcTransfer;\n // Determines the length of the wallet closing period, i.e. the period\n // when the wallet remains in the Closing state and can be subject\n // of deposit fraud challenges. This value is in seconds and should be\n // greater than the deposit refund time plus some time margin.\n uint32 walletClosingPeriod;\n // Collection of all revealed deposits indexed by\n // `keccak256(fundingTxHash | fundingOutputIndex)`.\n // The `fundingTxHash` is `bytes32` (ordered as in Bitcoin internally)\n // and `fundingOutputIndex` an `uint32`. This mapping may contain valid\n // and invalid deposits and the wallet is responsible for validating\n // them before attempting to execute a sweep.\n mapping(uint256 => Deposit.DepositRequest) deposits;\n // Indicates if the vault with the given address is trusted.\n // Depositors can route their revealed deposits only to trusted vaults\n // and have trusted vaults notified about new deposits as soon as these\n // deposits get swept. Vaults not trusted by the Bridge can still be\n // used by Bank balance owners on their own responsibility - anyone can\n // approve their Bank balance to any address.\n mapping(address => bool) isVaultTrusted;\n // Indicates if the address is a trusted SPV maintainer.\n // The SPV proof does not check whether the transaction is a part of the\n // Bitcoin mainnet, it only checks whether the transaction has been\n // mined performing the required amount of work as on Bitcoin mainnet.\n // The possibility of submitting SPV proofs is limited to trusted SPV\n // maintainers. The system expects transaction confirmations with the\n // required work accumulated, so trusted SPV maintainers can not prove\n // the transaction without providing the required Bitcoin proof of work.\n // Trusted maintainers address the issue of an economic game between\n // tBTC and Bitcoin mainnet where large Bitcoin mining pools can decide\n // to use their hash power to mine fake Bitcoin blocks to prove them in\n // tBTC instead of receiving Bitcoin miner rewards.\n mapping(address => bool) isSpvMaintainer;\n // Collection of all moved funds sweep requests indexed by\n // `keccak256(movingFundsTxHash | movingFundsOutputIndex)`.\n // The `movingFundsTxHash` is `bytes32` (ordered as in Bitcoin\n // internally) and `movingFundsOutputIndex` an `uint32`. Each entry\n // is actually an UTXO representing the moved funds and is supposed\n // to be swept with the current main UTXO of the recipient wallet.\n mapping(uint256 => MovingFunds.MovedFundsSweepRequest) movedFundsSweepRequests;\n // Collection of all pending redemption requests indexed by\n // redemption key built as\n // `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n // The `walletPubKeyHash` is the 20-byte wallet's public key hash\n // (computed using Bitcoin HASH160 over the compressed ECDSA\n // public key) and `redeemerOutputScript` is a Bitcoin script\n // (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n // redeemed BTC as requested by the redeemer. Requests are added\n // to this mapping by the `requestRedemption` method (duplicates\n // not allowed) and are removed by one of the following methods:\n // - `submitRedemptionProof` in case the request was handled\n // successfully,\n // - `notifyRedemptionTimeout` in case the request was reported\n // to be timed out.\n mapping(uint256 => Redemption.RedemptionRequest) pendingRedemptions;\n // Collection of all timed out redemptions requests indexed by\n // redemption key built as\n // `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n // The `walletPubKeyHash` is the 20-byte wallet's public key hash\n // (computed using Bitcoin HASH160 over the compressed ECDSA\n // public key) and `redeemerOutputScript` is the Bitcoin script\n // (P2PKH, P2WPKH, P2SH or P2WSH) that is involved in the timed\n // out request.\n // Only one method can add to this mapping:\n // - `notifyRedemptionTimeout` which puts the redemption key to this\n // mapping based on a timed out request stored previously in\n // `pendingRedemptions` mapping.\n // Only one method can remove entries from this mapping:\n // - `submitRedemptionProof` in case the timed out redemption request\n // was a part of the proven transaction.\n mapping(uint256 => Redemption.RedemptionRequest) timedOutRedemptions;\n // Collection of all submitted fraud challenges indexed by challenge\n // key built as `keccak256(walletPublicKey|sighash)`.\n mapping(uint256 => Fraud.FraudChallenge) fraudChallenges;\n // Collection of main UTXOs that are honestly spent indexed by\n // `keccak256(fundingTxHash | fundingOutputIndex)`. The `fundingTxHash`\n // is `bytes32` (ordered as in Bitcoin internally) and\n // `fundingOutputIndex` an `uint32`. A main UTXO is considered honestly\n // spent if it was used as an input of a transaction that have been\n // proven in the Bridge.\n mapping(uint256 => bool) spentMainUTXOs;\n // Maps the 20-byte wallet public key hash (computed using Bitcoin\n // HASH160 over the compressed ECDSA public key) to the basic wallet\n // information like state and pending redemptions value.\n mapping(bytes20 => Wallets.Wallet) registeredWallets;\n // Reserved storage space in case we need to add more variables.\n // The convention from OpenZeppelin suggests the storage space should\n // add up to 50 slots. Here we want to have more slots as there are\n // planned upgrades of the Bridge contract. If more entires are added to\n // the struct in the upcoming versions we need to reduce the array size.\n // See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n // slither-disable-next-line unused-state\n uint256[50] __gap;\n }\n\n event DepositParametersUpdated(\n uint64 depositDustThreshold,\n uint64 depositTreasuryFeeDivisor,\n uint64 depositTxMaxFee,\n uint32 depositRevealAheadPeriod\n );\n\n event RedemptionParametersUpdated(\n uint64 redemptionDustThreshold,\n uint64 redemptionTreasuryFeeDivisor,\n uint64 redemptionTxMaxFee,\n uint64 redemptionTxMaxTotalFee,\n uint32 redemptionTimeout,\n uint96 redemptionTimeoutSlashingAmount,\n uint32 redemptionTimeoutNotifierRewardMultiplier\n );\n\n event MovingFundsParametersUpdated(\n uint64 movingFundsTxMaxTotalFee,\n uint64 movingFundsDustThreshold,\n uint32 movingFundsTimeoutResetDelay,\n uint32 movingFundsTimeout,\n uint96 movingFundsTimeoutSlashingAmount,\n uint32 movingFundsTimeoutNotifierRewardMultiplier,\n uint16 movingFundsCommitmentGasOffset,\n uint64 movedFundsSweepTxMaxTotalFee,\n uint32 movedFundsSweepTimeout,\n uint96 movedFundsSweepTimeoutSlashingAmount,\n uint32 movedFundsSweepTimeoutNotifierRewardMultiplier\n );\n\n event WalletParametersUpdated(\n uint32 walletCreationPeriod,\n uint64 walletCreationMinBtcBalance,\n uint64 walletCreationMaxBtcBalance,\n uint64 walletClosureMinBtcBalance,\n uint32 walletMaxAge,\n uint64 walletMaxBtcTransfer,\n uint32 walletClosingPeriod\n );\n\n event FraudParametersUpdated(\n uint96 fraudChallengeDepositAmount,\n uint32 fraudChallengeDefeatTimeout,\n uint96 fraudSlashingAmount,\n uint32 fraudNotifierRewardMultiplier\n );\n\n event TreasuryUpdated(address treasury);\n\n /// @notice Updates parameters of deposits.\n /// @param _depositDustThreshold New value of the deposit dust threshold in\n /// satoshis. It is the minimal amount that can be requested to\n //// deposit. Value of this parameter must take into account the value\n /// of `depositTreasuryFeeDivisor` and `depositTxMaxFee` parameters\n /// in order to make requests that can incur the treasury and\n /// transaction fee and still satisfy the depositor.\n /// @param _depositTreasuryFeeDivisor New value of the treasury fee divisor.\n /// It is the divisor used to compute the treasury fee taken from\n /// each deposit and transferred to the treasury upon sweep proof\n /// submission. That fee is computed as follows:\n /// `treasuryFee = depositedAmount / depositTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each deposit,\n /// the `depositTreasuryFeeDivisor` should be set to `50`\n /// because `1/50 = 0.02 = 2%`.\n /// @param _depositTxMaxFee New value of the deposit tx max fee in satoshis.\n /// It is the maximum amount of BTC transaction fee that can\n /// be incurred by each swept deposit being part of the given sweep\n /// transaction. If the maximum BTC transaction fee is exceeded,\n /// such transaction is considered a fraud.\n /// @param _depositRevealAheadPeriod New value of the deposit reveal ahead\n /// period parameter in seconds. It defines the length of the period\n /// that must be preserved between the deposit reveal time and the\n /// deposit refund locktime.\n /// @dev Requirements:\n /// - Deposit dust threshold must be greater than zero,\n /// - Deposit dust threshold must be greater than deposit TX max fee,\n /// - Deposit transaction max fee must be greater than zero.\n function updateDepositParameters(\n Storage storage self,\n uint64 _depositDustThreshold,\n uint64 _depositTreasuryFeeDivisor,\n uint64 _depositTxMaxFee,\n uint32 _depositRevealAheadPeriod\n ) internal {\n require(\n _depositDustThreshold > 0,\n \"Deposit dust threshold must be greater than zero\"\n );\n\n require(\n _depositDustThreshold > _depositTxMaxFee,\n \"Deposit dust threshold must be greater than deposit TX max fee\"\n );\n\n require(\n _depositTxMaxFee > 0,\n \"Deposit transaction max fee must be greater than zero\"\n );\n\n self.depositDustThreshold = _depositDustThreshold;\n self.depositTreasuryFeeDivisor = _depositTreasuryFeeDivisor;\n self.depositTxMaxFee = _depositTxMaxFee;\n self.depositRevealAheadPeriod = _depositRevealAheadPeriod;\n\n emit DepositParametersUpdated(\n _depositDustThreshold,\n _depositTreasuryFeeDivisor,\n _depositTxMaxFee,\n _depositRevealAheadPeriod\n );\n }\n\n /// @notice Updates parameters of redemptions.\n /// @param _redemptionDustThreshold New value of the redemption dust\n /// threshold in satoshis. It is the minimal amount that can be\n /// requested for redemption. Value of this parameter must take into\n /// account the value of `redemptionTreasuryFeeDivisor` and\n /// `redemptionTxMaxFee` parameters in order to make requests that\n /// can incur the treasury and transaction fee and still satisfy the\n /// redeemer.\n /// @param _redemptionTreasuryFeeDivisor New value of the redemption\n /// treasury fee divisor. It is the divisor used to compute the\n /// treasury fee taken from each redemption request and transferred\n /// to the treasury upon successful request finalization. That fee is\n /// computed as follows:\n /// `treasuryFee = requestedAmount / redemptionTreasuryFeeDivisor`\n /// For example, if the treasury fee needs to be 2% of each\n /// redemption request, the `redemptionTreasuryFeeDivisor` should\n /// be set to `50` because `1/50 = 0.02 = 2%`.\n /// @param _redemptionTxMaxFee New value of the redemption transaction max\n /// fee in satoshis. It is the maximum amount of BTC transaction fee\n /// that can be incurred by each redemption request being part of the\n /// given redemption transaction. If the maximum BTC transaction fee\n /// is exceeded, such transaction is considered a fraud.\n /// This is a per-redemption output max fee for the redemption\n /// transaction.\n /// @param _redemptionTxMaxTotalFee New value of the redemption transaction\n /// max total fee in satoshis. It is the maximum amount of the total\n /// BTC transaction fee that is acceptable in a single redemption\n /// transaction. This is a _total_ max fee for the entire redemption\n /// transaction.\n /// @param _redemptionTimeout New value of the redemption timeout in seconds.\n /// It is the time after which the redemption request can be reported\n /// as timed out. It is counted from the moment when the redemption\n /// request was created via `requestRedemption` call. Reported timed\n /// out requests are cancelled and locked TBTC is returned to the\n /// redeemer in full amount.\n /// @param _redemptionTimeoutSlashingAmount New value of the redemption\n /// timeout slashing amount in T, it is the amount slashed from each\n /// wallet member for redemption timeout.\n /// @param _redemptionTimeoutNotifierRewardMultiplier New value of the\n /// redemption timeout notifier reward multiplier as percentage,\n /// it determines the percentage of the notifier reward from the\n /// staking contact the notifier of a redemption timeout receives.\n /// The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Redemption dust threshold must be greater than moving funds dust\n /// threshold,\n /// - Redemption dust threshold must be greater than the redemption TX\n /// max fee,\n /// - Redemption transaction max fee must be greater than zero,\n /// - Redemption transaction max total fee must be greater than or\n /// equal to the redemption transaction per-request max fee,\n /// - Redemption timeout must be greater than zero,\n /// - Redemption timeout notifier reward multiplier must be in the\n /// range [0, 100].\n function updateRedemptionParameters(\n Storage storage self,\n uint64 _redemptionDustThreshold,\n uint64 _redemptionTreasuryFeeDivisor,\n uint64 _redemptionTxMaxFee,\n uint64 _redemptionTxMaxTotalFee,\n uint32 _redemptionTimeout,\n uint96 _redemptionTimeoutSlashingAmount,\n uint32 _redemptionTimeoutNotifierRewardMultiplier\n ) internal {\n require(\n _redemptionDustThreshold > self.movingFundsDustThreshold,\n \"Redemption dust threshold must be greater than moving funds dust threshold\"\n );\n\n require(\n _redemptionDustThreshold > _redemptionTxMaxFee,\n \"Redemption dust threshold must be greater than redemption TX max fee\"\n );\n\n require(\n _redemptionTxMaxFee > 0,\n \"Redemption transaction max fee must be greater than zero\"\n );\n\n require(\n _redemptionTxMaxTotalFee >= _redemptionTxMaxFee,\n \"Redemption transaction max total fee must be greater than or equal to the redemption transaction per-request max fee\"\n );\n\n require(\n _redemptionTimeout > 0,\n \"Redemption timeout must be greater than zero\"\n );\n\n require(\n _redemptionTimeoutNotifierRewardMultiplier <= 100,\n \"Redemption timeout notifier reward multiplier must be in the range [0, 100]\"\n );\n\n self.redemptionDustThreshold = _redemptionDustThreshold;\n self.redemptionTreasuryFeeDivisor = _redemptionTreasuryFeeDivisor;\n self.redemptionTxMaxFee = _redemptionTxMaxFee;\n self.redemptionTxMaxTotalFee = _redemptionTxMaxTotalFee;\n self.redemptionTimeout = _redemptionTimeout;\n self.redemptionTimeoutSlashingAmount = _redemptionTimeoutSlashingAmount;\n self\n .redemptionTimeoutNotifierRewardMultiplier = _redemptionTimeoutNotifierRewardMultiplier;\n\n emit RedemptionParametersUpdated(\n _redemptionDustThreshold,\n _redemptionTreasuryFeeDivisor,\n _redemptionTxMaxFee,\n _redemptionTxMaxTotalFee,\n _redemptionTimeout,\n _redemptionTimeoutSlashingAmount,\n _redemptionTimeoutNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates parameters of moving funds.\n /// @param _movingFundsTxMaxTotalFee New value of the moving funds transaction\n /// max total fee in satoshis. It is the maximum amount of the total\n /// BTC transaction fee that is acceptable in a single moving funds\n /// transaction. This is a _total_ max fee for the entire moving\n /// funds transaction.\n /// @param _movingFundsDustThreshold New value of the moving funds dust\n /// threshold. It is the minimal satoshi amount that makes sense to\n /// be transferred during the moving funds process. Moving funds\n /// wallets having their BTC balance below that value can begin\n /// closing immediately as transferring such a low value may not be\n /// possible due to BTC network fees.\n /// @param _movingFundsTimeoutResetDelay New value of the moving funds\n /// timeout reset delay in seconds. It is the time after which the\n /// moving funds timeout can be reset in case the target wallet\n /// commitment cannot be submitted due to a lack of live wallets\n /// in the system. It is counted from the moment when the wallet\n /// was requested to move their funds and switched to the MovingFunds\n /// state or from the moment the timeout was reset the last time.\n /// @param _movingFundsTimeout New value of the moving funds timeout in\n /// seconds. It is the time after which the moving funds process can\n /// be reported as timed out. It is counted from the moment when the\n /// wallet was requested to move their funds and switched to the\n /// MovingFunds state.\n /// @param _movingFundsTimeoutSlashingAmount New value of the moving funds\n /// timeout slashing amount in T, it is the amount slashed from each\n /// wallet member for moving funds timeout.\n /// @param _movingFundsTimeoutNotifierRewardMultiplier New value of the\n /// moving funds timeout notifier reward multiplier as percentage,\n /// it determines the percentage of the notifier reward from the\n /// staking contact the notifier of a moving funds timeout receives.\n /// The value must be in the range [0, 100].\n /// @param _movingFundsCommitmentGasOffset New value of the gas offset for\n /// moving funds target wallet commitment transaction gas costs\n /// reimbursement.\n /// @param _movedFundsSweepTxMaxTotalFee New value of the moved funds sweep\n /// transaction max total fee in satoshis. It is the maximum amount\n /// of the total BTC transaction fee that is acceptable in a single\n /// moved funds sweep transaction. This is a _total_ max fee for the\n /// entire moved funds sweep transaction.\n /// @param _movedFundsSweepTimeout New value of the moved funds sweep\n /// timeout in seconds. It is the time after which the moved funds\n /// sweep process can be reported as timed out. It is counted from\n /// the moment when the wallet was requested to sweep the received\n /// funds.\n /// @param _movedFundsSweepTimeoutSlashingAmount New value of the moved\n /// funds sweep timeout slashing amount in T, it is the amount\n /// slashed from each wallet member for moved funds sweep timeout.\n /// @param _movedFundsSweepTimeoutNotifierRewardMultiplier New value of\n /// the moved funds sweep timeout notifier reward multiplier as\n /// percentage, it determines the percentage of the notifier reward\n /// from the staking contact the notifier of a moved funds sweep\n /// timeout receives. The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Moving funds transaction max total fee must be greater than zero,\n /// - Moving funds dust threshold must be greater than zero and lower\n /// than the redemption dust threshold,\n /// - Moving funds timeout reset delay must be greater than zero,\n /// - Moving funds timeout must be greater than the moving funds\n /// timeout reset delay,\n /// - Moving funds timeout notifier reward multiplier must be in the\n /// range [0, 100],\n /// - Moved funds sweep transaction max total fee must be greater than zero,\n /// - Moved funds sweep timeout must be greater than zero,\n /// - Moved funds sweep timeout notifier reward multiplier must be in the\n /// range [0, 100].\n function updateMovingFundsParameters(\n Storage storage self,\n uint64 _movingFundsTxMaxTotalFee,\n uint64 _movingFundsDustThreshold,\n uint32 _movingFundsTimeoutResetDelay,\n uint32 _movingFundsTimeout,\n uint96 _movingFundsTimeoutSlashingAmount,\n uint32 _movingFundsTimeoutNotifierRewardMultiplier,\n uint16 _movingFundsCommitmentGasOffset,\n uint64 _movedFundsSweepTxMaxTotalFee,\n uint32 _movedFundsSweepTimeout,\n uint96 _movedFundsSweepTimeoutSlashingAmount,\n uint32 _movedFundsSweepTimeoutNotifierRewardMultiplier\n ) internal {\n require(\n _movingFundsTxMaxTotalFee > 0,\n \"Moving funds transaction max total fee must be greater than zero\"\n );\n\n require(\n _movingFundsDustThreshold > 0 &&\n _movingFundsDustThreshold < self.redemptionDustThreshold,\n \"Moving funds dust threshold must be greater than zero and lower than redemption dust threshold\"\n );\n\n require(\n _movingFundsTimeoutResetDelay > 0,\n \"Moving funds timeout reset delay must be greater than zero\"\n );\n\n require(\n _movingFundsTimeout > _movingFundsTimeoutResetDelay,\n \"Moving funds timeout must be greater than its reset delay\"\n );\n\n require(\n _movingFundsTimeoutNotifierRewardMultiplier <= 100,\n \"Moving funds timeout notifier reward multiplier must be in the range [0, 100]\"\n );\n\n require(\n _movedFundsSweepTxMaxTotalFee > 0,\n \"Moved funds sweep transaction max total fee must be greater than zero\"\n );\n\n require(\n _movedFundsSweepTimeout > 0,\n \"Moved funds sweep timeout must be greater than zero\"\n );\n\n require(\n _movedFundsSweepTimeoutNotifierRewardMultiplier <= 100,\n \"Moved funds sweep timeout notifier reward multiplier must be in the range [0, 100]\"\n );\n\n self.movingFundsTxMaxTotalFee = _movingFundsTxMaxTotalFee;\n self.movingFundsDustThreshold = _movingFundsDustThreshold;\n self.movingFundsTimeoutResetDelay = _movingFundsTimeoutResetDelay;\n self.movingFundsTimeout = _movingFundsTimeout;\n self\n .movingFundsTimeoutSlashingAmount = _movingFundsTimeoutSlashingAmount;\n self\n .movingFundsTimeoutNotifierRewardMultiplier = _movingFundsTimeoutNotifierRewardMultiplier;\n self.movingFundsCommitmentGasOffset = _movingFundsCommitmentGasOffset;\n self.movedFundsSweepTxMaxTotalFee = _movedFundsSweepTxMaxTotalFee;\n self.movedFundsSweepTimeout = _movedFundsSweepTimeout;\n self\n .movedFundsSweepTimeoutSlashingAmount = _movedFundsSweepTimeoutSlashingAmount;\n self\n .movedFundsSweepTimeoutNotifierRewardMultiplier = _movedFundsSweepTimeoutNotifierRewardMultiplier;\n\n emit MovingFundsParametersUpdated(\n _movingFundsTxMaxTotalFee,\n _movingFundsDustThreshold,\n _movingFundsTimeoutResetDelay,\n _movingFundsTimeout,\n _movingFundsTimeoutSlashingAmount,\n _movingFundsTimeoutNotifierRewardMultiplier,\n _movingFundsCommitmentGasOffset,\n _movedFundsSweepTxMaxTotalFee,\n _movedFundsSweepTimeout,\n _movedFundsSweepTimeoutSlashingAmount,\n _movedFundsSweepTimeoutNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates parameters of wallets.\n /// @param _walletCreationPeriod New value of the wallet creation period in\n /// seconds, determines how frequently a new wallet creation can be\n /// requested.\n /// @param _walletCreationMinBtcBalance New value of the wallet minimum BTC\n /// balance in satoshi, used to decide about wallet creation.\n /// @param _walletCreationMaxBtcBalance New value of the wallet maximum BTC\n /// balance in satoshi, used to decide about wallet creation.\n /// @param _walletClosureMinBtcBalance New value of the wallet minimum BTC\n /// balance in satoshi, used to decide about wallet closure.\n /// @param _walletMaxAge New value of the wallet maximum age in seconds,\n /// indicates the maximum age of a wallet in seconds, after which\n /// the wallet moving funds process can be requested.\n /// @param _walletMaxBtcTransfer New value of the wallet maximum BTC transfer\n /// in satoshi, determines the maximum amount that can be transferred\n /// to a single target wallet during the moving funds process.\n /// @param _walletClosingPeriod New value of the wallet closing period in\n /// seconds, determines the length of the wallet closing period,\n // i.e. the period when the wallet remains in the Closing state\n // and can be subject of deposit fraud challenges.\n /// @dev Requirements:\n /// - Wallet maximum BTC balance must be greater than the wallet\n /// minimum BTC balance,\n /// - Wallet maximum BTC transfer must be greater than zero,\n /// - Wallet closing period must be greater than zero.\n function updateWalletParameters(\n Storage storage self,\n uint32 _walletCreationPeriod,\n uint64 _walletCreationMinBtcBalance,\n uint64 _walletCreationMaxBtcBalance,\n uint64 _walletClosureMinBtcBalance,\n uint32 _walletMaxAge,\n uint64 _walletMaxBtcTransfer,\n uint32 _walletClosingPeriod\n ) internal {\n require(\n _walletCreationMaxBtcBalance > _walletCreationMinBtcBalance,\n \"Wallet creation maximum BTC balance must be greater than the creation minimum BTC balance\"\n );\n require(\n _walletMaxBtcTransfer > 0,\n \"Wallet maximum BTC transfer must be greater than zero\"\n );\n require(\n _walletClosingPeriod > 0,\n \"Wallet closing period must be greater than zero\"\n );\n\n self.walletCreationPeriod = _walletCreationPeriod;\n self.walletCreationMinBtcBalance = _walletCreationMinBtcBalance;\n self.walletCreationMaxBtcBalance = _walletCreationMaxBtcBalance;\n self.walletClosureMinBtcBalance = _walletClosureMinBtcBalance;\n self.walletMaxAge = _walletMaxAge;\n self.walletMaxBtcTransfer = _walletMaxBtcTransfer;\n self.walletClosingPeriod = _walletClosingPeriod;\n\n emit WalletParametersUpdated(\n _walletCreationPeriod,\n _walletCreationMinBtcBalance,\n _walletCreationMaxBtcBalance,\n _walletClosureMinBtcBalance,\n _walletMaxAge,\n _walletMaxBtcTransfer,\n _walletClosingPeriod\n );\n }\n\n /// @notice Updates parameters related to frauds.\n /// @param _fraudChallengeDepositAmount New value of the fraud challenge\n /// deposit amount in wei, it is the amount of ETH the party\n /// challenging the wallet for fraud needs to deposit.\n /// @param _fraudChallengeDefeatTimeout New value of the challenge defeat\n /// timeout in seconds, it is the amount of time the wallet has to\n /// defeat a fraud challenge. The value must be greater than zero.\n /// @param _fraudSlashingAmount New value of the fraud slashing amount in T,\n /// it is the amount slashed from each wallet member for committing\n /// a fraud.\n /// @param _fraudNotifierRewardMultiplier New value of the fraud notifier\n /// reward multiplier as percentage, it determines the percentage of\n /// the notifier reward from the staking contact the notifier of\n /// a fraud receives. The value must be in the range [0, 100].\n /// @dev Requirements:\n /// - Fraud challenge defeat timeout must be greater than 0,\n /// - Fraud notifier reward multiplier must be in the range [0, 100].\n function updateFraudParameters(\n Storage storage self,\n uint96 _fraudChallengeDepositAmount,\n uint32 _fraudChallengeDefeatTimeout,\n uint96 _fraudSlashingAmount,\n uint32 _fraudNotifierRewardMultiplier\n ) internal {\n require(\n _fraudChallengeDefeatTimeout > 0,\n \"Fraud challenge defeat timeout must be greater than zero\"\n );\n\n require(\n _fraudNotifierRewardMultiplier <= 100,\n \"Fraud notifier reward multiplier must be in the range [0, 100]\"\n );\n\n self.fraudChallengeDepositAmount = _fraudChallengeDepositAmount;\n self.fraudChallengeDefeatTimeout = _fraudChallengeDefeatTimeout;\n self.fraudSlashingAmount = _fraudSlashingAmount;\n self.fraudNotifierRewardMultiplier = _fraudNotifierRewardMultiplier;\n\n emit FraudParametersUpdated(\n _fraudChallengeDepositAmount,\n _fraudChallengeDefeatTimeout,\n _fraudSlashingAmount,\n _fraudNotifierRewardMultiplier\n );\n }\n\n /// @notice Updates treasury address. The treasury receives the system fees.\n /// @param _treasury New value of the treasury address.\n /// @dev The treasury address must not be 0x0.\n function updateTreasury(Storage storage self, address _treasury) internal {\n require(_treasury != address(0), \"Treasury address must not be 0x0\");\n\n self.treasury = _treasury;\n emit TreasuryUpdated(_treasury);\n }\n}\n" + }, + "contracts/bridge/Deposit.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Wallets.sol\";\n\n/// @title Bridge deposit\n/// @notice The library handles the logic for revealing Bitcoin deposits to\n/// the Bridge.\n/// @dev The depositor puts together a P2SH or P2WSH address to deposit the\n/// funds. This script is unique to each depositor and looks like this:\n///\n/// ```\n/// DROP\n/// DROP\n/// DUP HASH160 EQUAL\n/// IF\n/// CHECKSIG\n/// ELSE\n/// DUP HASH160 EQUALVERIFY\n/// CHECKLOCKTIMEVERIFY DROP\n/// CHECKSIG\n/// ENDIF\n/// ```\n///\n/// Since each depositor has their own Ethereum address and their own\n/// blinding factor, each depositor’s script is unique, and the hash\n/// of each depositor’s script is unique.\nlibrary Deposit {\n using BTCUtils for bytes;\n using BytesLib for bytes;\n\n /// @notice Represents data which must be revealed by the depositor during\n /// deposit reveal.\n struct DepositRevealInfo {\n // Index of the funding output belonging to the funding transaction.\n uint32 fundingOutputIndex;\n // The blinding factor as 8 bytes. Byte endianness doesn't matter\n // as this factor is not interpreted as uint. The blinding factor allows\n // to distinguish deposits from the same depositor.\n bytes8 blindingFactor;\n // The compressed Bitcoin public key (33 bytes and 02 or 03 prefix)\n // of the deposit's wallet hashed in the HASH160 Bitcoin opcode style.\n bytes20 walletPubKeyHash;\n // The compressed Bitcoin public key (33 bytes and 02 or 03 prefix)\n // that can be used to make the deposit refund after the refund\n // locktime passes. Hashed in the HASH160 Bitcoin opcode style.\n bytes20 refundPubKeyHash;\n // The refund locktime (4-byte LE). Interpreted according to locktime\n // parsing rules described in:\n // https://developer.bitcoin.org/devguide/transactions.html#locktime-and-sequence-number\n // and used with OP_CHECKLOCKTIMEVERIFY opcode as described in:\n // https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki\n bytes4 refundLocktime;\n // Address of the Bank vault to which the deposit is routed to.\n // Optional, can be 0x0. The vault must be trusted by the Bridge.\n address vault;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's calldata argument.\n }\n\n /// @notice Represents tBTC deposit request data.\n struct DepositRequest {\n // Ethereum depositor address.\n address depositor;\n // Deposit amount in satoshi.\n uint64 amount;\n // UNIX timestamp the deposit was revealed at.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 revealedAt;\n // Address of the Bank vault the deposit is routed to.\n // Optional, can be 0x0.\n address vault;\n // Treasury TBTC fee in satoshi at the moment of deposit reveal.\n uint64 treasuryFee;\n // UNIX timestamp the deposit was swept at. Note this is not the\n // time when the deposit was swept on the Bitcoin chain but actually\n // the time when the sweep proof was delivered to the Ethereum chain.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 sweptAt;\n // This struct doesn't contain `__gap` property as the structure is stored\n // in a mapping, mappings store values in different slots and they are\n // not contiguous with other values.\n }\n\n event DepositRevealed(\n bytes32 fundingTxHash,\n uint32 fundingOutputIndex,\n address indexed depositor,\n uint64 amount,\n bytes8 blindingFactor,\n bytes20 indexed walletPubKeyHash,\n bytes20 refundPubKeyHash,\n bytes4 refundLocktime,\n address vault\n );\n\n /// @notice Used by the depositor to reveal information about their P2(W)SH\n /// Bitcoin deposit to the Bridge on Ethereum chain. The off-chain\n /// wallet listens for revealed deposit events and may decide to\n /// include the revealed deposit in the next executed sweep.\n /// Information about the Bitcoin deposit can be revealed before or\n /// after the Bitcoin transaction with P2(W)SH deposit is mined on\n /// the Bitcoin chain. Worth noting, the gas cost of this function\n /// scales with the number of P2(W)SH transaction inputs and\n /// outputs. The deposit may be routed to one of the trusted vaults.\n /// When a deposit is routed to a vault, vault gets notified when\n /// the deposit gets swept and it may execute the appropriate action.\n /// @param fundingTx Bitcoin funding transaction data, see `BitcoinTx.Info`.\n /// @param reveal Deposit reveal data, see `RevealInfo struct.\n /// @dev Requirements:\n /// - This function must be called by the same Ethereum address as the\n /// one used in the P2(W)SH BTC deposit transaction as a depositor,\n /// - `reveal.walletPubKeyHash` must identify a `Live` wallet,\n /// - `reveal.vault` must be 0x0 or point to a trusted vault,\n /// - `reveal.fundingOutputIndex` must point to the actual P2(W)SH\n /// output of the BTC deposit transaction,\n /// - `reveal.blindingFactor` must be the blinding factor used in the\n /// P2(W)SH BTC deposit transaction,\n /// - `reveal.walletPubKeyHash` must be the wallet pub key hash used in\n /// the P2(W)SH BTC deposit transaction,\n /// - `reveal.refundPubKeyHash` must be the refund pub key hash used in\n /// the P2(W)SH BTC deposit transaction,\n /// - `reveal.refundLocktime` must be the refund locktime used in the\n /// P2(W)SH BTC deposit transaction,\n /// - BTC deposit for the given `fundingTxHash`, `fundingOutputIndex`\n /// can be revealed only one time.\n ///\n /// If any of these requirements is not met, the wallet _must_ refuse\n /// to sweep the deposit and the depositor has to wait until the\n /// deposit script unlocks to receive their BTC back.\n function revealDeposit(\n BridgeState.Storage storage self,\n BitcoinTx.Info calldata fundingTx,\n DepositRevealInfo calldata reveal\n ) external {\n require(\n self.registeredWallets[reveal.walletPubKeyHash].state ==\n Wallets.WalletState.Live,\n \"Wallet must be in Live state\"\n );\n\n require(\n reveal.vault == address(0) || self.isVaultTrusted[reveal.vault],\n \"Vault is not trusted\"\n );\n\n if (self.depositRevealAheadPeriod > 0) {\n validateDepositRefundLocktime(self, reveal.refundLocktime);\n }\n\n bytes memory expectedScript = abi.encodePacked(\n hex\"14\", // Byte length of depositor Ethereum address.\n msg.sender,\n hex\"75\", // OP_DROP\n hex\"08\", // Byte length of blinding factor value.\n reveal.blindingFactor,\n hex\"75\", // OP_DROP\n hex\"76\", // OP_DUP\n hex\"a9\", // OP_HASH160\n hex\"14\", // Byte length of a compressed Bitcoin public key hash.\n reveal.walletPubKeyHash,\n hex\"87\", // OP_EQUAL\n hex\"63\", // OP_IF\n hex\"ac\", // OP_CHECKSIG\n hex\"67\", // OP_ELSE\n hex\"76\", // OP_DUP\n hex\"a9\", // OP_HASH160\n hex\"14\", // Byte length of a compressed Bitcoin public key hash.\n reveal.refundPubKeyHash,\n hex\"88\", // OP_EQUALVERIFY\n hex\"04\", // Byte length of refund locktime value.\n reveal.refundLocktime,\n hex\"b1\", // OP_CHECKLOCKTIMEVERIFY\n hex\"75\", // OP_DROP\n hex\"ac\", // OP_CHECKSIG\n hex\"68\" // OP_ENDIF\n );\n\n bytes memory fundingOutput = fundingTx\n .outputVector\n .extractOutputAtIndex(reveal.fundingOutputIndex);\n bytes memory fundingOutputHash = fundingOutput.extractHash();\n\n if (fundingOutputHash.length == 20) {\n // A 20-byte output hash is used by P2SH. That hash is constructed\n // by applying OP_HASH160 on the locking script. A 20-byte output\n // hash is used as well by P2PKH and P2WPKH (OP_HASH160 on the\n // public key). However, since we compare the actual output hash\n // with an expected locking script hash, this check will succeed only\n // for P2SH transaction type with expected script hash value. For\n // P2PKH and P2WPKH, it will fail on the output hash comparison with\n // the expected locking script hash.\n require(\n fundingOutputHash.slice20(0) == expectedScript.hash160View(),\n \"Wrong 20-byte script hash\"\n );\n } else if (fundingOutputHash.length == 32) {\n // A 32-byte output hash is used by P2WSH. That hash is constructed\n // by applying OP_SHA256 on the locking script.\n require(\n fundingOutputHash.toBytes32() == sha256(expectedScript),\n \"Wrong 32-byte script hash\"\n );\n } else {\n revert(\"Wrong script hash length\");\n }\n\n // Resulting TX hash is in native Bitcoin little-endian format.\n bytes32 fundingTxHash = abi\n .encodePacked(\n fundingTx.version,\n fundingTx.inputVector,\n fundingTx.outputVector,\n fundingTx.locktime\n )\n .hash256View();\n\n DepositRequest storage deposit = self.deposits[\n uint256(\n keccak256(\n abi.encodePacked(fundingTxHash, reveal.fundingOutputIndex)\n )\n )\n ];\n require(deposit.revealedAt == 0, \"Deposit already revealed\");\n\n uint64 fundingOutputAmount = fundingOutput.extractValue();\n\n require(\n fundingOutputAmount >= self.depositDustThreshold,\n \"Deposit amount too small\"\n );\n\n deposit.amount = fundingOutputAmount;\n deposit.depositor = msg.sender;\n /* solhint-disable-next-line not-rely-on-time */\n deposit.revealedAt = uint32(block.timestamp);\n deposit.vault = reveal.vault;\n deposit.treasuryFee = self.depositTreasuryFeeDivisor > 0\n ? fundingOutputAmount / self.depositTreasuryFeeDivisor\n : 0;\n // slither-disable-next-line reentrancy-events\n emit DepositRevealed(\n fundingTxHash,\n reveal.fundingOutputIndex,\n msg.sender,\n fundingOutputAmount,\n reveal.blindingFactor,\n reveal.walletPubKeyHash,\n reveal.refundPubKeyHash,\n reveal.refundLocktime,\n reveal.vault\n );\n }\n\n /// @notice Validates the deposit refund locktime. The validation passes\n /// successfully only if the deposit reveal is done respectively\n /// earlier than the moment when the deposit refund locktime is\n /// reached, i.e. the deposit become refundable. Reverts otherwise.\n /// @param refundLocktime The deposit refund locktime as 4-byte LE.\n /// @dev Requirements:\n /// - `refundLocktime` as integer must be >= 500M\n /// - `refundLocktime` must denote a timestamp that is at least\n /// `depositRevealAheadPeriod` seconds later than the moment\n /// of `block.timestamp`\n function validateDepositRefundLocktime(\n BridgeState.Storage storage self,\n bytes4 refundLocktime\n ) internal view {\n // Convert the refund locktime byte array to a LE integer. This is\n // the moment in time when the deposit become refundable.\n uint32 depositRefundableTimestamp = BTCUtils.reverseUint32(\n uint32(refundLocktime)\n );\n // According to https://developer.bitcoin.org/devguide/transactions.html#locktime-and-sequence-number\n // the locktime is parsed as a block number if less than 500M. We always\n // want to parse the locktime as an Unix timestamp so we allow only for\n // values bigger than or equal to 500M.\n require(\n depositRefundableTimestamp >= 500 * 1e6,\n \"Refund locktime must be a value >= 500M\"\n );\n // The deposit must be revealed before it becomes refundable.\n // This is because the sweeping wallet needs to have some time to\n // sweep the deposit and avoid a potential competition with the\n // depositor making the deposit refund.\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp + self.depositRevealAheadPeriod <=\n depositRefundableTimestamp,\n \"Deposit refund locktime is too close\"\n );\n }\n}\n" + }, + "contracts/bridge/DepositSweep.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Wallets.sol\";\n\nimport \"../bank/Bank.sol\";\n\n/// @title Bridge deposit sweep\n/// @notice The library handles the logic for sweeping transactions revealed to\n/// the Bridge\n/// @dev Bridge active wallet periodically signs a transaction that unlocks all\n/// of the valid, revealed deposits above the dust threshold, combines them\n/// into a single UTXO with the existing main wallet UTXO, and relocks\n/// those transactions without a 30-day refund clause to the same wallet.\n/// This has two main effects: it consolidates the UTXO set and it disables\n/// the refund. Balances of depositors in the Bank are increased when the\n/// SPV sweep proof is submitted to the Bridge.\nlibrary DepositSweep {\n using BridgeState for BridgeState.Storage;\n using BitcoinTx for BridgeState.Storage;\n\n using BTCUtils for bytes;\n\n /// @notice Represents temporary information needed during the processing\n /// of the deposit sweep Bitcoin transaction inputs. This structure\n /// is an internal one and should not be exported outside of the\n /// deposit sweep transaction processing code.\n /// @dev Allows to mitigate \"stack too deep\" errors on EVM.\n struct DepositSweepTxInputsProcessingInfo {\n // Input vector of the deposit sweep Bitcoin transaction. It is\n // assumed the vector's structure is valid so it must be validated\n // using e.g. `BTCUtils.validateVin` function before being used\n // during the processing. The validation is usually done as part\n // of the `BitcoinTx.validateProof` call that checks the SPV proof.\n bytes sweepTxInputVector;\n // Data of the wallet's main UTXO. If no main UTXO exists for the given\n // sweeping wallet, this parameter's fields should be zeroed to bypass\n // the main UTXO validation\n BitcoinTx.UTXO mainUtxo;\n // Address of the vault where all swept deposits should be routed to.\n // It is used to validate whether all swept deposits have been revealed\n // with the same `vault` parameter. It is an optional parameter.\n // Set to zero address if deposits are not routed to a vault.\n address vault;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's memory argument.\n }\n\n /// @notice Represents an outcome of the sweep Bitcoin transaction\n /// inputs processing.\n struct DepositSweepTxInputsInfo {\n // Sum of all inputs values i.e. all deposits and main UTXO value,\n // if present.\n uint256 inputsTotalValue;\n // Addresses of depositors who performed processed deposits. Ordered in\n // the same order as deposits inputs in the input vector. Size of this\n // array is either equal to the number of inputs (main UTXO doesn't\n // exist) or less by one (main UTXO exists and is pointed by one of\n // the inputs).\n address[] depositors;\n // Amounts of deposits corresponding to processed deposits. Ordered in\n // the same order as deposits inputs in the input vector. Size of this\n // array is either equal to the number of inputs (main UTXO doesn't\n // exist) or less by one (main UTXO exists and is pointed by one of\n // the inputs).\n uint256[] depositedAmounts;\n // Values of the treasury fee corresponding to processed deposits.\n // Ordered in the same order as deposits inputs in the input vector.\n // Size of this array is either equal to the number of inputs (main\n // UTXO doesn't exist) or less by one (main UTXO exists and is pointed\n // by one of the inputs).\n uint256[] treasuryFees;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's memory argument.\n }\n\n event DepositsSwept(bytes20 walletPubKeyHash, bytes32 sweepTxHash);\n\n /// @notice Used by the wallet to prove the BTC deposit sweep transaction\n /// and to update Bank balances accordingly. Sweep is only accepted\n /// if it satisfies SPV proof.\n ///\n /// The function is performing Bank balance updates by first\n /// computing the Bitcoin fee for the sweep transaction. The fee is\n /// divided evenly between all swept deposits. Each depositor\n /// receives a balance in the bank equal to the amount inferred\n /// during the reveal transaction, minus their fee share.\n ///\n /// It is possible to prove the given sweep only one time.\n /// @param sweepTx Bitcoin sweep transaction data.\n /// @param sweepProof Bitcoin sweep proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain. If no main UTXO exists for the given wallet,\n /// this parameter is ignored.\n /// @param vault Optional address of the vault where all swept deposits\n /// should be routed to. All deposits swept as part of the transaction\n /// must have their `vault` parameters set to the same address.\n /// If this parameter is set to an address of a trusted vault, swept\n /// deposits are routed to that vault.\n /// If this parameter is set to the zero address or to an address\n /// of a non-trusted vault, swept deposits are not routed to a\n /// vault but depositors' balances are increased in the Bank\n /// individually.\n /// @dev Requirements:\n /// - `sweepTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `sweepTx` should represent a Bitcoin transaction with 1..n\n /// inputs. If the wallet has no main UTXO, all n inputs should\n /// correspond to P2(W)SH revealed deposits UTXOs. If the wallet has\n /// an existing main UTXO, one of the n inputs must point to that\n /// main UTXO and remaining n-1 inputs should correspond to P2(W)SH\n /// revealed deposits UTXOs. That transaction must have only\n /// one P2(W)PKH output locking funds on the 20-byte wallet public\n /// key hash,\n /// - All revealed deposits that are swept by `sweepTx` must have\n /// their `vault` parameters set to the same address as the address\n /// passed in the `vault` function parameter,\n /// - `sweepProof` components must match the expected structure. See\n /// `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// If there is no main UTXO, this parameter is ignored.\n function submitDepositSweepProof(\n BridgeState.Storage storage self,\n BitcoinTx.Info calldata sweepTx,\n BitcoinTx.Proof calldata sweepProof,\n BitcoinTx.UTXO calldata mainUtxo,\n address vault\n ) external {\n // Wallet state validation is performed in the\n // `resolveDepositSweepingWallet` function.\n\n // The actual transaction proof is performed here. After that point, we\n // can assume the transaction happened on Bitcoin chain and has\n // a sufficient number of confirmations as determined by\n // `txProofDifficultyFactor` constant.\n bytes32 sweepTxHash = self.validateProof(sweepTx, sweepProof);\n\n // Process sweep transaction output and extract its target wallet\n // public key hash and value.\n (\n bytes20 walletPubKeyHash,\n uint64 sweepTxOutputValue\n ) = processDepositSweepTxOutput(self, sweepTx.outputVector);\n\n (\n Wallets.Wallet storage wallet,\n BitcoinTx.UTXO memory resolvedMainUtxo\n ) = resolveDepositSweepingWallet(self, walletPubKeyHash, mainUtxo);\n\n // Process sweep transaction inputs and extract all information needed\n // to perform deposit bookkeeping.\n DepositSweepTxInputsInfo\n memory inputsInfo = processDepositSweepTxInputs(\n self,\n DepositSweepTxInputsProcessingInfo(\n sweepTx.inputVector,\n resolvedMainUtxo,\n vault\n )\n );\n\n // Helper variable that will hold the sum of treasury fees paid by\n // all deposits.\n uint256 totalTreasuryFee = 0;\n\n // Determine the transaction fee that should be incurred by each deposit\n // and the indivisible remainder that should be additionally incurred\n // by the last deposit.\n (\n uint256 depositTxFee,\n uint256 depositTxFeeRemainder\n ) = depositSweepTxFeeDistribution(\n inputsInfo.inputsTotalValue,\n sweepTxOutputValue,\n inputsInfo.depositedAmounts.length\n );\n\n // Make sure the highest value of the deposit transaction fee does not\n // exceed the maximum value limited by the governable parameter.\n require(\n depositTxFee + depositTxFeeRemainder <= self.depositTxMaxFee,\n \"Transaction fee is too high\"\n );\n\n // Reduce each deposit amount by treasury fee and transaction fee.\n for (uint256 i = 0; i < inputsInfo.depositedAmounts.length; i++) {\n // The last deposit should incur the deposit transaction fee\n // remainder.\n uint256 depositTxFeeIncurred = i ==\n inputsInfo.depositedAmounts.length - 1\n ? depositTxFee + depositTxFeeRemainder\n : depositTxFee;\n\n // There is no need to check whether\n // `inputsInfo.depositedAmounts[i] - inputsInfo.treasuryFees[i] - txFee > 0`\n // since the `depositDustThreshold` should force that condition\n // to be always true.\n inputsInfo.depositedAmounts[i] =\n inputsInfo.depositedAmounts[i] -\n inputsInfo.treasuryFees[i] -\n depositTxFeeIncurred;\n totalTreasuryFee += inputsInfo.treasuryFees[i];\n }\n\n // Record this sweep data and assign them to the wallet public key hash\n // as new main UTXO. Transaction output index is always 0 as sweep\n // transaction always contains only one output.\n wallet.mainUtxoHash = keccak256(\n abi.encodePacked(sweepTxHash, uint32(0), sweepTxOutputValue)\n );\n\n // slither-disable-next-line reentrancy-events\n emit DepositsSwept(walletPubKeyHash, sweepTxHash);\n\n if (vault != address(0) && self.isVaultTrusted[vault]) {\n // If the `vault` address is not zero and belongs to a trusted\n // vault, route the deposits to that vault.\n self.bank.increaseBalanceAndCall(\n vault,\n inputsInfo.depositors,\n inputsInfo.depositedAmounts\n );\n } else {\n // If the `vault` address is zero or belongs to a non-trusted\n // vault, increase balances in the Bank individually for each\n // depositor.\n self.bank.increaseBalances(\n inputsInfo.depositors,\n inputsInfo.depositedAmounts\n );\n }\n\n // Pass the treasury fee to the treasury address.\n if (totalTreasuryFee > 0) {\n self.bank.increaseBalance(self.treasury, totalTreasuryFee);\n }\n }\n\n /// @notice Resolves sweeping wallet based on the provided wallet public key\n /// hash. Validates the wallet state and current main UTXO, as\n /// currently known on the Ethereum chain.\n /// @param walletPubKeyHash public key hash of the wallet proving the sweep\n /// Bitcoin transaction.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain. If no main UTXO exists for the given wallet,\n /// this parameter is ignored.\n /// @return wallet Data of the sweeping wallet.\n /// @return resolvedMainUtxo The actual main UTXO of the sweeping wallet\n /// resolved by cross-checking the `mainUtxo` parameter with\n /// the chain state. If the validation went well, this is the\n /// plain-text main UTXO corresponding to the `wallet.mainUtxoHash`.\n /// @dev Requirements:\n /// - Sweeping wallet must be either in Live or MovingFunds state,\n /// - If the main UTXO of the sweeping wallet exists in the storage,\n /// the passed `mainUTXO` parameter must be equal to the stored one.\n function resolveDepositSweepingWallet(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo\n )\n internal\n view\n returns (\n Wallets.Wallet storage wallet,\n BitcoinTx.UTXO memory resolvedMainUtxo\n )\n {\n wallet = self.registeredWallets[walletPubKeyHash];\n\n Wallets.WalletState walletState = wallet.state;\n require(\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds,\n \"Wallet must be in Live or MovingFunds state\"\n );\n\n // Check if the main UTXO for given wallet exists. If so, validate\n // passed main UTXO data against the stored hash and use them for\n // further processing. If no main UTXO exists, use empty data.\n resolvedMainUtxo = BitcoinTx.UTXO(bytes32(0), 0, 0);\n bytes32 mainUtxoHash = wallet.mainUtxoHash;\n if (mainUtxoHash != bytes32(0)) {\n require(\n keccak256(\n abi.encodePacked(\n mainUtxo.txHash,\n mainUtxo.txOutputIndex,\n mainUtxo.txOutputValue\n )\n ) == mainUtxoHash,\n \"Invalid main UTXO data\"\n );\n resolvedMainUtxo = mainUtxo;\n }\n }\n\n /// @notice Processes the Bitcoin sweep transaction output vector by\n /// extracting the single output and using it to gain additional\n /// information required for further processing (e.g. value and\n /// wallet public key hash).\n /// @param sweepTxOutputVector Bitcoin sweep transaction output vector.\n /// This function assumes vector's structure is valid so it must be\n /// validated using e.g. `BTCUtils.validateVout` function before\n /// it is passed here.\n /// @return walletPubKeyHash 20-byte wallet public key hash.\n /// @return value 8-byte sweep transaction output value.\n function processDepositSweepTxOutput(\n BridgeState.Storage storage self,\n bytes memory sweepTxOutputVector\n ) internal view returns (bytes20 walletPubKeyHash, uint64 value) {\n // To determine the total number of sweep transaction outputs, we need to\n // parse the compactSize uint (VarInt) the output vector is prepended by.\n // That compactSize uint encodes the number of vector elements using the\n // format presented in:\n // https://developer.bitcoin.org/reference/transactions.html#compactsize-unsigned-integers\n // We don't need asserting the compactSize uint is parseable since it\n // was already checked during `validateVout` validation.\n // See `BitcoinTx.outputVector` docs for more details.\n (, uint256 outputsCount) = sweepTxOutputVector.parseVarInt();\n require(\n outputsCount == 1,\n \"Sweep transaction must have a single output\"\n );\n\n bytes memory output = sweepTxOutputVector.extractOutputAtIndex(0);\n walletPubKeyHash = self.extractPubKeyHash(output);\n value = output.extractValue();\n\n return (walletPubKeyHash, value);\n }\n\n /// @notice Processes the Bitcoin sweep transaction input vector. It\n /// extracts each input and tries to obtain associated deposit or\n /// main UTXO data, depending on the input type. Reverts\n /// if one of the inputs cannot be recognized as a pointer to a\n /// revealed deposit or expected main UTXO.\n /// This function also marks each processed deposit as swept.\n /// @return resultInfo Outcomes of the processing.\n function processDepositSweepTxInputs(\n BridgeState.Storage storage self,\n DepositSweepTxInputsProcessingInfo memory processInfo\n ) internal returns (DepositSweepTxInputsInfo memory resultInfo) {\n // If the passed `mainUtxo` parameter's values are zeroed, the main UTXO\n // for the given wallet doesn't exist and it is not expected to be\n // included in the sweep transaction input vector.\n bool mainUtxoExpected = processInfo.mainUtxo.txHash != bytes32(0);\n bool mainUtxoFound = false;\n\n // Determining the total number of sweep transaction inputs in the same\n // way as for number of outputs. See `BitcoinTx.inputVector` docs for\n // more details.\n (uint256 inputsCompactSizeUintLength, uint256 inputsCount) = processInfo\n .sweepTxInputVector\n .parseVarInt();\n\n // To determine the first input starting index, we must jump over\n // the compactSize uint which prepends the input vector. One byte\n // must be added because `BtcUtils.parseVarInt` does not include\n // compactSize uint tag in the returned length.\n //\n // For >= 0 && <= 252, `BTCUtils.determineVarIntDataLengthAt`\n // returns `0`, so we jump over one byte of compactSize uint.\n //\n // For >= 253 && <= 0xffff there is `0xfd` tag,\n // `BTCUtils.determineVarIntDataLengthAt` returns `2` (no\n // tag byte included) so we need to jump over 1+2 bytes of\n // compactSize uint.\n //\n // Please refer `BTCUtils` library and compactSize uint\n // docs in `BitcoinTx` library for more details.\n uint256 inputStartingIndex = 1 + inputsCompactSizeUintLength;\n\n // Determine the swept deposits count. If main UTXO is NOT expected,\n // all inputs should be deposits. If main UTXO is expected, one input\n // should point to that main UTXO.\n resultInfo.depositors = new address[](\n !mainUtxoExpected ? inputsCount : inputsCount - 1\n );\n resultInfo.depositedAmounts = new uint256[](\n resultInfo.depositors.length\n );\n resultInfo.treasuryFees = new uint256[](resultInfo.depositors.length);\n\n // Initialize helper variables.\n uint256 processedDepositsCount = 0;\n\n // Inputs processing loop.\n for (uint256 i = 0; i < inputsCount; i++) {\n (\n bytes32 outpointTxHash,\n uint32 outpointIndex,\n uint256 inputLength\n ) = parseDepositSweepTxInputAt(\n processInfo.sweepTxInputVector,\n inputStartingIndex\n );\n\n Deposit.DepositRequest storage deposit = self.deposits[\n uint256(\n keccak256(abi.encodePacked(outpointTxHash, outpointIndex))\n )\n ];\n\n if (deposit.revealedAt != 0) {\n // If we entered here, that means the input was identified as\n // a revealed deposit.\n require(deposit.sweptAt == 0, \"Deposit already swept\");\n\n require(\n deposit.vault == processInfo.vault,\n \"Deposit should be routed to another vault\"\n );\n\n if (processedDepositsCount == resultInfo.depositors.length) {\n // If this condition is true, that means a deposit input\n // took place of an expected main UTXO input.\n // In other words, there is no expected main UTXO\n // input and all inputs come from valid, revealed deposits.\n revert(\n \"Expected main UTXO not present in sweep transaction inputs\"\n );\n }\n\n /* solhint-disable-next-line not-rely-on-time */\n deposit.sweptAt = uint32(block.timestamp);\n\n resultInfo.depositors[processedDepositsCount] = deposit\n .depositor;\n resultInfo.depositedAmounts[processedDepositsCount] = deposit\n .amount;\n resultInfo.inputsTotalValue += resultInfo.depositedAmounts[\n processedDepositsCount\n ];\n resultInfo.treasuryFees[processedDepositsCount] = deposit\n .treasuryFee;\n\n processedDepositsCount++;\n } else if (\n mainUtxoExpected != mainUtxoFound &&\n processInfo.mainUtxo.txHash == outpointTxHash &&\n processInfo.mainUtxo.txOutputIndex == outpointIndex\n ) {\n // If we entered here, that means the input was identified as\n // the expected main UTXO.\n resultInfo.inputsTotalValue += processInfo\n .mainUtxo\n .txOutputValue;\n mainUtxoFound = true;\n\n // Main UTXO used as an input, mark it as spent.\n self.spentMainUTXOs[\n uint256(\n keccak256(\n abi.encodePacked(outpointTxHash, outpointIndex)\n )\n )\n ] = true;\n } else {\n revert(\"Unknown input type\");\n }\n\n // Make the `inputStartingIndex` pointing to the next input by\n // increasing it by current input's length.\n inputStartingIndex += inputLength;\n }\n\n // Construction of the input processing loop guarantees that:\n // `processedDepositsCount == resultInfo.depositors.length == resultInfo.depositedAmounts.length`\n // is always true at this point. We just use the first variable\n // to assert the total count of swept deposit is bigger than zero.\n require(\n processedDepositsCount > 0,\n \"Sweep transaction must process at least one deposit\"\n );\n\n // Assert the main UTXO was used as one of current sweep's inputs if\n // it was actually expected.\n require(\n mainUtxoExpected == mainUtxoFound,\n \"Expected main UTXO not present in sweep transaction inputs\"\n );\n\n return resultInfo;\n }\n\n /// @notice Parses a Bitcoin transaction input starting at the given index.\n /// @param inputVector Bitcoin transaction input vector.\n /// @param inputStartingIndex Index the given input starts at.\n /// @return outpointTxHash 32-byte hash of the Bitcoin transaction which is\n /// pointed in the given input's outpoint.\n /// @return outpointIndex 4-byte index of the Bitcoin transaction output\n /// which is pointed in the given input's outpoint.\n /// @return inputLength Byte length of the given input.\n /// @dev This function assumes vector's structure is valid so it must be\n /// validated using e.g. `BTCUtils.validateVin` function before it\n /// is passed here.\n function parseDepositSweepTxInputAt(\n bytes memory inputVector,\n uint256 inputStartingIndex\n )\n internal\n pure\n returns (\n bytes32 outpointTxHash,\n uint32 outpointIndex,\n uint256 inputLength\n )\n {\n outpointTxHash = inputVector.extractInputTxIdLeAt(inputStartingIndex);\n\n outpointIndex = BTCUtils.reverseUint32(\n uint32(inputVector.extractTxIndexLeAt(inputStartingIndex))\n );\n\n inputLength = inputVector.determineInputLengthAt(inputStartingIndex);\n\n return (outpointTxHash, outpointIndex, inputLength);\n }\n\n /// @notice Determines the distribution of the sweep transaction fee\n /// over swept deposits.\n /// @param sweepTxInputsTotalValue Total value of all sweep transaction inputs.\n /// @param sweepTxOutputValue Value of the sweep transaction output.\n /// @param depositsCount Count of the deposits swept by the sweep transaction.\n /// @return depositTxFee Transaction fee per deposit determined by evenly\n /// spreading the divisible part of the sweep transaction fee\n /// over all deposits.\n /// @return depositTxFeeRemainder The indivisible part of the sweep\n /// transaction fee than cannot be distributed over all deposits.\n /// @dev It is up to the caller to decide how the remainder should be\n /// counted in. This function only computes its value.\n function depositSweepTxFeeDistribution(\n uint256 sweepTxInputsTotalValue,\n uint256 sweepTxOutputValue,\n uint256 depositsCount\n )\n internal\n pure\n returns (uint256 depositTxFee, uint256 depositTxFeeRemainder)\n {\n // The sweep transaction fee is just the difference between inputs\n // amounts sum and the output amount.\n uint256 sweepTxFee = sweepTxInputsTotalValue - sweepTxOutputValue;\n // Compute the indivisible remainder that remains after dividing the\n // sweep transaction fee over all deposits evenly.\n depositTxFeeRemainder = sweepTxFee % depositsCount;\n // Compute the transaction fee per deposit by dividing the sweep\n // transaction fee (reduced by the remainder) by the number of deposits.\n depositTxFee = (sweepTxFee - depositTxFeeRemainder) / depositsCount;\n\n return (depositTxFee, depositTxFeeRemainder);\n }\n}\n" + }, + "contracts/bridge/EcdsaLib.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\n\nlibrary EcdsaLib {\n using BytesLib for bytes;\n\n /// @notice Converts public key X and Y coordinates (32-byte each) to a\n /// compressed public key (33-byte). Compressed public key is X\n /// coordinate prefixed with `02` or `03` based on the Y coordinate parity.\n /// It is expected that the uncompressed public key is stripped\n /// (i.e. it is not prefixed with `04`).\n /// @param x Wallet's public key's X coordinate.\n /// @param y Wallet's public key's Y coordinate.\n /// @return Compressed public key (33-byte), prefixed with `02` or `03`.\n function compressPublicKey(bytes32 x, bytes32 y)\n internal\n pure\n returns (bytes memory)\n {\n bytes1 prefix;\n if (uint256(y) % 2 == 0) {\n prefix = hex\"02\";\n } else {\n prefix = hex\"03\";\n }\n\n return bytes.concat(prefix, x);\n }\n}\n" + }, + "contracts/bridge/Fraud.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {CheckBitcoinSigs} from \"@keep-network/bitcoin-spv-sol/contracts/CheckBitcoinSigs.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./EcdsaLib.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Heartbeat.sol\";\nimport \"./MovingFunds.sol\";\nimport \"./Wallets.sol\";\n\n/// @title Bridge fraud\n/// @notice The library handles the logic for challenging Bridge wallets that\n/// committed fraud.\n/// @dev Anyone can submit a fraud challenge indicating that a UTXO being under\n/// the wallet control was unlocked by the wallet but was not used\n/// according to the protocol rules. That means the wallet signed\n/// a transaction input pointing to that UTXO and there is a unique\n/// sighash and signature pair associated with that input.\n///\n/// In order to defeat the challenge, the same wallet public key and\n/// signature must be provided as were used to calculate the sighash during\n/// the challenge. The wallet provides the preimage which produces sighash\n/// used to generate the ECDSA signature that is the subject of the fraud\n/// claim.\n///\n/// The fraud challenge defeat attempt will succeed if the inputs in the\n/// preimage are considered honestly spent by the wallet. Therefore the\n/// transaction spending the UTXO must be proven in the Bridge before\n/// a challenge defeat is called.\n///\n/// Another option is when a malicious wallet member used a signed heartbeat\n/// message periodically produced by the wallet off-chain to challenge the\n/// wallet for a fraud. Anyone from the wallet can defeat the challenge by\n/// proving the sighash and signature were produced for a heartbeat message\n/// following a strict format.\nlibrary Fraud {\n using Wallets for BridgeState.Storage;\n\n using BytesLib for bytes;\n using BTCUtils for bytes;\n using BTCUtils for uint32;\n using EcdsaLib for bytes;\n\n struct FraudChallenge {\n // The address of the party challenging the wallet.\n address challenger;\n // The amount of ETH the challenger deposited.\n uint256 depositAmount;\n // The timestamp the challenge was submitted at.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 reportedAt;\n // The flag indicating whether the challenge has been resolved.\n bool resolved;\n // This struct doesn't contain `__gap` property as the structure is stored\n // in a mapping, mappings store values in different slots and they are\n // not contiguous with other values.\n }\n\n event FraudChallengeSubmitted(\n bytes20 indexed walletPubKeyHash,\n bytes32 sighash,\n uint8 v,\n bytes32 r,\n bytes32 s\n );\n\n event FraudChallengeDefeated(\n bytes20 indexed walletPubKeyHash,\n bytes32 sighash\n );\n\n event FraudChallengeDefeatTimedOut(\n bytes20 indexed walletPubKeyHash,\n // Sighash calculated as a Bitcoin's hash256 (double sha2) of:\n // - a preimage of a transaction spending UTXO according to the protocol\n // rules OR\n // - a valid heartbeat message produced by the wallet off-chain.\n bytes32 sighash\n );\n\n /// @notice Submits a fraud challenge indicating that a UTXO being under\n /// wallet control was unlocked by the wallet but was not used\n /// according to the protocol rules. That means the wallet signed\n /// a transaction input pointing to that UTXO and there is a unique\n /// sighash and signature pair associated with that input. This\n /// function uses those parameters to create a fraud accusation that\n /// proves a given transaction input unlocking the given UTXO was\n /// actually signed by the wallet. This function cannot determine\n /// whether the transaction was actually broadcast and the input was\n /// consumed in a fraudulent way so it just opens a challenge period\n /// during which the wallet can defeat the challenge by submitting\n /// proof of a transaction that consumes the given input according\n /// to protocol rules. To prevent spurious allegations, the caller\n /// must deposit ETH that is returned back upon justified fraud\n /// challenge or confiscated otherwise.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param preimageSha256 The hash that was generated by applying SHA-256\n /// one time over the preimage used during input signing. The preimage\n /// is a serialized subset of the transaction and its structure\n /// depends on the transaction input (see BIP-143 for reference).\n /// Notice that applying SHA-256 over the `preimageSha256` results\n /// in `sighash`. The path from `preimage` to `sighash` looks like\n /// this:\n /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.\n /// @param signature Bitcoin signature in the R/S/V format\n /// @dev Requirements:\n /// - Wallet behind `walletPublicKey` must be in Live or MovingFunds\n /// or Closing state,\n /// - The challenger must send appropriate amount of ETH used as\n /// fraud challenge deposit,\n /// - The signature (represented by r, s and v) must be generated by\n /// the wallet behind `walletPubKey` during signing of `sighash`\n /// which was calculated from `preimageSha256`,\n /// - Wallet can be challenged for the given signature only once.\n function submitFraudChallenge(\n BridgeState.Storage storage self,\n bytes calldata walletPublicKey,\n bytes memory preimageSha256,\n BitcoinTx.RSVSignature calldata signature\n ) external {\n require(\n msg.value >= self.fraudChallengeDepositAmount,\n \"The amount of ETH deposited is too low\"\n );\n\n // To prevent ECDSA signature forgery `sighash` must be calculated\n // inside the function and not passed as a function parameter.\n // Signature forgery could result in a wrongful fraud accusation\n // against a wallet.\n bytes32 sighash = sha256(preimageSha256);\n\n require(\n CheckBitcoinSigs.checkSig(\n walletPublicKey,\n sighash,\n signature.v,\n signature.r,\n signature.s\n ),\n \"Signature verification failure\"\n );\n\n bytes memory compressedWalletPublicKey = EcdsaLib.compressPublicKey(\n walletPublicKey.slice32(0),\n walletPublicKey.slice32(32)\n );\n bytes20 walletPubKeyHash = compressedWalletPublicKey.hash160View();\n\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n\n require(\n wallet.state == Wallets.WalletState.Live ||\n wallet.state == Wallets.WalletState.MovingFunds ||\n wallet.state == Wallets.WalletState.Closing,\n \"Wallet must be in Live or MovingFunds or Closing state\"\n );\n\n uint256 challengeKey = uint256(\n keccak256(abi.encodePacked(walletPublicKey, sighash))\n );\n\n FraudChallenge storage challenge = self.fraudChallenges[challengeKey];\n require(challenge.reportedAt == 0, \"Fraud challenge already exists\");\n\n challenge.challenger = msg.sender;\n challenge.depositAmount = msg.value;\n /* solhint-disable-next-line not-rely-on-time */\n challenge.reportedAt = uint32(block.timestamp);\n challenge.resolved = false;\n // slither-disable-next-line reentrancy-events\n emit FraudChallengeSubmitted(\n walletPubKeyHash,\n sighash,\n signature.v,\n signature.r,\n signature.s\n );\n }\n\n /// @notice Allows to defeat a pending fraud challenge against a wallet if\n /// the transaction that spends the UTXO follows the protocol rules.\n /// In order to defeat the challenge the same `walletPublicKey` and\n /// signature (represented by `r`, `s` and `v`) must be provided as\n /// were used to calculate the sighash during input signing.\n /// The fraud challenge defeat attempt will only succeed if the\n /// inputs in the preimage are considered honestly spent by the\n /// wallet. Therefore the transaction spending the UTXO must be\n /// proven in the Bridge before a challenge defeat is called.\n /// If successfully defeated, the fraud challenge is marked as\n /// resolved and the amount of ether deposited by the challenger is\n /// sent to the treasury.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param preimage The preimage which produces sighash used to generate the\n /// ECDSA signature that is the subject of the fraud claim. It is a\n /// serialized subset of the transaction. The exact subset used as\n /// the preimage depends on the transaction input the signature is\n /// produced for. See BIP-143 for reference.\n /// @param witness Flag indicating whether the preimage was produced for a\n /// witness input. True for witness, false for non-witness input.\n /// @dev Requirements:\n /// - `walletPublicKey` and `sighash` calculated as `hash256(preimage)`\n /// must identify an open fraud challenge,\n /// - the preimage must be a valid preimage of a transaction generated\n /// according to the protocol rules and already proved in the Bridge,\n /// - before a defeat attempt is made the transaction that spends the\n /// given UTXO must be proven in the Bridge.\n function defeatFraudChallenge(\n BridgeState.Storage storage self,\n bytes calldata walletPublicKey,\n bytes calldata preimage,\n bool witness\n ) external {\n bytes32 sighash = preimage.hash256();\n\n uint256 challengeKey = uint256(\n keccak256(abi.encodePacked(walletPublicKey, sighash))\n );\n\n FraudChallenge storage challenge = self.fraudChallenges[challengeKey];\n\n require(challenge.reportedAt > 0, \"Fraud challenge does not exist\");\n require(\n !challenge.resolved,\n \"Fraud challenge has already been resolved\"\n );\n\n // Ensure SIGHASH_ALL type was used during signing, which is represented\n // by type value `1`.\n require(extractSighashType(preimage) == 1, \"Wrong sighash type\");\n\n uint256 utxoKey = witness\n ? extractUtxoKeyFromWitnessPreimage(preimage)\n : extractUtxoKeyFromNonWitnessPreimage(preimage);\n\n // Check that the UTXO key identifies a correctly spent UTXO.\n require(\n self.deposits[utxoKey].sweptAt > 0 ||\n self.spentMainUTXOs[utxoKey] ||\n self.movedFundsSweepRequests[utxoKey].state ==\n MovingFunds.MovedFundsSweepRequestState.Processed,\n \"Spent UTXO not found among correctly spent UTXOs\"\n );\n\n resolveFraudChallenge(self, walletPublicKey, challenge, sighash);\n }\n\n /// @notice Allows to defeat a pending fraud challenge against a wallet by\n /// proving the sighash and signature were produced for an off-chain\n /// wallet heartbeat message following a strict format.\n /// In order to defeat the challenge the same `walletPublicKey` and\n /// signature (represented by `r`, `s` and `v`) must be provided as\n /// were used to calculate the sighash during heartbeat message\n /// signing. The fraud challenge defeat attempt will only succeed if\n /// the signed message follows a strict format required for\n /// heartbeat messages. If successfully defeated, the fraud\n /// challenge is marked as resolved and the amount of ether\n /// deposited by the challenger is sent to the treasury.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes),\n /// @param heartbeatMessage Off-chain heartbeat message meeting the heartbeat\n /// message format requirements which produces sighash used to\n /// generate the ECDSA signature that is the subject of the fraud\n /// claim.\n /// @dev Requirements:\n /// - `walletPublicKey` and `sighash` calculated as\n /// `hash256(heartbeatMessage)` must identify an open fraud challenge,\n /// - `heartbeatMessage` must follow a strict format of heartbeat\n /// messages.\n function defeatFraudChallengeWithHeartbeat(\n BridgeState.Storage storage self,\n bytes calldata walletPublicKey,\n bytes calldata heartbeatMessage\n ) external {\n bytes32 sighash = heartbeatMessage.hash256();\n\n uint256 challengeKey = uint256(\n keccak256(abi.encodePacked(walletPublicKey, sighash))\n );\n\n FraudChallenge storage challenge = self.fraudChallenges[challengeKey];\n\n require(challenge.reportedAt > 0, \"Fraud challenge does not exist\");\n require(\n !challenge.resolved,\n \"Fraud challenge has already been resolved\"\n );\n\n require(\n Heartbeat.isValidHeartbeatMessage(heartbeatMessage),\n \"Not a valid heartbeat message\"\n );\n\n resolveFraudChallenge(self, walletPublicKey, challenge, sighash);\n }\n\n /// @notice Called only for successfully defeated fraud challenges.\n /// The fraud challenge is marked as resolved and the amount of\n /// ether deposited by the challenger is sent to the treasury.\n /// @dev Requirements:\n /// - Must be called only for successfully defeated fraud challenges.\n function resolveFraudChallenge(\n BridgeState.Storage storage self,\n bytes calldata walletPublicKey,\n FraudChallenge storage challenge,\n bytes32 sighash\n ) internal {\n // Mark the challenge as resolved as it was successfully defeated\n challenge.resolved = true;\n\n // Send the ether deposited by the challenger to the treasury\n /* solhint-disable avoid-low-level-calls */\n // slither-disable-next-line low-level-calls,unchecked-lowlevel,arbitrary-send\n self.treasury.call{gas: 100000, value: challenge.depositAmount}(\"\");\n /* solhint-enable avoid-low-level-calls */\n\n bytes memory compressedWalletPublicKey = EcdsaLib.compressPublicKey(\n walletPublicKey.slice32(0),\n walletPublicKey.slice32(32)\n );\n bytes20 walletPubKeyHash = compressedWalletPublicKey.hash160View();\n\n // slither-disable-next-line reentrancy-events\n emit FraudChallengeDefeated(walletPubKeyHash, sighash);\n }\n\n /// @notice Notifies about defeat timeout for the given fraud challenge.\n /// Can be called only if there was a fraud challenge identified by\n /// the provided `walletPublicKey` and `sighash` and it was not\n /// defeated on time. The amount of time that needs to pass after\n /// a fraud challenge is reported is indicated by the\n /// `challengeDefeatTimeout`. After a successful fraud challenge\n /// defeat timeout notification the fraud challenge is marked as\n /// resolved, the stake of each operator is slashed, the ether\n /// deposited is returned to the challenger and the challenger is\n /// rewarded.\n /// @param walletPublicKey The public key of the wallet in the uncompressed\n /// and unprefixed format (64 bytes).\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @param preimageSha256 The hash that was generated by applying SHA-256\n /// one time over the preimage used during input signing. The preimage\n /// is a serialized subset of the transaction and its structure\n /// depends on the transaction input (see BIP-143 for reference).\n /// Notice that applying SHA-256 over the `preimageSha256` results\n /// in `sighash`. The path from `preimage` to `sighash` looks like\n /// this:\n /// preimage -> (SHA-256) -> preimageSha256 -> (SHA-256) -> sighash.\n /// @dev Requirements:\n /// - The wallet must be in the Live or MovingFunds or Closing or\n /// Terminated state,\n /// - The `walletPublicKey` and `sighash` calculated from\n /// `preimageSha256` must identify an open fraud challenge,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract,\n /// - The amount of time indicated by `challengeDefeatTimeout` must pass\n /// after the challenge was reported.\n function notifyFraudChallengeDefeatTimeout(\n BridgeState.Storage storage self,\n bytes calldata walletPublicKey,\n uint32[] calldata walletMembersIDs,\n bytes memory preimageSha256\n ) external {\n // Wallet state is validated in `notifyWalletFraudChallengeDefeatTimeout`.\n\n bytes32 sighash = sha256(preimageSha256);\n\n uint256 challengeKey = uint256(\n keccak256(abi.encodePacked(walletPublicKey, sighash))\n );\n\n FraudChallenge storage challenge = self.fraudChallenges[challengeKey];\n\n require(challenge.reportedAt > 0, \"Fraud challenge does not exist\");\n\n require(\n !challenge.resolved,\n \"Fraud challenge has already been resolved\"\n );\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp >=\n challenge.reportedAt + self.fraudChallengeDefeatTimeout,\n \"Fraud challenge defeat period did not time out yet\"\n );\n\n challenge.resolved = true;\n // Return the ether deposited by the challenger\n /* solhint-disable avoid-low-level-calls */\n // slither-disable-next-line low-level-calls,unchecked-lowlevel\n challenge.challenger.call{gas: 100000, value: challenge.depositAmount}(\n \"\"\n );\n /* solhint-enable avoid-low-level-calls */\n\n bytes memory compressedWalletPublicKey = EcdsaLib.compressPublicKey(\n walletPublicKey.slice32(0),\n walletPublicKey.slice32(32)\n );\n bytes20 walletPubKeyHash = compressedWalletPublicKey.hash160View();\n\n self.notifyWalletFraudChallengeDefeatTimeout(\n walletPubKeyHash,\n walletMembersIDs,\n challenge.challenger\n );\n\n // slither-disable-next-line reentrancy-events\n emit FraudChallengeDefeatTimedOut(walletPubKeyHash, sighash);\n }\n\n /// @notice Extracts the UTXO keys from the given preimage used during\n /// signing of a witness input.\n /// @param preimage The preimage which produces sighash used to generate the\n /// ECDSA signature that is the subject of the fraud claim. It is a\n /// serialized subset of the transaction. The exact subset used as\n /// the preimage depends on the transaction input the signature is\n /// produced for. See BIP-143 for reference\n /// @return utxoKey UTXO key that identifies spent input.\n function extractUtxoKeyFromWitnessPreimage(bytes calldata preimage)\n internal\n pure\n returns (uint256 utxoKey)\n {\n // The expected structure of the preimage created during signing of a\n // witness input:\n // - transaction version (4 bytes)\n // - hash of previous outpoints of all inputs (32 bytes)\n // - hash of sequences of all inputs (32 bytes)\n // - outpoint (hash + index) of the input being signed (36 bytes)\n // - the unlocking script of the input (variable length)\n // - value of the outpoint (8 bytes)\n // - sequence of the input being signed (4 bytes)\n // - hash of all outputs (32 bytes)\n // - transaction locktime (4 bytes)\n // - sighash type (4 bytes)\n\n // See Bitcoin's BIP-143 for reference:\n // https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki.\n\n // The outpoint (hash and index) is located at the constant offset of\n // 68 (4 + 32 + 32).\n bytes32 outpointTxHash = preimage.extractInputTxIdLeAt(68);\n uint32 outpointIndex = BTCUtils.reverseUint32(\n uint32(preimage.extractTxIndexLeAt(68))\n );\n\n return\n uint256(keccak256(abi.encodePacked(outpointTxHash, outpointIndex)));\n }\n\n /// @notice Extracts the UTXO key from the given preimage used during\n /// signing of a non-witness input.\n /// @param preimage The preimage which produces sighash used to generate the\n /// ECDSA signature that is the subject of the fraud claim. It is a\n /// serialized subset of the transaction. The exact subset used as\n /// the preimage depends on the transaction input the signature is\n /// produced for. See BIP-143 for reference.\n /// @return utxoKey UTXO key that identifies spent input.\n function extractUtxoKeyFromNonWitnessPreimage(bytes calldata preimage)\n internal\n pure\n returns (uint256 utxoKey)\n {\n // The expected structure of the preimage created during signing of a\n // non-witness input:\n // - transaction version (4 bytes)\n // - number of inputs written as compactSize uint (1 byte, 3 bytes,\n // 5 bytes or 9 bytes)\n // - for each input\n // - outpoint (hash and index) (36 bytes)\n // - unlocking script for the input being signed (variable length)\n // or `00` for all other inputs (1 byte)\n // - input sequence (4 bytes)\n // - number of outputs written as compactSize uint (1 byte, 3 bytes,\n // 5 bytes or 9 bytes)\n // - outputs (variable length)\n // - transaction locktime (4 bytes)\n // - sighash type (4 bytes)\n\n // See example for reference:\n // https://en.bitcoin.it/wiki/OP_CHECKSIG#Code_samples_and_raw_dumps.\n\n // The input data begins at the constant offset of 4 (the first 4 bytes\n // are for the transaction version).\n (uint256 inputsCompactSizeUintLength, uint256 inputsCount) = preimage\n .parseVarIntAt(4);\n\n // To determine the first input starting index, we must jump 4 bytes\n // over the transaction version length and the compactSize uint which\n // prepends the input vector. One byte must be added because\n // `BtcUtils.parseVarInt` does not include compactSize uint tag in the\n // returned length.\n //\n // For >= 0 && <= 252, `BTCUtils.determineVarIntDataLengthAt`\n // returns `0`, so we jump over one byte of compactSize uint.\n //\n // For >= 253 && <= 0xffff there is `0xfd` tag,\n // `BTCUtils.determineVarIntDataLengthAt` returns `2` (no\n // tag byte included) so we need to jump over 1+2 bytes of\n // compactSize uint.\n //\n // Please refer `BTCUtils` library and compactSize uint\n // docs in `BitcoinTx` library for more details.\n uint256 inputStartingIndex = 4 + 1 + inputsCompactSizeUintLength;\n\n for (uint256 i = 0; i < inputsCount; i++) {\n uint256 inputLength = preimage.determineInputLengthAt(\n inputStartingIndex\n );\n\n (, uint256 scriptSigLength) = preimage.extractScriptSigLenAt(\n inputStartingIndex\n );\n\n if (scriptSigLength > 0) {\n // The input this preimage was generated for was found.\n // All the other inputs in the preimage are marked with a null\n // scriptSig (\"00\") which has length of 1.\n bytes32 outpointTxHash = preimage.extractInputTxIdLeAt(\n inputStartingIndex\n );\n uint32 outpointIndex = BTCUtils.reverseUint32(\n uint32(preimage.extractTxIndexLeAt(inputStartingIndex))\n );\n\n utxoKey = uint256(\n keccak256(abi.encodePacked(outpointTxHash, outpointIndex))\n );\n\n break;\n }\n\n inputStartingIndex += inputLength;\n }\n\n return utxoKey;\n }\n\n /// @notice Extracts the sighash type from the given preimage.\n /// @param preimage Serialized subset of the transaction. See BIP-143 for\n /// reference.\n /// @dev Sighash type is stored as the last 4 bytes in the preimage (little\n /// endian).\n /// @return sighashType Sighash type as a 32-bit integer.\n function extractSighashType(bytes calldata preimage)\n internal\n pure\n returns (uint32 sighashType)\n {\n bytes4 sighashTypeBytes = preimage.slice4(preimage.length - 4);\n uint32 sighashTypeLE = uint32(sighashTypeBytes);\n return sighashTypeLE.reverseUint32();\n }\n}\n" + }, + "contracts/bridge/Heartbeat.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\n\n/// @title Bridge wallet heartbeat\n/// @notice The library establishes expected format for heartbeat messages\n/// signed by wallet ECDSA signing group. Heartbeat messages are\n/// constructed in such a way that they can not be used as a Bitcoin\n/// transaction preimages.\n/// @dev The smallest Bitcoin non-coinbase transaction is a one spending an\n/// OP_TRUE anyonecanspend output and creating 1 OP_TRUE anyonecanspend\n/// output. Such a transaction has 61 bytes (see `BitcoinTx` documentation):\n/// 4 bytes for version\n/// 1 byte for tx_in_count\n/// 36 bytes for tx_in.previous_output\n/// 1 byte for tx_in.script_bytes (value: 0)\n/// 0 bytes for tx_in.signature_script\n/// 4 bytes for tx_in.sequence\n/// 1 byte for tx_out_count\n/// 8 bytes for tx_out.value\n/// 1 byte for tx_out.pk_script_bytes\n/// 1 byte for tx_out.pk_script\n/// 4 bytes for lock_time\n///\n///\n/// The smallest Bitcoin coinbase transaction is a one creating\n/// 1 OP_TRUE anyonecanspend output and having an empty coinbase script.\n/// Such a transaction has 65 bytes:\n/// 4 bytes for version\n/// 1 byte for tx_in_count\n/// 32 bytes for tx_in.hash (all 0x00)\n/// 4 bytes for tx_in.index (all 0xff)\n/// 1 byte for tx_in.script_bytes (value: 0)\n/// 4 bytes for tx_in.height\n/// 0 byte for tx_in.coinbase_script\n/// 4 bytes for tx_in.sequence\n/// 1 byte for tx_out_count\n/// 8 bytes for tx_out.value\n/// 1 byte for tx_out.pk_script_bytes\n/// 1 byte for tx_out.pk_script\n/// 4 bytes for lock_time\n///\n///\n/// A SIGHASH flag is used to indicate which part of the transaction is\n/// signed by the ECDSA signature. There are currently 3 flags:\n/// SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, and different combinations\n/// of these flags.\n///\n/// No matter the SIGHASH flag and no matter the combination, the following\n/// fields from the transaction are always included in the constructed\n/// preimage:\n/// 4 bytes for version\n/// 36 bytes for tx_in.previous_output (or tx_in.hash + tx_in.index for coinbase)\n/// 4 bytes for lock_time\n///\n/// Additionally, the last 4 bytes of the preimage determines the SIGHASH\n/// flag.\n///\n/// This is enough to say there is no way the preimage could be shorter\n/// than 4 + 36 + 4 + 4 = 48 bytes.\n///\n/// For this reason, we construct the heartbeat message, as a 16-byte\n/// message. The first 8 bytes are 0xffffffffffffffff. The last 8 bytes\n/// are for an arbitrary uint64, being a signed heartbeat nonce (for\n/// example, the last Ethereum block hash).\n///\n/// The message being signed by the wallet when executing the heartbeat\n/// protocol should be Bitcoin's hash256 (double SHA-256) of the heartbeat\n/// message:\n/// heartbeat_sighash = hash256(heartbeat_message)\nlibrary Heartbeat {\n using BytesLib for bytes;\n\n /// @notice Determines if the signed byte array is a valid, non-fraudulent\n /// heartbeat message.\n /// @param message Message signed by the wallet. It is a potential heartbeat\n /// message, Bitcoin transaction preimage, or an arbitrary signed\n /// bytes.\n /// @dev Wallet heartbeat message must be exactly 16 bytes long with the first\n /// 8 bytes set to 0xffffffffffffffff.\n /// @return True if valid heartbeat message, false otherwise.\n function isValidHeartbeatMessage(bytes calldata message)\n internal\n pure\n returns (bool)\n {\n if (message.length != 16) {\n return false;\n }\n\n if (message.slice8(0) != 0xffffffffffffffff) {\n return false;\n }\n\n return true;\n }\n}\n" + }, + "contracts/bridge/IRelay.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\n/// @title Interface for the Bitcoin relay\n/// @notice Contains only the methods needed by tBTC v2. The Bitcoin relay\n/// provides the difficulty of the previous and current epoch. One\n/// difficulty epoch spans 2016 blocks.\ninterface IRelay {\n /// @notice Returns the difficulty of the current epoch.\n function getCurrentEpochDifficulty() external view returns (uint256);\n\n /// @notice Returns the difficulty of the previous epoch.\n function getPrevEpochDifficulty() external view returns (uint256);\n}\n" + }, + "contracts/bridge/MovingFunds.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Redemption.sol\";\nimport \"./Wallets.sol\";\n\n/// @title Moving Bridge wallet funds\n/// @notice The library handles the logic for moving Bitcoin between Bridge\n/// wallets.\n/// @dev A wallet that failed a heartbeat, did not process requested redemption\n/// on time, or qualifies to be closed, begins the procedure of moving\n/// funds to other wallets in the Bridge. The wallet needs to commit to\n/// which other Live wallets it is moving the funds to and then, provide an\n/// SPV proof of moving funds to the previously committed wallets.\n/// Once the proof is submitted, all target wallets are supposed to\n/// sweep the received UTXOs with their own main UTXOs in order to\n/// update their BTC balances.\nlibrary MovingFunds {\n using BridgeState for BridgeState.Storage;\n using Wallets for BridgeState.Storage;\n using BitcoinTx for BridgeState.Storage;\n\n using BTCUtils for bytes;\n using BytesLib for bytes;\n\n /// @notice Represents temporary information needed during the processing\n /// of the moving funds Bitcoin transaction outputs. This structure\n /// is an internal one and should not be exported outside of the\n /// moving funds transaction processing code.\n /// @dev Allows to mitigate \"stack too deep\" errors on EVM.\n struct MovingFundsTxOutputsProcessingInfo {\n // 32-byte hash of the moving funds Bitcoin transaction.\n bytes32 movingFundsTxHash;\n // Output vector of the moving funds Bitcoin transaction. It is\n // assumed the vector's structure is valid so it must be validated\n // using e.g. `BTCUtils.validateVout` function before being used\n // during the processing. The validation is usually done as part\n // of the `BitcoinTx.validateProof` call that checks the SPV proof.\n bytes movingFundsTxOutputVector;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's memory argument.\n }\n\n /// @notice Represents moved funds sweep request state.\n enum MovedFundsSweepRequestState {\n /// @dev The request is unknown to the Bridge.\n Unknown,\n /// @dev Request is pending and can become either processed or timed out.\n Pending,\n /// @dev Request was processed by the target wallet.\n Processed,\n /// @dev Request was not processed in the given time window and\n /// the timeout was reported.\n TimedOut\n }\n\n /// @notice Represents a moved funds sweep request. The request is\n /// registered in `submitMovingFundsProof` where we know funds\n /// have been moved to the target wallet and the only step left is\n /// to have the target wallet sweep them.\n struct MovedFundsSweepRequest {\n // 20-byte public key hash of the wallet supposed to sweep the UTXO\n // representing the received funds with their own main UTXO\n bytes20 walletPubKeyHash;\n // Value of the received funds.\n uint64 value;\n // UNIX timestamp the request was created at.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 createdAt;\n // The current state of the request.\n MovedFundsSweepRequestState state;\n // This struct doesn't contain `__gap` property as the structure is stored\n // in a mapping, mappings store values in different slots and they are\n // not contiguous with other values.\n }\n\n event MovingFundsCommitmentSubmitted(\n bytes20 indexed walletPubKeyHash,\n bytes20[] targetWallets,\n address submitter\n );\n\n event MovingFundsTimeoutReset(bytes20 indexed walletPubKeyHash);\n\n event MovingFundsCompleted(\n bytes20 indexed walletPubKeyHash,\n bytes32 movingFundsTxHash\n );\n\n event MovingFundsTimedOut(bytes20 indexed walletPubKeyHash);\n\n event MovingFundsBelowDustReported(bytes20 indexed walletPubKeyHash);\n\n event MovedFundsSwept(\n bytes20 indexed walletPubKeyHash,\n bytes32 sweepTxHash\n );\n\n event MovedFundsSweepTimedOut(\n bytes20 indexed walletPubKeyHash,\n bytes32 movingFundsTxHash,\n uint32 movingFundsTxOutputIndex\n );\n\n /// @notice Submits the moving funds target wallets commitment.\n /// Once all requirements are met, that function registers the\n /// target wallets commitment and opens the way for moving funds\n /// proof submission.\n /// @param walletPubKeyHash 20-byte public key hash of the source wallet.\n /// @param walletMainUtxo Data of the source wallet's main UTXO, as\n /// currently known on the Ethereum chain.\n /// @param walletMembersIDs Identifiers of the source wallet signing group\n /// members.\n /// @param walletMemberIndex Position of the caller in the source wallet\n /// signing group members list.\n /// @param targetWallets List of 20-byte public key hashes of the target\n /// wallets that the source wallet commits to move the funds to.\n /// @dev Requirements:\n /// - The source wallet must be in the MovingFunds state,\n /// - The source wallet must not have pending redemption requests,\n /// - The source wallet must not have pending moved funds sweep requests,\n /// - The source wallet must not have submitted its commitment already,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given source wallet in the ECDSA registry. Those IDs are\n /// not directly stored in the contract for gas efficiency purposes\n /// but they can be read from appropriate `DkgResultSubmitted`\n /// and `DkgResultApproved` events,\n /// - The `walletMemberIndex` must be in range [1, walletMembersIDs.length],\n /// - The caller must be the member of the source wallet signing group\n /// at the position indicated by `walletMemberIndex` parameter,\n /// - The `walletMainUtxo` components must point to the recent main\n /// UTXO of the source wallet, as currently known on the Ethereum\n /// chain,\n /// - Source wallet BTC balance must be greater than zero,\n /// - At least one Live wallet must exist in the system,\n /// - Submitted target wallets count must match the expected count\n /// `N = min(liveWalletsCount, ceil(walletBtcBalance / walletMaxBtcTransfer))`\n /// where `N > 0`,\n /// - Each target wallet must be not equal to the source wallet,\n /// - Each target wallet must follow the expected order i.e. all\n /// target wallets 20-byte public key hashes represented as numbers\n /// must form a strictly increasing sequence without duplicates,\n /// - Each target wallet must be in Live state.\n function submitMovingFundsCommitment(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata walletMainUtxo,\n uint32[] calldata walletMembersIDs,\n uint256 walletMemberIndex,\n bytes20[] calldata targetWallets\n ) external {\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n\n require(\n wallet.state == Wallets.WalletState.MovingFunds,\n \"Source wallet must be in MovingFunds state\"\n );\n\n require(\n wallet.pendingRedemptionsValue == 0,\n \"Source wallet must handle all pending redemptions first\"\n );\n\n require(\n wallet.pendingMovedFundsSweepRequestsCount == 0,\n \"Source wallet must handle all pending moved funds sweep requests first\"\n );\n\n require(\n wallet.movingFundsTargetWalletsCommitmentHash == bytes32(0),\n \"Target wallets commitment already submitted\"\n );\n\n require(\n self.ecdsaWalletRegistry.isWalletMember(\n wallet.ecdsaWalletID,\n walletMembersIDs,\n msg.sender,\n walletMemberIndex\n ),\n \"Caller is not a member of the source wallet\"\n );\n\n uint64 walletBtcBalance = self.getWalletBtcBalance(\n walletPubKeyHash,\n walletMainUtxo\n );\n\n require(walletBtcBalance > 0, \"Wallet BTC balance is zero\");\n\n uint256 expectedTargetWalletsCount = Math.min(\n self.liveWalletsCount,\n Math.ceilDiv(walletBtcBalance, self.walletMaxBtcTransfer)\n );\n\n // This requirement fails only when `liveWalletsCount` is zero. In\n // that case, the system cannot accept the commitment and must provide\n // new wallets first. However, the wallet supposed to submit the\n // commitment can keep resetting the moving funds timeout until then.\n require(expectedTargetWalletsCount > 0, \"No target wallets available\");\n\n require(\n targetWallets.length == expectedTargetWalletsCount,\n \"Submitted target wallets count is other than expected\"\n );\n\n uint160 lastProcessedTargetWallet = 0;\n\n for (uint256 i = 0; i < targetWallets.length; i++) {\n bytes20 targetWallet = targetWallets[i];\n\n require(\n targetWallet != walletPubKeyHash,\n \"Submitted target wallet cannot be equal to the source wallet\"\n );\n\n require(\n uint160(targetWallet) > lastProcessedTargetWallet,\n \"Submitted target wallet breaks the expected order\"\n );\n\n require(\n self.registeredWallets[targetWallet].state ==\n Wallets.WalletState.Live,\n \"Submitted target wallet must be in Live state\"\n );\n\n lastProcessedTargetWallet = uint160(targetWallet);\n }\n\n wallet.movingFundsTargetWalletsCommitmentHash = keccak256(\n abi.encodePacked(targetWallets)\n );\n\n emit MovingFundsCommitmentSubmitted(\n walletPubKeyHash,\n targetWallets,\n msg.sender\n );\n }\n\n /// @notice Resets the moving funds timeout for the given wallet if the\n /// target wallet commitment cannot be submitted due to a lack\n /// of live wallets in the system.\n /// @param walletPubKeyHash 20-byte public key hash of the moving funds wallet\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The target wallets commitment must not be already submitted for\n /// the given moving funds wallet,\n /// - Live wallets count must be zero,\n /// - The moving funds timeout reset delay must be elapsed.\n function resetMovingFundsTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) external {\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n\n require(\n wallet.state == Wallets.WalletState.MovingFunds,\n \"Wallet must be in MovingFunds state\"\n );\n\n // If the moving funds wallet already submitted their target wallets\n // commitment, there is no point to reset the timeout since the\n // wallet can make the BTC transaction and submit the proof.\n require(\n wallet.movingFundsTargetWalletsCommitmentHash == bytes32(0),\n \"Target wallets commitment already submitted\"\n );\n\n require(self.liveWalletsCount == 0, \"Live wallets count must be zero\");\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp >\n wallet.movingFundsRequestedAt +\n self.movingFundsTimeoutResetDelay,\n \"Moving funds timeout cannot be reset yet\"\n );\n\n /* solhint-disable-next-line not-rely-on-time */\n wallet.movingFundsRequestedAt = uint32(block.timestamp);\n\n emit MovingFundsTimeoutReset(walletPubKeyHash);\n }\n\n /// @notice Used by the wallet to prove the BTC moving funds transaction\n /// and to make the necessary state changes. Moving funds is only\n /// accepted if it satisfies SPV proof.\n ///\n /// The function validates the moving funds transaction structure\n /// by checking if it actually spends the main UTXO of the declared\n /// wallet and locks the value on the pre-committed target wallets\n /// using a reasonable transaction fee. If all preconditions are\n /// met, this functions closes the source wallet.\n ///\n /// It is possible to prove the given moving funds transaction only\n /// one time.\n /// @param movingFundsTx Bitcoin moving funds transaction data.\n /// @param movingFundsProof Bitcoin moving funds proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet\n /// which performed the moving funds transaction.\n /// @dev Requirements:\n /// - `movingFundsTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `movingFundsTx` should represent a Bitcoin transaction with\n /// exactly 1 input that refers to the wallet's main UTXO. That\n /// transaction should have 1..n outputs corresponding to the\n /// pre-committed target wallets. Outputs must be ordered in the\n /// same way as their corresponding target wallets are ordered\n /// within the target wallets commitment,\n /// - `movingFundsProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// Additionally, the recent main UTXO on Ethereum must be set,\n /// - `walletPubKeyHash` must be connected with the main UTXO used\n /// as transaction single input,\n /// - The wallet that `walletPubKeyHash` points to must be in the\n /// MovingFunds state,\n /// - The target wallets commitment must be submitted by the wallet\n /// that `walletPubKeyHash` points to,\n /// - The total Bitcoin transaction fee must be lesser or equal\n /// to `movingFundsTxMaxTotalFee` governable parameter.\n function submitMovingFundsProof(\n BridgeState.Storage storage self,\n BitcoinTx.Info calldata movingFundsTx,\n BitcoinTx.Proof calldata movingFundsProof,\n BitcoinTx.UTXO calldata mainUtxo,\n bytes20 walletPubKeyHash\n ) external {\n // Wallet state is validated in `notifyWalletFundsMoved`.\n\n // The actual transaction proof is performed here. After that point, we\n // can assume the transaction happened on Bitcoin chain and has\n // a sufficient number of confirmations as determined by\n // `txProofDifficultyFactor` constant.\n bytes32 movingFundsTxHash = self.validateProof(\n movingFundsTx,\n movingFundsProof\n );\n\n // Assert that main UTXO for passed wallet exists in storage.\n bytes32 mainUtxoHash = self\n .registeredWallets[walletPubKeyHash]\n .mainUtxoHash;\n require(mainUtxoHash != bytes32(0), \"No main UTXO for given wallet\");\n\n // Assert that passed main UTXO parameter is the same as in storage and\n // can be used for further processing.\n require(\n keccak256(\n abi.encodePacked(\n mainUtxo.txHash,\n mainUtxo.txOutputIndex,\n mainUtxo.txOutputValue\n )\n ) == mainUtxoHash,\n \"Invalid main UTXO data\"\n );\n\n // Process the moving funds transaction input. Specifically, check if\n // it refers to the expected wallet's main UTXO.\n OutboundTx.processWalletOutboundTxInput(\n self,\n movingFundsTx.inputVector,\n mainUtxo\n );\n\n (\n bytes32 targetWalletsHash,\n uint256 outputsTotalValue\n ) = processMovingFundsTxOutputs(\n self,\n MovingFundsTxOutputsProcessingInfo(\n movingFundsTxHash,\n movingFundsTx.outputVector\n )\n );\n\n require(\n mainUtxo.txOutputValue - outputsTotalValue <=\n self.movingFundsTxMaxTotalFee,\n \"Transaction fee is too high\"\n );\n\n self.notifyWalletFundsMoved(walletPubKeyHash, targetWalletsHash);\n // slither-disable-next-line reentrancy-events\n emit MovingFundsCompleted(walletPubKeyHash, movingFundsTxHash);\n }\n\n /// @notice Processes the moving funds Bitcoin transaction output vector\n /// and extracts information required for further processing.\n /// @param processInfo Processing info containing the moving funds tx\n /// hash and output vector.\n /// @return targetWalletsHash keccak256 hash over the list of actual\n /// target wallets used in the transaction.\n /// @return outputsTotalValue Sum of all outputs values.\n /// @dev Requirements:\n /// - The `movingFundsTxOutputVector` must be parseable, i.e. must\n /// be validated by the caller as stated in their parameter doc,\n /// - Each output must refer to a 20-byte public key hash,\n /// - The total outputs value must be evenly divided over all outputs.\n function processMovingFundsTxOutputs(\n BridgeState.Storage storage self,\n MovingFundsTxOutputsProcessingInfo memory processInfo\n ) internal returns (bytes32 targetWalletsHash, uint256 outputsTotalValue) {\n // Determining the total number of Bitcoin transaction outputs in\n // the same way as for number of inputs. See `BitcoinTx.outputVector`\n // docs for more details.\n (\n uint256 outputsCompactSizeUintLength,\n uint256 outputsCount\n ) = processInfo.movingFundsTxOutputVector.parseVarInt();\n\n // To determine the first output starting index, we must jump over\n // the compactSize uint which prepends the output vector. One byte\n // must be added because `BtcUtils.parseVarInt` does not include\n // compactSize uint tag in the returned length.\n //\n // For >= 0 && <= 252, `BTCUtils.determineVarIntDataLengthAt`\n // returns `0`, so we jump over one byte of compactSize uint.\n //\n // For >= 253 && <= 0xffff there is `0xfd` tag,\n // `BTCUtils.determineVarIntDataLengthAt` returns `2` (no\n // tag byte included) so we need to jump over 1+2 bytes of\n // compactSize uint.\n //\n // Please refer `BTCUtils` library and compactSize uint\n // docs in `BitcoinTx` library for more details.\n uint256 outputStartingIndex = 1 + outputsCompactSizeUintLength;\n\n bytes20[] memory targetWallets = new bytes20[](outputsCount);\n uint64[] memory outputsValues = new uint64[](outputsCount);\n\n // Outputs processing loop. Note that the `outputIndex` must be\n // `uint32` to build proper `movedFundsSweepRequests` keys.\n for (\n uint32 outputIndex = 0;\n outputIndex < outputsCount;\n outputIndex++\n ) {\n uint256 outputLength = processInfo\n .movingFundsTxOutputVector\n .determineOutputLengthAt(outputStartingIndex);\n\n bytes memory output = processInfo.movingFundsTxOutputVector.slice(\n outputStartingIndex,\n outputLength\n );\n\n bytes20 targetWalletPubKeyHash = self.extractPubKeyHash(output);\n\n // Add the wallet public key hash to the list that will be used\n // to build the result list hash. There is no need to check if\n // given output is a change here because the actual target wallet\n // list must be exactly the same as the pre-committed target wallet\n // list which is guaranteed to be valid.\n targetWallets[outputIndex] = targetWalletPubKeyHash;\n\n // Extract the value from given output.\n outputsValues[outputIndex] = output.extractValue();\n outputsTotalValue += outputsValues[outputIndex];\n\n // Register a moved funds sweep request that must be handled\n // by the target wallet. The target wallet must sweep the\n // received funds with their own main UTXO in order to update\n // their BTC balance. Worth noting there is no need to check\n // if the sweep request already exists in the system because\n // the moving funds wallet is moved to the Closing state after\n // submitting the moving funds proof so there is no possibility\n // to submit the proof again and register the sweep request twice.\n self.movedFundsSweepRequests[\n uint256(\n keccak256(\n abi.encodePacked(\n processInfo.movingFundsTxHash,\n outputIndex\n )\n )\n )\n ] = MovedFundsSweepRequest(\n targetWalletPubKeyHash,\n outputsValues[outputIndex],\n /* solhint-disable-next-line not-rely-on-time */\n uint32(block.timestamp),\n MovedFundsSweepRequestState.Pending\n );\n // We added a new moved funds sweep request for the target wallet\n // so we must increment their request counter.\n self\n .registeredWallets[targetWalletPubKeyHash]\n .pendingMovedFundsSweepRequestsCount++;\n\n // Make the `outputStartingIndex` pointing to the next output by\n // increasing it by current output's length.\n outputStartingIndex += outputLength;\n }\n\n // Compute the indivisible remainder that remains after dividing the\n // outputs total value over all outputs evenly.\n uint256 outputsTotalValueRemainder = outputsTotalValue % outputsCount;\n // Compute the minimum allowed output value by dividing the outputs\n // total value (reduced by the remainder) by the number of outputs.\n uint256 minOutputValue = (outputsTotalValue -\n outputsTotalValueRemainder) / outputsCount;\n // Maximum possible value is the minimum value with the remainder included.\n uint256 maxOutputValue = minOutputValue + outputsTotalValueRemainder;\n\n for (uint256 i = 0; i < outputsCount; i++) {\n require(\n minOutputValue <= outputsValues[i] &&\n outputsValues[i] <= maxOutputValue,\n \"Transaction amount is not distributed evenly\"\n );\n }\n\n targetWalletsHash = keccak256(abi.encodePacked(targetWallets));\n\n return (targetWalletsHash, outputsTotalValue);\n }\n\n /// @notice Notifies about a timed out moving funds process. Terminates\n /// the wallet and slashes signing group members as a result.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The moving funds timeout must be actually exceeded,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract.\n function notifyMovingFundsTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs\n ) external {\n // Wallet state is validated in `notifyWalletMovingFundsTimeout`.\n\n uint32 movingFundsRequestedAt = self\n .registeredWallets[walletPubKeyHash]\n .movingFundsRequestedAt;\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp > movingFundsRequestedAt + self.movingFundsTimeout,\n \"Moving funds has not timed out yet\"\n );\n\n self.notifyWalletMovingFundsTimeout(walletPubKeyHash, walletMembersIDs);\n\n // slither-disable-next-line reentrancy-events\n emit MovingFundsTimedOut(walletPubKeyHash);\n }\n\n /// @notice Notifies about a moving funds wallet whose BTC balance is\n /// below the moving funds dust threshold. Ends the moving funds\n /// process and begins wallet closing immediately.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known\n /// on the Ethereum chain.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state,\n /// - The `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// If the wallet has no main UTXO, this parameter can be empty as it\n /// is ignored,\n /// - The wallet BTC balance must be below the moving funds threshold.\n function notifyMovingFundsBelowDust(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo\n ) external {\n // Wallet state is validated in `notifyWalletMovingFundsBelowDust`.\n\n uint64 walletBtcBalance = self.getWalletBtcBalance(\n walletPubKeyHash,\n mainUtxo\n );\n\n require(\n walletBtcBalance < self.movingFundsDustThreshold,\n \"Wallet BTC balance must be below the moving funds dust threshold\"\n );\n\n self.notifyWalletMovingFundsBelowDust(walletPubKeyHash);\n\n // slither-disable-next-line reentrancy-events\n emit MovingFundsBelowDustReported(walletPubKeyHash);\n }\n\n /// @notice Used by the wallet to prove the BTC moved funds sweep\n /// transaction and to make the necessary state changes. Moved\n /// funds sweep is only accepted if it satisfies SPV proof.\n ///\n /// The function validates the sweep transaction structure by\n /// checking if it actually spends the moved funds UTXO and the\n /// sweeping wallet's main UTXO (optionally), and if it locks the\n /// value on the sweeping wallet's 20-byte public key hash using a\n /// reasonable transaction fee. If all preconditions are\n /// met, this function updates the sweeping wallet main UTXO, thus\n /// their BTC balance.\n ///\n /// It is possible to prove the given sweep transaction only\n /// one time.\n /// @param sweepTx Bitcoin sweep funds transaction data.\n /// @param sweepProof Bitcoin sweep funds proof data.\n /// @param mainUtxo Data of the sweeping wallet's main UTXO, as currently\n /// known on the Ethereum chain.\n /// @dev Requirements:\n /// - `sweepTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `sweepTx` should represent a Bitcoin transaction with\n /// the first input pointing to a wallet's sweep Pending request and,\n /// optionally, the second input pointing to the wallet's main UTXO,\n /// if the sweeping wallet has a main UTXO set. There should be only\n /// one output locking funds on the sweeping wallet 20-byte public\n /// key hash,\n /// - `sweepProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the sweeping wallet, as currently known on the Ethereum chain.\n /// If there is no main UTXO, this parameter is ignored,\n /// - The sweeping wallet must be in the Live or MovingFunds state,\n /// - The total Bitcoin transaction fee must be lesser or equal\n /// to `movedFundsSweepTxMaxTotalFee` governable parameter.\n function submitMovedFundsSweepProof(\n BridgeState.Storage storage self,\n BitcoinTx.Info calldata sweepTx,\n BitcoinTx.Proof calldata sweepProof,\n BitcoinTx.UTXO calldata mainUtxo\n ) external {\n // Wallet state validation is performed in the\n // `resolveMovedFundsSweepingWallet` function.\n\n // The actual transaction proof is performed here. After that point, we\n // can assume the transaction happened on Bitcoin chain and has\n // a sufficient number of confirmations as determined by\n // `txProofDifficultyFactor` constant.\n bytes32 sweepTxHash = self.validateProof(sweepTx, sweepProof);\n\n (\n bytes20 walletPubKeyHash,\n uint64 sweepTxOutputValue\n ) = processMovedFundsSweepTxOutput(self, sweepTx.outputVector);\n\n (\n Wallets.Wallet storage wallet,\n BitcoinTx.UTXO memory resolvedMainUtxo\n ) = resolveMovedFundsSweepingWallet(self, walletPubKeyHash, mainUtxo);\n\n uint256 sweepTxInputsTotalValue = processMovedFundsSweepTxInputs(\n self,\n sweepTx.inputVector,\n resolvedMainUtxo,\n walletPubKeyHash\n );\n\n require(\n sweepTxInputsTotalValue - sweepTxOutputValue <=\n self.movedFundsSweepTxMaxTotalFee,\n \"Transaction fee is too high\"\n );\n\n // Use the sweep transaction output as the new sweeping wallet's main UTXO.\n // Transaction output index is always 0 as sweep transaction always\n // contains only one output.\n wallet.mainUtxoHash = keccak256(\n abi.encodePacked(sweepTxHash, uint32(0), sweepTxOutputValue)\n );\n\n // slither-disable-next-line reentrancy-events\n emit MovedFundsSwept(walletPubKeyHash, sweepTxHash);\n }\n\n /// @notice Processes the Bitcoin moved funds sweep transaction output vector\n /// by extracting the single output and using it to gain additional\n /// information required for further processing (e.g. value and\n /// wallet public key hash).\n /// @param sweepTxOutputVector Bitcoin moved funds sweep transaction output\n /// vector.\n /// This function assumes vector's structure is valid so it must be\n /// validated using e.g. `BTCUtils.validateVout` function before\n /// it is passed here.\n /// @return walletPubKeyHash 20-byte wallet public key hash.\n /// @return value 8-byte moved funds sweep transaction output value.\n /// @dev Requirements:\n /// - Output vector must contain only one output,\n /// - The single output must be of P2PKH or P2WPKH type and lock the\n /// funds on a 20-byte public key hash.\n function processMovedFundsSweepTxOutput(\n BridgeState.Storage storage self,\n bytes memory sweepTxOutputVector\n ) internal view returns (bytes20 walletPubKeyHash, uint64 value) {\n // To determine the total number of sweep transaction outputs, we need to\n // parse the compactSize uint (VarInt) the output vector is prepended by.\n // That compactSize uint encodes the number of vector elements using the\n // format presented in:\n // https://developer.bitcoin.org/reference/transactions.html#compactsize-unsigned-integers\n // We don't need asserting the compactSize uint is parseable since it\n // was already checked during `validateVout` validation performed as\n // part of the `BitcoinTx.validateProof` call.\n // See `BitcoinTx.outputVector` docs for more details.\n (, uint256 outputsCount) = sweepTxOutputVector.parseVarInt();\n require(\n outputsCount == 1,\n \"Moved funds sweep transaction must have a single output\"\n );\n\n bytes memory output = sweepTxOutputVector.extractOutputAtIndex(0);\n walletPubKeyHash = self.extractPubKeyHash(output);\n value = output.extractValue();\n\n return (walletPubKeyHash, value);\n }\n\n /// @notice Resolves sweeping wallet based on the provided wallet public key\n /// hash. Validates the wallet state and current main UTXO, as\n /// currently known on the Ethereum chain.\n /// @param walletPubKeyHash public key hash of the wallet proving the sweep\n /// Bitcoin transaction.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain. If no main UTXO exists for the given wallet,\n /// this parameter is ignored.\n /// @return wallet Data of the sweeping wallet.\n /// @return resolvedMainUtxo The actual main UTXO of the sweeping wallet\n /// resolved by cross-checking the `mainUtxo` parameter with\n /// the chain state. If the validation went well, this is the\n /// plain-text main UTXO corresponding to the `wallet.mainUtxoHash`.\n /// @dev Requirements:\n /// - Sweeping wallet must be either in Live or MovingFunds state,\n /// - If the main UTXO of the sweeping wallet exists in the storage,\n /// the passed `mainUTXO` parameter must be equal to the stored one.\n function resolveMovedFundsSweepingWallet(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo\n )\n internal\n view\n returns (\n Wallets.Wallet storage wallet,\n BitcoinTx.UTXO memory resolvedMainUtxo\n )\n {\n wallet = self.registeredWallets[walletPubKeyHash];\n\n Wallets.WalletState walletState = wallet.state;\n require(\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds,\n \"Wallet must be in Live or MovingFunds state\"\n );\n\n // Check if the main UTXO for given wallet exists. If so, validate\n // passed main UTXO data against the stored hash and use them for\n // further processing. If no main UTXO exists, use empty data.\n resolvedMainUtxo = BitcoinTx.UTXO(bytes32(0), 0, 0);\n bytes32 mainUtxoHash = wallet.mainUtxoHash;\n if (mainUtxoHash != bytes32(0)) {\n require(\n keccak256(\n abi.encodePacked(\n mainUtxo.txHash,\n mainUtxo.txOutputIndex,\n mainUtxo.txOutputValue\n )\n ) == mainUtxoHash,\n \"Invalid main UTXO data\"\n );\n resolvedMainUtxo = mainUtxo;\n }\n }\n\n /// @notice Processes the Bitcoin moved funds sweep transaction input vector.\n /// It extracts the first input and tries to match it with one of\n /// the moved funds sweep requests targeting the sweeping wallet.\n /// If the sweep request is an existing Pending request, this\n /// function marks it as Processed. If the sweeping wallet has a\n /// main UTXO, this function extracts the second input, makes sure\n /// it refers to the wallet main UTXO, and marks that main UTXO as\n /// correctly spent.\n /// @param sweepTxInputVector Bitcoin moved funds sweep transaction input vector.\n /// This function assumes vector's structure is valid so it must be\n /// validated using e.g. `BTCUtils.validateVin` function before\n /// it is passed here.\n /// @param mainUtxo Data of the sweeping wallet's main UTXO. If no main UTXO\n /// exists for the given the wallet, this parameter's fields should\n /// be zeroed to bypass the main UTXO validation.\n /// @param walletPubKeyHash 20-byte public key hash of the sweeping wallet.\n /// @return inputsTotalValue Total inputs value sum.\n /// @dev Requirements:\n /// - The input vector must consist of one mandatory and one optional\n /// input,\n /// - The mandatory input must be the first input in the vector,\n /// - The mandatory input must point to a Pending moved funds sweep\n /// request that is targeted to the sweeping wallet,\n /// - The optional output must be the second input in the vector,\n /// - The optional input is required if the sweeping wallet has a\n /// main UTXO (i.e. the `mainUtxo` is not zeroed). In that case,\n /// that input must point the the sweeping wallet main UTXO.\n function processMovedFundsSweepTxInputs(\n BridgeState.Storage storage self,\n bytes memory sweepTxInputVector,\n BitcoinTx.UTXO memory mainUtxo,\n bytes20 walletPubKeyHash\n ) internal returns (uint256 inputsTotalValue) {\n // To determine the total number of Bitcoin transaction inputs,\n // we need to parse the compactSize uint (VarInt) the input vector is\n // prepended by. That compactSize uint encodes the number of vector\n // elements using the format presented in:\n // https://developer.bitcoin.org/reference/transactions.html#compactsize-unsigned-integers\n // We don't need asserting the compactSize uint is parseable since it\n // was already checked during `validateVin` validation performed as\n // part of the `BitcoinTx.validateProof` call.\n // See `BitcoinTx.inputVector` docs for more details.\n (\n uint256 inputsCompactSizeUintLength,\n uint256 inputsCount\n ) = sweepTxInputVector.parseVarInt();\n\n // To determine the first input starting index, we must jump over\n // the compactSize uint which prepends the input vector. One byte\n // must be added because `BtcUtils.parseVarInt` does not include\n // compactSize uint tag in the returned length.\n //\n // For >= 0 && <= 252, `BTCUtils.determineVarIntDataLengthAt`\n // returns `0`, so we jump over one byte of compactSize uint.\n //\n // For >= 253 && <= 0xffff there is `0xfd` tag,\n // `BTCUtils.determineVarIntDataLengthAt` returns `2` (no\n // tag byte included) so we need to jump over 1+2 bytes of\n // compactSize uint.\n //\n // Please refer `BTCUtils` library and compactSize uint\n // docs in `BitcoinTx` library for more details.\n uint256 inputStartingIndex = 1 + inputsCompactSizeUintLength;\n\n // We always expect the first input to be the swept UTXO. Additionally,\n // if the sweeping wallet has a main UTXO, that main UTXO should be\n // pointed by the second input.\n require(\n inputsCount == (mainUtxo.txHash != bytes32(0) ? 2 : 1),\n \"Moved funds sweep transaction must have a proper inputs count\"\n );\n\n // Parse the first input and extract its outpoint tx hash and index.\n (\n bytes32 firstInputOutpointTxHash,\n uint32 firstInputOutpointIndex,\n uint256 firstInputLength\n ) = parseMovedFundsSweepTxInputAt(\n sweepTxInputVector,\n inputStartingIndex\n );\n\n // Build the request key and fetch the corresponding moved funds sweep\n // request from contract storage.\n MovedFundsSweepRequest storage sweepRequest = self\n .movedFundsSweepRequests[\n uint256(\n keccak256(\n abi.encodePacked(\n firstInputOutpointTxHash,\n firstInputOutpointIndex\n )\n )\n )\n ];\n\n require(\n sweepRequest.state == MovedFundsSweepRequestState.Pending,\n \"Sweep request must be in Pending state\"\n );\n // We must check if the wallet extracted from the moved funds sweep\n // transaction output is truly the owner of the sweep request connected\n // with the swept UTXO. This is needed to prevent a case when a wallet\n // handles its own sweep request but locks the funds on another\n // wallet public key hash.\n require(\n sweepRequest.walletPubKeyHash == walletPubKeyHash,\n \"Sweep request belongs to another wallet\"\n );\n // If the validation passed, the sweep request must be marked as\n // processed and its value should be counted into the total inputs\n // value sum.\n sweepRequest.state = MovedFundsSweepRequestState.Processed;\n inputsTotalValue += sweepRequest.value;\n\n self\n .registeredWallets[walletPubKeyHash]\n .pendingMovedFundsSweepRequestsCount--;\n\n // If the main UTXO for the sweeping wallet exists, it must be processed.\n if (mainUtxo.txHash != bytes32(0)) {\n // The second input is supposed to point to that sweeping wallet\n // main UTXO. We need to parse that input.\n (\n bytes32 secondInputOutpointTxHash,\n uint32 secondInputOutpointIndex,\n\n ) = parseMovedFundsSweepTxInputAt(\n sweepTxInputVector,\n inputStartingIndex + firstInputLength\n );\n // Make sure the second input refers to the sweeping wallet main UTXO.\n require(\n mainUtxo.txHash == secondInputOutpointTxHash &&\n mainUtxo.txOutputIndex == secondInputOutpointIndex,\n \"Second input must point to the wallet's main UTXO\"\n );\n\n // If the validation passed, count the main UTXO value into the\n // total inputs value sum.\n inputsTotalValue += mainUtxo.txOutputValue;\n\n // Main UTXO used as an input, mark it as spent. This is needed\n // to defend against fraud challenges referring to this main UTXO.\n self.spentMainUTXOs[\n uint256(\n keccak256(\n abi.encodePacked(\n secondInputOutpointTxHash,\n secondInputOutpointIndex\n )\n )\n )\n ] = true;\n }\n\n return inputsTotalValue;\n }\n\n /// @notice Parses a Bitcoin transaction input starting at the given index.\n /// @param inputVector Bitcoin transaction input vector.\n /// @param inputStartingIndex Index the given input starts at.\n /// @return outpointTxHash 32-byte hash of the Bitcoin transaction which is\n /// pointed in the given input's outpoint.\n /// @return outpointIndex 4-byte index of the Bitcoin transaction output\n /// which is pointed in the given input's outpoint.\n /// @return inputLength Byte length of the given input.\n /// @dev This function assumes vector's structure is valid so it must be\n /// validated using e.g. `BTCUtils.validateVin` function before it\n /// is passed here.\n function parseMovedFundsSweepTxInputAt(\n bytes memory inputVector,\n uint256 inputStartingIndex\n )\n internal\n pure\n returns (\n bytes32 outpointTxHash,\n uint32 outpointIndex,\n uint256 inputLength\n )\n {\n outpointTxHash = inputVector.extractInputTxIdLeAt(inputStartingIndex);\n\n outpointIndex = BTCUtils.reverseUint32(\n uint32(inputVector.extractTxIndexLeAt(inputStartingIndex))\n );\n\n inputLength = inputVector.determineInputLengthAt(inputStartingIndex);\n\n return (outpointTxHash, outpointIndex, inputLength);\n }\n\n /// @notice Notifies about a timed out moved funds sweep process. If the\n /// wallet is not terminated yet, that function terminates\n /// the wallet and slashes signing group members as a result.\n /// Marks the given sweep request as TimedOut.\n /// @param movingFundsTxHash 32-byte hash of the moving funds transaction\n /// that caused the sweep request to be created.\n /// @param movingFundsTxOutputIndex Index of the moving funds transaction\n /// output that is subject of the sweep request.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The moved funds sweep request must be in the Pending state,\n /// - The moved funds sweep timeout must be actually exceeded,\n /// - The wallet must be either in the Live or MovingFunds or\n /// Terminated state,,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract.\n function notifyMovedFundsSweepTimeout(\n BridgeState.Storage storage self,\n bytes32 movingFundsTxHash,\n uint32 movingFundsTxOutputIndex,\n uint32[] calldata walletMembersIDs\n ) external {\n // Wallet state is validated in `notifyWalletMovedFundsSweepTimeout`.\n\n MovedFundsSweepRequest storage sweepRequest = self\n .movedFundsSweepRequests[\n uint256(\n keccak256(\n abi.encodePacked(\n movingFundsTxHash,\n movingFundsTxOutputIndex\n )\n )\n )\n ];\n\n require(\n sweepRequest.state == MovedFundsSweepRequestState.Pending,\n \"Sweep request must be in Pending state\"\n );\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp >\n sweepRequest.createdAt + self.movedFundsSweepTimeout,\n \"Sweep request has not timed out yet\"\n );\n\n bytes20 walletPubKeyHash = sweepRequest.walletPubKeyHash;\n\n self.notifyWalletMovedFundsSweepTimeout(\n walletPubKeyHash,\n walletMembersIDs\n );\n\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n sweepRequest.state = MovedFundsSweepRequestState.TimedOut;\n wallet.pendingMovedFundsSweepRequestsCount--;\n\n // slither-disable-next-line reentrancy-events\n emit MovedFundsSweepTimedOut(\n walletPubKeyHash,\n movingFundsTxHash,\n movingFundsTxOutputIndex\n );\n }\n}\n" + }, + "contracts/bridge/Redemption.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./BridgeState.sol\";\nimport \"./Wallets.sol\";\n\nimport \"../bank/Bank.sol\";\n\n/// @notice Aggregates functions common to the redemption transaction proof\n/// validation and to the moving funds transaction proof validation.\nlibrary OutboundTx {\n using BTCUtils for bytes;\n\n /// @notice Checks whether an outbound Bitcoin transaction performed from\n /// the given wallet has an input vector that contains a single\n /// input referring to the wallet's main UTXO. Marks that main UTXO\n /// as correctly spent if the validation succeeds. Reverts otherwise.\n /// There are two outbound transactions from a wallet possible: a\n /// redemption transaction or a moving funds to another wallet\n /// transaction.\n /// @param walletOutboundTxInputVector Bitcoin outbound transaction's input\n /// vector. This function assumes vector's structure is valid so it\n /// must be validated using e.g. `BTCUtils.validateVin` function\n /// before it is passed here.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n function processWalletOutboundTxInput(\n BridgeState.Storage storage self,\n bytes memory walletOutboundTxInputVector,\n BitcoinTx.UTXO calldata mainUtxo\n ) internal {\n // Assert that the single outbound transaction input actually\n // refers to the wallet's main UTXO.\n (\n bytes32 outpointTxHash,\n uint32 outpointIndex\n ) = parseWalletOutboundTxInput(walletOutboundTxInputVector);\n require(\n mainUtxo.txHash == outpointTxHash &&\n mainUtxo.txOutputIndex == outpointIndex,\n \"Outbound transaction input must point to the wallet's main UTXO\"\n );\n\n // Main UTXO used as an input, mark it as spent.\n self.spentMainUTXOs[\n uint256(\n keccak256(\n abi.encodePacked(mainUtxo.txHash, mainUtxo.txOutputIndex)\n )\n )\n ] = true;\n }\n\n /// @notice Parses the input vector of an outbound Bitcoin transaction\n /// performed from the given wallet. It extracts the single input\n /// then the transaction hash and output index from its outpoint.\n /// There are two outbound transactions from a wallet possible: a\n /// redemption transaction or a moving funds to another wallet\n /// transaction.\n /// @param walletOutboundTxInputVector Bitcoin outbound transaction input\n /// vector. This function assumes vector's structure is valid so it\n /// must be validated using e.g. `BTCUtils.validateVin` function\n /// before it is passed here.\n /// @return outpointTxHash 32-byte hash of the Bitcoin transaction which is\n /// pointed in the input's outpoint.\n /// @return outpointIndex 4-byte index of the Bitcoin transaction output\n /// which is pointed in the input's outpoint.\n function parseWalletOutboundTxInput(\n bytes memory walletOutboundTxInputVector\n ) internal pure returns (bytes32 outpointTxHash, uint32 outpointIndex) {\n // To determine the total number of Bitcoin transaction inputs,\n // we need to parse the compactSize uint (VarInt) the input vector is\n // prepended by. That compactSize uint encodes the number of vector\n // elements using the format presented in:\n // https://developer.bitcoin.org/reference/transactions.html#compactsize-unsigned-integers\n // We don't need asserting the compactSize uint is parseable since it\n // was already checked during `validateVin` validation.\n // See `BitcoinTx.inputVector` docs for more details.\n (, uint256 inputsCount) = walletOutboundTxInputVector.parseVarInt();\n require(\n inputsCount == 1,\n \"Outbound transaction must have a single input\"\n );\n\n bytes memory input = walletOutboundTxInputVector.extractInputAtIndex(0);\n\n outpointTxHash = input.extractInputTxIdLE();\n\n outpointIndex = BTCUtils.reverseUint32(\n uint32(input.extractTxIndexLE())\n );\n\n // There is only one input in the transaction. Input has an outpoint\n // field that is a reference to the transaction being spent (see\n // `BitcoinTx` docs). The outpoint contains the hash of the transaction\n // to spend (`outpointTxHash`) and the index of the specific output\n // from that transaction (`outpointIndex`).\n return (outpointTxHash, outpointIndex);\n }\n}\n\n/// @title Bridge redemption\n/// @notice The library handles the logic for redeeming Bitcoin balances from\n/// the Bridge.\n/// @dev To initiate a redemption, a user with a Bank balance supplies\n/// a Bitcoin address. Then, the system calculates the redemption fee, and\n/// releases balance to the provided Bitcoin address. Just like in case of\n/// sweeps of revealed deposits, redemption requests are processed in\n/// batches and require SPV proof to be submitted to the Bridge.\nlibrary Redemption {\n using BridgeState for BridgeState.Storage;\n using Wallets for BridgeState.Storage;\n using BitcoinTx for BridgeState.Storage;\n\n using BTCUtils for bytes;\n using BytesLib for bytes;\n\n /// @notice Represents a redemption request.\n struct RedemptionRequest {\n // ETH address of the redeemer who created the request.\n address redeemer;\n // Requested TBTC amount in satoshi.\n uint64 requestedAmount;\n // Treasury TBTC fee in satoshi at the moment of request creation.\n uint64 treasuryFee;\n // Transaction maximum BTC fee in satoshi at the moment of request\n // creation.\n uint64 txMaxFee;\n // UNIX timestamp the request was created at.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 requestedAt;\n // This struct doesn't contain `__gap` property as the structure is stored\n // in a mapping, mappings store values in different slots and they are\n // not contiguous with other values.\n }\n\n /// @notice Represents an outcome of the redemption Bitcoin transaction\n /// outputs processing.\n struct RedemptionTxOutputsInfo {\n // Sum of all outputs values i.e. all redemptions and change value,\n // if present.\n uint256 outputsTotalValue;\n // Total TBTC value in satoshi that should be burned by the Bridge.\n // It includes the total amount of all BTC redeemed in the transaction\n // and the fee paid to BTC miners for the redemption transaction.\n uint64 totalBurnableValue;\n // Total TBTC value in satoshi that should be transferred to\n // the treasury. It is a sum of all treasury fees paid by all\n // redeemers included in the redemption transaction.\n uint64 totalTreasuryFee;\n // Index of the change output. The change output becomes\n // the new main wallet's UTXO.\n uint32 changeIndex;\n // Value in satoshi of the change output.\n uint64 changeValue;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's memory argument.\n }\n\n /// @notice Represents temporary information needed during the processing of\n /// the redemption Bitcoin transaction outputs. This structure is an\n /// internal one and should not be exported outside of the redemption\n /// transaction processing code.\n /// @dev Allows to mitigate \"stack too deep\" errors on EVM.\n struct RedemptionTxOutputsProcessingInfo {\n // The first output starting index in the transaction.\n uint256 outputStartingIndex;\n // The number of outputs in the transaction.\n uint256 outputsCount;\n // P2PKH script for the wallet. Needed to determine the change output.\n bytes32 walletP2PKHScriptKeccak;\n // P2WPKH script for the wallet. Needed to determine the change output.\n bytes32 walletP2WPKHScriptKeccak;\n // This struct doesn't contain `__gap` property as the structure is not\n // stored, it is used as a function's memory argument.\n }\n\n event RedemptionRequested(\n bytes20 indexed walletPubKeyHash,\n bytes redeemerOutputScript,\n address indexed redeemer,\n uint64 requestedAmount,\n uint64 treasuryFee,\n uint64 txMaxFee\n );\n\n event RedemptionsCompleted(\n bytes20 indexed walletPubKeyHash,\n bytes32 redemptionTxHash\n );\n\n event RedemptionTimedOut(\n bytes20 indexed walletPubKeyHash,\n bytes redeemerOutputScript\n );\n\n /// @notice Requests redemption of the given amount from the specified\n /// wallet to the redeemer Bitcoin output script.\n /// This function handles the simplest case, where balance owner is\n /// the redeemer.\n /// @param walletPubKeyHash The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key).\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param balanceOwner The address of the Bank balance owner whose balance\n /// is getting redeemed. Balance owner address is stored as\n /// a redeemer address who will be able co claim back the Bank\n /// balance if anything goes wrong during the redemption.\n /// @param redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC.\n /// @param amount Requested amount in satoshi. This is also the Bank balance\n /// that is taken from the `balanceOwner` upon request.\n /// Once the request is handled, the actual amount of BTC locked\n /// on the redeemer output script will be always lower than this value\n /// since the treasury and Bitcoin transaction fees must be incurred.\n /// The minimal amount satisfying the request can be computed as:\n /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.\n /// Fees values are taken at the moment of request creation.\n /// @dev Requirements:\n /// - Wallet behind `walletPubKeyHash` must be live,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain,\n /// - `redeemerOutputScript` must be a proper Bitcoin script,\n /// - `redeemerOutputScript` cannot have wallet PKH as payload,\n /// - `amount` must be above or equal the `redemptionDustThreshold`,\n /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be\n /// used for only one pending request at the same time,\n /// - Wallet must have enough Bitcoin balance to proceed the request,\n /// - Balance owner must make an allowance in the Bank that the Bridge\n /// contract can spend the given `amount`.\n function requestRedemption(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo,\n address balanceOwner,\n bytes calldata redeemerOutputScript,\n uint64 amount\n ) external {\n requestRedemption(\n self,\n walletPubKeyHash,\n mainUtxo,\n balanceOwner,\n balanceOwner,\n redeemerOutputScript,\n amount\n );\n }\n\n /// @notice Requests redemption of the given amount from the specified\n /// wallet to the redeemer Bitcoin output script. Used by\n /// `Bridge.receiveBalanceApproval`. Can handle more complex cases\n /// where balance owner may be someone else than the redeemer.\n /// @param balanceOwner The address of the Bank balance owner whose balance\n /// is getting redeemed.\n /// @param amount Requested amount in satoshi. This is also the Bank balance\n /// that is taken from the `balanceOwner` upon request.\n /// Once the request is handled, the actual amount of BTC locked\n /// on the redeemer output script will be always lower than this value\n /// since the treasury and Bitcoin transaction fees must be incurred.\n /// The minimal amount satisfying the request can be computed as:\n /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.\n /// Fees values are taken at the moment of request creation.\n /// @param redemptionData ABI-encoded redemption data:\n /// [\n /// address redeemer,\n /// bytes20 walletPubKeyHash,\n /// bytes32 mainUtxoTxHash,\n /// uint32 mainUtxoTxOutputIndex,\n /// uint64 mainUtxoTxOutputValue,\n /// bytes redeemerOutputScript\n /// ]\n ///\n /// - redeemer: The Ethereum address of the redeemer who will be able\n /// to claim Bank balance if anything goes wrong during the redemption.\n /// In the most basic case, when someone redeems their Bitcoin\n /// balance from the Bank, `balanceOwner` is the same as `redeemer`.\n /// However, when a Vault is redeeming part of its balance for some\n /// redeemer address (for example, someone who has earlier deposited\n /// into that Vault), `balanceOwner` is the Vault, and `redeemer` is\n /// the address for which the vault is redeeming its balance to,\n /// - walletPubKeyHash: The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key),\n /// - mainUtxoTxHash: Data of the wallet's main UTXO TX hash, as\n /// currently known on the Ethereum chain,\n /// - mainUtxoTxOutputIndex: Data of the wallet's main UTXO output\n /// index, as currently known on Ethereum chain,\n /// - mainUtxoTxOutputValue: Data of the wallet's main UTXO output\n /// value, as currently known on Ethereum chain,\n /// - redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC.\n /// @dev Requirements:\n /// - Wallet behind `walletPubKeyHash` must be live,\n /// - `mainUtxo*` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain,\n /// - `redeemerOutputScript` must be a proper Bitcoin script,\n /// - `redeemerOutputScript` cannot have wallet PKH as payload,\n /// - `amount` must be above or equal the `redemptionDustThreshold`,\n /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be\n /// used for only one pending request at the same time,\n /// - Wallet must have enough Bitcoin balance to proceed the request,\n /// - Balance owner must make an allowance in the Bank that the Bridge\n /// contract can spend the given `amount`.\n function requestRedemption(\n BridgeState.Storage storage self,\n address balanceOwner,\n uint64 amount,\n bytes calldata redemptionData\n ) external {\n (\n address redeemer,\n bytes20 walletPubKeyHash,\n bytes32 mainUtxoTxHash,\n uint32 mainUtxoTxOutputIndex,\n uint64 mainUtxoTxOutputValue,\n bytes memory redeemerOutputScript\n ) = abi.decode(\n redemptionData,\n (address, bytes20, bytes32, uint32, uint64, bytes)\n );\n\n requestRedemption(\n self,\n walletPubKeyHash,\n BitcoinTx.UTXO(\n mainUtxoTxHash,\n mainUtxoTxOutputIndex,\n mainUtxoTxOutputValue\n ),\n balanceOwner,\n redeemer,\n redeemerOutputScript,\n amount\n );\n }\n\n /// @notice Requests redemption of the given amount from the specified\n /// wallet to the redeemer Bitcoin output script.\n /// @param walletPubKeyHash The 20-byte wallet public key hash (computed\n /// using Bitcoin HASH160 over the compressed ECDSA public key).\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param balanceOwner The address of the Bank balance owner whose balance\n /// is getting redeemed.\n /// @param redeemer The Ethereum address of the redeemer who will be able to\n /// claim Bank balance if anything goes wrong during the redemption.\n /// In the most basic case, when someone redeems their Bitcoin\n /// balance from the Bank, `balanceOwner` is the same as `redeemer`.\n /// However, when a Vault is redeeming part of its balance for some\n /// redeemer address (for example, someone who has earlier deposited\n /// into that Vault), `balanceOwner` is the Vault, and `redeemer` is\n /// the address for which the vault is redeeming its balance to.\n /// @param redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH) that will be used to lock\n /// redeemed BTC.\n /// @param amount Requested amount in satoshi. This is also the Bank balance\n /// that is taken from the `balanceOwner` upon request.\n /// Once the request is handled, the actual amount of BTC locked\n /// on the redeemer output script will be always lower than this value\n /// since the treasury and Bitcoin transaction fees must be incurred.\n /// The minimal amount satisfying the request can be computed as:\n /// `amount - (amount / redemptionTreasuryFeeDivisor) - redemptionTxMaxFee`.\n /// Fees values are taken at the moment of request creation.\n /// @dev Requirements:\n /// - Wallet behind `walletPubKeyHash` must be live,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain,\n /// - `redeemerOutputScript` must be a proper Bitcoin script,\n /// - `redeemerOutputScript` cannot have wallet PKH as payload,\n /// - `amount` must be above or equal the `redemptionDustThreshold`,\n /// - Given `walletPubKeyHash` and `redeemerOutputScript` pair can be\n /// used for only one pending request at the same time,\n /// - Wallet must have enough Bitcoin balance to proceed the request,\n /// - Balance owner must make an allowance in the Bank that the Bridge\n /// contract can spend the given `amount`.\n function requestRedemption(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO memory mainUtxo,\n address balanceOwner,\n address redeemer,\n bytes memory redeemerOutputScript,\n uint64 amount\n ) internal {\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n\n require(\n wallet.state == Wallets.WalletState.Live,\n \"Wallet must be in Live state\"\n );\n\n bytes32 mainUtxoHash = wallet.mainUtxoHash;\n require(\n mainUtxoHash != bytes32(0),\n \"No main UTXO for the given wallet\"\n );\n require(\n keccak256(\n abi.encodePacked(\n mainUtxo.txHash,\n mainUtxo.txOutputIndex,\n mainUtxo.txOutputValue\n )\n ) == mainUtxoHash,\n \"Invalid main UTXO data\"\n );\n\n // Validate if redeemer output script is a correct standard type\n // (P2PKH, P2WPKH, P2SH or P2WSH). This is done by using\n // `BTCUtils.extractHashAt` on it. Such a function extracts the payload\n // properly only from standard outputs so if it succeeds, we have a\n // guarantee the redeemer output script is proper. The underlying way\n // of validation is the same as in tBTC v1.\n bytes memory redeemerOutputScriptPayload = redeemerOutputScript\n .extractHashAt(0, redeemerOutputScript.length);\n\n require(\n redeemerOutputScriptPayload.length > 0,\n \"Redeemer output script must be a standard type\"\n );\n // Check if the redeemer output script payload does not point to the\n // wallet public key hash.\n require(\n redeemerOutputScriptPayload.length != 20 ||\n walletPubKeyHash != redeemerOutputScriptPayload.slice20(0),\n \"Redeemer output script must not point to the wallet PKH\"\n );\n\n require(\n amount >= self.redemptionDustThreshold,\n \"Redemption amount too small\"\n );\n\n // The redemption key is built on top of the wallet public key hash\n // and redeemer output script pair. That means there can be only one\n // request asking for redemption from the given wallet to the given\n // BTC script at the same time.\n uint256 redemptionKey = getRedemptionKey(\n walletPubKeyHash,\n redeemerOutputScript\n );\n\n // Check if given redemption key is not used by a pending redemption.\n // There is no need to check for existence in `timedOutRedemptions`\n // since the wallet's state is changed to other than Live after\n // first time out is reported so making new requests is not possible.\n // slither-disable-next-line incorrect-equality\n require(\n self.pendingRedemptions[redemptionKey].requestedAt == 0,\n \"There is a pending redemption request from this wallet to the same address\"\n );\n\n // No need to check whether `amount - treasuryFee - txMaxFee > 0`\n // since the `redemptionDustThreshold` should force that condition\n // to be always true.\n uint64 treasuryFee = self.redemptionTreasuryFeeDivisor > 0\n ? amount / self.redemptionTreasuryFeeDivisor\n : 0;\n uint64 txMaxFee = self.redemptionTxMaxFee;\n\n // The main wallet UTXO's value doesn't include all pending redemptions.\n // To determine if the requested redemption can be performed by the\n // wallet we need to subtract the total value of all pending redemptions\n // from that wallet's main UTXO value. Given that the treasury fee is\n // not redeemed from the wallet, we are subtracting it.\n wallet.pendingRedemptionsValue += amount - treasuryFee;\n require(\n mainUtxo.txOutputValue >= wallet.pendingRedemptionsValue,\n \"Insufficient wallet funds\"\n );\n\n self.pendingRedemptions[redemptionKey] = RedemptionRequest(\n redeemer,\n amount,\n treasuryFee,\n txMaxFee,\n /* solhint-disable-next-line not-rely-on-time */\n uint32(block.timestamp)\n );\n\n // slither-disable-next-line reentrancy-events\n emit RedemptionRequested(\n walletPubKeyHash,\n redeemerOutputScript,\n redeemer,\n amount,\n treasuryFee,\n txMaxFee\n );\n\n self.bank.transferBalanceFrom(balanceOwner, address(this), amount);\n }\n\n /// @notice Used by the wallet to prove the BTC redemption transaction\n /// and to make the necessary bookkeeping. Redemption is only\n /// accepted if it satisfies SPV proof.\n ///\n /// The function is performing Bank balance updates by burning\n /// the total redeemed Bitcoin amount from Bridge balance and\n /// transferring the treasury fee sum to the treasury address.\n ///\n /// It is possible to prove the given redemption only one time.\n /// @param redemptionTx Bitcoin redemption transaction data.\n /// @param redemptionProof Bitcoin redemption proof data.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet which\n /// performed the redemption transaction.\n /// @dev Requirements:\n /// - `redemptionTx` components must match the expected structure. See\n /// `BitcoinTx.Info` docs for reference. Their values must exactly\n /// correspond to appropriate Bitcoin transaction fields to produce\n /// a provable transaction hash,\n /// - The `redemptionTx` should represent a Bitcoin transaction with\n /// exactly 1 input that refers to the wallet's main UTXO. That\n /// transaction should have 1..n outputs handling existing pending\n /// redemption requests or pointing to reported timed out requests.\n /// There can be also 1 optional output representing the\n /// change and pointing back to the 20-byte wallet public key hash.\n /// The change should be always present if the redeemed value sum\n /// is lower than the total wallet's BTC balance,\n /// - `redemptionProof` components must match the expected structure.\n /// See `BitcoinTx.Proof` docs for reference. The `bitcoinHeaders`\n /// field must contain a valid number of block headers, not less\n /// than the `txProofDifficultyFactor` contract constant,\n /// - `mainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// Additionally, the recent main UTXO on Ethereum must be set,\n /// - `walletPubKeyHash` must be connected with the main UTXO used\n /// as transaction single input.\n /// Other remarks:\n /// - Putting the change output as the first transaction output can\n /// save some gas because the output processing loop begins each\n /// iteration by checking whether the given output is the change\n /// thus uses some gas for making the comparison. Once the change\n /// is identified, that check is omitted in further iterations.\n function submitRedemptionProof(\n BridgeState.Storage storage self,\n BitcoinTx.Info calldata redemptionTx,\n BitcoinTx.Proof calldata redemptionProof,\n BitcoinTx.UTXO calldata mainUtxo,\n bytes20 walletPubKeyHash\n ) external {\n // Wallet state validation is performed in the `resolveRedeemingWallet`\n // function.\n\n // The actual transaction proof is performed here. After that point, we\n // can assume the transaction happened on Bitcoin chain and has\n // a sufficient number of confirmations as determined by\n // `txProofDifficultyFactor` constant.\n bytes32 redemptionTxHash = self.validateProof(\n redemptionTx,\n redemptionProof\n );\n\n Wallets.Wallet storage wallet = resolveRedeemingWallet(\n self,\n walletPubKeyHash,\n mainUtxo\n );\n\n // Process the redemption transaction input. Specifically, check if it\n // refers to the expected wallet's main UTXO.\n OutboundTx.processWalletOutboundTxInput(\n self,\n redemptionTx.inputVector,\n mainUtxo\n );\n\n // Process redemption transaction outputs to extract some info required\n // for further processing.\n RedemptionTxOutputsInfo memory outputsInfo = processRedemptionTxOutputs(\n self,\n redemptionTx.outputVector,\n walletPubKeyHash\n );\n\n require(\n mainUtxo.txOutputValue - outputsInfo.outputsTotalValue <=\n self.redemptionTxMaxTotalFee,\n \"Transaction fee is too high\"\n );\n\n if (outputsInfo.changeValue > 0) {\n // If the change value is grater than zero, it means the change\n // output exists and can be used as new wallet's main UTXO.\n wallet.mainUtxoHash = keccak256(\n abi.encodePacked(\n redemptionTxHash,\n outputsInfo.changeIndex,\n outputsInfo.changeValue\n )\n );\n } else {\n // If the change value is zero, it means the change output doesn't\n // exists and no funds left on the wallet. Delete the main UTXO\n // for that wallet to represent that state in a proper way.\n delete wallet.mainUtxoHash;\n }\n\n wallet.pendingRedemptionsValue -= outputsInfo.totalBurnableValue;\n\n emit RedemptionsCompleted(walletPubKeyHash, redemptionTxHash);\n\n self.bank.decreaseBalance(outputsInfo.totalBurnableValue);\n\n if (outputsInfo.totalTreasuryFee > 0) {\n self.bank.transferBalance(\n self.treasury,\n outputsInfo.totalTreasuryFee\n );\n }\n }\n\n /// @notice Resolves redeeming wallet based on the provided wallet public\n /// key hash. Validates the wallet state and current main UTXO, as\n /// currently known on the Ethereum chain.\n /// @param walletPubKeyHash public key hash of the wallet proving the sweep\n /// Bitcoin transaction.\n /// @param mainUtxo Data of the wallet's main UTXO, as currently known on\n /// the Ethereum chain.\n /// @return wallet Data of the sweeping wallet.\n /// @dev Requirements:\n /// - Sweeping wallet must be either in Live or MovingFunds state,\n /// - Main UTXO of the redeeming wallet must exists in the storage,\n /// - The passed `mainUTXO` parameter must be equal to the stored one.\n function resolveRedeemingWallet(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata mainUtxo\n ) internal view returns (Wallets.Wallet storage wallet) {\n wallet = self.registeredWallets[walletPubKeyHash];\n\n // Assert that main UTXO for passed wallet exists in storage.\n bytes32 mainUtxoHash = wallet.mainUtxoHash;\n require(mainUtxoHash != bytes32(0), \"No main UTXO for given wallet\");\n\n // Assert that passed main UTXO parameter is the same as in storage and\n // can be used for further processing.\n require(\n keccak256(\n abi.encodePacked(\n mainUtxo.txHash,\n mainUtxo.txOutputIndex,\n mainUtxo.txOutputValue\n )\n ) == mainUtxoHash,\n \"Invalid main UTXO data\"\n );\n\n Wallets.WalletState walletState = wallet.state;\n require(\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds,\n \"Wallet must be in Live or MovingFunds state\"\n );\n }\n\n /// @notice Processes the Bitcoin redemption transaction output vector.\n /// It extracts each output and tries to identify it as a pending\n /// redemption request, reported timed out request, or change.\n /// Reverts if one of the outputs cannot be recognized properly.\n /// This function also marks each request as processed by removing\n /// them from `pendingRedemptions` mapping.\n /// @param redemptionTxOutputVector Bitcoin redemption transaction output\n /// vector. This function assumes vector's structure is valid so it\n /// must be validated using e.g. `BTCUtils.validateVout` function\n /// before it is passed here.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet which\n /// performed the redemption transaction.\n /// @return info Outcomes of the processing.\n function processRedemptionTxOutputs(\n BridgeState.Storage storage self,\n bytes memory redemptionTxOutputVector,\n bytes20 walletPubKeyHash\n ) internal returns (RedemptionTxOutputsInfo memory info) {\n // Determining the total number of redemption transaction outputs in\n // the same way as for number of inputs. See `BitcoinTx.outputVector`\n // docs for more details.\n (\n uint256 outputsCompactSizeUintLength,\n uint256 outputsCount\n ) = redemptionTxOutputVector.parseVarInt();\n\n // To determine the first output starting index, we must jump over\n // the compactSize uint which prepends the output vector. One byte\n // must be added because `BtcUtils.parseVarInt` does not include\n // compactSize uint tag in the returned length.\n //\n // For >= 0 && <= 252, `BTCUtils.determineVarIntDataLengthAt`\n // returns `0`, so we jump over one byte of compactSize uint.\n //\n // For >= 253 && <= 0xffff there is `0xfd` tag,\n // `BTCUtils.determineVarIntDataLengthAt` returns `2` (no\n // tag byte included) so we need to jump over 1+2 bytes of\n // compactSize uint.\n //\n // Please refer `BTCUtils` library and compactSize uint\n // docs in `BitcoinTx` library for more details.\n uint256 outputStartingIndex = 1 + outputsCompactSizeUintLength;\n\n // Calculate the keccak256 for two possible wallet's P2PKH or P2WPKH\n // scripts that can be used to lock the change. This is done upfront to\n // save on gas. Both scripts have a strict format defined by Bitcoin.\n //\n // The P2PKH script has the byte format: <0x1976a914> <20-byte PKH> <0x88ac>.\n // According to https://en.bitcoin.it/wiki/Script#Opcodes this translates to:\n // - 0x19: Byte length of the entire script\n // - 0x76: OP_DUP\n // - 0xa9: OP_HASH160\n // - 0x14: Byte length of the public key hash\n // - 0x88: OP_EQUALVERIFY\n // - 0xac: OP_CHECKSIG\n // which matches the P2PKH structure as per:\n // https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash\n bytes32 walletP2PKHScriptKeccak = keccak256(\n abi.encodePacked(BitcoinTx.makeP2PKHScript(walletPubKeyHash))\n );\n // The P2WPKH script has the byte format: <0x160014> <20-byte PKH>.\n // According to https://en.bitcoin.it/wiki/Script#Opcodes this translates to:\n // - 0x16: Byte length of the entire script\n // - 0x00: OP_0\n // - 0x14: Byte length of the public key hash\n // which matches the P2WPKH structure as per:\n // https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH\n bytes32 walletP2WPKHScriptKeccak = keccak256(\n abi.encodePacked(BitcoinTx.makeP2WPKHScript(walletPubKeyHash))\n );\n\n return\n processRedemptionTxOutputs(\n self,\n redemptionTxOutputVector,\n walletPubKeyHash,\n RedemptionTxOutputsProcessingInfo(\n outputStartingIndex,\n outputsCount,\n walletP2PKHScriptKeccak,\n walletP2WPKHScriptKeccak\n )\n );\n }\n\n /// @notice Processes all outputs from the redemption transaction. Tries to\n /// identify output as a change output, pending redemption request\n /// or reported redemption. Reverts if one of the outputs cannot be\n /// recognized properly. Marks each request as processed by removing\n /// them from `pendingRedemptions` mapping.\n /// @param redemptionTxOutputVector Bitcoin redemption transaction output\n /// vector. This function assumes vector's structure is valid so it\n /// must be validated using e.g. `BTCUtils.validateVout` function\n /// before it is passed here.\n /// @param walletPubKeyHash 20-byte public key hash (computed using Bitcoin\n /// HASH160 over the compressed ECDSA public key) of the wallet which\n /// performed the redemption transaction.\n /// @param processInfo RedemptionTxOutputsProcessingInfo identifying output\n /// starting index, the number of outputs and possible wallet change\n /// P2PKH and P2WPKH scripts.\n function processRedemptionTxOutputs(\n BridgeState.Storage storage self,\n bytes memory redemptionTxOutputVector,\n bytes20 walletPubKeyHash,\n RedemptionTxOutputsProcessingInfo memory processInfo\n ) internal returns (RedemptionTxOutputsInfo memory resultInfo) {\n // Helper flag indicating whether there was at least one redemption\n // output present (redemption must be either pending or reported as\n // timed out).\n bool redemptionPresent = false;\n\n // Outputs processing loop.\n for (uint256 i = 0; i < processInfo.outputsCount; i++) {\n uint256 outputLength = redemptionTxOutputVector\n .determineOutputLengthAt(processInfo.outputStartingIndex);\n\n // Extract the value from given output.\n uint64 outputValue = redemptionTxOutputVector.extractValueAt(\n processInfo.outputStartingIndex\n );\n\n // The output consists of an 8-byte value and a variable length\n // script. To hash that script we slice the output starting from\n // 9th byte until the end.\n uint256 scriptLength = outputLength - 8;\n uint256 outputScriptStart = processInfo.outputStartingIndex + 8;\n\n bytes32 outputScriptHash;\n /* solhint-disable-next-line no-inline-assembly */\n assembly {\n // The first argument to assembly keccak256 is the pointer.\n // We point to `redemptionTxOutputVector` but at the position\n // indicated by `outputScriptStart`. To load that position, we\n // need to call `add(outputScriptStart, 32)` because\n // `outputScriptStart` has 32 bytes.\n outputScriptHash := keccak256(\n add(redemptionTxOutputVector, add(outputScriptStart, 32)),\n scriptLength\n )\n }\n\n if (\n resultInfo.changeValue == 0 &&\n (outputScriptHash == processInfo.walletP2PKHScriptKeccak ||\n outputScriptHash == processInfo.walletP2WPKHScriptKeccak) &&\n outputValue > 0\n ) {\n // If we entered here, that means the change output with a\n // proper non-zero value was found.\n resultInfo.changeIndex = uint32(i);\n resultInfo.changeValue = outputValue;\n } else {\n // If we entered here, that the means the given output is\n // supposed to represent a redemption.\n (\n uint64 burnableValue,\n uint64 treasuryFee\n ) = processNonChangeRedemptionTxOutput(\n self,\n _getRedemptionKey(walletPubKeyHash, outputScriptHash),\n outputValue\n );\n resultInfo.totalBurnableValue += burnableValue;\n resultInfo.totalTreasuryFee += treasuryFee;\n redemptionPresent = true;\n }\n\n resultInfo.outputsTotalValue += outputValue;\n\n // Make the `outputStartingIndex` pointing to the next output by\n // increasing it by current output's length.\n processInfo.outputStartingIndex += outputLength;\n }\n\n // Protect against the cases when there is only a single change output\n // referring back to the wallet PKH and just burning main UTXO value\n // for transaction fees.\n require(\n redemptionPresent,\n \"Redemption transaction must process at least one redemption\"\n );\n }\n\n /// @notice Processes a single redemption transaction output. Tries to\n /// identify output as a pending redemption request or reported\n /// redemption timeout. Output script passed to this function must\n /// not be the change output. Such output needs to be identified\n /// separately before calling this function.\n /// Reverts if output is neither requested pending redemption nor\n /// requested and reported timed-out redemption.\n /// This function also marks each pending request as processed by\n /// removing them from `pendingRedemptions` mapping.\n /// @param redemptionKey Redemption key of the output being processed.\n /// @param outputValue Value of the output being processed.\n /// @return burnableValue The value burnable as a result of processing this\n /// single redemption output. This value needs to be summed up with\n /// burnable values of all other outputs to evaluate total burnable\n /// value for the entire redemption transaction. This value is 0\n /// for a timed-out redemption request.\n /// @return treasuryFee The treasury fee from this single redemption output.\n /// This value needs to be summed up with treasury fees of all other\n /// outputs to evaluate the total treasury fee for the entire\n /// redemption transaction. This value is 0 for a timed-out\n /// redemption request.\n /// @dev Requirements:\n /// - This function should be called only if the given output\n /// represents redemption. It must not be the change output.\n function processNonChangeRedemptionTxOutput(\n BridgeState.Storage storage self,\n uint256 redemptionKey,\n uint64 outputValue\n ) internal returns (uint64 burnableValue, uint64 treasuryFee) {\n if (self.pendingRedemptions[redemptionKey].requestedAt != 0) {\n // If we entered here, that means the output was identified\n // as a pending redemption request.\n RedemptionRequest storage request = self.pendingRedemptions[\n redemptionKey\n ];\n // Compute the request's redeemable amount as the requested\n // amount reduced by the treasury fee. The request's\n // minimal amount is then the redeemable amount reduced by\n // the maximum transaction fee.\n uint64 redeemableAmount = request.requestedAmount -\n request.treasuryFee;\n // Output value must fit between the request's redeemable\n // and minimal amounts to be deemed valid.\n require(\n redeemableAmount - request.txMaxFee <= outputValue &&\n outputValue <= redeemableAmount,\n \"Output value is not within the acceptable range of the pending request\"\n );\n // Add the redeemable amount to the total burnable value\n // the Bridge will use to decrease its balance in the Bank.\n burnableValue = redeemableAmount;\n // Add the request's treasury fee to the total treasury fee\n // value the Bridge will transfer to the treasury.\n treasuryFee = request.treasuryFee;\n // Request was properly handled so remove its redemption\n // key from the mapping to make it reusable for further\n // requests.\n delete self.pendingRedemptions[redemptionKey];\n } else {\n // If we entered here, the output is not a redemption\n // request but there is still a chance the given output is\n // related to a reported timed out redemption request.\n // If so, check if the output value matches the request\n // amount to confirm this is an overdue request fulfillment\n // then bypass this output and process the subsequent\n // ones. That also means the wallet was already punished\n // for the inactivity. Otherwise, just revert.\n RedemptionRequest storage request = self.timedOutRedemptions[\n redemptionKey\n ];\n\n require(\n request.requestedAt != 0,\n \"Output is a non-requested redemption\"\n );\n\n uint64 redeemableAmount = request.requestedAmount -\n request.treasuryFee;\n\n require(\n redeemableAmount - request.txMaxFee <= outputValue &&\n outputValue <= redeemableAmount,\n \"Output value is not within the acceptable range of the timed out request\"\n );\n\n delete self.timedOutRedemptions[redemptionKey];\n }\n }\n\n /// @notice Notifies that there is a pending redemption request associated\n /// with the given wallet, that has timed out. The redemption\n /// request is identified by the key built as\n /// `keccak256(keccak256(redeemerOutputScript) | walletPubKeyHash)`.\n /// The results of calling this function:\n /// - the pending redemptions value for the wallet will be decreased\n /// by the requested amount (minus treasury fee),\n /// - the tokens taken from the redeemer on redemption request will\n /// be returned to the redeemer,\n /// - the request will be moved from pending redemptions to\n /// timed-out redemptions,\n /// - if the state of the wallet is `Live` or `MovingFunds`, the\n /// wallet operators will be slashed and the notifier will be\n /// rewarded,\n /// - if the state of wallet is `Live`, the wallet will be closed or\n /// marked as `MovingFunds` (depending on the presence or absence\n /// of the wallet's main UTXO) and the wallet will no longer be\n /// marked as the active wallet (if it was marked as such).\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @param redeemerOutputScript The redeemer's length-prefixed output\n /// script (P2PKH, P2WPKH, P2SH or P2WSH).\n /// @dev Requirements:\n /// - The wallet must be in the Live or MovingFunds or Terminated state,\n /// - The redemption request identified by `walletPubKeyHash` and\n /// `redeemerOutputScript` must exist,\n /// - The expression `keccak256(abi.encode(walletMembersIDs))` must\n /// be exactly the same as the hash stored under `membersIdsHash`\n /// for the given `walletID`. Those IDs are not directly stored\n /// in the contract for gas efficiency purposes but they can be\n /// read from appropriate `DkgResultSubmitted` and `DkgResultApproved`\n /// events of the `WalletRegistry` contract,\n /// - The amount of time defined by `redemptionTimeout` must have\n /// passed since the redemption was requested (the request must be\n /// timed-out).\n function notifyRedemptionTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs,\n bytes calldata redeemerOutputScript\n ) external {\n // Wallet state is validated in `notifyWalletRedemptionTimeout`.\n uint256 redemptionKey = getRedemptionKey(\n walletPubKeyHash,\n redeemerOutputScript\n );\n Redemption.RedemptionRequest memory request = self.pendingRedemptions[\n redemptionKey\n ];\n\n require(request.requestedAt > 0, \"Redemption request does not exist\");\n require(\n /* solhint-disable-next-line not-rely-on-time */\n request.requestedAt + self.redemptionTimeout < block.timestamp,\n \"Redemption request has not timed out\"\n );\n\n // Update the wallet's pending redemptions value\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n wallet.pendingRedemptionsValue -=\n request.requestedAmount -\n request.treasuryFee;\n\n // It is worth noting that there is no need to check if\n // `timedOutRedemption` mapping already contains the given redemption\n // key. There is no possibility to re-use a key of a reported timed-out\n // redemption because the wallet responsible for causing the timeout is\n // moved to a state that prevents it to receive new redemption requests.\n\n // Propagate timeout consequences to the wallet\n self.notifyWalletRedemptionTimeout(walletPubKeyHash, walletMembersIDs);\n\n // Move the redemption from pending redemptions to timed-out redemptions\n self.timedOutRedemptions[redemptionKey] = request;\n delete self.pendingRedemptions[redemptionKey];\n\n // slither-disable-next-line reentrancy-events\n emit RedemptionTimedOut(walletPubKeyHash, redeemerOutputScript);\n\n // Return the requested amount of tokens to the redeemer\n self.bank.transferBalance(request.redeemer, request.requestedAmount);\n }\n\n /// @notice Calculate redemption key without allocations.\n /// @param walletPubKeyHash the pubkey hash of the wallet.\n /// @param script the output script of the redemption.\n /// @return The key = keccak256(keccak256(script) | walletPubKeyHash).\n function getRedemptionKey(bytes20 walletPubKeyHash, bytes memory script)\n internal\n pure\n returns (uint256)\n {\n bytes32 scriptHash = keccak256(script);\n uint256 key;\n /* solhint-disable-next-line no-inline-assembly */\n assembly {\n mstore(0, scriptHash)\n mstore(32, walletPubKeyHash)\n key := keccak256(0, 52)\n }\n return key;\n }\n\n /// @notice Finish calculating redemption key without allocations.\n /// @param walletPubKeyHash the pubkey hash of the wallet.\n /// @param scriptHash the output script hash of the redemption.\n /// @return The key = keccak256(scriptHash | walletPubKeyHash).\n function _getRedemptionKey(bytes20 walletPubKeyHash, bytes32 scriptHash)\n internal\n pure\n returns (uint256)\n {\n uint256 key;\n /* solhint-disable-next-line no-inline-assembly */\n assembly {\n mstore(0, scriptHash)\n mstore(32, walletPubKeyHash)\n key := keccak256(0, 52)\n }\n return key;\n }\n}\n" + }, + "contracts/bridge/WalletCoordinator.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\nimport \"@keep-network/random-beacon/contracts/Reimbursable.sol\";\nimport \"@keep-network/random-beacon/contracts/ReimbursementPool.sol\";\n\nimport \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./Bridge.sol\";\nimport \"./Deposit.sol\";\nimport \"./Wallets.sol\";\n\n/// @title Wallet coordinator.\n/// @notice The wallet coordinator contract aims to facilitate the coordination\n/// of the off-chain wallet members during complex multi-chain wallet\n/// operations like deposit sweeping, redemptions, or moving funds.\n/// Such processes involve various moving parts and many steps that each\n/// individual wallet member must do. Given the distributed nature of\n/// the off-chain wallet software, full off-chain implementation is\n/// challenging and prone to errors, especially byzantine faults.\n/// This contract provides a single and trusted on-chain coordination\n/// point thus taking the riskiest part out of the off-chain software.\n/// The off-chain wallet members can focus on the core tasks and do not\n/// bother about electing a trusted coordinator or aligning internal\n/// states using complex consensus algorithms.\ncontract WalletCoordinator is OwnableUpgradeable, Reimbursable {\n using BTCUtils for bytes;\n using BytesLib for bytes;\n\n /// @notice Represents wallet action:\n enum WalletAction {\n /// @dev The wallet does not perform any action.\n Idle,\n /// @dev The wallet is executing heartbeat.\n Heartbeat,\n /// @dev The wallet is handling a deposit sweep action.\n DepositSweep,\n /// @dev The wallet is handling a redemption action.\n Redemption,\n /// @dev The wallet is handling a moving funds action.\n MovingFunds,\n /// @dev The wallet is handling a moved funds sweep action.\n MovedFundsSweep\n }\n\n /// @notice Holds information about a wallet time lock.\n struct WalletLock {\n /// @notice A UNIX timestamp defining the moment until which the wallet\n /// is locked and cannot receive new proposals. The value of 0\n /// means the wallet is not locked and can receive a proposal\n /// at any time.\n uint32 expiresAt;\n /// @notice The wallet action being the cause of the lock.\n WalletAction cause;\n }\n\n /// @notice Helper structure representing a deposit sweep proposal.\n struct DepositSweepProposal {\n // 20-byte public key hash of the target wallet.\n bytes20 walletPubKeyHash;\n // Deposits that should be part of the sweep.\n DepositKey[] depositsKeys;\n // Proposed BTC fee for the entire transaction.\n uint256 sweepTxFee;\n // Array containing the reveal blocks of each deposit. This information\n // strongly facilitates the off-chain processing. Using those blocks,\n // wallet operators can quickly fetch corresponding Bridge.DepositRevealed\n // events carrying deposit data necessary to perform proposal validation.\n // This field is not explicitly validated within the validateDepositSweepProposal\n // function because if something is wrong here the off-chain wallet\n // operators will fail anyway as they won't be able to gather deposit\n // data necessary to perform the on-chain validation using the\n // validateDepositSweepProposal function.\n uint256[] depositsRevealBlocks;\n }\n\n /// @notice Helper structure representing a plain-text deposit key.\n /// Each deposit can be identified by their 32-byte funding\n /// transaction hash (Bitcoin internal byte order) an the funding\n /// output index (0-based).\n /// @dev Do not confuse this structure with the deposit key used within the\n /// Bridge contract to store deposits. Here we have the plain-text\n /// components of the key while the Bridge uses a uint representation of\n /// keccak256(fundingTxHash | fundingOutputIndex) for gas efficiency.\n struct DepositKey {\n bytes32 fundingTxHash;\n uint32 fundingOutputIndex;\n }\n\n /// @notice Helper structure holding deposit extra data required during\n /// deposit sweep proposal validation. Basically, this structure\n /// is a combination of BitcoinTx.Info and relevant parts of\n /// Deposit.DepositRevealInfo.\n /// @dev These data can be pulled from respective `DepositRevealed` events\n /// emitted by the `Bridge.revealDeposit` function. The `fundingTx`\n /// field must be taken directly from the Bitcoin chain, using the\n /// `DepositRevealed.fundingTxHash` as transaction identifier.\n struct DepositExtraInfo {\n BitcoinTx.Info fundingTx;\n bytes8 blindingFactor;\n bytes20 walletPubKeyHash;\n bytes20 refundPubKeyHash;\n bytes4 refundLocktime;\n }\n\n /// @notice Mapping that holds addresses allowed to submit proposals and\n /// request heartbeats.\n mapping(address => bool) public isCoordinator;\n\n /// @notice Mapping that holds wallet time locks. The key is a 20-byte\n /// wallet public key hash.\n mapping(bytes20 => WalletLock) public walletLock;\n\n /// @notice Handle to the Bridge contract.\n Bridge public bridge;\n\n /// @notice Determines the wallet heartbeat request validity time. In other\n /// words, this is the worst-case time for a wallet heartbeat\n /// during which the wallet is busy and canot take other actions.\n /// This is also the duration of the time lock applied to the wallet\n /// once a new heartbeat request is submitted.\n ///\n /// For example, if a deposit sweep proposal was submitted at\n /// 2 pm and heartbeatRequestValidity is 1 hour, the next request or\n /// proposal (of any type) can be submitted after 3 pm.\n uint32 public heartbeatRequestValidity;\n\n /// @notice Gas that is meant to balance the heartbeat request overall cost.\n /// Can be updated by the owner based on the current conditions.\n uint32 public heartbeatRequestGasOffset;\n\n /// @notice Determines the deposit sweep proposal validity time. In other\n /// words, this is the worst-case time for a deposit sweep during\n /// which the wallet is busy and cannot take another actions. This\n /// is also the duration of the time lock applied to the wallet\n /// once a new deposit sweep proposal is submitted.\n ///\n /// For example, if a deposit sweep proposal was submitted at\n /// 2 pm and depositSweepProposalValidity is 4 hours, the next\n /// proposal (of any type) can be submitted after 6 pm.\n uint32 public depositSweepProposalValidity;\n\n /// @notice The minimum time that must elapse since the deposit reveal\n /// before a deposit becomes eligible for a deposit sweep.\n ///\n /// For example, if a deposit was revealed at 9 am and depositMinAge\n /// is 2 hours, the deposit is eligible for sweep after 11 am.\n ///\n /// @dev Forcing deposit minimum age ensures block finality for Ethereum.\n /// In the happy path case, i.e. where the deposit is revealed immediately\n /// after being broadcast on the Bitcoin network, the minimum age\n /// check also ensures block finality for Bitcoin.\n uint32 public depositMinAge;\n\n /// @notice Each deposit can be technically swept until it reaches its\n /// refund timestamp after which it can be taken back by the depositor.\n /// However, allowing the wallet to sweep deposits that are close\n /// to their refund timestamp may cause a race between the wallet\n /// and the depositor. In result, the wallet may sign an invalid\n /// sweep transaction that aims to sweep an already refunded deposit.\n /// Such tx signature may be used to create an undefeatable fraud\n /// challenge against the wallet. In order to mitigate that problem,\n /// this parameter determines a safety margin that puts the latest\n /// moment a deposit can be swept far before the point after which\n /// the deposit becomes refundable.\n ///\n /// For example, if a deposit becomes refundable after 8 pm and\n /// depositRefundSafetyMargin is 6 hours, the deposit is valid for\n /// for a sweep only before 2 pm.\n uint32 public depositRefundSafetyMargin;\n\n /// @notice The maximum count of deposits that can be swept within a\n /// single sweep.\n uint16 public depositSweepMaxSize;\n\n /// @notice Gas that is meant to balance the deposit sweep proposal\n /// submission overall cost. Can be updated by the owner based on\n /// the current conditions.\n uint32 public depositSweepProposalSubmissionGasOffset;\n\n event CoordinatorAdded(address indexed coordinator);\n\n event CoordinatorRemoved(address indexed coordinator);\n\n event WalletManuallyUnlocked(bytes20 indexed walletPubKeyHash);\n\n event HeartbeatRequestParametersUpdated(\n uint32 heartbeatRequestValidity,\n uint32 heartbeatRequestGasOffset\n );\n\n event HeartbeatRequestSubmitted(\n bytes20 walletPubKeyHash,\n bytes message,\n address indexed coordinator\n );\n\n event DepositSweepProposalParametersUpdated(\n uint32 depositSweepProposalValidity,\n uint32 depositMinAge,\n uint32 depositRefundSafetyMargin,\n uint16 depositSweepMaxSize,\n uint32 depositSweepProposalSubmissionGasOffset\n );\n\n event DepositSweepProposalSubmitted(\n DepositSweepProposal proposal,\n address indexed coordinator\n );\n\n modifier onlyCoordinator() {\n require(isCoordinator[msg.sender], \"Caller is not a coordinator\");\n _;\n }\n\n modifier onlyAfterWalletLock(bytes20 walletPubKeyHash) {\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp > walletLock[walletPubKeyHash].expiresAt,\n \"Wallet locked\"\n );\n _;\n }\n\n modifier onlyReimbursableAdmin() override {\n require(owner() == msg.sender, \"Caller is not the owner\");\n _;\n }\n\n function initialize(Bridge _bridge) external initializer {\n __Ownable_init();\n\n bridge = _bridge;\n // Pre-fetch addresses to save gas later.\n (, , , reimbursementPool) = _bridge.contractReferences();\n\n heartbeatRequestValidity = 1 hours;\n heartbeatRequestGasOffset = 5_000;\n\n depositSweepProposalValidity = 4 hours;\n depositMinAge = 2 hours;\n depositRefundSafetyMargin = 24 hours;\n depositSweepMaxSize = 5;\n depositSweepProposalSubmissionGasOffset = 5_000;\n }\n\n /// @notice Adds the given address to the set of coordinator addresses.\n /// @param coordinator Address of the new coordinator.\n /// @dev Requirements:\n /// - The caller must be the owner,\n /// - The `coordinator` must not be an existing coordinator.\n function addCoordinator(address coordinator) external onlyOwner {\n require(\n !isCoordinator[coordinator],\n \"This address is already a coordinator\"\n );\n isCoordinator[coordinator] = true;\n emit CoordinatorAdded(coordinator);\n }\n\n /// @notice Removes the given address from the set of coordinator addresses.\n /// @param coordinator Address of the existing coordinator.\n /// @dev Requirements:\n /// - The caller must be the owner,\n /// - The `coordinator` must be an existing coordinator.\n function removeCoordinator(address coordinator) external onlyOwner {\n require(\n isCoordinator[coordinator],\n \"This address is not a coordinator\"\n );\n delete isCoordinator[coordinator];\n emit CoordinatorRemoved(coordinator);\n }\n\n /// @notice Allows to unlock the given wallet before their time lock expires.\n /// This function should be used in exceptional cases where\n /// something went wrong and there is a need to unlock the wallet\n /// without waiting.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet\n /// @dev Requirements:\n /// - The caller must be the owner.\n function unlockWallet(bytes20 walletPubKeyHash) external onlyOwner {\n // Just in case, allow the owner to unlock the wallet earlier.\n walletLock[walletPubKeyHash] = WalletLock(0, WalletAction.Idle);\n emit WalletManuallyUnlocked(walletPubKeyHash);\n }\n\n /// @notice Updates parameters related to heartbeat request.\n /// @param _heartbeatRequestValidity The new value of `heartbeatRequestValidity`.\n /// @param _heartbeatRequestGasOffset The new value of `heartbeatRequestGasOffset`.\n /// @dev Requirements:\n /// - The caller must be the owner.\n function updateHeartbeatRequestParameters(\n uint32 _heartbeatRequestValidity,\n uint32 _heartbeatRequestGasOffset\n ) external onlyOwner {\n heartbeatRequestValidity = _heartbeatRequestValidity;\n heartbeatRequestGasOffset = _heartbeatRequestGasOffset;\n emit HeartbeatRequestParametersUpdated(\n _heartbeatRequestValidity,\n _heartbeatRequestGasOffset\n );\n }\n\n /// @notice Updates parameters related to deposit sweep proposal.\n /// @param _depositSweepProposalValidity The new value of `depositSweepProposalValidity`.\n /// @param _depositMinAge The new value of `depositMinAge`.\n /// @param _depositRefundSafetyMargin The new value of `depositRefundSafetyMargin`.\n /// @param _depositSweepMaxSize The new value of `depositSweepMaxSize`.\n /// @dev Requirements:\n /// - The caller must be the owner.\n function updateDepositSweepProposalParameters(\n uint32 _depositSweepProposalValidity,\n uint32 _depositMinAge,\n uint32 _depositRefundSafetyMargin,\n uint16 _depositSweepMaxSize,\n uint32 _depositSweepProposalSubmissionGasOffset\n ) external onlyOwner {\n depositSweepProposalValidity = _depositSweepProposalValidity;\n depositMinAge = _depositMinAge;\n depositRefundSafetyMargin = _depositRefundSafetyMargin;\n depositSweepMaxSize = _depositSweepMaxSize;\n depositSweepProposalSubmissionGasOffset = _depositSweepProposalSubmissionGasOffset;\n\n emit DepositSweepProposalParametersUpdated(\n _depositSweepProposalValidity,\n _depositMinAge,\n _depositRefundSafetyMargin,\n _depositSweepMaxSize,\n _depositSweepProposalSubmissionGasOffset\n );\n }\n\n /// @notice Submits a heartbeat request from the wallet. Locks the wallet\n /// for a specific time, equal to the request validity period.\n /// This function validates the proposed heartbeat messge to see\n /// if it matches the heartbeat format expected by the Bridge.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet that is\n /// supposed to execute the heartbeat.\n /// @param message The proposed heartbeat message for the wallet to sign.\n /// @dev Requirements:\n /// - The caller is a coordinator,\n /// - The wallet is not time-locked,\n /// - The message to sign is a valid heartbeat message.\n function requestHeartbeat(bytes20 walletPubKeyHash, bytes calldata message)\n public\n onlyCoordinator\n onlyAfterWalletLock(walletPubKeyHash)\n {\n require(\n Heartbeat.isValidHeartbeatMessage(message),\n \"Not a valid heartbeat message\"\n );\n\n walletLock[walletPubKeyHash] = WalletLock(\n /* solhint-disable-next-line not-rely-on-time */\n uint32(block.timestamp) + heartbeatRequestValidity,\n WalletAction.Heartbeat\n );\n\n emit HeartbeatRequestSubmitted(walletPubKeyHash, message, msg.sender);\n }\n\n /// @notice Wraps `requestHeartbeat` call and reimburses the caller's\n /// transaction cost.\n /// @dev See `requestHeartbeat` function documentation.\n function requestHeartbeatWithReimbursement(\n bytes20 walletPubKeyHash,\n bytes calldata message\n ) external {\n uint256 gasStart = gasleft();\n\n requestHeartbeat(walletPubKeyHash, message);\n\n reimbursementPool.refund(\n (gasStart - gasleft()) + heartbeatRequestGasOffset,\n msg.sender\n );\n }\n\n /// @notice Submits a deposit sweep proposal. Locks the target wallet\n /// for a specific time, equal to the proposal validity period.\n /// This function does not store the proposal in the state but\n /// just emits an event that serves as a guiding light for wallet\n /// off-chain members. Wallet members are supposed to validate\n /// the proposal on their own, before taking any action.\n /// @param proposal The deposit sweep proposal\n /// @dev Requirements:\n /// - The caller is a coordinator,\n /// - The wallet is not time-locked.\n function submitDepositSweepProposal(DepositSweepProposal calldata proposal)\n public\n onlyCoordinator\n onlyAfterWalletLock(proposal.walletPubKeyHash)\n {\n walletLock[proposal.walletPubKeyHash] = WalletLock(\n /* solhint-disable-next-line not-rely-on-time */\n uint32(block.timestamp) + depositSweepProposalValidity,\n WalletAction.DepositSweep\n );\n\n emit DepositSweepProposalSubmitted(proposal, msg.sender);\n }\n\n /// @notice Wraps `submitDepositSweepProposal` call and reimburses the\n /// caller's transaction cost.\n /// @dev See `submitDepositSweepProposal` function documentation.\n function submitDepositSweepProposalWithReimbursement(\n DepositSweepProposal calldata proposal\n ) external {\n uint256 gasStart = gasleft();\n\n submitDepositSweepProposal(proposal);\n\n reimbursementPool.refund(\n (gasStart - gasleft()) + depositSweepProposalSubmissionGasOffset,\n msg.sender\n );\n }\n\n /// @notice View function encapsulating the main rules of a valid deposit\n /// sweep proposal. This function is meant to facilitate the off-chain\n /// validation of the incoming proposals. Thanks to it, most\n /// of the work can be done using a single readonly contract call.\n /// Worth noting, the validation done here is not exhaustive as some\n /// conditions may not be verifiable within the on-chain function or\n /// checking them may be easier on the off-chain side. For example,\n /// this function does not check the SPV proofs and confirmations of\n /// the deposit funding transactions as this would require an\n /// integration with the difficulty relay that greatly increases\n /// complexity. Instead of that, each off-chain wallet member is\n /// supposed to do that check on their own.\n /// @param proposal The sweeping proposal to validate.\n /// @param depositsExtraInfo Deposits extra data required to perform the validation.\n /// @return True if the proposal is valid. Reverts otherwise.\n /// @dev Requirements:\n /// - The target wallet must be in the Live state,\n /// - The number of deposits included in the sweep must be in\n /// the range [1, `depositSweepMaxSize`],\n /// - The length of `depositsExtraInfo` array must be equal to the\n /// length of `proposal.depositsKeys`, i.e. each deposit must\n /// have exactly one set of corresponding extra data,\n /// - The proposed sweep tx fee must be grater than zero,\n /// - The proposed maximum per-deposit sweep tx fee must be lesser than\n /// or equal the maximum fee allowed by the Bridge (`Bridge.depositTxMaxFee`),\n /// - Each deposit must be revealed to the Bridge,\n /// - Each deposit must be old enough, i.e. at least `depositMinAge`\n /// elapsed since their reveal time,\n /// - Each deposit must not be swept yet,\n /// - Each deposit must have valid extra data (see `validateDepositExtraInfo`),\n /// - Each deposit must have the refund safety margin preserved,\n /// - Each deposit must be controlled by the same wallet,\n /// - Each deposit must target the same vault.\n ///\n /// The following off-chain validation must be performed as a bare minimum:\n /// - Inputs used for the sweep transaction have enough Bitcoin confirmations,\n /// - Deposits revealed to the Bridge have enough Ethereum confirmations.\n function validateDepositSweepProposal(\n DepositSweepProposal calldata proposal,\n DepositExtraInfo[] calldata depositsExtraInfo\n ) external view returns (bool) {\n require(\n bridge.wallets(proposal.walletPubKeyHash).state ==\n Wallets.WalletState.Live,\n \"Wallet is not in Live state\"\n );\n\n require(proposal.depositsKeys.length > 0, \"Sweep below the min size\");\n\n require(\n proposal.depositsKeys.length <= depositSweepMaxSize,\n \"Sweep exceeds the max size\"\n );\n\n require(\n proposal.depositsKeys.length == depositsExtraInfo.length,\n \"Each deposit key must have matching extra data\"\n );\n\n validateSweepTxFee(proposal.sweepTxFee, proposal.depositsKeys.length);\n\n address proposalVault = address(0);\n\n for (uint256 i = 0; i < proposal.depositsKeys.length; i++) {\n DepositKey memory depositKey = proposal.depositsKeys[i];\n DepositExtraInfo memory depositExtraInfo = depositsExtraInfo[i];\n\n // slither-disable-next-line calls-loop\n Deposit.DepositRequest memory depositRequest = bridge.deposits(\n uint256(\n keccak256(\n abi.encodePacked(\n depositKey.fundingTxHash,\n depositKey.fundingOutputIndex\n )\n )\n )\n );\n\n require(depositRequest.revealedAt != 0, \"Deposit not revealed\");\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp > depositRequest.revealedAt + depositMinAge,\n \"Deposit min age not achieved yet\"\n );\n\n require(depositRequest.sweptAt == 0, \"Deposit already swept\");\n\n validateDepositExtraInfo(\n depositKey,\n depositRequest.depositor,\n depositExtraInfo\n );\n\n uint32 depositRefundableTimestamp = BTCUtils.reverseUint32(\n uint32(depositExtraInfo.refundLocktime)\n );\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp <\n depositRefundableTimestamp - depositRefundSafetyMargin,\n \"Deposit refund safety margin is not preserved\"\n );\n\n require(\n depositExtraInfo.walletPubKeyHash == proposal.walletPubKeyHash,\n \"Deposit controlled by different wallet\"\n );\n\n // Make sure all deposits target the same vault by using the\n // vault of the first deposit as a reference.\n if (i == 0) {\n proposalVault = depositRequest.vault;\n }\n require(\n depositRequest.vault == proposalVault,\n \"Deposit targets different vault\"\n );\n }\n\n return true;\n }\n\n /// @notice Validates the sweep tx fee by checking if the part of the fee\n /// incurred by each deposit does not exceed the maximum value\n /// allowed by the Bridge. This function is heavily based on\n /// `DepositSweep.depositSweepTxFeeDistribution` function.\n /// @param sweepTxFee The sweep transaction fee.\n /// @param depositsCount Count of the deposits swept by the sweep transaction.\n /// @dev Requirements:\n /// - The sweep tx fee must be grater than zero,\n /// - The maximum per-deposit sweep tx fee must be lesser than or equal\n /// the maximum fee allowed by the Bridge (`Bridge.depositTxMaxFee`).\n function validateSweepTxFee(uint256 sweepTxFee, uint256 depositsCount)\n internal\n view\n {\n require(sweepTxFee > 0, \"Proposed transaction fee cannot be zero\");\n\n // Compute the indivisible remainder that remains after dividing the\n // sweep transaction fee over all deposits evenly.\n uint256 depositTxFeeRemainder = sweepTxFee % depositsCount;\n // Compute the transaction fee per deposit by dividing the sweep\n // transaction fee (reduced by the remainder) by the number of deposits.\n uint256 depositTxFee = (sweepTxFee - depositTxFeeRemainder) /\n depositsCount;\n\n (, , uint64 depositTxMaxFee, ) = bridge.depositParameters();\n\n // The transaction fee is incurred by each deposit evenly except for the last\n // deposit that has the indivisible remainder additionally incurred.\n // See `DepositSweep.submitDepositSweepProof`.\n // We must make sure the highest value of the deposit transaction fee does\n // not exceed the maximum value limited by the governable parameter.\n require(\n depositTxFee + depositTxFeeRemainder <= depositTxMaxFee,\n \"Proposed transaction fee is too high\"\n );\n }\n\n /// @notice Validates the extra data for the given deposit. This function\n /// is heavily based on `Deposit.revealDeposit` function.\n /// @param depositKey Key of the given deposit.\n /// @param depositor Depositor that revealed the deposit.\n /// @param depositExtraInfo Extra data being subject of the validation.\n /// @dev Requirements:\n /// - The transaction hash computed using `depositExtraInfo.fundingTx`\n /// must match the `depositKey.fundingTxHash`. This requirement\n /// ensures the funding transaction data provided in the extra\n /// data container actually represent the funding transaction of\n /// the given deposit.\n /// - The P2(W)SH script inferred from `depositExtraInfo` is actually\n /// used to lock funds by the `depositKey.fundingOutputIndex` output\n /// of the `depositExtraInfo.fundingTx` transaction. This requirement\n /// ensures the reveal data provided in the extra data container\n /// actually matches the given deposit.\n function validateDepositExtraInfo(\n DepositKey memory depositKey,\n address depositor,\n DepositExtraInfo memory depositExtraInfo\n ) internal view {\n bytes32 depositExtraFundingTxHash = abi\n .encodePacked(\n depositExtraInfo.fundingTx.version,\n depositExtraInfo.fundingTx.inputVector,\n depositExtraInfo.fundingTx.outputVector,\n depositExtraInfo.fundingTx.locktime\n )\n .hash256View();\n\n // Make sure the funding tx provided as part of deposit extra data\n // actually matches the deposit referred by the given deposit key.\n if (depositKey.fundingTxHash != depositExtraFundingTxHash) {\n revert(\"Extra info funding tx hash does not match\");\n }\n\n bytes memory expectedScript = abi.encodePacked(\n hex\"14\", // Byte length of depositor Ethereum address.\n depositor,\n hex\"75\", // OP_DROP\n hex\"08\", // Byte length of blinding factor value.\n depositExtraInfo.blindingFactor,\n hex\"75\", // OP_DROP\n hex\"76\", // OP_DUP\n hex\"a9\", // OP_HASH160\n hex\"14\", // Byte length of a compressed Bitcoin public key hash.\n depositExtraInfo.walletPubKeyHash,\n hex\"87\", // OP_EQUAL\n hex\"63\", // OP_IF\n hex\"ac\", // OP_CHECKSIG\n hex\"67\", // OP_ELSE\n hex\"76\", // OP_DUP\n hex\"a9\", // OP_HASH160\n hex\"14\", // Byte length of a compressed Bitcoin public key hash.\n depositExtraInfo.refundPubKeyHash,\n hex\"88\", // OP_EQUALVERIFY\n hex\"04\", // Byte length of refund locktime value.\n depositExtraInfo.refundLocktime,\n hex\"b1\", // OP_CHECKLOCKTIMEVERIFY\n hex\"75\", // OP_DROP\n hex\"ac\", // OP_CHECKSIG\n hex\"68\" // OP_ENDIF\n );\n\n bytes memory fundingOutput = depositExtraInfo\n .fundingTx\n .outputVector\n .extractOutputAtIndex(depositKey.fundingOutputIndex);\n bytes memory fundingOutputHash = fundingOutput.extractHash();\n\n // Path that checks the deposit extra data validity in case the\n // referred deposit is a P2SH.\n if (\n // slither-disable-next-line calls-loop\n fundingOutputHash.length == 20 &&\n fundingOutputHash.slice20(0) == expectedScript.hash160View()\n ) {\n return;\n }\n\n // Path that checks the deposit extra data validity in case the\n // referred deposit is a P2WSH.\n if (\n fundingOutputHash.length == 32 &&\n fundingOutputHash.toBytes32() == sha256(expectedScript)\n ) {\n return;\n }\n\n revert(\"Extra info funding output script does not match\");\n }\n}\n" + }, + "contracts/bridge/Wallets.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {EcdsaDkg} from \"@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n\nimport \"./BitcoinTx.sol\";\nimport \"./EcdsaLib.sol\";\nimport \"./BridgeState.sol\";\n\n/// @title Wallet library\n/// @notice Library responsible for handling integration between Bridge\n/// contract and ECDSA wallets.\nlibrary Wallets {\n using BTCUtils for bytes;\n\n /// @notice Represents wallet state:\n enum WalletState {\n /// @dev The wallet is unknown to the Bridge.\n Unknown,\n /// @dev The wallet can sweep deposits and accept redemption requests.\n Live,\n /// @dev The wallet was deemed unhealthy and is expected to move their\n /// outstanding funds to another wallet. The wallet can still\n /// fulfill their pending redemption requests although new\n /// redemption requests and new deposit reveals are not accepted.\n MovingFunds,\n /// @dev The wallet moved or redeemed all their funds and is in the\n /// closing period where it is still a subject of fraud challenges\n /// and must defend against them. This state is needed to protect\n /// against deposit frauds on deposits revealed but not swept.\n /// The closing period must be greater that the deposit refund\n /// time plus some time margin.\n Closing,\n /// @dev The wallet finalized the closing period successfully and\n /// can no longer perform any action in the Bridge.\n Closed,\n /// @dev The wallet committed a fraud that was reported, did not move\n /// funds to another wallet before a timeout, or did not sweep\n /// funds moved to if from another wallet before a timeout. The\n /// wallet is blocked and can not perform any actions in the Bridge.\n /// Off-chain coordination with the wallet operators is needed to\n /// recover funds.\n Terminated\n }\n\n /// @notice Holds information about a wallet.\n struct Wallet {\n // Identifier of a ECDSA Wallet registered in the ECDSA Wallet Registry.\n bytes32 ecdsaWalletID;\n // Latest wallet's main UTXO hash computed as\n // keccak256(txHash | txOutputIndex | txOutputValue). The `tx` prefix\n // refers to the transaction which created that main UTXO. The `txHash`\n // is `bytes32` (ordered as in Bitcoin internally), `txOutputIndex`\n // an `uint32`, and `txOutputValue` an `uint64` value.\n bytes32 mainUtxoHash;\n // The total redeemable value of pending redemption requests targeting\n // that wallet.\n uint64 pendingRedemptionsValue;\n // UNIX timestamp the wallet was created at.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 createdAt;\n // UNIX timestamp indicating the moment the wallet was requested to\n // move their funds.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 movingFundsRequestedAt;\n // UNIX timestamp indicating the moment the wallet's closing period\n // started.\n // XXX: Unsigned 32-bit int unix seconds, will break February 7th 2106.\n uint32 closingStartedAt;\n // Total count of pending moved funds sweep requests targeting this wallet.\n uint32 pendingMovedFundsSweepRequestsCount;\n // Current state of the wallet.\n WalletState state;\n // Moving funds target wallet commitment submitted by the wallet. It\n // is built by applying the keccak256 hash over the list of 20-byte\n // public key hashes of the target wallets.\n bytes32 movingFundsTargetWalletsCommitmentHash;\n // This struct doesn't contain `__gap` property as the structure is stored\n // in a mapping, mappings store values in different slots and they are\n // not contiguous with other values.\n }\n\n event NewWalletRequested();\n\n event NewWalletRegistered(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletMovingFunds(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletClosing(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletClosed(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n event WalletTerminated(\n bytes32 indexed ecdsaWalletID,\n bytes20 indexed walletPubKeyHash\n );\n\n /// @notice Requests creation of a new wallet. This function just\n /// forms a request and the creation process is performed\n /// asynchronously. Outcome of that process should be delivered\n /// using `registerNewWallet` function.\n /// @param activeWalletMainUtxo Data of the active wallet's main UTXO, as\n /// currently known on the Ethereum chain.\n /// @dev Requirements:\n /// - `activeWalletMainUtxo` components must point to the recent main\n /// UTXO of the given active wallet, as currently known on the\n /// Ethereum chain. If there is no active wallet at the moment, or\n /// the active wallet has no main UTXO, this parameter can be\n /// empty as it is ignored,\n /// - Wallet creation must not be in progress,\n /// - If the active wallet is set, one of the following\n /// conditions must be true:\n /// - The active wallet BTC balance is above the minimum threshold\n /// and the active wallet is old enough, i.e. the creation period\n /// was elapsed since its creation time,\n /// - The active wallet BTC balance is above the maximum threshold.\n function requestNewWallet(\n BridgeState.Storage storage self,\n BitcoinTx.UTXO calldata activeWalletMainUtxo\n ) external {\n require(\n self.ecdsaWalletRegistry.getWalletCreationState() ==\n EcdsaDkg.State.IDLE,\n \"Wallet creation already in progress\"\n );\n\n bytes20 activeWalletPubKeyHash = self.activeWalletPubKeyHash;\n\n // If the active wallet is set, fetch this wallet's details from\n // storage to perform conditions check. The `registerNewWallet`\n // function guarantees an active wallet is always one of the\n // registered ones.\n if (activeWalletPubKeyHash != bytes20(0)) {\n uint64 activeWalletBtcBalance = getWalletBtcBalance(\n self,\n activeWalletPubKeyHash,\n activeWalletMainUtxo\n );\n uint32 activeWalletCreatedAt = self\n .registeredWallets[activeWalletPubKeyHash]\n .createdAt;\n /* solhint-disable-next-line not-rely-on-time */\n bool activeWalletOldEnough = block.timestamp >=\n activeWalletCreatedAt + self.walletCreationPeriod;\n\n require(\n (activeWalletOldEnough &&\n activeWalletBtcBalance >=\n self.walletCreationMinBtcBalance) ||\n activeWalletBtcBalance >= self.walletCreationMaxBtcBalance,\n \"Wallet creation conditions are not met\"\n );\n }\n\n emit NewWalletRequested();\n\n self.ecdsaWalletRegistry.requestNewWallet();\n }\n\n /// @notice Registers a new wallet. This function should be called\n /// after the wallet creation process initiated using\n /// `requestNewWallet` completes and brings the outcomes.\n /// @param ecdsaWalletID Wallet's unique identifier.\n /// @param publicKeyX Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n /// @dev Requirements:\n /// - The only caller authorized to call this function is `registry`,\n /// - Given wallet data must not belong to an already registered wallet.\n function registerNewWallet(\n BridgeState.Storage storage self,\n bytes32 ecdsaWalletID,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external {\n require(\n msg.sender == address(self.ecdsaWalletRegistry),\n \"Caller is not the ECDSA Wallet Registry\"\n );\n\n // Compress wallet's public key and calculate Bitcoin's hash160 of it.\n bytes20 walletPubKeyHash = bytes20(\n EcdsaLib.compressPublicKey(publicKeyX, publicKeyY).hash160View()\n );\n\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n require(\n wallet.state == WalletState.Unknown,\n \"ECDSA wallet has been already registered\"\n );\n wallet.ecdsaWalletID = ecdsaWalletID;\n wallet.state = WalletState.Live;\n /* solhint-disable-next-line not-rely-on-time */\n wallet.createdAt = uint32(block.timestamp);\n\n // Set the freshly created wallet as the new active wallet.\n self.activeWalletPubKeyHash = walletPubKeyHash;\n\n self.liveWalletsCount++;\n\n emit NewWalletRegistered(ecdsaWalletID, walletPubKeyHash);\n }\n\n /// @notice Handles a notification about a wallet redemption timeout.\n /// Triggers the wallet moving funds process only if the wallet is\n /// still in the Live state. That means multiple action timeouts can\n /// be reported for the same wallet but only the first report\n /// requests the wallet to move their funds. Executes slashing if\n /// the wallet is in Live or MovingFunds state. Allows to notify\n /// redemption timeout also for a Terminated wallet in case the\n /// redemption was requested before the wallet got terminated.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The wallet must be in the `Live`, `MovingFunds`,\n /// or `Terminated` state.\n function notifyWalletRedemptionTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n WalletState walletState = wallet.state;\n\n require(\n walletState == WalletState.Live ||\n walletState == WalletState.MovingFunds ||\n walletState == WalletState.Terminated,\n \"Wallet must be in Live or MovingFunds or Terminated state\"\n );\n\n if (\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds\n ) {\n // Slash the wallet operators and reward the notifier\n self.ecdsaWalletRegistry.seize(\n self.redemptionTimeoutSlashingAmount,\n self.redemptionTimeoutNotifierRewardMultiplier,\n msg.sender,\n wallet.ecdsaWalletID,\n walletMembersIDs\n );\n }\n\n if (walletState == WalletState.Live) {\n moveFunds(self, walletPubKeyHash);\n }\n }\n\n /// @notice Handles a notification about a wallet heartbeat failure and\n /// triggers the wallet moving funds process.\n /// @param publicKeyX Wallet's public key's X coordinate.\n /// @param publicKeyY Wallet's public key's Y coordinate.\n /// @dev Requirements:\n /// - The only caller authorized to call this function is `registry`,\n /// - Wallet must be in Live state.\n function notifyWalletHeartbeatFailed(\n BridgeState.Storage storage self,\n bytes32 publicKeyX,\n bytes32 publicKeyY\n ) external {\n require(\n msg.sender == address(self.ecdsaWalletRegistry),\n \"Caller is not the ECDSA Wallet Registry\"\n );\n\n // Compress wallet's public key and calculate Bitcoin's hash160 of it.\n bytes20 walletPubKeyHash = bytes20(\n EcdsaLib.compressPublicKey(publicKeyX, publicKeyY).hash160View()\n );\n\n require(\n self.registeredWallets[walletPubKeyHash].state == WalletState.Live,\n \"Wallet must be in Live state\"\n );\n\n moveFunds(self, walletPubKeyHash);\n }\n\n /// @notice Notifies that the wallet is either old enough or has too few\n /// satoshis left and qualifies to be closed.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMainUtxo Data of the wallet's main UTXO, as currently\n /// known on the Ethereum chain.\n /// @dev Requirements:\n /// - Wallet must not be set as the current active wallet,\n /// - Wallet must exceed the wallet maximum age OR the wallet BTC\n /// balance must be lesser than the minimum threshold. If the latter\n /// case is true, the `walletMainUtxo` components must point to the\n /// recent main UTXO of the given wallet, as currently known on the\n /// Ethereum chain. If the wallet has no main UTXO, this parameter\n /// can be empty as it is ignored since the wallet balance is\n /// assumed to be zero,\n /// - Wallet must be in Live state.\n function notifyWalletCloseable(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata walletMainUtxo\n ) external {\n require(\n self.activeWalletPubKeyHash != walletPubKeyHash,\n \"Active wallet cannot be considered closeable\"\n );\n\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n require(\n wallet.state == WalletState.Live,\n \"Wallet must be in Live state\"\n );\n\n /* solhint-disable-next-line not-rely-on-time */\n bool walletOldEnough = block.timestamp >=\n wallet.createdAt + self.walletMaxAge;\n\n require(\n walletOldEnough ||\n getWalletBtcBalance(self, walletPubKeyHash, walletMainUtxo) <\n self.walletClosureMinBtcBalance,\n \"Wallet needs to be old enough or have too few satoshis\"\n );\n\n moveFunds(self, walletPubKeyHash);\n }\n\n /// @notice Notifies about the end of the closing period for the given wallet.\n /// Closes the wallet ultimately and notifies the ECDSA registry\n /// about this fact.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The wallet must be in the Closing state,\n /// - The wallet closing period must have elapsed.\n function notifyWalletClosingPeriodElapsed(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n\n require(\n wallet.state == WalletState.Closing,\n \"Wallet must be in Closing state\"\n );\n\n require(\n /* solhint-disable-next-line not-rely-on-time */\n block.timestamp >\n wallet.closingStartedAt + self.walletClosingPeriod,\n \"Closing period has not elapsed yet\"\n );\n\n finalizeWalletClosing(self, walletPubKeyHash);\n }\n\n /// @notice Notifies that the wallet completed the moving funds process\n /// successfully. Checks if the funds were moved to the expected\n /// target wallets. Closes the source wallet if everything went\n /// good and reverts otherwise.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param targetWalletsHash 32-byte keccak256 hash over the list of\n /// 20-byte public key hashes of the target wallets actually used\n /// within the moving funds transactions.\n /// @dev Requirements:\n /// - The caller must make sure the moving funds transaction actually\n /// happened on Bitcoin chain and fits the protocol requirements,\n /// - The source wallet must be in the MovingFunds state,\n /// - The target wallets commitment must be submitted by the source\n /// wallet,\n /// - The actual target wallets used in the moving funds transaction\n /// must be exactly the same as the target wallets commitment.\n function notifyWalletFundsMoved(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n bytes32 targetWalletsHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n // Check that the wallet is in the MovingFunds state but don't check\n // if the moving funds timeout is exceeded. That should give a\n // possibility to move funds in case when timeout was hit but was\n // not reported yet.\n require(\n wallet.state == WalletState.MovingFunds,\n \"Wallet must be in MovingFunds state\"\n );\n\n bytes32 targetWalletsCommitmentHash = wallet\n .movingFundsTargetWalletsCommitmentHash;\n\n require(\n targetWalletsCommitmentHash != bytes32(0),\n \"Target wallets commitment not submitted yet\"\n );\n\n // Make sure that the target wallets where funds were moved to are\n // exactly the same as the ones the source wallet committed to.\n require(\n targetWalletsCommitmentHash == targetWalletsHash,\n \"Target wallets don't correspond to the commitment\"\n );\n\n // If funds were moved, the wallet has no longer a main UTXO.\n delete wallet.mainUtxoHash;\n\n beginWalletClosing(self, walletPubKeyHash);\n }\n\n /// @notice Called when a MovingFunds wallet has a balance below the dust\n /// threshold. Begins the wallet closing.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state.\n function notifyWalletMovingFundsBelowDust(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n WalletState walletState = self\n .registeredWallets[walletPubKeyHash]\n .state;\n\n require(\n walletState == Wallets.WalletState.MovingFunds,\n \"Wallet must be in MovingFunds state\"\n );\n\n beginWalletClosing(self, walletPubKeyHash);\n }\n\n /// @notice Called when the timeout for MovingFunds for the wallet elapsed.\n /// Slashes wallet members and terminates the wallet.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The wallet must be in the MovingFunds state.\n function notifyWalletMovingFundsTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs\n ) internal {\n Wallets.Wallet storage wallet = self.registeredWallets[\n walletPubKeyHash\n ];\n\n require(\n wallet.state == Wallets.WalletState.MovingFunds,\n \"Wallet must be in MovingFunds state\"\n );\n\n self.ecdsaWalletRegistry.seize(\n self.movingFundsTimeoutSlashingAmount,\n self.movingFundsTimeoutNotifierRewardMultiplier,\n msg.sender,\n wallet.ecdsaWalletID,\n walletMembersIDs\n );\n\n terminateWallet(self, walletPubKeyHash);\n }\n\n /// @notice Called when a wallet which was asked to sweep funds moved from\n /// another wallet did not provide a sweeping proof before a timeout.\n /// Slashes and terminates the wallet who failed to provide a proof.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet which was\n /// supposed to sweep funds.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @dev Requirements:\n /// - The wallet must be in the `Live`, `MovingFunds`,\n /// or `Terminated` state.\n function notifyWalletMovedFundsSweepTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n WalletState walletState = wallet.state;\n\n require(\n walletState == WalletState.Live ||\n walletState == WalletState.MovingFunds ||\n walletState == WalletState.Terminated,\n \"Wallet must be in Live or MovingFunds or Terminated state\"\n );\n\n if (\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds\n ) {\n self.ecdsaWalletRegistry.seize(\n self.movedFundsSweepTimeoutSlashingAmount,\n self.movedFundsSweepTimeoutNotifierRewardMultiplier,\n msg.sender,\n wallet.ecdsaWalletID,\n walletMembersIDs\n );\n\n terminateWallet(self, walletPubKeyHash);\n }\n }\n\n /// @notice Called when a wallet which was challenged for a fraud did not\n /// defeat the challenge before the timeout. Slashes and terminates\n /// the wallet who failed to defeat the challenge. If the wallet is\n /// already terminated, it does nothing.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet which was\n /// supposed to sweep funds.\n /// @param walletMembersIDs Identifiers of the wallet signing group members.\n /// @param challenger Address of the party which submitted the fraud\n /// challenge.\n /// @dev Requirements:\n /// - The wallet must be in the `Live`, `MovingFunds`, `Closing`\n /// or `Terminated` state.\n function notifyWalletFraudChallengeDefeatTimeout(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n uint32[] calldata walletMembersIDs,\n address challenger\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n WalletState walletState = wallet.state;\n\n if (\n walletState == Wallets.WalletState.Live ||\n walletState == Wallets.WalletState.MovingFunds ||\n walletState == Wallets.WalletState.Closing\n ) {\n self.ecdsaWalletRegistry.seize(\n self.fraudSlashingAmount,\n self.fraudNotifierRewardMultiplier,\n challenger,\n wallet.ecdsaWalletID,\n walletMembersIDs\n );\n\n terminateWallet(self, walletPubKeyHash);\n } else if (walletState == Wallets.WalletState.Terminated) {\n // This is a special case when the wallet was already terminated\n // due to a previous deliberate protocol violation. In that\n // case, this function should be still callable for other fraud\n // challenges timeouts in order to let the challenger unlock its\n // ETH deposit back. However, the wallet termination logic is\n // not called and the challenger is not rewarded.\n } else {\n revert(\n \"Wallet must be in Live or MovingFunds or Closing or Terminated state\"\n );\n }\n }\n\n /// @notice Requests a wallet to move their funds. If the wallet balance\n /// is zero, the wallet closing begins immediately. If the move\n /// funds request refers to the current active wallet, such a wallet\n /// is no longer considered active and the active wallet slot\n /// is unset allowing to trigger a new wallet creation immediately.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The caller must make sure that the wallet is in the Live state.\n function moveFunds(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n\n if (wallet.mainUtxoHash == bytes32(0)) {\n // If the wallet has no main UTXO, that means its BTC balance\n // is zero and the wallet closing should begin immediately.\n beginWalletClosing(self, walletPubKeyHash);\n } else {\n // Otherwise, initialize the moving funds process.\n wallet.state = WalletState.MovingFunds;\n /* solhint-disable-next-line not-rely-on-time */\n wallet.movingFundsRequestedAt = uint32(block.timestamp);\n\n // slither-disable-next-line reentrancy-events\n emit WalletMovingFunds(wallet.ecdsaWalletID, walletPubKeyHash);\n }\n\n if (self.activeWalletPubKeyHash == walletPubKeyHash) {\n // If the move funds request refers to the current active wallet,\n // unset the active wallet and make the wallet creation process\n // possible in order to get a new healthy active wallet.\n delete self.activeWalletPubKeyHash;\n }\n\n self.liveWalletsCount--;\n }\n\n /// @notice Begins the closing period of the given wallet.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The caller must make sure that the wallet is in the\n /// MovingFunds state.\n function beginWalletClosing(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n // Initialize the closing period.\n wallet.state = WalletState.Closing;\n /* solhint-disable-next-line not-rely-on-time */\n wallet.closingStartedAt = uint32(block.timestamp);\n\n // slither-disable-next-line reentrancy-events\n emit WalletClosing(wallet.ecdsaWalletID, walletPubKeyHash);\n }\n\n /// @notice Finalizes the closing period of the given wallet and notifies\n /// the ECDSA registry about this fact.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The caller must make sure that the wallet is in the Closing state.\n function finalizeWalletClosing(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n\n wallet.state = WalletState.Closed;\n\n emit WalletClosed(wallet.ecdsaWalletID, walletPubKeyHash);\n\n self.ecdsaWalletRegistry.closeWallet(wallet.ecdsaWalletID);\n }\n\n /// @notice Terminates the given wallet and notifies the ECDSA registry\n /// about this fact. If the wallet termination refers to the current\n /// active wallet, such a wallet is no longer considered active and\n /// the active wallet slot is unset allowing to trigger a new wallet\n /// creation immediately.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @dev Requirements:\n /// - The caller must make sure that the wallet is in the\n /// Live or MovingFunds or Closing state.\n function terminateWallet(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash\n ) internal {\n Wallet storage wallet = self.registeredWallets[walletPubKeyHash];\n\n if (wallet.state == WalletState.Live) {\n self.liveWalletsCount--;\n }\n\n wallet.state = WalletState.Terminated;\n\n // slither-disable-next-line reentrancy-events\n emit WalletTerminated(wallet.ecdsaWalletID, walletPubKeyHash);\n\n if (self.activeWalletPubKeyHash == walletPubKeyHash) {\n // If termination refers to the current active wallet,\n // unset the active wallet and make the wallet creation process\n // possible in order to get a new healthy active wallet.\n delete self.activeWalletPubKeyHash;\n }\n\n self.ecdsaWalletRegistry.closeWallet(wallet.ecdsaWalletID);\n }\n\n /// @notice Gets BTC balance for given the wallet.\n /// @param walletPubKeyHash 20-byte public key hash of the wallet.\n /// @param walletMainUtxo Data of the wallet's main UTXO, as currently\n /// known on the Ethereum chain.\n /// @return walletBtcBalance Current BTC balance for the given wallet.\n /// @dev Requirements:\n /// - `walletMainUtxo` components must point to the recent main UTXO\n /// of the given wallet, as currently known on the Ethereum chain.\n /// If the wallet has no main UTXO, this parameter can be empty as it\n /// is ignored.\n function getWalletBtcBalance(\n BridgeState.Storage storage self,\n bytes20 walletPubKeyHash,\n BitcoinTx.UTXO calldata walletMainUtxo\n ) internal view returns (uint64 walletBtcBalance) {\n bytes32 walletMainUtxoHash = self\n .registeredWallets[walletPubKeyHash]\n .mainUtxoHash;\n\n // If the wallet has a main UTXO hash set, cross-check it with the\n // provided plain-text parameter and get the transaction output value\n // as BTC balance. Otherwise, the BTC balance is just zero.\n if (walletMainUtxoHash != bytes32(0)) {\n require(\n keccak256(\n abi.encodePacked(\n walletMainUtxo.txHash,\n walletMainUtxo.txOutputIndex,\n walletMainUtxo.txOutputValue\n )\n ) == walletMainUtxoHash,\n \"Invalid wallet main UTXO data\"\n );\n\n walletBtcBalance = walletMainUtxo.txOutputValue;\n }\n\n return walletBtcBalance;\n }\n}\n" + }, + "contracts/relay/LightRelay.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\nimport {BytesLib} from \"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\";\nimport {BTCUtils} from \"@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {ValidateSPV} from \"@keep-network/bitcoin-spv-sol/contracts/ValidateSPV.sol\";\n\nimport \"../bridge/IRelay.sol\";\n\nstruct Epoch {\n uint32 timestamp;\n // By definition, bitcoin targets have at least 32 leading zero bits.\n // Thus we can only store the bits that aren't guaranteed to be 0.\n uint224 target;\n}\n\ninterface ILightRelay is IRelay {\n event Genesis(uint256 blockHeight);\n event Retarget(uint256 oldDifficulty, uint256 newDifficulty);\n event ProofLengthChanged(uint256 newLength);\n event AuthorizationRequirementChanged(bool newStatus);\n event SubmitterAuthorized(address submitter);\n event SubmitterDeauthorized(address submitter);\n\n function retarget(bytes memory headers) external;\n\n function validateChain(bytes memory headers)\n external\n view\n returns (uint256 startingHeaderTimestamp, uint256 headerCount);\n\n function getBlockDifficulty(uint256 blockNumber)\n external\n view\n returns (uint256);\n\n function getEpochDifficulty(uint256 epochNumber)\n external\n view\n returns (uint256);\n\n function getRelayRange()\n external\n view\n returns (uint256 relayGenesis, uint256 currentEpochEnd);\n}\n\nlibrary RelayUtils {\n using BytesLib for bytes;\n\n /// @notice Extract the timestamp of the header at the given position.\n /// @param headers Byte array containing the header of interest.\n /// @param at The start of the header in the array.\n /// @return The timestamp of the header.\n /// @dev Assumes that the specified position contains a valid header.\n /// Performs no validation whatsoever.\n function extractTimestampAt(bytes memory headers, uint256 at)\n internal\n pure\n returns (uint32)\n {\n return BTCUtils.reverseUint32(uint32(headers.slice4(68 + at)));\n }\n}\n\n/// @dev THE RELAY MUST NOT BE USED BEFORE GENESIS AND AT LEAST ONE RETARGET.\ncontract LightRelay is Ownable, ILightRelay {\n using BytesLib for bytes;\n using BTCUtils for bytes;\n using ValidateSPV for bytes;\n using RelayUtils for bytes;\n\n bool public ready;\n // Whether the relay requires the address submitting a retarget to be\n // authorised in advance by governance.\n bool public authorizationRequired;\n // Number of blocks required for each side of a retarget proof:\n // a retarget must provide `proofLength` blocks before the retarget\n // and `proofLength` blocks after it.\n // Governable\n // Should be set to a fairly high number (e.g. 20-50) in production.\n uint64 public proofLength;\n // The number of the first epoch recorded by the relay.\n // This should equal the height of the block starting the genesis epoch,\n // divided by 2016, but this is not enforced as the relay has no\n // information about block numbers.\n uint64 public genesisEpoch;\n // The number of the latest epoch whose difficulty is proven to the relay.\n // If the genesis epoch's number is set correctly, and retargets along the\n // way have been legitimate, this equals the height of the block starting\n // the most recent epoch, divided by 2016.\n uint64 public currentEpoch;\n\n uint256 internal currentEpochDifficulty;\n uint256 internal prevEpochDifficulty;\n\n // Each epoch from genesis to the current one, keyed by their numbers.\n mapping(uint256 => Epoch) internal epochs;\n\n mapping(address => bool) public isAuthorized;\n\n modifier relayActive() {\n require(ready, \"Relay is not ready for use\");\n _;\n }\n\n /// @notice Establish a starting point for the relay by providing the\n /// target, timestamp and blockheight of the first block of the relay\n /// genesis epoch.\n /// @param genesisHeader The first block header of the genesis epoch.\n /// @param genesisHeight The block number of the first block of the epoch.\n /// @param genesisProofLength The number of blocks required to accept a\n /// proof.\n /// @dev If the relay is used by querying the current and previous epoch\n /// difficulty, at least one retarget needs to be provided after genesis;\n /// otherwise the prevEpochDifficulty will be uninitialised and zero.\n function genesis(\n bytes calldata genesisHeader,\n uint256 genesisHeight,\n uint64 genesisProofLength\n ) external onlyOwner {\n require(!ready, \"Genesis already performed\");\n\n require(genesisHeader.length == 80, \"Invalid genesis header length\");\n\n require(\n genesisHeight % 2016 == 0,\n \"Invalid height of relay genesis block\"\n );\n\n require(genesisProofLength < 2016, \"Proof length excessive\");\n require(genesisProofLength > 0, \"Proof length may not be zero\");\n\n genesisEpoch = uint64(genesisHeight / 2016);\n currentEpoch = genesisEpoch;\n uint256 genesisTarget = genesisHeader.extractTarget();\n uint256 genesisTimestamp = genesisHeader.extractTimestamp();\n epochs[genesisEpoch] = Epoch(\n uint32(genesisTimestamp),\n uint224(genesisTarget)\n );\n proofLength = genesisProofLength;\n currentEpochDifficulty = BTCUtils.calculateDifficulty(genesisTarget);\n ready = true;\n\n emit Genesis(genesisHeight);\n }\n\n /// @notice Set the number of blocks required to accept a header chain.\n /// @param newLength The required number of blocks. Must be less than 2016.\n /// @dev For production, a high number (e.g. 20-50) is recommended.\n /// Small numbers are accepted but should only be used for testing.\n function setProofLength(uint64 newLength) external relayActive onlyOwner {\n require(newLength < 2016, \"Proof length excessive\");\n require(newLength > 0, \"Proof length may not be zero\");\n require(newLength != proofLength, \"Proof length unchanged\");\n proofLength = newLength;\n emit ProofLengthChanged(newLength);\n }\n\n /// @notice Set whether the relay requires retarget submitters to be\n /// pre-authorised by governance.\n /// @param status True if authorisation is to be required, false if not.\n function setAuthorizationStatus(bool status) external onlyOwner {\n authorizationRequired = status;\n emit AuthorizationRequirementChanged(status);\n }\n\n /// @notice Authorise the given address to submit retarget proofs.\n /// @param submitter The address to be authorised.\n function authorize(address submitter) external onlyOwner {\n isAuthorized[submitter] = true;\n emit SubmitterAuthorized(submitter);\n }\n\n /// @notice Rescind the authorisation of the submitter to retarget.\n /// @param submitter The address to be deauthorised.\n function deauthorize(address submitter) external onlyOwner {\n isAuthorized[submitter] = false;\n emit SubmitterDeauthorized(submitter);\n }\n\n /// @notice Add a new epoch to the relay by providing a proof\n /// of the difficulty before and after the retarget.\n /// @param headers A chain of headers including the last X blocks before\n /// the retarget, followed by the first X blocks after the retarget,\n /// where X equals the current proof length.\n /// @dev Checks that the first X blocks are valid in the most recent epoch,\n /// that the difficulty of the new epoch is calculated correctly according\n /// to the block timestamps, and that the next X blocks would be valid in\n /// the new epoch.\n /// We have no information of block heights, so we cannot enforce that\n /// retargets only happen every 2016 blocks; instead, we assume that this\n /// is the case if a valid proof of work is provided.\n /// It is possible to cheat the relay by providing X blocks from earlier in\n /// the most recent epoch, and then mining X new blocks after them.\n /// However, each of these malicious blocks would have to be mined to a\n /// higher difficulty than the legitimate ones.\n /// Alternatively, if the retarget has not been performed yet, one could\n /// first mine X blocks in the old difficulty with timestamps set far in\n /// the future, and then another X blocks at a greatly reduced difficulty.\n /// In either case, cheating the realy requires more work than mining X\n /// legitimate blocks.\n /// Only the most recent epoch is vulnerable to these attacks; once a\n /// retarget has been proven to the relay, the epoch is immutable even if a\n /// contradictory proof were to be presented later.\n function retarget(bytes memory headers) external relayActive {\n if (authorizationRequired) {\n require(isAuthorized[msg.sender], \"Submitter unauthorized\");\n }\n\n require(\n // Require proofLength headers on both sides of the retarget\n headers.length == (proofLength * 2 * 80),\n \"Invalid header length\"\n );\n\n Epoch storage latest = epochs[currentEpoch];\n\n uint256 oldTarget = latest.target;\n\n bytes32 previousHeaderDigest = bytes32(0);\n\n // Validate old chain\n for (uint256 i = 0; i < proofLength; i++) {\n (\n bytes32 currentDigest,\n uint256 currentHeaderTarget\n ) = validateHeader(headers, i * 80, previousHeaderDigest);\n\n require(\n currentHeaderTarget == oldTarget,\n \"Invalid target in pre-retarget headers\"\n );\n\n previousHeaderDigest = currentDigest;\n }\n\n // get timestamp of retarget block\n uint256 epochEndTimestamp = headers.extractTimestampAt(\n (proofLength - 1) * 80\n );\n\n // An attacker could produce blocks with timestamps in the future,\n // in an attempt to reduce the difficulty after the retarget\n // to make mining the second part of the retarget proof easier.\n // In particular, the attacker could reuse all but one block\n // from the legitimate chain, and only mine the last block.\n // To hinder this, require that the epoch end timestamp does not\n // exceed the ethereum timestamp.\n // NOTE: both are unix seconds, so this comparison should be valid.\n require(\n /* solhint-disable-next-line not-rely-on-time */\n epochEndTimestamp < block.timestamp,\n \"Epoch cannot end in the future\"\n );\n\n // Expected target is the full-length target\n uint256 expectedTarget = BTCUtils.retargetAlgorithm(\n oldTarget,\n latest.timestamp,\n epochEndTimestamp\n );\n\n // Mined target is the header-encoded target\n uint256 minedTarget = 0;\n\n uint256 epochStartTimestamp = headers.extractTimestampAt(\n proofLength * 80\n );\n\n // validate new chain\n for (uint256 j = proofLength; j < proofLength * 2; j++) {\n (\n bytes32 _currentDigest,\n uint256 _currentHeaderTarget\n ) = validateHeader(headers, j * 80, previousHeaderDigest);\n\n if (minedTarget == 0) {\n // The new target has not been set, so check its correctness\n minedTarget = _currentHeaderTarget;\n require(\n // Although the target is a 256-bit number, there are only 32 bits of\n // space in the Bitcoin header. Because of that, the version stored in\n // the header is a less-precise representation of the actual target\n // using base-256 version of scientific notation.\n //\n // The 256-bit unsigned integer returned from BTCUtils.retargetAlgorithm\n // is the precise target value.\n // The 256-bit unsigned integer returned from validateHeader is the less\n // precise target value because it was read from 32 bits of space of\n // Bitcoin block header.\n //\n // We can't compare the precise and less precise representations together\n // so we first mask them to obtain the less precise version:\n // (full & truncated) == truncated\n _currentHeaderTarget ==\n (expectedTarget & _currentHeaderTarget),\n \"Invalid target in new epoch\"\n );\n } else {\n // The new target has been set, so remaining targets should match.\n require(\n _currentHeaderTarget == minedTarget,\n \"Unexpected target change after retarget\"\n );\n }\n\n previousHeaderDigest = _currentDigest;\n }\n\n currentEpoch = currentEpoch + 1;\n\n epochs[currentEpoch] = Epoch(\n uint32(epochStartTimestamp),\n uint224(minedTarget)\n );\n\n uint256 oldDifficulty = currentEpochDifficulty;\n uint256 newDifficulty = BTCUtils.calculateDifficulty(minedTarget);\n\n prevEpochDifficulty = oldDifficulty;\n currentEpochDifficulty = newDifficulty;\n\n emit Retarget(oldDifficulty, newDifficulty);\n }\n\n /// @notice Check whether a given chain of headers should be accepted as\n /// valid within the rules of the relay.\n /// If the validation fails, this function throws an exception.\n /// @param headers A chain of 2 to 2015 bitcoin headers.\n /// @return startingHeaderTimestamp The timestamp of the first header.\n /// @return headerCount The number of headers.\n /// @dev A chain of headers is accepted as valid if:\n /// - Its length is between 2 and 2015 headers.\n /// - Headers in the chain are sequential and refer to previous digests.\n /// - Each header is mined with the correct amount of work.\n /// - The difficulty in each header matches an epoch of the relay,\n /// as determined by the headers' timestamps. The headers must be between\n /// the genesis epoch and the latest proven epoch (inclusive).\n /// If the chain contains a retarget, it is accepted if the retarget has\n /// already been proven to the relay.\n /// If the chain contains blocks of an epoch that has not been proven to\n /// the relay (after a retarget within the header chain, or when the entire\n /// chain falls within an epoch that has not been proven yet), it will be\n /// rejected.\n /// One exception to this is when two subsequent epochs have exactly the\n /// same difficulty; headers from the latter epoch will be accepted if the\n /// previous epoch has been proven to the relay.\n /// This is because it is not possible to distinguish such headers from\n /// headers of the previous epoch.\n ///\n /// If the difficulty increases significantly between relay genesis and the\n /// present, creating fraudulent proofs for earlier epochs becomes easier.\n /// Users of the relay should check the timestamps of valid headers and\n /// only accept appropriately recent ones.\n function validateChain(bytes memory headers)\n external\n view\n returns (uint256 startingHeaderTimestamp, uint256 headerCount)\n {\n require(headers.length % 80 == 0, \"Invalid header length\");\n\n headerCount = headers.length / 80;\n\n require(\n headerCount > 1 && headerCount < 2016,\n \"Invalid number of headers\"\n );\n\n startingHeaderTimestamp = headers.extractTimestamp();\n\n // Short-circuit the first header's validation.\n // We validate the header here to get the target which is needed to\n // precisely identify the epoch.\n (\n bytes32 previousHeaderDigest,\n uint256 currentHeaderTarget\n ) = validateHeader(headers, 0, bytes32(0));\n\n Epoch memory nullEpoch = Epoch(0, 0);\n\n uint256 startingEpochNumber = currentEpoch;\n Epoch memory startingEpoch = epochs[startingEpochNumber];\n Epoch memory nextEpoch = nullEpoch;\n\n // Find the correct epoch for the given chain\n // Fastest with recent epochs, but able to handle anything after genesis\n //\n // The rules for bitcoin timestamps are:\n // - must be greater than the median of the last 11 blocks' timestamps\n // - must be less than the network-adjusted time +2 hours\n //\n // Because of this, the timestamp of a header may be smaller than the\n // starting time, or greater than the ending time of its epoch.\n // However, a valid timestamp is guaranteed to fall within the window\n // formed by the epochs immediately before and after its timestamp.\n // We can identify cases like these by comparing the targets.\n while (startingHeaderTimestamp < startingEpoch.timestamp) {\n startingEpochNumber -= 1;\n nextEpoch = startingEpoch;\n startingEpoch = epochs[startingEpochNumber];\n }\n\n // We have identified the centre of the window,\n // by reaching the most recent epoch whose starting timestamp\n // or reached before the genesis where epoch slots are empty.\n // Therefore check that the timestamp is nonzero.\n require(\n startingEpoch.timestamp > 0,\n \"Cannot validate chains before relay genesis\"\n );\n\n // The targets don't match. This could be because the block is invalid,\n // or it could be because of timestamp inaccuracy.\n // To cover the latter case, check adjacent epochs.\n if (currentHeaderTarget != startingEpoch.target) {\n // The target matches the next epoch.\n // This means we are right at the beginning of the next epoch,\n // and retargets during the chain should not be possible.\n if (currentHeaderTarget == nextEpoch.target) {\n startingEpoch = nextEpoch;\n nextEpoch = nullEpoch;\n }\n // The target doesn't match the next epoch.\n // Therefore the only valid epoch is the previous one.\n // Because the timestamp can't be more than 2 hours into the future\n // we must be right near the end of the epoch,\n // so a retarget is possible.\n else {\n startingEpochNumber -= 1;\n nextEpoch = startingEpoch;\n startingEpoch = epochs[startingEpochNumber];\n\n // We have failed to find a match,\n // therefore the target has to be invalid.\n require(\n currentHeaderTarget == startingEpoch.target,\n \"Invalid target in header chain\"\n );\n }\n }\n\n // We've found the correct epoch for the first header.\n // Validate the rest.\n for (uint256 i = 1; i < headerCount; i++) {\n bytes32 currentDigest;\n (currentDigest, currentHeaderTarget) = validateHeader(\n headers,\n i * 80,\n previousHeaderDigest\n );\n\n // If the header's target does not match the expected target,\n // check if a retarget is possible.\n //\n // If next epoch timestamp exists, a valid retarget is possible\n // (if next epoch timestamp doesn't exist, either a retarget has\n // already happened in this chain, the relay needs a retarget\n // before this chain can be validated, or a retarget is not allowed\n // because we know the headers are within a timestamp irregularity\n // of the previous retarget).\n //\n // In this case the target must match the next epoch's target,\n // and the header's timestamp must match the epoch's start.\n if (currentHeaderTarget != startingEpoch.target) {\n uint256 currentHeaderTimestamp = headers.extractTimestampAt(\n i * 80\n );\n\n require(\n nextEpoch.timestamp != 0 &&\n currentHeaderTarget == nextEpoch.target &&\n currentHeaderTimestamp == nextEpoch.timestamp,\n \"Invalid target in header chain\"\n );\n\n startingEpoch = nextEpoch;\n nextEpoch = nullEpoch;\n }\n\n previousHeaderDigest = currentDigest;\n }\n\n return (startingHeaderTimestamp, headerCount);\n }\n\n /// @notice Get the difficulty of the specified block.\n /// @param blockNumber The number of the block. Must fall within the relay\n /// range (at or after the relay genesis, and at or before the end of the\n /// most recent epoch proven to the relay).\n /// @return The difficulty of the epoch.\n function getBlockDifficulty(uint256 blockNumber)\n external\n view\n returns (uint256)\n {\n return getEpochDifficulty(blockNumber / 2016);\n }\n\n /// @notice Get the range of blocks the relay can accept proofs for.\n /// @dev Assumes that the genesis has been set correctly.\n /// Additionally, if the next epoch after the current one has the exact\n /// same difficulty, headers for it can be validated as well.\n /// This function should be used for informative purposes,\n /// e.g. to determine whether a retarget must be provided before submitting\n /// a header chain for validation.\n /// @return relayGenesis The height of the earliest block that can be\n /// included in header chains for the relay to validate.\n /// @return currentEpochEnd The height of the last block that can be\n /// included in header chains for the relay to validate.\n function getRelayRange()\n external\n view\n returns (uint256 relayGenesis, uint256 currentEpochEnd)\n {\n relayGenesis = genesisEpoch * 2016;\n currentEpochEnd = (currentEpoch * 2016) + 2015;\n }\n\n /// @notice Returns the difficulty of the current epoch.\n /// @dev returns 0 if the relay is not ready.\n /// @return The difficulty of the current epoch.\n function getCurrentEpochDifficulty()\n external\n view\n virtual\n returns (uint256)\n {\n return currentEpochDifficulty;\n }\n\n /// @notice Returns the difficulty of the previous epoch.\n /// @dev Returns 0 if the relay is not ready or has not had a retarget.\n /// @return The difficulty of the previous epoch.\n function getPrevEpochDifficulty() external view virtual returns (uint256) {\n return prevEpochDifficulty;\n }\n\n function getCurrentAndPrevEpochDifficulty()\n external\n view\n returns (uint256 current, uint256 previous)\n {\n return (currentEpochDifficulty, prevEpochDifficulty);\n }\n\n /// @notice Get the difficulty of the specified epoch.\n /// @param epochNumber The number of the epoch (the height of the first\n /// block of the epoch, divided by 2016). Must fall within the relay range.\n /// @return The difficulty of the epoch.\n function getEpochDifficulty(uint256 epochNumber)\n public\n view\n returns (uint256)\n {\n require(epochNumber >= genesisEpoch, \"Epoch is before relay genesis\");\n require(\n epochNumber <= currentEpoch,\n \"Epoch is not proven to the relay yet\"\n );\n return BTCUtils.calculateDifficulty(epochs[epochNumber].target);\n }\n\n /// @notice Check that the specified header forms a correct chain with the\n /// digest of the previous header (if provided), and has sufficient work.\n /// @param headers The byte array containing the header of interest.\n /// @param start The start of the header in the array.\n /// @param prevDigest The digest of the previous header\n /// (optional; providing zeros for the digest skips the check).\n /// @return digest The digest of the current header.\n /// @return target The PoW target of the header.\n /// @dev Throws an exception if the header's chain or PoW are invalid.\n /// Performs no other validation.\n function validateHeader(\n bytes memory headers,\n uint256 start,\n bytes32 prevDigest\n ) internal view returns (bytes32 digest, uint256 target) {\n // If previous block digest has been provided, require that it matches\n if (prevDigest != bytes32(0)) {\n require(\n headers.validateHeaderPrevHash(start, prevDigest),\n \"Invalid chain\"\n );\n }\n\n // Require that the header has sufficient work for its stated target\n target = headers.extractTargetAt(start);\n digest = headers.hash256Slice(start, 80);\n require(ValidateSPV.validateHeaderWork(digest, target), \"Invalid work\");\n\n return (digest, target);\n }\n}\n" + }, + "contracts/relay/LightRelayMaintainerProxy.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@keep-network/random-beacon/contracts/Reimbursable.sol\";\nimport \"@keep-network/random-beacon/contracts/ReimbursementPool.sol\";\n\nimport \"./LightRelay.sol\";\n\n/// @title LightRelayMaintainerProxy\n/// @notice The proxy contract that allows the relay maintainers to be refunded\n/// for the spent gas from the `ReimbursementPool`. When proving the\n/// next Bitcoin difficulty epoch, the maintainer calls the\n/// `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay`\n/// contract.\ncontract LightRelayMaintainerProxy is Ownable, Reimbursable {\n ILightRelay public lightRelay;\n\n /// @notice Stores the addresses that can maintain the relay. Those\n /// addresses are attested by the DAO.\n /// @dev The goal is to prevent a griefing attack by frontrunning relay\n /// maintainer which is responsible for retargetting the relay in the\n /// given round. The maintainer's transaction would revert with no gas\n /// refund. Having the ability to restrict maintainer addresses is also\n /// important in case the underlying relay contract has authorization\n /// requirements for callers.\n mapping(address => bool) public isAuthorized;\n\n /// @notice Gas that is meant to balance the retarget overall cost. Can be\n // updated by the governance based on the current market conditions.\n uint256 public retargetGasOffset;\n\n event LightRelayUpdated(address newRelay);\n\n event MaintainerAuthorized(address indexed maintainer);\n\n event MaintainerDeauthorized(address indexed maintainer);\n\n event RetargetGasOffsetUpdated(uint256 retargetGasOffset);\n\n modifier onlyRelayMaintainer() {\n require(isAuthorized[msg.sender], \"Caller is not authorized\");\n _;\n }\n\n modifier onlyReimbursableAdmin() override {\n require(owner() == msg.sender, \"Caller is not the owner\");\n _;\n }\n\n constructor(ILightRelay _lightRelay, ReimbursementPool _reimbursementPool) {\n require(\n address(_lightRelay) != address(0),\n \"Light relay must not be zero address\"\n );\n require(\n address(_reimbursementPool) != address(0),\n \"Reimbursement pool must not be zero address\"\n );\n\n lightRelay = _lightRelay;\n reimbursementPool = _reimbursementPool;\n\n retargetGasOffset = 54000;\n }\n\n /// @notice Allows the governance to upgrade the `LightRelay` address.\n /// @dev The function does not implement any governance delay and does not\n /// check the status of the `LightRelay`. The Governance implementation\n /// needs to ensure all requirements for the upgrade are satisfied\n /// before executing this function.\n function updateLightRelay(ILightRelay _lightRelay) external onlyOwner {\n require(\n address(_lightRelay) != address(0),\n \"New light relay must not be zero address\"\n );\n\n lightRelay = _lightRelay;\n emit LightRelayUpdated(address(_lightRelay));\n }\n\n /// @notice Authorizes the given address as a maintainer. Can only be called\n /// by the owner and the address of the maintainer must not be\n /// already authorized.\n /// @dev The function does not implement any governance delay.\n /// @param maintainer The address of the maintainer to be authorized.\n function authorize(address maintainer) external onlyOwner {\n require(!isAuthorized[maintainer], \"Maintainer is already authorized\");\n\n isAuthorized[maintainer] = true;\n emit MaintainerAuthorized(maintainer);\n }\n\n /// @notice Deauthorizes the given address as a maintainer. Can only be\n /// called by the owner and the address of the maintainer must be\n /// authorized.\n /// @dev The function does not implement any governance delay.\n /// @param maintainer The address of the maintainer to be deauthorized.\n function deauthorize(address maintainer) external onlyOwner {\n require(isAuthorized[maintainer], \"Maintainer is not authorized\");\n\n isAuthorized[maintainer] = false;\n emit MaintainerDeauthorized(maintainer);\n }\n\n /// @notice Updates the values of retarget gas offset.\n /// @dev Can be called only by the contract owner. The caller is responsible\n /// for validating the parameter. The function does not implement any\n /// governance delay.\n /// @param newRetargetGasOffset New retarget gas offset.\n function updateRetargetGasOffset(uint256 newRetargetGasOffset)\n external\n onlyOwner\n {\n retargetGasOffset = newRetargetGasOffset;\n emit RetargetGasOffsetUpdated(retargetGasOffset);\n }\n\n /// @notice Wraps `LightRelay.retarget` call and reimburses the caller's\n /// transaction cost. Can only be called by an authorized relay\n /// maintainer.\n /// @dev See `LightRelay.retarget` function documentation.\n function retarget(bytes memory headers) external onlyRelayMaintainer {\n uint256 gasStart = gasleft();\n\n lightRelay.retarget(headers);\n\n reimbursementPool.refund(\n (gasStart - gasleft()) + retargetGasOffset,\n msg.sender\n );\n }\n}\n" + }, + "contracts/vault/IVault.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0-only\n\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ██████████████ ▐████▌ ██████████████\n// ██████████████ ▐████▌ ██████████████\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n// ▐████▌ ▐████▌\n\npragma solidity 0.8.17;\n\nimport \"../bank/IReceiveBalanceApproval.sol\";\n\n/// @title Bank Vault interface\n/// @notice `IVault` is an interface for a smart contract consuming Bank\n/// balances of other contracts or externally owned accounts (EOA).\ninterface IVault is IReceiveBalanceApproval {\n /// @notice Called by the Bank in `increaseBalanceAndCall` function after\n /// increasing the balance in the Bank for the vault. It happens in\n /// the same transaction in which deposits were swept by the Bridge.\n /// This allows the depositor to route their deposit revealed to the\n /// Bridge to the particular smart contract (vault) in the same\n /// transaction in which the deposit is revealed. This way, the\n /// depositor does not have to execute additional transaction after\n /// the deposit gets swept by the Bridge to approve and transfer\n /// their balance to the vault.\n /// @param depositors Addresses of depositors whose deposits have been swept.\n /// @param depositedAmounts Amounts deposited by individual depositors and\n /// swept.\n /// @dev The implementation must ensure this function can only be called\n /// by the Bank. The Bank guarantees that the vault's balance was\n /// increased by the sum of all deposited amounts before this function\n /// is called, in the same transaction.\n function receiveBalanceIncrease(\n address[] calldata depositors,\n uint256[] calldata depositedAmounts\n ) external;\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 1000 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "storageLayout", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/solidity/export.json b/solidity/export.json index 36cef3413..0e5a1efa6 100644 --- a/solidity/export.json +++ b/solidity/export.json @@ -6891,6 +6891,280 @@ } ] }, + "LightRelayMaintainerProxy": { + "address": "0x4ca2f6206Da1A7Cb8155FEA68797EFDf25EFa3C8", + "abi": [ + { + "inputs": [ + { + "internalType": "contract ILightRelay", + "name": "_lightRelay", + "type": "address" + }, + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newRelay", + "type": "address" + } + ], + "name": "LightRelayUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "MaintainerAuthorized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "MaintainerDeauthorized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReimbursementPool", + "type": "address" + } + ], + "name": "ReimbursementPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "retargetGasOffset", + "type": "uint256" + } + ], + "name": "RetargetGasOffsetUpdated", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "authorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "maintainer", + "type": "address" + } + ], + "name": "deauthorize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lightRelay", + "outputs": [ + { + "internalType": "contract ILightRelay", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reimbursementPool", + "outputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "headers", + "type": "bytes" + } + ], + "name": "retarget", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "retargetGasOffset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ILightRelay", + "name": "_lightRelay", + "type": "address" + } + ], + "name": "updateLightRelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "name": "updateReimbursementPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newRetargetGasOffset", + "type": "uint256" + } + ], + "name": "updateRetargetGasOffset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, "MaintainerProxy": { "address": "0xcF29Ff894674775841F60Aa2a3c373DE27A8df2b", "abi": [ From 772cf08cb8bf046a80469baca3d476f5cc2b2979 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 10:09:26 +0200 Subject: [PATCH 088/198] Renaming upgrade deployment scripts --- ...ormhole_gateway.ts => 31_upgrade_arbitrum_wormhole_gateway.ts} | 0 ...ormhole_gateway.ts => 31_upgrade_optimism_wormhole_gateway.ts} | 0 ...wormhole_gateway.ts => 31_upgrade_polygon_wormhole_gateway.ts} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename cross-chain/arbitrum/deploy_l2/{03_upgrade_arbitrum_wormhole_gateway.ts => 31_upgrade_arbitrum_wormhole_gateway.ts} (100%) rename cross-chain/optimism/deploy_l2/{03_upgrade_optimism_wormhole_gateway.ts => 31_upgrade_optimism_wormhole_gateway.ts} (100%) rename cross-chain/polygon/deploy_sidechain/{05_upgrade_polygon_wormhole_gateway.ts => 31_upgrade_polygon_wormhole_gateway.ts} (100%) diff --git a/cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts b/cross-chain/arbitrum/deploy_l2/31_upgrade_arbitrum_wormhole_gateway.ts similarity index 100% rename from cross-chain/arbitrum/deploy_l2/03_upgrade_arbitrum_wormhole_gateway.ts rename to cross-chain/arbitrum/deploy_l2/31_upgrade_arbitrum_wormhole_gateway.ts diff --git a/cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts b/cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts similarity index 100% rename from cross-chain/optimism/deploy_l2/03_upgrade_optimism_wormhole_gateway.ts rename to cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts diff --git a/cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts similarity index 100% rename from cross-chain/polygon/deploy_sidechain/05_upgrade_polygon_wormhole_gateway.ts rename to cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts From 31ba6455b9abebf8c46e1df37fa7ff4addcbd629 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 10:29:05 +0200 Subject: [PATCH 089/198] Applying correct tags Copy paste error from Arbitrum module. Changed the tags to the correct ones. --- .../deploy_l2/31_upgrade_optimism_wormhole_gateway.ts | 8 ++++---- .../31_upgrade_polygon_wormhole_gateway.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts b/cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts index 4f4c9d23d..d3cfc3d6d 100644 --- a/cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts +++ b/cross-chain/optimism/deploy_l2/31_upgrade_optimism_wormhole_gateway.ts @@ -27,9 +27,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } ) - // Contracts can be verified on L2 Arbiscan in a similar way as we do it on - // L1 Etherscan - if (hre.network.tags.arbiscan) { + // Contracts can be verified on L2 Optimism Etherscan in a similar way as we do + // it on L1 Etherscan + if (hre.network.tags.optimism_etherscan) { // We use `verify` instead of `verify:verify` as the `verify` task is defined // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation // contract, the proxy itself and any proxy-related contracts, as well as @@ -47,4 +47,4 @@ func.tags = ["UpgradeOptimismWormholeGateway"] // Comment this line when running an upgrade. // yarn deploy --tags UpgradeOptimismWormholeGateway --network -// func.skip = async () => true +func.skip = async () => true diff --git a/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts index a3845960f..684a2fd93 100644 --- a/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts +++ b/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts @@ -27,9 +27,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } ) - // Contracts can be verified on L2 Arbiscan in a similar way as we do it on + // Contracts can be verified on L2 Polygonscan in a similar way as we do it on // L1 Etherscan - if (hre.network.tags.arbiscan) { + if (hre.network.tags.polygonscan) { // We use `verify` instead of `verify:verify` as the `verify` task is defined // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation // contract, the proxy itself and any proxy-related contracts, as well as From 53149a7da682716c3e44856bed3ca3970c94d61d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 10:48:16 +0200 Subject: [PATCH 090/198] Removing verification part We already have an existing verification script that can be reused. --- .../31_upgrade_polygon_wormhole_gateway.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts b/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts index 684a2fd93..75dd186a5 100644 --- a/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts +++ b/cross-chain/polygon/deploy_sidechain/31_upgrade_polygon_wormhole_gateway.ts @@ -9,7 +9,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const PolygonWormholeTBTC = await deployments.get("PolygonWormholeTBTC") const PolygonTBTC = await deployments.get("PolygonTBTC") - const [, proxyDeployment] = await helpers.upgrades.upgradeProxy( + await helpers.upgrades.upgradeProxy( "PolygonWormholeGateway", "PolygonWormholeGateway", { @@ -26,19 +26,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { }, } ) - - // Contracts can be verified on L2 Polygonscan in a similar way as we do it on - // L1 Etherscan - if (hre.network.tags.polygonscan) { - // We use `verify` instead of `verify:verify` as the `verify` task is defined - // in "@openzeppelin/hardhat-upgrades" to verify the proxy’s implementation - // contract, the proxy itself and any proxy-related contracts, as well as - // link the proxy to the implementation contract’s ABI on (Ether)scan. - await hre.run("verify", { - address: proxyDeployment.address, - constructorArgsParams: proxyDeployment.args, - }) - } } export default func From 69a6f4076cc2b39e346dab0952e2f700427cb177 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 11:05:01 +0200 Subject: [PATCH 091/198] Updating yarn.lock to the latest dev version --- cross-chain/arbitrum/yarn.lock | 38 +++++++++++++++++++++------------- cross-chain/optimism/yarn.lock | 10 ++++----- cross-chain/polygon/yarn.lock | 10 ++++----- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/cross-chain/arbitrum/yarn.lock b/cross-chain/arbitrum/yarn.lock index 38639c333..67e90aa0f 100644 --- a/cross-chain/arbitrum/yarn.lock +++ b/cross-chain/arbitrum/yarn.lock @@ -696,12 +696,12 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.6": - version "2.1.0-dev.6" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.6.tgz#ccc690f784b6e802a5b80b2dfb7127d96e548a25" - integrity sha512-1D74OPVzzxxVcG8za/niuxmwEdDc5R6KNuHsUvsFkcHNJE1UgQNw+QdrI+k3M2so6YrO4L5lP7vTvIvBDbEMNQ== +"@keep-network/ecdsa@2.1.0-dev.10": + version "2.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.10.tgz#aa9075416a960a640298e4095f3fb94de83866fb" + integrity sha512-axUrpyoGvIVKqNVohdzuqlwHGb9QoCdmfdHGy6mONncMkEJsc/BZqUMOSlJtW42QVddMfG672kvgNZF5zsTjNQ== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/random-beacon" "2.1.0-dev.8" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" @@ -738,10 +738,20 @@ "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" -"@keep-network/random-beacon@2.1.0-dev.5": - version "2.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.5.tgz#5ea1a76f57c8171fe3b12ecf4cfcefee38f954ac" - integrity sha512-v3Mqzwx69WqG5bi8qEO4b72PpDMbwl69f5PYHZ0vO3g2pzU1PpVq2nq/vzgdqW2xgztvnHFwOq+lOyN8hx0K3A== +"@keep-network/random-beacon@2.1.0-dev.8": + version "2.1.0-dev.8" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.8.tgz#d21466250448175d2c9a21b876386196a4fe47f6" + integrity sha512-mnQ7eh49A8NiQ+9Y83kF0Rdr9Do/s2CcXaL4L+NdLPzVJW5SvXmOMfaJ9mghvHr9pqmqcSgpVzLyHL0EnrR51Q== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.3" + +"@keep-network/random-beacon@2.1.0-dev.9": + version "2.1.0-dev.9" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.9.tgz#1058f1eff13e12d2831ec13fa61ecca399d92247" + integrity sha512-W4/AgMRWbYU4NO7YB0URbicjH89DMYHlOCT+GbyL/znZ7DLhLXzZCMJW4EvxM1lm8/wA6NsZev/2E25mHeqDIA== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" @@ -764,13 +774,13 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "1.2.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.2.0-dev.1.tgz#4a1879e4979afbc06f0f9d9356c789ecc0ffea0e" - integrity sha512-cS4kta9XnPPtj5PW64Uso8c19VgEIukpPyCyJ8iXMyHKRmbfZsEw8I0aHmvkyZ2szdbcNJ2qcLL203uHAmyYAA== + version "1.4.0-dev.0" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.4.0-dev.0.tgz#3c3b40d36917ad3e35a4f64d4b45f64e6ce46b8a" + integrity sha512-aOoo+WxgV8eR03z0vjstG7lX0q9B5K4VAi7GYT8lVO0uLErXpHawveNZKNnt+DBh4Sp1c3IZuF21EYJKKCLEyw== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.6" - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/ecdsa" "2.1.0-dev.10" + "@keep-network/random-beacon" "2.1.0-dev.9" "@keep-network/tbtc" "1.1.2-dev.1" "@openzeppelin/contracts" "^4.8.1" "@openzeppelin/contracts-upgradeable" "^4.8.1" diff --git a/cross-chain/optimism/yarn.lock b/cross-chain/optimism/yarn.lock index 38639c333..65ea8ed13 100644 --- a/cross-chain/optimism/yarn.lock +++ b/cross-chain/optimism/yarn.lock @@ -764,13 +764,13 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "1.2.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.2.0-dev.1.tgz#4a1879e4979afbc06f0f9d9356c789ecc0ffea0e" - integrity sha512-cS4kta9XnPPtj5PW64Uso8c19VgEIukpPyCyJ8iXMyHKRmbfZsEw8I0aHmvkyZ2szdbcNJ2qcLL203uHAmyYAA== + version "1.4.0-dev.0" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.4.0-dev.0.tgz#3c3b40d36917ad3e35a4f64d4b45f64e6ce46b8a" + integrity sha512-aOoo+WxgV8eR03z0vjstG7lX0q9B5K4VAi7GYT8lVO0uLErXpHawveNZKNnt+DBh4Sp1c3IZuF21EYJKKCLEyw== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.6" - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/ecdsa" "2.1.0-dev.10" + "@keep-network/random-beacon" "2.1.0-dev.9" "@keep-network/tbtc" "1.1.2-dev.1" "@openzeppelin/contracts" "^4.8.1" "@openzeppelin/contracts-upgradeable" "^4.8.1" diff --git a/cross-chain/polygon/yarn.lock b/cross-chain/polygon/yarn.lock index 38639c333..65ea8ed13 100644 --- a/cross-chain/polygon/yarn.lock +++ b/cross-chain/polygon/yarn.lock @@ -764,13 +764,13 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "1.2.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.2.0-dev.1.tgz#4a1879e4979afbc06f0f9d9356c789ecc0ffea0e" - integrity sha512-cS4kta9XnPPtj5PW64Uso8c19VgEIukpPyCyJ8iXMyHKRmbfZsEw8I0aHmvkyZ2szdbcNJ2qcLL203uHAmyYAA== + version "1.4.0-dev.0" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.4.0-dev.0.tgz#3c3b40d36917ad3e35a4f64d4b45f64e6ce46b8a" + integrity sha512-aOoo+WxgV8eR03z0vjstG7lX0q9B5K4VAi7GYT8lVO0uLErXpHawveNZKNnt+DBh4Sp1c3IZuF21EYJKKCLEyw== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.6" - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/ecdsa" "2.1.0-dev.10" + "@keep-network/random-beacon" "2.1.0-dev.9" "@keep-network/tbtc" "1.1.2-dev.1" "@openzeppelin/contracts" "^4.8.1" "@openzeppelin/contracts-upgradeable" "^4.8.1" From 6a01b455dfa7440ec68accad37449c90abbc7968 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 11 May 2023 11:10:56 +0200 Subject: [PATCH 092/198] Updating missing upgrades in yarn.lock --- cross-chain/optimism/yarn.lock | 28 +++++++++++++++++++--------- cross-chain/polygon/yarn.lock | 28 +++++++++++++++++++--------- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/cross-chain/optimism/yarn.lock b/cross-chain/optimism/yarn.lock index 65ea8ed13..67e90aa0f 100644 --- a/cross-chain/optimism/yarn.lock +++ b/cross-chain/optimism/yarn.lock @@ -696,12 +696,12 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.6": - version "2.1.0-dev.6" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.6.tgz#ccc690f784b6e802a5b80b2dfb7127d96e548a25" - integrity sha512-1D74OPVzzxxVcG8za/niuxmwEdDc5R6KNuHsUvsFkcHNJE1UgQNw+QdrI+k3M2so6YrO4L5lP7vTvIvBDbEMNQ== +"@keep-network/ecdsa@2.1.0-dev.10": + version "2.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.10.tgz#aa9075416a960a640298e4095f3fb94de83866fb" + integrity sha512-axUrpyoGvIVKqNVohdzuqlwHGb9QoCdmfdHGy6mONncMkEJsc/BZqUMOSlJtW42QVddMfG672kvgNZF5zsTjNQ== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/random-beacon" "2.1.0-dev.8" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" @@ -738,10 +738,20 @@ "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" -"@keep-network/random-beacon@2.1.0-dev.5": - version "2.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.5.tgz#5ea1a76f57c8171fe3b12ecf4cfcefee38f954ac" - integrity sha512-v3Mqzwx69WqG5bi8qEO4b72PpDMbwl69f5PYHZ0vO3g2pzU1PpVq2nq/vzgdqW2xgztvnHFwOq+lOyN8hx0K3A== +"@keep-network/random-beacon@2.1.0-dev.8": + version "2.1.0-dev.8" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.8.tgz#d21466250448175d2c9a21b876386196a4fe47f6" + integrity sha512-mnQ7eh49A8NiQ+9Y83kF0Rdr9Do/s2CcXaL4L+NdLPzVJW5SvXmOMfaJ9mghvHr9pqmqcSgpVzLyHL0EnrR51Q== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.3" + +"@keep-network/random-beacon@2.1.0-dev.9": + version "2.1.0-dev.9" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.9.tgz#1058f1eff13e12d2831ec13fa61ecca399d92247" + integrity sha512-W4/AgMRWbYU4NO7YB0URbicjH89DMYHlOCT+GbyL/znZ7DLhLXzZCMJW4EvxM1lm8/wA6NsZev/2E25mHeqDIA== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" diff --git a/cross-chain/polygon/yarn.lock b/cross-chain/polygon/yarn.lock index 65ea8ed13..67e90aa0f 100644 --- a/cross-chain/polygon/yarn.lock +++ b/cross-chain/polygon/yarn.lock @@ -696,12 +696,12 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.6": - version "2.1.0-dev.6" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.6.tgz#ccc690f784b6e802a5b80b2dfb7127d96e548a25" - integrity sha512-1D74OPVzzxxVcG8za/niuxmwEdDc5R6KNuHsUvsFkcHNJE1UgQNw+QdrI+k3M2so6YrO4L5lP7vTvIvBDbEMNQ== +"@keep-network/ecdsa@2.1.0-dev.10": + version "2.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.10.tgz#aa9075416a960a640298e4095f3fb94de83866fb" + integrity sha512-axUrpyoGvIVKqNVohdzuqlwHGb9QoCdmfdHGy6mONncMkEJsc/BZqUMOSlJtW42QVddMfG672kvgNZF5zsTjNQ== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/random-beacon" "2.1.0-dev.8" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" @@ -738,10 +738,20 @@ "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" -"@keep-network/random-beacon@2.1.0-dev.5": - version "2.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.5.tgz#5ea1a76f57c8171fe3b12ecf4cfcefee38f954ac" - integrity sha512-v3Mqzwx69WqG5bi8qEO4b72PpDMbwl69f5PYHZ0vO3g2pzU1PpVq2nq/vzgdqW2xgztvnHFwOq+lOyN8hx0K3A== +"@keep-network/random-beacon@2.1.0-dev.8": + version "2.1.0-dev.8" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.8.tgz#d21466250448175d2c9a21b876386196a4fe47f6" + integrity sha512-mnQ7eh49A8NiQ+9Y83kF0Rdr9Do/s2CcXaL4L+NdLPzVJW5SvXmOMfaJ9mghvHr9pqmqcSgpVzLyHL0EnrR51Q== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.3" + +"@keep-network/random-beacon@2.1.0-dev.9": + version "2.1.0-dev.9" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.9.tgz#1058f1eff13e12d2831ec13fa61ecca399d92247" + integrity sha512-W4/AgMRWbYU4NO7YB0URbicjH89DMYHlOCT+GbyL/znZ7DLhLXzZCMJW4EvxM1lm8/wA6NsZev/2E25mHeqDIA== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" From b770b102c646f9fbf902baa7c67abc6cbe120389 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 11 May 2023 11:46:52 +0200 Subject: [PATCH 093/198] Artifacts from tbtc-v2-arbitrum v1.0.1 --- .../arbitrum/.openzeppelin/unknown-42161.json | 164 ++++++++++++++++++ .../arbitrumOne/ArbitrumWormholeGateway.json | 68 ++------ 2 files changed, 179 insertions(+), 53 deletions(-) diff --git a/cross-chain/arbitrum/.openzeppelin/unknown-42161.json b/cross-chain/arbitrum/.openzeppelin/unknown-42161.json index 0d97322c8..01f43f51a 100644 --- a/cross-chain/arbitrum/.openzeppelin/unknown-42161.json +++ b/cross-chain/arbitrum/.openzeppelin/unknown-42161.json @@ -453,6 +453,170 @@ } } } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0xa10aD2570ea7b93d19fDae6Bd7189fF4929Bc747", + "txHash": "0xa91eb836546ccc63781e40a841010602fd856e55350fb92e189582384deec26d", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/cross-chain/arbitrum/deployments/arbitrumOne/ArbitrumWormholeGateway.json b/cross-chain/arbitrum/deployments/arbitrumOne/ArbitrumWormholeGateway.json index 95ba62997..fdcfde559 100644 --- a/cross-chain/arbitrum/deployments/arbitrumOne/ArbitrumWormholeGateway.json +++ b/cross-chain/arbitrum/deployments/arbitrumOne/ArbitrumWormholeGateway.json @@ -421,75 +421,37 @@ "type": "function" } ], - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", + "transactionHash": "0x74305eb933793943e03a0826ef673117abc30184fe0cf1d0c1530f02bbec87d8", "receipt": { - "to": null, + "to": "0x02612d20CC087670a959Bb12cA3c5fd56C8A3DB3", "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", - "contractAddress": "0x1293a54e160D1cd7075487898d65266081A15458", + "contractAddress": null, "transactionIndex": 1, - "gasUsed": "5777231", - "logsBloom": "0x00000000000000000000400000000000400000000002000000800000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000002000001000000000000000080000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000001800000000000000000000000000000000400000000000000000000000000000004000000000020000000000000000000440000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000010", - "blockHash": "0x4d0c1a57ac001fe399bdf92e84ab47a30155017dc4d9b10a8e074a13307ce5a1", - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", + "gasUsed": "1528828", + "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000002001000000000000000000000000000002000000000000000000000000000000000004000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010", + "blockHash": "0x1f87894ba083964e5c171e726c7137d71c08d8d7db9c73778d14a966fce2ae6d", + "transactionHash": "0x74305eb933793943e03a0826ef673117abc30184fe0cf1d0c1530f02bbec87d8", "logs": [ { "transactionIndex": 1, - "blockNumber": 75577070, - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", + "blockNumber": 89548295, + "transactionHash": "0x74305eb933793943e03a0826ef673117abc30184fe0cf1d0c1530f02bbec87d8", "address": "0x1293a54e160D1cd7075487898d65266081A15458", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000041c9b5639e3f2f6c61e9b78b2c6ff3746e79d91a" + "0x000000000000000000000000a10ad2570ea7b93d19fdae6bd7189ff4929bc747" ], "data": "0x", "logIndex": 0, - "blockHash": "0x4d0c1a57ac001fe399bdf92e84ab47a30155017dc4d9b10a8e074a13307ce5a1" - }, - { - "transactionIndex": 1, - "blockNumber": 75577070, - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x4d0c1a57ac001fe399bdf92e84ab47a30155017dc4d9b10a8e074a13307ce5a1" - }, - { - "transactionIndex": 1, - "blockNumber": 75577070, - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 2, - "blockHash": "0x4d0c1a57ac001fe399bdf92e84ab47a30155017dc4d9b10a8e074a13307ce5a1" - }, - { - "transactionIndex": 1, - "blockNumber": 75577070, - "transactionHash": "0x559dd0fd66a929cc5e892380c15018b8bbc217de242ce13bb97f94eadc5df0e7", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002612d20cc087670a959bb12ca3c5fd56c8a3db3", - "logIndex": 3, - "blockHash": "0x4d0c1a57ac001fe399bdf92e84ab47a30155017dc4d9b10a8e074a13307ce5a1" + "blockHash": "0x1f87894ba083964e5c171e726c7137d71c08d8d7db9c73778d14a966fce2ae6d" } ], - "blockNumber": 75577070, - "cumulativeGasUsed": "5777231", + "blockNumber": 89548295, + "cumulativeGasUsed": "1528828", "status": 1, "byzantium": true }, - "numDeployments": 1, - "implementation": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "numDeployments": 2, + "implementation": "0xa10aD2570ea7b93d19fDae6Bd7189fF4929Bc747", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file From 406beb1cee8e8051161802e6e66316c115bc17f0 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 11 May 2023 11:55:32 +0200 Subject: [PATCH 094/198] Artifacts from tbtc-v2-optimism v1.0.1 --- .../optimism/.openzeppelin/optimism.json | 164 ++++++++++++++++++ .../optimism/OptimismWormholeGateway.json | 68 ++------ 2 files changed, 179 insertions(+), 53 deletions(-) diff --git a/cross-chain/optimism/.openzeppelin/optimism.json b/cross-chain/optimism/.openzeppelin/optimism.json index c52e16b7b..94ff55b5d 100644 --- a/cross-chain/optimism/.openzeppelin/optimism.json +++ b/cross-chain/optimism/.openzeppelin/optimism.json @@ -453,6 +453,170 @@ } } } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0xF94D0d0471Ae14B6310d94fA4F95e5fc9f3ffC17", + "txHash": "0x3931783c3945e29d69c4710d0933c6c33c85375151f0c3506aa8bb3fed5c730e", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json b/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json index 075c93cda..509239987 100644 --- a/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json +++ b/cross-chain/optimism/deployments/optimism/OptimismWormholeGateway.json @@ -421,75 +421,37 @@ "type": "function" } ], - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "transactionHash": "0x956a752b238e3375738a3a6d04d73d3e7f2875b0550c84d5f196999678818f5b", "receipt": { - "to": null, + "to": "0x02612d20CC087670a959Bb12cA3c5fd56C8A3DB3", "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", - "contractAddress": "0x1293a54e160D1cd7075487898d65266081A15458", + "contractAddress": null, "transactionIndex": 0, - "gasUsed": "749603", - "logsBloom": "0x00000000000000000000400000000000400000000002000000800000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000002000001000000000000000080000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000001800000000000000000000000000000000400000000000000000000000000000004000000000020000000000000000000440000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000010", - "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b", - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "gasUsed": "38760", + "logsBloom": "0x00000000000000000000000000000000400000000000000000200000000000000000000000000000000000000000000000000000000000000000800000000000000000080000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000004000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010", + "blockHash": "0x4a00896a25a17b1ea37f3cd6f8f2ae99226d3482fdbb15b6627bd86b88718ef6", + "transactionHash": "0x956a752b238e3375738a3a6d04d73d3e7f2875b0550c84d5f196999678818f5b", "logs": [ { "transactionIndex": 0, - "blockNumber": 89900107, - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", + "blockNumber": 97406169, + "transactionHash": "0x956a752b238e3375738a3a6d04d73d3e7f2875b0550c84d5f196999678818f5b", "address": "0x1293a54e160D1cd7075487898d65266081A15458", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000041c9b5639e3f2f6c61e9b78b2c6ff3746e79d91a" + "0x000000000000000000000000f94d0d0471ae14b6310d94fa4f95e5fc9f3ffc17" ], "data": "0x", "logIndex": 0, - "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" - }, - { - "transactionIndex": 0, - "blockNumber": 89900107, - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" - }, - { - "transactionIndex": 0, - "blockNumber": 89900107, - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 2, - "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" - }, - { - "transactionIndex": 0, - "blockNumber": 89900107, - "transactionHash": "0x34fa74cf35cd850fa2f2b17c2c0ed44232eab1c0c8230134d599594d44e78b5e", - "address": "0x1293a54e160D1cd7075487898d65266081A15458", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002612d20cc087670a959bb12ca3c5fd56c8a3db3", - "logIndex": 3, - "blockHash": "0x115c040577e16636489be4a4e98d89955cda55dbbfb1be5ae111622e80db018b" + "blockHash": "0x4a00896a25a17b1ea37f3cd6f8f2ae99226d3482fdbb15b6627bd86b88718ef6" } ], - "blockNumber": 89900107, - "cumulativeGasUsed": "749603", + "blockNumber": 97406169, + "cumulativeGasUsed": "38760", "status": 1, "byzantium": true }, - "numDeployments": 1, - "implementation": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", + "numDeployments": 2, + "implementation": "0xF94D0d0471Ae14B6310d94fA4F95e5fc9f3ffC17", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file From 0e331c64f949072e404540db5d12786917c2d588 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 11 May 2023 12:00:21 +0200 Subject: [PATCH 095/198] Artifacts from tbtc-v2-polygon v1.0.1 --- .../polygon/.openzeppelin/polygon.json | 164 ++++++++++++++++++ .../polygon/PolygonWormholeGateway.json | 88 +++------- 2 files changed, 189 insertions(+), 63 deletions(-) diff --git a/cross-chain/polygon/.openzeppelin/polygon.json b/cross-chain/polygon/.openzeppelin/polygon.json index e6911feff..73a98be6d 100644 --- a/cross-chain/polygon/.openzeppelin/polygon.json +++ b/cross-chain/polygon/.openzeppelin/polygon.json @@ -453,6 +453,170 @@ } } } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0xdF708431162Ba247dDaE362D2c919e0fbAfcf9DE", + "txHash": "0xdd42fcac9ca8509a00a7c7344ef72934f473093e55508e63c1f6de54541a0c85", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json b/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json index b5a673953..59ad2c417 100644 --- a/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json +++ b/cross-chain/polygon/deployments/polygon/PolygonWormholeGateway.json @@ -421,90 +421,52 @@ "type": "function" } ], - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "transactionHash": "0x424acddd74ccc5dc38267ef39c7bb17824d5ebcd6090ca52deb6d47b5ca0883b", "receipt": { - "to": null, + "to": "0x1293a54e160D1cd7075487898d65266081A15458", "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", - "contractAddress": "0x09959798B95d00a3183d20FaC298E4594E599eab", - "transactionIndex": 34, - "gasUsed": "749615", - "logsBloom": "0x00000000000000000000000000000000400000000800000000800000000000000000000000000000000000000000000000008400000000000000000000000400000000000000000000000000000006800001000800000000000100000000000000000000030000000001000000000800000000800000000080000000000000400000000000000000000000000000000000000000000080000000000000800000200000000008000004000000000400000000000000000000000000000000004000000020000000000001000000440000000000000400000000100000000020000000000000000000002000000000000000000000000000000000000000100000", - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3", - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "contractAddress": null, + "transactionIndex": 85, + "gasUsed": "38748", + "logsBloom": "0x00000000000000000000000000000000400000000800000000000000000000000000000000000000000000000000000000108000000000000000000000000400000000000000000000000000000002800000000000000000000100000000000000000000010000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000040000100000000000000010000000000000000000000000010000004000000020000000000001000000400000000000000000000000100000000000000000000000000000002000800000000000000000000000000000000000100000", + "blockHash": "0xb6b78a6e5cc2e9432cf5b28e5df6e5a07d3191dc131c9e16f8d083aaef64b4b9", + "transactionHash": "0x424acddd74ccc5dc38267ef39c7bb17824d5ebcd6090ca52deb6d47b5ca0883b", "logs": [ { - "transactionIndex": 34, - "blockNumber": 41515765, - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "transactionIndex": 85, + "blockNumber": 42569184, + "transactionHash": "0x424acddd74ccc5dc38267ef39c7bb17824d5ebcd6090ca52deb6d47b5ca0883b", "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000292c9fdf2e2475599cbe350cc473c221bd67ae28" + "0x000000000000000000000000df708431162ba247ddae362d2c919e0fbafcf9de" ], "data": "0x", - "logIndex": 144, - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + "logIndex": 355, + "blockHash": "0xb6b78a6e5cc2e9432cf5b28e5df6e5a07d3191dc131c9e16f8d083aaef64b4b9" }, { - "transactionIndex": 34, - "blockNumber": 41515765, - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", - "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" - ], - "data": "0x", - "logIndex": 145, - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" - }, - { - "transactionIndex": 34, - "blockNumber": 41515765, - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", - "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 146, - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" - }, - { - "transactionIndex": 34, - "blockNumber": 41515765, - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", - "address": "0x09959798B95d00a3183d20FaC298E4594E599eab", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001293a54e160d1cd7075487898d65266081a15458", - "logIndex": 147, - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" - }, - { - "transactionIndex": 34, - "blockNumber": 41515765, - "transactionHash": "0x6fbbce7c044a776c67a031fa5de974173ae7dd747c95ab90891d09b50d69c240", + "transactionIndex": 85, + "blockNumber": 42569184, + "transactionHash": "0x424acddd74ccc5dc38267ef39c7bb17824d5ebcd6090ca52deb6d47b5ca0883b", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf", - "0x000000000000000000000000eb4f2a75cac4bbcb4d71c252e4cc80eb80bb3a34" + "0x00000000000000000000000026c80cc193b27d73d2c40943acec77f4da2c5bd8" ], - "data": "0x0000000000000000000000000000000000000000000000000082da2deb4f2812000000000000000000000000000000000000000000000003a1842f4eb9b1aa5e00000000000000000000000000000000000000000000052254a12ab84b8f7f3c000000000000000000000000000000000000000000000003a1015520ce62824c000000000000000000000000000000000000000000000522552404e636dea74e", - "logIndex": 148, - "blockHash": "0xefcc0a3be4da4e68b72e2b833226bdc14c6cf4e39fa5bc548334efb5af76c5e3" + "data": "0x0000000000000000000000000000000000000000000000000004213ba745d00000000000000000000000000000000000000000000000000308c1dce9af73a03d00000000000000000000000000000000000000000000124539cf39a6735e3b9500000000000000000000000000000000000000000000000308bdbbae082dd03d00000000000000000000000000000000000000000000124539d35ae21aa40b95", + "logIndex": 356, + "blockHash": "0xb6b78a6e5cc2e9432cf5b28e5df6e5a07d3191dc131c9e16f8d083aaef64b4b9" } ], - "blockNumber": 41515765, - "cumulativeGasUsed": "5384226", + "blockNumber": 42569184, + "cumulativeGasUsed": "14852198", "status": 1, "byzantium": true }, - "numDeployments": 1, - "implementation": "0x292C9fdf2e2475599cBe350cc473c221Bd67AE28", + "numDeployments": 2, + "implementation": "0xdF708431162Ba247dDaE362D2c919e0fbAfcf9DE", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file From e370ed2a76dc34e81970d31ca45b2a04a4cde593 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 11 May 2023 12:28:02 +0200 Subject: [PATCH 096/198] Refactor the Goerli light relay contract The version of `GoerliLightRelay` used so far served `1` as current and previous difficulty all the time. In effect, the `Bridge` accepted incoming SPV proofs as long as the Bitcoin headers being part of the proof were at difficulty `1`. All headers being at other difficulties were rejected. In result, we observed problems with SPV proofs once Bitcoin testnet changed its difficulty from `1` to something else. To mitigate the problem with other difficulties, this changeset modifies the `GoerliLightRelay` by adding an explicit difficulty setter. From now, the difficulty served by the relay can be set using an arbitrary Bitcoin headers chain. The new setter can be used just before an SPV proof is submitted to the `Bridge` to cause the desired `Bridge` behavior. --- solidity/contracts/test/GoerliLightRelay.sol | 39 ++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/solidity/contracts/test/GoerliLightRelay.sol b/solidity/contracts/test/GoerliLightRelay.sol index c6aaf62bd..4a5d7e1db 100644 --- a/solidity/contracts/test/GoerliLightRelay.sol +++ b/solidity/contracts/test/GoerliLightRelay.sol @@ -15,33 +15,34 @@ pragma solidity 0.8.17; +import {BTCUtils} from "@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol"; + import "../relay/LightRelay.sol"; /// @title Goerli Light Relay /// @notice GoerliLightRelay is a stub version of LightRelay intended to be -/// used on the Goerli test network. It always returns `1` as the current -/// and previous difficulties making it possible to bypass validation of -/// difficulties of Bitcoin testnet blocks. Since difficulty in Bitcoin -/// testnet often falls to `1` it would not be possible to validate -/// blocks with the real LightRelay. -/// @dev Since the returned difficulties are fixed and impossible to be modified -/// with any setters, it is safe to use GoerliLightRelay without risking -/// somebody may change the difficulties and block the test network. -/// Notice that GoerliLightRelay is derived from LightRelay so that the two +/// used on the Goerli test network. It allows to set the relay's +/// difficulty based on arbitrary Bitcoin headers thus effectively +/// bypass the validation of difficulties of Bitcoin testnet blocks. +/// Since difficulty in Bitcoin testnet often falls to `1` it would not +/// be possible to validate blocks with the real LightRelay. +/// @dev Notice that GoerliLightRelay is derived from LightRelay so that the two /// contracts have the same API and correct bindings can be generated. contract GoerliLightRelay is LightRelay { - /// @notice Returns `1` as the difficulty of the previous epoch. - function getPrevEpochDifficulty() external view override returns (uint256) { - return 1; - } + using BTCUtils for bytes; + using BTCUtils for uint256; - /// @notice Returns `1` as the difficulty of the current epoch. - function getCurrentEpochDifficulty() + /// @notice Sets the current and previous difficulty based on the difficulty + /// inferred from the provided Bitcoin headers. + function setDifficultyFromHeaders(bytes memory bitcoinHeaders) external - view - override - returns (uint256) + onlyOwner { - return 1; + uint256 firstHeaderDiff = bitcoinHeaders + .extractTarget() + .calculateDifficulty(); + + currentEpochDifficulty = firstHeaderDiff; + prevEpochDifficulty = firstHeaderDiff; } } From 4d3fd3c4118cfb7247a9702c09ecf16136659888 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Tue, 16 May 2023 16:25:51 +0200 Subject: [PATCH 097/198] Adjust WalletCoordinator gas offsets Two gas offsets have been adjusted as a result of User Acceptance Tests execution on Goerli. `heartbeatRequestGasOffset` has been updated from `5_000` to `10_000`. Looking at the heartbeat request TX (https://goerli.etherscan.io/tx/0x0b76d88351a7e8d85fea53be4e17931d2a753ffddd90e73bcc734230c9ac84c8) the difference between ETH burned and reimbursed is 0.00000349514053395 eth which is 3495 Gwei. Assuming the gas price was ~1 Gwei, we should increase the offset by ~3500 Gwei so 8_500. We add an additional 1_500 as a safety margin. For `depositSweepProposalSubmissionGasOffset`, the situation is more complex because the cost of the transaction depends on the number of inputs. We decided to optimize for 10 inputs. This transaction was expected with the offset set to `20_000` and 10 inputs: https://goerli.etherscan.io/tx/0x3c9df2ff00b533fc4b94f905a9c5bba5c70e9594e97ec215a6cf87aa0686902a --- solidity/contracts/bridge/WalletCoordinator.sol | 4 ++-- solidity/test/bridge/WalletCoordinator.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 333372979..3f56171b7 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -252,13 +252,13 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { (, , , reimbursementPool) = _bridge.contractReferences(); heartbeatRequestValidity = 1 hours; - heartbeatRequestGasOffset = 5_000; + heartbeatRequestGasOffset = 10_000; depositSweepProposalValidity = 4 hours; depositMinAge = 2 hours; depositRefundSafetyMargin = 24 hours; depositSweepMaxSize = 5; - depositSweepProposalSubmissionGasOffset = 5_000; + depositSweepProposalSubmissionGasOffset = 20_000; // optimized for 10 inputs } /// @notice Adds the given address to the set of coordinator addresses. diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index fb9e1dee6..4b6f6a7bf 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -677,7 +677,7 @@ describe("WalletCoordinator", () => { it("should do the refund", async () => { const diff = coordinatorBalanceAfter.sub(coordinatorBalanceBefore) expect(diff).to.be.gt(0) - expect(diff).to.be.lt(ethers.utils.parseUnits("1000000", "gwei")) // 0,001 ETH + expect(diff).to.be.lt(ethers.utils.parseUnits("2000000", "gwei")) // 0,002 ETH }) }) }) @@ -982,7 +982,7 @@ describe("WalletCoordinator", () => { it("should do the refund", async () => { const diff = coordinatorBalanceAfter.sub(coordinatorBalanceBefore) expect(diff).to.be.gt(0) - expect(diff).to.be.lt(ethers.utils.parseUnits("1000000", "gwei")) // 0,001 ETH + expect(diff).to.be.lt(ethers.utils.parseUnits("4000000", "gwei")) // 0,004 ETH }) }) }) From 80c024bca839d1b922132fe949ff56ccdf212e92 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 17 May 2023 12:25:54 +0200 Subject: [PATCH 098/198] Add coordinator address to the WalletCoordinator contract The coordinator is EOA that will propose sweeps through the WalletCoordinator contract. The first coordinator address is controlled by the dev team but the DAO can add and remove coordinator addresses as they wish. --- solidity/deploy/35_add_coordinator_address.ts | 20 +++++++++++++++++++ ..._transfer_wallet_coordinator_ownership.ts} | 0 ...37_deploy_light_relay_maintainer_proxy.ts} | 0 ...tainer_in_light_relay_maintainer_proxy.ts} | 0 ...light_relay_maintainer_proxy_ownership.ts} | 0 ...maintainer_proxy_in_reimbursement_pool.ts} | 0 ..._relay_maintainer_proxy_in_light_relay.ts} | 0 solidity/hardhat.config.ts | 7 ++++++- 8 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 solidity/deploy/35_add_coordinator_address.ts rename solidity/deploy/{35_transfer_wallet_coordinator_ownership.ts => 36_transfer_wallet_coordinator_ownership.ts} (100%) rename solidity/deploy/{36_deploy_light_relay_maintainer_proxy.ts => 37_deploy_light_relay_maintainer_proxy.ts} (100%) rename solidity/deploy/{37_authorize_maintainer_in_light_relay_maintainer_proxy.ts => 38_authorize_maintainer_in_light_relay_maintainer_proxy.ts} (100%) rename solidity/deploy/{38_transfer_light_relay_maintainer_proxy_ownership.ts => 39_transfer_light_relay_maintainer_proxy_ownership.ts} (100%) rename solidity/deploy/{39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts => 40_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts} (100%) rename solidity/deploy/{40_authorize_light_relay_maintainer_proxy_in_light_relay.ts => 41_authorize_light_relay_maintainer_proxy_in_light_relay.ts} (100%) diff --git a/solidity/deploy/35_add_coordinator_address.ts b/solidity/deploy/35_add_coordinator_address.ts new file mode 100644 index 000000000..0f52b056e --- /dev/null +++ b/solidity/deploy/35_add_coordinator_address.ts @@ -0,0 +1,20 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction } from "hardhat-deploy/types" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { getNamedAccounts, deployments } = hre + const { execute } = deployments + const { deployer, coordinator } = await getNamedAccounts() + + await execute( + "WalletCoordinator", + { from: deployer, log: true, waitConfirmations: 1 }, + "addCoordinator", + coordinator + ) +} + +export default func + +func.tags = ["AddCoordinatorAddress"] +func.dependencies = ["WalletCoordinator"] diff --git a/solidity/deploy/35_transfer_wallet_coordinator_ownership.ts b/solidity/deploy/36_transfer_wallet_coordinator_ownership.ts similarity index 100% rename from solidity/deploy/35_transfer_wallet_coordinator_ownership.ts rename to solidity/deploy/36_transfer_wallet_coordinator_ownership.ts diff --git a/solidity/deploy/36_deploy_light_relay_maintainer_proxy.ts b/solidity/deploy/37_deploy_light_relay_maintainer_proxy.ts similarity index 100% rename from solidity/deploy/36_deploy_light_relay_maintainer_proxy.ts rename to solidity/deploy/37_deploy_light_relay_maintainer_proxy.ts diff --git a/solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts b/solidity/deploy/38_authorize_maintainer_in_light_relay_maintainer_proxy.ts similarity index 100% rename from solidity/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.ts rename to solidity/deploy/38_authorize_maintainer_in_light_relay_maintainer_proxy.ts diff --git a/solidity/deploy/38_transfer_light_relay_maintainer_proxy_ownership.ts b/solidity/deploy/39_transfer_light_relay_maintainer_proxy_ownership.ts similarity index 100% rename from solidity/deploy/38_transfer_light_relay_maintainer_proxy_ownership.ts rename to solidity/deploy/39_transfer_light_relay_maintainer_proxy_ownership.ts diff --git a/solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts b/solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts similarity index 100% rename from solidity/deploy/39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts rename to solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts diff --git a/solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_light_relay.ts b/solidity/deploy/41_authorize_light_relay_maintainer_proxy_in_light_relay.ts similarity index 100% rename from solidity/deploy/40_authorize_light_relay_maintainer_proxy_in_light_relay.ts rename to solidity/deploy/41_authorize_light_relay_maintainer_proxy_in_light_relay.ts diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 2018052c2..0878c8e05 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -218,8 +218,13 @@ const config: HardhatUserConfig = { goerli: 0, // We are not setting SPV maintainer for mainnet in deployment scripts. }, - v1Redeemer: { + coordinator: { default: 9, + goerli: "0x4815cd81fFc21039a25aCFbD97CE75cCE8579042", + mainnet: "0x0595acCca29654c43Bd67E18578b30a405265234" + }, + v1Redeemer: { + default: 10, goerli: 0, mainnet: "0x8Bac178fA95Cb56D11A94d4f1b2B1F5Fc48A30eA", }, From 019ec5e9deca8e65f8fe27523a52d0a9ddead41f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 12:32:55 +0200 Subject: [PATCH 099/198] Adding Goerli deployment artifacts L2 contracts are deployed behind the OZ transperent proxy and it might happen that these contracts will require an update. We need to preserve OZ manifest file on Goerli. Contract artifacts are also needed for various testing purposes as well as for gateways mapping. --- cross-chain/arbitrum/.gitignore | 2 + .../.openzeppelin/unknown-421613.json | 458 ++++++++++ .../deployments/arbitrumGoerli/.chainId | 1 + .../arbitrumGoerli/ArbitrumTBTC.json | 863 ++++++++++++++++++ .../ArbitrumWormholeGateway.json | 495 ++++++++++ 5 files changed, 1819 insertions(+) create mode 100644 cross-chain/arbitrum/.openzeppelin/unknown-421613.json create mode 100644 cross-chain/arbitrum/deployments/arbitrumGoerli/.chainId create mode 100644 cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumTBTC.json create mode 100644 cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumWormholeGateway.json diff --git a/cross-chain/arbitrum/.gitignore b/cross-chain/arbitrum/.gitignore index b07695466..bc2e1841e 100644 --- a/cross-chain/arbitrum/.gitignore +++ b/cross-chain/arbitrum/.gitignore @@ -9,7 +9,9 @@ /deployments/* !/deployments/mainnet/ !/deployments/arbitrumOne/ +!/deployments/arbitrumGoerli/ # OZ /.openzeppelin/unknown-*.json !/.openzeppelin/unknown-42161.json +!/.openzeppelin/unknown-421613.json diff --git a/cross-chain/arbitrum/.openzeppelin/unknown-421613.json b/cross-chain/arbitrum/.openzeppelin/unknown-421613.json new file mode 100644 index 000000000..249610d04 --- /dev/null +++ b/cross-chain/arbitrum/.openzeppelin/unknown-421613.json @@ -0,0 +1,458 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x93acCF14d143132DA0F592552baad5AF0d14CDF2", + "txHash": "0xfc8fc644749794f2e05cdd4321e9ea03ad282383ab6486d1e3015319536c468d" + }, + "proxies": [ + { + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "txHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "kind": "transparent" + }, + { + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "txHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "kind": "transparent" + } + ], + "impls": { + "1eca3b29684e1fcc811e32be6ee7e72cd846a93f69838508595506ae72555f18": { + "address": "0x5fA3D34F6c1537A0393098F0e124064B66cE8E24", + "txHash": "0x675b6f658e4be2e8dd0546b92fc8260302b68de3222e5f00dc52659936b2a74e", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:400" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:32" + }, + { + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:33" + }, + { + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:120" + }, + { + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)3297_storage)", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:28" + }, + { + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:40", + "renamedFrom": "_PERMIT_TYPEHASH" + }, + { + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:108" + }, + { + "label": "_owner", + "offset": 0, + "slot": "254", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "304", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "isMinter", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:76" + }, + { + "label": "minters", + "offset": 0, + "slot": "355", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:77" + }, + { + "label": "isGuardian", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:85" + }, + { + "label": "guardians", + "offset": 0, + "slot": "357", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:89" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Counter)3297_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)3297_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "txHash": "0x16e5ff7e87f80d3f1ec4ac65ce36c13b5aa60e2f8dd8551e24c27532350c071b", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/cross-chain/arbitrum/deployments/arbitrumGoerli/.chainId b/cross-chain/arbitrum/deployments/arbitrumGoerli/.chainId new file mode 100644 index 000000000..16be23a37 --- /dev/null +++ b/cross-chain/arbitrum/deployments/arbitrumGoerli/.chainId @@ -0,0 +1 @@ +421613 \ No newline at end of file diff --git a/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumTBTC.json b/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumTBTC.json new file mode 100644 index 000000000..d1a8d5362 --- /dev/null +++ b/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumTBTC.json @@ -0,0 +1,863 @@ +{ + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "abi": [ + { + "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": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "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": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "transactionIndex": 2, + "gasUsed": "42396728", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000206000001000000800000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000200000000000000000000000000020000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000020000002000000000020040000000000000400000000000000000020040000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0333d5ea17ae5a01d65208ee67658638160f81eb0691df6119c942212cda0137", + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 20175727, + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000005fa3d34f6c1537a0393098f0e124064b66ce8e24" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x0333d5ea17ae5a01d65208ee67658638160f81eb0691df6119c942212cda0137" + }, + { + "transactionIndex": 2, + "blockNumber": 20175727, + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x0333d5ea17ae5a01d65208ee67658638160f81eb0691df6119c942212cda0137" + }, + { + "transactionIndex": 2, + "blockNumber": 20175727, + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 3, + "blockHash": "0x0333d5ea17ae5a01d65208ee67658638160f81eb0691df6119c942212cda0137" + }, + { + "transactionIndex": 2, + "blockNumber": 20175727, + "transactionHash": "0xfcdb8772ef8d6f2a749b01b98d8cd17425686944273d50196a09caa1a784de32", + "address": "0x85727F4725A4B2834e00Db1AA8e1b843a188162F", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000093accf14d143132da0f592552baad5af0d14cdf2", + "logIndex": 4, + "blockHash": "0x0333d5ea17ae5a01d65208ee67658638160f81eb0691df6119c942212cda0137" + } + ], + "blockNumber": 20175727, + "cumulativeGasUsed": "45671396", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x5fA3D34F6c1537A0393098F0e124064B66cE8E24", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumWormholeGateway.json b/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumWormholeGateway.json new file mode 100644 index 000000000..6a3edfdf3 --- /dev/null +++ b/cross-chain/arbitrum/deployments/arbitrumGoerli/ArbitrumWormholeGateway.json @@ -0,0 +1,495 @@ +{ + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositWormholeTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "transactionIndex": 1, + "gasUsed": "42929206", + "logsBloom": "0x00000400000000000000000000000000400000000000000000800000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000202000001000000000000000000000000000000000000020000000000000000000800100000800000000000000000000000410000000200000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000002000000000000000000020000000000000000020040000000000000400000000010000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x66eeee66744481e636707a084022a3c40807f189159c0c1f171bc89b244616d4", + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 20175760, + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000004be8f183572ec802ad26756f3e9398098700e76" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x66eeee66744481e636707a084022a3c40807f189159c0c1f171bc89b244616d4" + }, + { + "transactionIndex": 1, + "blockNumber": 20175760, + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x66eeee66744481e636707a084022a3c40807f189159c0c1f171bc89b244616d4" + }, + { + "transactionIndex": 1, + "blockNumber": 20175760, + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x66eeee66744481e636707a084022a3c40807f189159c0c1f171bc89b244616d4" + }, + { + "transactionIndex": 1, + "blockNumber": 20175760, + "transactionHash": "0xb4f37bb47aa50dfe41f0cd501e992f41e891759d6e938e0f3336f665b0e66b5b", + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000093accf14d143132da0f592552baad5af0d14cdf2", + "logIndex": 3, + "blockHash": "0x66eeee66744481e636707a084022a3c40807f189159c0c1f171bc89b244616d4" + } + ], + "blockNumber": 20175760, + "cumulativeGasUsed": "42929206", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file From 6ccfdece351b9580a8b5213163414f7cb65a4b0f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 13:29:30 +0200 Subject: [PATCH 100/198] Adding testnet deployment artifacts It might happen that we need to upgrade the L2 contracts and for this we need OZ manifest file desribing Goerli deployment as well as contract artifacts. --- cross-chain/optimism/.gitignore | 1 + .../.openzeppelin/optimism-goerli.json | 458 ++++++++++ .../deployments/optimismGoerli/.chainId | 1 + .../optimismGoerli/OptimismTBTC.json | 863 ++++++++++++++++++ .../OptimismWormholeGateway.json | 495 ++++++++++ .../ArbitrumWormholeGateway.json | 2 +- 6 files changed, 1819 insertions(+), 1 deletion(-) create mode 100644 cross-chain/optimism/.openzeppelin/optimism-goerli.json create mode 100644 cross-chain/optimism/deployments/optimismGoerli/.chainId create mode 100644 cross-chain/optimism/deployments/optimismGoerli/OptimismTBTC.json create mode 100644 cross-chain/optimism/deployments/optimismGoerli/OptimismWormholeGateway.json diff --git a/cross-chain/optimism/.gitignore b/cross-chain/optimism/.gitignore index 9f67dca5f..64240eb35 100644 --- a/cross-chain/optimism/.gitignore +++ b/cross-chain/optimism/.gitignore @@ -9,6 +9,7 @@ /deployments/* !/deployments/mainnet/ !/deployments/optimism/ +!/deployments/optimismGoerli/ # OZ /.openzeppelin/unknown-*.json diff --git a/cross-chain/optimism/.openzeppelin/optimism-goerli.json b/cross-chain/optimism/.openzeppelin/optimism-goerli.json new file mode 100644 index 000000000..9564ecd39 --- /dev/null +++ b/cross-chain/optimism/.openzeppelin/optimism-goerli.json @@ -0,0 +1,458 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "txHash": "0x0d7e2a225846fc0d467b6487c0eb724266fbee2b959fbbe1325269f43a454339" + }, + "proxies": [ + { + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "txHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "kind": "transparent" + }, + { + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "txHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "kind": "transparent" + } + ], + "impls": { + "1eca3b29684e1fcc811e32be6ee7e72cd846a93f69838508595506ae72555f18": { + "address": "0x5D8e618f44A59dd528cce58d00801F4C8e5cfa8D", + "txHash": "0x12984eeac49aaf61b2c7195c37966d3124654fbc1974d2beec80e951ee8c7085", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:400" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:32" + }, + { + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:33" + }, + { + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:120" + }, + { + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)3297_storage)", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:28" + }, + { + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:40", + "renamedFrom": "_PERMIT_TYPEHASH" + }, + { + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:108" + }, + { + "label": "_owner", + "offset": 0, + "slot": "254", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "304", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "isMinter", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:76" + }, + { + "label": "minters", + "offset": 0, + "slot": "355", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:77" + }, + { + "label": "isGuardian", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:85" + }, + { + "label": "guardians", + "offset": 0, + "slot": "357", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:89" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Counter)3297_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)3297_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0x73A63e2Be2D911dc7eFAc189Bfdf48FbB6532B5b", + "txHash": "0x4d3bdde5365c63cceb585fc671be3d7ef92ef1b67a83dbb61440999515084659", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/cross-chain/optimism/deployments/optimismGoerli/.chainId b/cross-chain/optimism/deployments/optimismGoerli/.chainId new file mode 100644 index 000000000..1e59c84a3 --- /dev/null +++ b/cross-chain/optimism/deployments/optimismGoerli/.chainId @@ -0,0 +1 @@ +420 \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimismGoerli/OptimismTBTC.json b/cross-chain/optimism/deployments/optimismGoerli/OptimismTBTC.json new file mode 100644 index 000000000..c712f5e0d --- /dev/null +++ b/cross-chain/optimism/deployments/optimismGoerli/OptimismTBTC.json @@ -0,0 +1,863 @@ +{ + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "abi": [ + { + "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": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "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": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "transactionIndex": 1, + "gasUsed": "732126", + "logsBloom": "0x00000000000000000000000000004000400000000000000000800000100000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000202000401000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000200000000000000000000000000000000000080000002000000800000000000000000000000000000000400000000000000000100000000000000000000000020000000000000000020040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x7dc35b7acca6c3095be3ef2ad981dfad945dbb973b9943e3b0b2c4d272fa56dc", + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 9447251, + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000005d8e618f44a59dd528cce58d00801f4c8e5cfa8d" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x7dc35b7acca6c3095be3ef2ad981dfad945dbb973b9943e3b0b2c4d272fa56dc" + }, + { + "transactionIndex": 1, + "blockNumber": 9447251, + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x7dc35b7acca6c3095be3ef2ad981dfad945dbb973b9943e3b0b2c4d272fa56dc" + }, + { + "transactionIndex": 1, + "blockNumber": 9447251, + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x7dc35b7acca6c3095be3ef2ad981dfad945dbb973b9943e3b0b2c4d272fa56dc" + }, + { + "transactionIndex": 1, + "blockNumber": 9447251, + "transactionHash": "0xdd6d13c09c3045099e9d6066cd1ebc1353714aee8d39a54599ab15a402854008", + "address": "0x1a53759DE2eADf73bd0b05c07a4F1F5B7912dA3d", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000091fe7128f74dbd4f031ea3d90fc5ea4dcfd81818", + "logIndex": 3, + "blockHash": "0x7dc35b7acca6c3095be3ef2ad981dfad945dbb973b9943e3b0b2c4d272fa56dc" + } + ], + "blockNumber": 9447251, + "cumulativeGasUsed": "796139", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x5D8e618f44A59dd528cce58d00801F4C8e5cfa8D", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/optimism/deployments/optimismGoerli/OptimismWormholeGateway.json b/cross-chain/optimism/deployments/optimismGoerli/OptimismWormholeGateway.json new file mode 100644 index 000000000..bd22bf443 --- /dev/null +++ b/cross-chain/optimism/deployments/optimismGoerli/OptimismWormholeGateway.json @@ -0,0 +1,495 @@ +{ + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositWormholeTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "transactionIndex": 2, + "gasUsed": "749615", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000202000001000000000000000010000000000000000000020000000000000000000880000000800000000000000000000000400000000200000000000000000000000000000008000080000000000000800000000000000000000004000000000400000000000000000000000000000000000000000020000000002000000020040000000000400400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x5d2e28bf9617f4bbc8dd4a45c278917a3fd4ae1301cda44d2d0322a5a9ecc202", + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 9447269, + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000073a63e2be2d911dc7efac189bfdf48fbb6532b5b" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x5d2e28bf9617f4bbc8dd4a45c278917a3fd4ae1301cda44d2d0322a5a9ecc202" + }, + { + "transactionIndex": 2, + "blockNumber": 9447269, + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x5d2e28bf9617f4bbc8dd4a45c278917a3fd4ae1301cda44d2d0322a5a9ecc202" + }, + { + "transactionIndex": 2, + "blockNumber": 9447269, + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 5, + "blockHash": "0x5d2e28bf9617f4bbc8dd4a45c278917a3fd4ae1301cda44d2d0322a5a9ecc202" + }, + { + "transactionIndex": 2, + "blockNumber": 9447269, + "transactionHash": "0x805d4430b11c0de578b14b17a0c92305d5f9bd158819e15c8969a12477861d41", + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000091fe7128f74dbd4f031ea3d90fc5ea4dcfd81818", + "logIndex": 6, + "blockHash": "0x5d2e28bf9617f4bbc8dd4a45c278917a3fd4ae1301cda44d2d0322a5a9ecc202" + } + ], + "blockNumber": 9447269, + "cumulativeGasUsed": "942794", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x73A63e2Be2D911dc7eFAc189Bfdf48FbB6532B5b", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/optimism/external/optimismGoerli/ArbitrumWormholeGateway.json b/cross-chain/optimism/external/optimismGoerli/ArbitrumWormholeGateway.json index 74c39592d..ea8693dc5 100644 --- a/cross-chain/optimism/external/optimismGoerli/ArbitrumWormholeGateway.json +++ b/cross-chain/optimism/external/optimismGoerli/ArbitrumWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xe3e0511EEbD87F08FbaE4486419cb5dFB06e1343" + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2" } From 0947d27953d1f359d05e6791b420b7009add3e66 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 17 May 2023 14:43:17 +0200 Subject: [PATCH 101/198] Updated deployment script dependencies We should execute AddCoordinatorAddress before TransferWalletCoordinatorOwnership. --- solidity/deploy/36_transfer_wallet_coordinator_ownership.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/deploy/36_transfer_wallet_coordinator_ownership.ts b/solidity/deploy/36_transfer_wallet_coordinator_ownership.ts index 77439c765..7c8673bfc 100644 --- a/solidity/deploy/36_transfer_wallet_coordinator_ownership.ts +++ b/solidity/deploy/36_transfer_wallet_coordinator_ownership.ts @@ -15,5 +15,5 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { export default func func.tags = ["TransferWalletCoordinatorOwnership"] -func.dependencies = ["WalletCoordinator"] +func.dependencies = ["AddCoordinatorAddress"] func.runAtTheEnd = true From 974cc44c65e587180edac0ec6c819867048cade1 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Wed, 17 May 2023 15:00:44 +0200 Subject: [PATCH 102/198] Make linter happy --- solidity/hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 0878c8e05..9577cd06f 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -221,7 +221,7 @@ const config: HardhatUserConfig = { coordinator: { default: 9, goerli: "0x4815cd81fFc21039a25aCFbD97CE75cCE8579042", - mainnet: "0x0595acCca29654c43Bd67E18578b30a405265234" + mainnet: "0x0595acCca29654c43Bd67E18578b30a405265234", }, v1Redeemer: { default: 10, From 94ebc17649619dae2d39c554e48cc2f0d094ff0e Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 15:33:59 +0200 Subject: [PATCH 103/198] Updating arbitrum module with opti and poly gateways --- .../external/arbitrumGoerli/OptimismWormholeGateway.json | 2 +- .../external/arbitrumGoerli/PolygonWormholeGateway.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json index 334fdb833..283665601 100644 --- a/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumGoerli/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621" } diff --git a/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json index 334fdb833..c9c6cfe9a 100644 --- a/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json +++ b/cross-chain/arbitrum/external/arbitrumGoerli/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818" } From 4a3406197fc2439d6776b3e5c1b2615c40b76bb1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 15:34:38 +0200 Subject: [PATCH 104/198] Updating optimism module with poly gateway --- .../external/optimismGoerli/PolygonWormholeGateway.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json index 334fdb833..c9c6cfe9a 100644 --- a/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json +++ b/cross-chain/optimism/external/optimismGoerli/PolygonWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818" } From e3f72ac92f0a85b8591d07d2927ac60920acbdef Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 15:36:00 +0200 Subject: [PATCH 105/198] Updating polygon module with arbi and opti gateway --- .../polygon/external/mumbai/ArbitrumWormholeGateway.json | 2 +- .../polygon/external/mumbai/OptimismWormholeGateway.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json b/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json index 74c39592d..ea8693dc5 100644 --- a/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json +++ b/cross-chain/polygon/external/mumbai/ArbitrumWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xe3e0511EEbD87F08FbaE4486419cb5dFB06e1343" + "address": "0x31A15e213B59E230b45e8c5c99dAFAc3d1236Ee2" } diff --git a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json index 334fdb833..283665601 100644 --- a/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json +++ b/cross-chain/polygon/external/mumbai/OptimismWormholeGateway.json @@ -1,3 +1,3 @@ { - "address": "0xc3D46e0266d95215589DE639cC4E93b79f88fc6C" + "address": "0x6449F4381f3d63bDfb36B3bDc375724aD3cD4621" } From 95c921e3b0ad3b02081eef275f9897c5f0564916 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 15:36:47 +0200 Subject: [PATCH 106/198] Adding OZ manifesto file for Polygon module --- .../polygon/.openzeppelin/polygon-mumbai.json | 458 ++++++++++++++++++ 1 file changed, 458 insertions(+) create mode 100644 cross-chain/polygon/.openzeppelin/polygon-mumbai.json diff --git a/cross-chain/polygon/.openzeppelin/polygon-mumbai.json b/cross-chain/polygon/.openzeppelin/polygon-mumbai.json new file mode 100644 index 000000000..aa19cf3f4 --- /dev/null +++ b/cross-chain/polygon/.openzeppelin/polygon-mumbai.json @@ -0,0 +1,458 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x5FB63D9e076a314023F2D1aB5dBFd7045C281EbA", + "txHash": "0x2c13a93c270ba5f4d2090bf5d0a982a30fe2559cfeb2921d54a8e9a60595d191" + }, + "proxies": [ + { + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "txHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "kind": "transparent" + }, + { + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "txHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "kind": "transparent" + } + ], + "impls": { + "1eca3b29684e1fcc811e32be6ee7e72cd846a93f69838508595506ae72555f18": { + "address": "0x8420404dC5e9a9f920280B2e0e08988cc7008459", + "txHash": "0x470955a965f850dfc0d2bcd1e32116b71a9ced3fd59d56ddde77e1f4aeee303d", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_balances", + "offset": 0, + "slot": "51", + "type": "t_mapping(t_address,t_uint256)", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:37" + }, + { + "label": "_allowances", + "offset": 0, + "slot": "52", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:39" + }, + { + "label": "_totalSupply", + "offset": 0, + "slot": "53", + "type": "t_uint256", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:41" + }, + { + "label": "_name", + "offset": 0, + "slot": "54", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:43" + }, + { + "label": "_symbol", + "offset": 0, + "slot": "55", + "type": "t_string_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44" + }, + { + "label": "__gap", + "offset": 0, + "slot": "56", + "type": "t_array(t_uint256)45_storage", + "contract": "ERC20Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:400" + }, + { + "label": "__gap", + "offset": 0, + "slot": "101", + "type": "t_array(t_uint256)50_storage", + "contract": "ERC20BurnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51" + }, + { + "label": "_HASHED_NAME", + "offset": 0, + "slot": "151", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:32" + }, + { + "label": "_HASHED_VERSION", + "offset": 0, + "slot": "152", + "type": "t_bytes32", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:33" + }, + { + "label": "__gap", + "offset": 0, + "slot": "153", + "type": "t_array(t_uint256)50_storage", + "contract": "EIP712Upgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol:120" + }, + { + "label": "_nonces", + "offset": 0, + "slot": "203", + "type": "t_mapping(t_address,t_struct(Counter)3297_storage)", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:28" + }, + { + "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", + "offset": 0, + "slot": "204", + "type": "t_bytes32", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:40", + "renamedFrom": "_PERMIT_TYPEHASH" + }, + { + "label": "__gap", + "offset": 0, + "slot": "205", + "type": "t_array(t_uint256)49_storage", + "contract": "ERC20PermitUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol:108" + }, + { + "label": "_owner", + "offset": 0, + "slot": "254", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "255", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "304", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "305", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "isMinter", + "offset": 0, + "slot": "354", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:76" + }, + { + "label": "minters", + "offset": 0, + "slot": "355", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:77" + }, + { + "label": "isGuardian", + "offset": 0, + "slot": "356", + "type": "t_mapping(t_address,t_bool)", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:85" + }, + { + "label": "guardians", + "offset": 0, + "slot": "357", + "type": "t_array(t_address)dyn_storage", + "contract": "L2TBTC", + "src": "@keep-network/tbtc-v2/contracts/l2/L2TBTC.sol:89" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_address)dyn_storage": { + "label": "address[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)45_storage": { + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(Counter)3297_storage)": { + "label": "mapping(address => struct CountersUpgradeable.Counter)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Counter)3297_storage": { + "label": "struct CountersUpgradeable.Counter", + "members": [ + { + "label": "_value", + "type": "t_uint256", + "offset": 0, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "70974f3ab30d1010f875de7eebcbde08a1b6c71845f5272c23be8f95af866a64": { + "address": "0x5D8e618f44A59dd528cce58d00801F4C8e5cfa8D", + "txHash": "0x5ef2c43ac416e25e25bac712702c81787056a9cfcd0f9589be825911c284f503", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_status", + "offset": 0, + "slot": "101", + "type": "t_uint256", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "ReentrancyGuardUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:80" + }, + { + "label": "bridge", + "offset": 0, + "slot": "151", + "type": "t_contract(IWormholeTokenBridge)518", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:122" + }, + { + "label": "bridgeToken", + "offset": 0, + "slot": "152", + "type": "t_contract(IERC20Upgradeable)2252", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:123" + }, + { + "label": "tbtc", + "offset": 0, + "slot": "153", + "type": "t_contract(L2TBTC)443", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:124" + }, + { + "label": "gateways", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_uint16,t_bytes32)", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:136" + }, + { + "label": "mintingLimit", + "offset": 0, + "slot": "155", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:147" + }, + { + "label": "mintedAmount", + "offset": 0, + "slot": "156", + "type": "t_uint256", + "contract": "L2WormholeGateway", + "src": "@keep-network/tbtc-v2/contracts/l2/L2WormholeGateway.sol:151" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IERC20Upgradeable)2252": { + "label": "contract IERC20Upgradeable", + "numberOfBytes": "20" + }, + "t_contract(IWormholeTokenBridge)518": { + "label": "contract IWormholeTokenBridge", + "numberOfBytes": "20" + }, + "t_contract(L2TBTC)443": { + "label": "contract L2TBTC", + "numberOfBytes": "20" + }, + "t_mapping(t_uint16,t_bytes32)": { + "label": "mapping(uint16 => bytes32)", + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} From e3cef59b6699f4b8c12c4ca1a59df1315811e542 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 17 May 2023 15:45:52 +0200 Subject: [PATCH 107/198] Adding mumbai deployment artifacts --- cross-chain/polygon/.gitignore | 1 + .../polygon/deployments/mumbai/.chainId | 1 + .../deployments/mumbai/PolygonTBTC.json | 878 ++++++++++++++++++ .../mumbai/PolygonWormholeGateway.json | 510 ++++++++++ 4 files changed, 1390 insertions(+) create mode 100644 cross-chain/polygon/deployments/mumbai/.chainId create mode 100644 cross-chain/polygon/deployments/mumbai/PolygonTBTC.json create mode 100644 cross-chain/polygon/deployments/mumbai/PolygonWormholeGateway.json diff --git a/cross-chain/polygon/.gitignore b/cross-chain/polygon/.gitignore index 702b559a6..ae6c3fbe7 100644 --- a/cross-chain/polygon/.gitignore +++ b/cross-chain/polygon/.gitignore @@ -9,6 +9,7 @@ /deployments/* !/deployments/mainnet/ !/deployments/polygon/ +!/deployments/mumbai/ # OZ /.openzeppelin/unknown-*.json diff --git a/cross-chain/polygon/deployments/mumbai/.chainId b/cross-chain/polygon/deployments/mumbai/.chainId new file mode 100644 index 000000000..d7e2f72ce --- /dev/null +++ b/cross-chain/polygon/deployments/mumbai/.chainId @@ -0,0 +1 @@ +80001 \ No newline at end of file diff --git a/cross-chain/polygon/deployments/mumbai/PolygonTBTC.json b/cross-chain/polygon/deployments/mumbai/PolygonTBTC.json new file mode 100644 index 000000000..6658f0c93 --- /dev/null +++ b/cross-chain/polygon/deployments/mumbai/PolygonTBTC.json @@ -0,0 +1,878 @@ +{ + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "abi": [ + { + "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": "guardian", + "type": "address" + } + ], + "name": "GuardianAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "GuardianRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "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" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "addGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "addMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "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": [], + "name": "getGuardians", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "guardians", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "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": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isGuardian", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "minters", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "recoverERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC721Upgradeable", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "recoverERC721", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guardian", + "type": "address" + } + ], + "name": "removeGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "removeMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "transactionIndex": 3, + "gasUsed": "732114", + "logsBloom": "0x00000000008000000000000000000000400000000000000001800000000000000000000000000000000000000000000000008000000000400000000000018000000000000040000000000000000202800001000000000000000100000000000000000000020000000000800000000800000000800000000080000000000000400000000200000000000000000000000000000000000080000000000000800000200000000000000000080000000400000000000000000000000000000000004000000020000000000001000020040100000000000400000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5", + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 35702944, + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000008420404dc5e9a9f920280b2e0e08988cc7008459" + ], + "data": "0x", + "logIndex": 24, + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5" + }, + { + "transactionIndex": 3, + "blockNumber": 35702944, + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 25, + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5" + }, + { + "transactionIndex": 3, + "blockNumber": 35702944, + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 26, + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5" + }, + { + "transactionIndex": 3, + "blockNumber": 35702944, + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "address": "0xBcD7917282E529BAA6f232DdDc75F3901245A492", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000005fb63d9e076a314023f2d1ab5dbfd7045c281eba", + "logIndex": 27, + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5" + }, + { + "transactionIndex": 3, + "blockNumber": 35702944, + "transactionHash": "0xc61a4f40fe01779e489b085dd5dff22195ad0953f33bf38e624cb21cb0614012", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc", + "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" + ], + "data": "0x00000000000000000000000000000000000000000000000000061e412e1f324e00000000000000000000000000000000000000000000000001d2ad5745509c2400000000000000000000000000000000000000000000090d42157262a78aa24900000000000000000000000000000000000000000000000001cc8f16173169d600000000000000000000000000000000000000000000090d421b90a3d5a9d497", + "logIndex": 28, + "blockHash": "0x5a00a9867c8359700a982a0481250dd4c8170cebc63e9e6655fe00db17c510c5" + } + ], + "blockNumber": 35702944, + "cumulativeGasUsed": "1675677", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x8420404dC5e9a9f920280B2e0e08988cc7008459", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/cross-chain/polygon/deployments/mumbai/PolygonWormholeGateway.json b/cross-chain/polygon/deployments/mumbai/PolygonWormholeGateway.json new file mode 100644 index 000000000..1d5047767 --- /dev/null +++ b/cross-chain/polygon/deployments/mumbai/PolygonWormholeGateway.json @@ -0,0 +1,510 @@ +{ + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "GatewayAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "mintingLimit", + "type": "uint256" + } + ], + "name": "MintingLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WormholeTbtcReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "WormholeTbtcSent", + "type": "event" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bridgeToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositWormholeTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "_address", + "type": "bytes32" + } + ], + "name": "fromWormholeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "name": "gateways", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "_bridge", + "type": "address" + }, + { + "internalType": "contract IERC20Upgradeable", + "name": "_bridgeToken", + "type": "address" + }, + { + "internalType": "contract L2TBTC", + "name": "_tbtc", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "mintedAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintingLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "encodedVm", + "type": "bytes" + } + ], + "name": "receiveTbtc", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint16", + "name": "recipientChain", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "arbiterFee", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "nonce", + "type": "uint32" + } + ], + "name": "sendTbtc", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtc", + "outputs": [ + { + "internalType": "contract L2TBTC", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + } + ], + "name": "toWormholeAddress", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint16", + "name": "chainId", + "type": "uint16" + }, + { + "internalType": "bytes32", + "name": "gateway", + "type": "bytes32" + } + ], + "name": "updateGatewayAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintingLimit", + "type": "uint256" + } + ], + "name": "updateMintingLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "receipt": { + "to": null, + "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", + "contractAddress": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "transactionIndex": 0, + "gasUsed": "749603", + "logsBloom": "0x08000000000000000000000000004000400001000000000000800010000000000000008000000020000000000000000000008000000000000000000000000000000000000000000000000000000202800001000000000000000100000000000000000000020000000000000000000800000000800000000080000000000000400000000200000000000000000000000000000000000080000000000000800000200000000000000000000000000400000000400000000100000000000000004000000020000000000001000020040000000000000400000000100000001020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663", + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 35702972, + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000005d8e618f44a59dd528cce58d00801f4c8e5cfa8d" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663" + }, + { + "transactionIndex": 0, + "blockNumber": 35702972, + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663" + }, + { + "transactionIndex": 0, + "blockNumber": 35702972, + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 2, + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663" + }, + { + "transactionIndex": 0, + "blockNumber": 35702972, + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "address": "0x91Fe7128f74dBd4F031ea3D90FC5Ea4DCfD81818", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000005fb63d9e076a314023f2d1ab5dbfd7045c281eba", + "logIndex": 3, + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663" + }, + { + "transactionIndex": 0, + "blockNumber": 35702972, + "transactionHash": "0x93354ead88174ecc97297c812b4b534be6d175ffe682cc1b1ee7c1a70fb1432b", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc", + "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" + ], + "data": "0x000000000000000000000000000000000000000000000000001aa1997d602c0000000000000000000000000000000000000000000000000001c35769a76dd006000000000000000000000000000000000000000000000e46eca540398772cce300000000000000000000000000000000000000000000000001a8b5d02a0da406000000000000000000000000000000000000000000000e46ecbfe1d304d2f8e3", + "logIndex": 4, + "blockHash": "0x34c1d04f7b53b2f74f51c4effb0678b583890a50ea767843c16be51cf2361663" + } + ], + "blockNumber": 35702972, + "cumulativeGasUsed": "749603", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x5D8e618f44A59dd528cce58d00801F4C8e5cfa8D", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file From 1559ed054b575c6e26775943149018847bab7180 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Thu, 18 May 2023 12:09:54 +0200 Subject: [PATCH 108/198] Mainnet WalletCoordinator deployment artifacts --- solidity/.openzeppelin/mainnet.json | 235 +++++ .../mainnet/WalletCoordinator.json | 840 ++++++++++++++++++ solidity/export.json | 769 ++++++++++++++++ 3 files changed, 1844 insertions(+) create mode 100644 solidity/deployments/mainnet/WalletCoordinator.json diff --git a/solidity/.openzeppelin/mainnet.json b/solidity/.openzeppelin/mainnet.json index 94256dc66..b21fce9c9 100644 --- a/solidity/.openzeppelin/mainnet.json +++ b/solidity/.openzeppelin/mainnet.json @@ -9,6 +9,11 @@ "address": "0x5e4861a80B55f035D899f66772117F00FA0E8e7B", "txHash": "0x932eda38cc1fdf7d68bfa6ff11c8bbd443ef32ccdad4ebc55afc7f25fa4398ef", "kind": "transparent" + }, + { + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "txHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "kind": "transparent" } ], "impls": { @@ -1411,6 +1416,236 @@ } } } + }, + "b8a091d7318541da80a4a032ca1660f9ef5aa923c5203d70ae367fdbae462567": { + "address": "0x9eAE6e8e99d27D377F1EA0659b0CB16ce8aD32bA", + "txHash": "0x4882729501029ce404d379009e8e339c1aaf62b035b6c9df5be88efd0420ee4b", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "reimbursementPool", + "offset": 0, + "slot": "101", + "type": "t_contract(ReimbursementPool)5481", + "contract": "Reimbursable", + "src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "Reimbursable", + "src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51" + }, + { + "label": "isCoordinator", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_address,t_bool)", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:136" + }, + { + "label": "walletLock", + "offset": 0, + "slot": "152", + "type": "t_mapping(t_bytes20,t_struct(WalletLock)22127_storage)", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:138" + }, + { + "label": "bridge", + "offset": 0, + "slot": "153", + "type": "t_contract(Bridge)16800", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:140" + }, + { + "label": "heartbeatRequestValidity", + "offset": 20, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:151" + }, + { + "label": "heartbeatRequestGasOffset", + "offset": 24, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:155" + }, + { + "label": "depositSweepProposalValidity", + "offset": 28, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:167" + }, + { + "label": "depositMinAge", + "offset": 0, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:177" + }, + { + "label": "depositRefundSafetyMargin", + "offset": 4, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:198" + }, + { + "label": "depositSweepMaxSize", + "offset": 8, + "slot": "154", + "type": "t_uint16", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:202" + }, + { + "label": "depositSweepProposalSubmissionGasOffset", + "offset": 10, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:211" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes20": { + "label": "bytes20", + "numberOfBytes": "20" + }, + "t_contract(Bridge)16800": { + "label": "contract Bridge", + "numberOfBytes": "20" + }, + "t_contract(ReimbursementPool)5481": { + "label": "contract ReimbursementPool", + "numberOfBytes": "20" + }, + "t_enum(WalletAction)22119": { + "label": "enum WalletCoordinator.WalletAction", + "members": [ + "Idle", + "Heartbeat", + "DepositSweep", + "Redemption", + "MovingFunds", + "MovedFundsSweep" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes20,t_struct(WalletLock)22127_storage)": { + "label": "mapping(bytes20 => struct WalletCoordinator.WalletLock)", + "numberOfBytes": "32" + }, + "t_struct(WalletLock)22127_storage": { + "label": "struct WalletCoordinator.WalletLock", + "members": [ + { + "label": "expiresAt", + "type": "t_uint32", + "offset": 0, + "slot": "0" + }, + { + "label": "cause", + "type": "t_enum(WalletAction)22119", + "offset": 4, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/solidity/deployments/mainnet/WalletCoordinator.json b/solidity/deployments/mainnet/WalletCoordinator.json new file mode 100644 index 000000000..feefc6882 --- /dev/null +++ b/solidity/deployments/mainnet/WalletCoordinator.json @@ -0,0 +1,840 @@ +{ + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "CoordinatorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "CoordinatorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "depositSweepProposalValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositMinAge", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositRefundSafetyMargin", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "depositSweepMaxSize", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositSweepProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "DepositSweepProposalParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "indexed": false, + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "DepositSweepProposalSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "heartbeatRequestValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "heartbeatRequestGasOffset", + "type": "uint32" + } + ], + "name": "HeartbeatRequestParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "HeartbeatRequestSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReimbursementPool", + "type": "address" + } + ], + "name": "ReimbursementPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + } + ], + "name": "WalletManuallyUnlocked", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "addCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract Bridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositMinAge", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositRefundSafetyMargin", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepMaxSize", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepProposalSubmissionGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepProposalValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "heartbeatRequestGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "heartbeatRequestValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Bridge", + "name": "_bridge", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isCoordinator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reimbursementPool", + "outputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "removeCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "requestHeartbeat", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "requestHeartbeatWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitDepositSweepProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitDepositSweepProposalWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + } + ], + "name": "unlockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_depositSweepProposalValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_depositMinAge", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_depositRefundSafetyMargin", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_depositSweepMaxSize", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "_depositSweepProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "updateDepositSweepProposalParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_heartbeatRequestValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_heartbeatRequestGasOffset", + "type": "uint32" + } + ], + "name": "updateHeartbeatRequestParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "name": "updateReimbursementPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "bytes4", + "name": "version", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "inputVector", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "outputVector", + "type": "bytes" + }, + { + "internalType": "bytes4", + "name": "locktime", + "type": "bytes4" + } + ], + "internalType": "struct BitcoinTx.Info", + "name": "fundingTx", + "type": "tuple" + }, + { + "internalType": "bytes8", + "name": "blindingFactor", + "type": "bytes8" + }, + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes20", + "name": "refundPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes4", + "name": "refundLocktime", + "type": "bytes4" + } + ], + "internalType": "struct WalletCoordinator.DepositExtraInfo[]", + "name": "depositsExtraInfo", + "type": "tuple[]" + } + ], + "name": "validateDepositSweepProposal", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "", + "type": "bytes20" + } + ], + "name": "walletLock", + "outputs": [ + { + "internalType": "uint32", + "name": "expiresAt", + "type": "uint32" + }, + { + "internalType": "enum WalletCoordinator.WalletAction", + "name": "cause", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "receipt": { + "to": null, + "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", + "contractAddress": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "transactionIndex": 35, + "gasUsed": "723585", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000020040000000002000001000000000000000000000000000000000000020000002000000000000800000000800000000000000000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000020000000000400000000000000000004000000400000000000000020000000000000000000440000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x13d48fd27c9bc628d729cd2b79b4791b2ae0039fdbc4a7cfa823b9a04e628b19", + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "logs": [ + { + "transactionIndex": 35, + "blockNumber": 17285662, + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000009eae6e8e99d27d377f1ea0659b0cb16ce8ad32ba" + ], + "data": "0x", + "logIndex": 188, + "blockHash": "0x13d48fd27c9bc628d729cd2b79b4791b2ae0039fdbc4a7cfa823b9a04e628b19" + }, + { + "transactionIndex": 35, + "blockNumber": 17285662, + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" + ], + "data": "0x", + "logIndex": 189, + "blockHash": "0x13d48fd27c9bc628d729cd2b79b4791b2ae0039fdbc4a7cfa823b9a04e628b19" + }, + { + "transactionIndex": 35, + "blockNumber": 17285662, + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 190, + "blockHash": "0x13d48fd27c9bc628d729cd2b79b4791b2ae0039fdbc4a7cfa823b9a04e628b19" + }, + { + "transactionIndex": 35, + "blockNumber": 17285662, + "transactionHash": "0x0a8cd2034987664518ad1583c484fb43031f73edcd8e5e3d38dafc08de6f6bb1", + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016a76d3cd3c1e3ce843c6680d6b37e9116b5c706", + "logIndex": 191, + "blockHash": "0x13d48fd27c9bc628d729cd2b79b4791b2ae0039fdbc4a7cfa823b9a04e628b19" + } + ], + "blockNumber": 17285662, + "cumulativeGasUsed": "7053979", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0x9eAE6e8e99d27D377F1EA0659b0CB16ce8aD32bA", + "devdoc": "Contract deployed as upgradable proxy" +} \ No newline at end of file diff --git a/solidity/export.json b/solidity/export.json index 0e5a1efa6..cef4b247b 100644 --- a/solidity/export.json +++ b/solidity/export.json @@ -11190,6 +11190,775 @@ } ] }, + "WalletCoordinator": { + "address": "0x64EA4b84e2BdfD313428b96658260E495a420093", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "CoordinatorAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "CoordinatorRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "depositSweepProposalValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositMinAge", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositRefundSafetyMargin", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "depositSweepMaxSize", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "depositSweepProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "DepositSweepProposalParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "indexed": false, + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "DepositSweepProposalSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "heartbeatRequestValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "heartbeatRequestGasOffset", + "type": "uint32" + } + ], + "name": "HeartbeatRequestParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "HeartbeatRequestSubmitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReimbursementPool", + "type": "address" + } + ], + "name": "ReimbursementPoolUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + } + ], + "name": "WalletManuallyUnlocked", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "addCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract Bridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositMinAge", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositRefundSafetyMargin", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepMaxSize", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepProposalSubmissionGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositSweepProposalValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "heartbeatRequestGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "heartbeatRequestValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Bridge", + "name": "_bridge", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isCoordinator", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reimbursementPool", + "outputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "removeCoordinator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "requestHeartbeat", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "requestHeartbeatWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitDepositSweepProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitDepositSweepProposalWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + } + ], + "name": "unlockWallet", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_depositSweepProposalValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_depositMinAge", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_depositRefundSafetyMargin", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_depositSweepMaxSize", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "_depositSweepProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "updateDepositSweepProposalParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_heartbeatRequestValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_heartbeatRequestGasOffset", + "type": "uint32" + } + ], + "name": "updateHeartbeatRequestParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "name": "updateReimbursementPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "fundingTxHash", + "type": "bytes32" + }, + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + } + ], + "internalType": "struct WalletCoordinator.DepositKey[]", + "name": "depositsKeys", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "sweepTxFee", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "depositsRevealBlocks", + "type": "uint256[]" + } + ], + "internalType": "struct WalletCoordinator.DepositSweepProposal", + "name": "proposal", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "bytes4", + "name": "version", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "inputVector", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "outputVector", + "type": "bytes" + }, + { + "internalType": "bytes4", + "name": "locktime", + "type": "bytes4" + } + ], + "internalType": "struct BitcoinTx.Info", + "name": "fundingTx", + "type": "tuple" + }, + { + "internalType": "bytes8", + "name": "blindingFactor", + "type": "bytes8" + }, + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes20", + "name": "refundPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes4", + "name": "refundLocktime", + "type": "bytes4" + } + ], + "internalType": "struct WalletCoordinator.DepositExtraInfo[]", + "name": "depositsExtraInfo", + "type": "tuple[]" + } + ], + "name": "validateDepositSweepProposal", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes20", + "name": "", + "type": "bytes20" + } + ], + "name": "walletLock", + "outputs": [ + { + "internalType": "uint32", + "name": "expiresAt", + "type": "uint32" + }, + { + "internalType": "enum WalletCoordinator.WalletAction", + "name": "cause", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, "Wallets": { "address": "0xC67913137429985416DbCe28D9fa9ec960BA47BF", "abi": [ From 3a5959bb32a7c11be67143fbea8997beb56c7aea Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Thu, 18 May 2023 12:16:58 +0200 Subject: [PATCH 109/198] Bumping up solidity version to v1.5.0-dev --- solidity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/package.json b/solidity/package.json index 3b23d4904..536a76fd6 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2", - "version": "1.4.0-dev", + "version": "1.5.0-dev", "license": "GPL-3.0-only", "files": [ "artifacts/", From 81932a021dc90dbe086093805e14a85d69f942a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 23 May 2023 09:34:39 +0200 Subject: [PATCH 110/198] Temporarily trigger the workflow on feature branch Temporary change, only to test the workflows. Needs to be reverted. --- .github/workflows/contracts-docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index ceff6bcad..2007796a9 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -62,7 +62,8 @@ jobs: contracts-docs-publish: name: Publish contracts documentation needs: docs-detect-changes - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/') + # TODO: remove last OR + if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/584/merge' uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: projectDir: /solidity From ce72d9f5b6ea59881edd445e3f0e6ff01a4668ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 23 May 2023 09:55:22 +0200 Subject: [PATCH 111/198] Fix values of GPG secrets --- .github/workflows/contracts-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 2007796a9..6640de86a 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -83,5 +83,5 @@ jobs: userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} - gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PASSPHRASE }} - gpgPassphrase: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }} + gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }} + gpgPassphrase: ${{ secrets.THRESHOLD_DOCS_GPG_PASSPHRASE }} From 9f6ff6565d7cafb55d0a801db3ad44cd30334d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 23 May 2023 13:59:56 +0200 Subject: [PATCH 112/198] Temporarily use action from `fix-docs-generation` branch The branch contains a step that cleans cache before running Docgen. We want to verify if this will help for the random problems with docs generation. --- .github/workflows/contracts-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 6640de86a..37adea8b6 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -39,7 +39,7 @@ jobs: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@fix-docs-generation # TODO: change to `main` with: projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` @@ -64,7 +64,7 @@ jobs: needs: docs-detect-changes # TODO: remove last OR if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/584/merge' - uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@fix-docs-generation # TODO: change to `main` with: projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` From 2c7c63e15e3b7af800710770a458f93ff67eb1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 6 Jun 2023 16:10:53 +0200 Subject: [PATCH 113/198] Don't run postinstall script separately from yarn install Background: Previously we've been running postinstall script in a separate step from the `yarn install` command. We've been doing that as a workaround for a problem we had with the postinstall script in the `@threshold-network/solidity-contracts` package (the script in that package often randomly failed). Running `yarn upgrade` with `--ignore-scripts` flag prevented the execution of postinstall script in the main project and its depandencies. And running `yarn run postinstall` after did execute the postinstall script in the main project. The change: Recently we have refactored the `@threshold-network/solidity-contracts` project and got rid of the problematic script. We can go back to executing `yarn install` without the `--ignore-scripts` flag. --- monitoring/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitoring/Dockerfile b/monitoring/Dockerfile index 2212d741e..b65cbb238 100644 --- a/monitoring/Dockerfile +++ b/monitoring/Dockerfile @@ -24,8 +24,7 @@ COPY package.json yarn.lock ./ COPY tsconfig.json ./ COPY src ./src -RUN yarn install --frozen-lockfile --ignore-scripts -RUN yarn run postinstall +RUN yarn install --frozen-lockfile RUN yarn build From 751e81fa21af596462e84c8d0d3bab6d0f951ae6 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 7 Jun 2023 14:42:20 +0200 Subject: [PATCH 114/198] Add the new fn that finds a wallet for redemption Add `findWalletForRedemption` function that returns the wallet details needed to request a redemption based on the redemption amount. This function looks for an oldest acive wallet(wallet must be in `Live` state) that has enough BTC to handle a redemption request. --- typescript/src/chain.ts | 16 +++++++ typescript/src/ethereum.ts | 68 ++++++++++++++++++++++++--- typescript/src/index.ts | 2 + typescript/src/redemption.ts | 69 ++++++++++++++++++++++++++++ typescript/test/utils/mock-bridge.ts | 19 +++++++- 5 files changed, 166 insertions(+), 8 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index dae8606d2..cb7f2a873 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -23,6 +23,7 @@ import { DkgResultChallengedEvent, DkgResultSubmittedEvent, NewWalletRegisteredEvent, + Wallet, } from "./wallet" import type { ExecutionLoggerFn } from "./backoff" @@ -244,6 +245,21 @@ export interface Bridge { * Returns the attached WalletRegistry instance. */ walletRegistry(): Promise + + /** + * Gets details about a registered wallet. + * @param walletPublicKeyHash The 20-byte wallet public key hash (computed + * using Bitcoin HASH160 over the compressed ECDSA public key). + * @returns Promise with the wallet details. + */ + wallets(walletPublicKeyHash: string): Promise + + /** + * Builds the UTXO hash based on the UTXO components. + * @param utxo UTXO components. + * @returns The hash of the UTXO. + */ + buildUTXOHash(utxo: UnspentTransactionOutput): Hex } /** diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 69cf0c86e..d64c98a4c 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -47,6 +47,7 @@ import type { Bridge as ContractBridge, Deposit as ContractDeposit, Redemption as ContractRedemption, + Wallets, } from "../typechain/Bridge" import type { WalletRegistry as ContractWalletRegistry } from "../typechain/WalletRegistry" import type { TBTCVault as ContractTBTCVault } from "../typechain/TBTCVault" @@ -57,6 +58,8 @@ import { DkgResultChallengedEvent, DkgResultSubmittedEvent, NewWalletRegisteredEvent, + Wallet, + WalletState, } from "./wallet" type ContractDepositRequest = ContractDeposit.DepositRequestStructOutput @@ -639,18 +642,18 @@ export class Bridge return undefined } - const { ecdsaWalletID } = await backoffRetrier<{ ecdsaWalletID: string }>( - this._totalRetryAttempts - )(async () => { - return await this._instance.wallets(activeWalletPublicKeyHash) - }) + const { ecdsaWalletID } = await this.wallets(activeWalletPublicKeyHash) + return (await this.toCompressedWalletPublicKey(ecdsaWalletID)).toString() + } + + private async toCompressedWalletPublicKey(ecdsaWalletID: Hex): Promise { const walletRegistry = await this.walletRegistry() const uncompressedPublicKey = await walletRegistry.getWalletPublicKey( - Hex.from(ecdsaWalletID) + ecdsaWalletID ) - return compressPublicKey(uncompressedPublicKey) + return Hex.from(compressPublicKey(uncompressedPublicKey)) } // eslint-disable-next-line valid-jsdoc @@ -694,6 +697,57 @@ export class Bridge signerOrProvider: this._instance.signer || this._instance.provider, }) } + + async wallets(walletPublicKeyHash: string): Promise { + const wallet = await backoffRetrier( + this._totalRetryAttempts + )(async () => { + return await this._instance.wallets(walletPublicKeyHash) + }) + + return this.parseWalletDetails(wallet) + } + + private async parseWalletDetails( + wallet: Wallets.WalletStructOutput + ): Promise { + const ecdsaWalletID = Hex.from(wallet.ecdsaWalletID) + + return { + ecdsaWalletID, + walletPublicKey: await this.toCompressedWalletPublicKey(ecdsaWalletID), + mainUtxoHash: Hex.from(wallet.mainUtxoHash), + pendingRedemptionsValue: wallet.pendingRedemptionsValue, + createdAt: wallet.createdAt, + movingFundsRequestedAt: wallet.movingFundsRequestedAt, + closingStartedAt: wallet.closingStartedAt, + pendingMovedFundsSweepRequestsCount: + wallet.pendingMovedFundsSweepRequestsCount, + state: WalletState.parse(wallet.state), + movingFundsTargetWalletsCommitmentHash: Hex.from( + wallet.movingFundsTargetWalletsCommitmentHash + ), + } + } + + /** + * Builds the UTXO hash based on the UTXO components. UTXO hash is computed as + * `keccak256(txHash | txOutputIndex | txOutputValue)`. + * @param utxo UTXO components. + * @returns The hash of the UTXO. + */ + buildUTXOHash(utxo: UnspentTransactionOutput): Hex { + return Hex.from( + utils.solidityKeccak256( + ["bytes32", "uint32", "uint64"], + [ + utxo.transactionHash.reverse().toPrefixedString(), + utxo.outputIndex, + utxo.value, + ] + ) + ) + } } /** diff --git a/typescript/src/index.ts b/typescript/src/index.ts index 8f5384bde..7bc6e4922 100644 --- a/typescript/src/index.ts +++ b/typescript/src/index.ts @@ -13,6 +13,7 @@ import { requestRedemption, submitRedemptionProof, getRedemptionRequest, + findWalletForRedemption, } from "./redemption" import { @@ -31,6 +32,7 @@ export const TBTC = { getRevealedDeposit, requestRedemption, getRedemptionRequest, + findWalletForRedemption, } export const SpvMaintainer = { diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index ec96659d5..6256b3057 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -7,9 +7,12 @@ import { UnspentTransactionOutput, Client as BitcoinClient, TransactionHash, + encodeToBitcoinAddress, } from "./bitcoin" import { Bridge, Identifier } from "./chain" import { assembleTransactionProof } from "./proof" +import { WalletState } from "./wallet" +import { BitcoinNetwork } from "./bitcoin-network" /** * Represents a redemption request. @@ -406,3 +409,69 @@ export async function getRedemptionRequest( return redemptionRequests[0] } + +/** + * Finds the oldest active wallet that has enough BTC to handle a redemption request. + * @param amount The amount to be redeemed. + * @param bridge The handle to the Bridge on-chain contract. + * @param bitcoinClient Bitcoin client used to interact with the network. + * @param bitcoinNetwork Bitcoin network. + * @returns Promise with the wallet details needed to request a redemption. + */ +export async function findWalletForRedemption( + amount: BigNumber, + bridge: Bridge, + bitcoinClient: BitcoinClient, + bitcoinNetwork: BitcoinNetwork +): Promise<{ + walletPublicKeyHash: string + mainUTXO: UnspentTransactionOutput +}> { + const wallets = await bridge.getNewWalletRegisteredEvents() + + let walletPublicKeyHash + let mainUTXO + let maxAmount = BigNumber.from(0) + for (const wallet of wallets) { + const _walletPublicKeyHash = wallet.walletPublicKeyHash.toPrefixedString() + const { state, mainUtxoHash } = await bridge.wallets(_walletPublicKeyHash) + + // Wallet must be in Live state. + if (state !== WalletState.Live) continue + + const walletBitcoinAddress = encodeToBitcoinAddress( + wallet.walletPublicKeyHash.toString(), + true, + bitcoinNetwork + ) + + const utxos = await bitcoinClient.findAllUnspentTransactionOutputs( + walletBitcoinAddress + ) + + // We need to find correct utxo- utxo components must point to the recent + // main UTXO of the given wallet, as currently known on the chain. + const utxo = utxos.find((utxo) => + mainUtxoHash.equals(bridge.buildUTXOHash(utxo)) + ) + + if (!utxo) continue + + // Save the max possible redemption amount. + maxAmount = utxo.value.gt(maxAmount) ? utxo.value : maxAmount + + if (utxo.value.gte(amount)) { + walletPublicKeyHash = _walletPublicKeyHash + mainUTXO = utxo + + break + } + } + + if (!walletPublicKeyHash || !mainUTXO) + throw new Error( + `Could not find a wallet with enough funds. Maximum redemption amount is ${maxAmount} Satoshi.` + ) + + return { walletPublicKeyHash, mainUTXO } +} diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index d342357c2..cb4e4064a 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -15,7 +15,7 @@ import { computeHash160, TransactionHash } from "../../src/bitcoin" import { depositSweepWithNoMainUtxoAndWitnessOutput } from "../data/deposit-sweep" import { Address } from "../../src/ethereum" import { Hex } from "../../src/hex" -import { NewWalletRegisteredEvent } from "../../src/wallet" +import { NewWalletRegisteredEvent, Wallet } from "../../src/wallet" interface DepositSweepProofLogEntry { sweepTx: DecomposedRawTransaction @@ -314,4 +314,21 @@ export class MockBridge implements Bridge { walletRegistry(): Promise { throw new Error("not implemented") } + + wallets(walletPublicKeyHash: string): Promise { + throw new Error("not implemented") + } + + buildUTXOHash(utxo: UnspentTransactionOutput): Hex { + return Hex.from( + utils.solidityKeccak256( + ["bytes32", "uint32", "uint64"], + [ + utxo.transactionHash.reverse().toPrefixedString(), + utxo.outputIndex, + utxo.value, + ] + ) + ) + } } From d927ab44ae068c5ef71e6eebb78d8252ca639d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 7 Jun 2023 15:22:23 +0200 Subject: [PATCH 115/198] Change Valkyrie's to noreply email Change introduced to fix the 'Your push would publish a private email address.' error. --- .github/workflows/contracts-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 37adea8b6..574ed45f3 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -79,7 +79,7 @@ jobs: destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBaseBranch: main - userEmail: valkyrie@thesis.co + userEmail: 8324465+thesis-valkyrie@noreply.github.com userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} From 71641e004f2d110bfabc56f62549aacbc8d83a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 7 Jun 2023 18:30:44 +0200 Subject: [PATCH 116/198] Update dependencies to `random-beacon`, `ecdsa` and `tbtc-v2` We have published new `@keep-network/random-beacon`, `@keep-network/ecdsa` and `@keep-network/tbtc-v2` packages. Those packages no longer include the `prepare-dependencies.sh` script from `@threshold-network/solidity-contracts` which was causing random failures during `yarn install`. As in some CI jobs we install the dependencies based on the lockfile (with the `--frozen-lockfile` flag), we need to update dependencies in the lockfile so that the new, improved packages would be used. --- solidity/yarn.lock | 79 +-- typescript/yarn.lock | 1427 ++++++++++++++++++++++-------------------- 2 files changed, 768 insertions(+), 738 deletions(-) diff --git a/solidity/yarn.lock b/solidity/yarn.lock index 9710f23f9..b2e2bf3ae 100644 --- a/solidity/yarn.lock +++ b/solidity/yarn.lock @@ -108,7 +108,7 @@ resolved "https://registry.yarnpkg.com/@celo/utils/-/utils-0.1.11.tgz#c35e3b385091fc6f0c0c355b73270f4a8559ad38" integrity sha512-i3oK1guBxH89AEBaVA1d5CHnANehL36gPIcSpPBWiYZrKTGGVvbwNmVoaDwaKFXih0N22vXQAf2Rul8w5VzC3w== dependencies: - "@umpirsky/country-list" "git+https://github.com/umpirsky/country-list#05fda51" + "@umpirsky/country-list" "git://github.com/umpirsky/country-list#05fda51" bigi "^1.1.0" bignumber.js "^9.0.0" bip32 "2.0.5" @@ -1595,26 +1595,21 @@ integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== "@keep-network/ecdsa@development": - version "2.1.0-dev.0" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.0.tgz#3af765c1dceb9d8d3f191c1a44dadc956f22ae01" - integrity sha512-6qlWnOhVfMnItcfLfyWUvdlQ6P9hmWa9T1OModZP0i1drxSKeINTrBq50u8Z6hrORs/J2anPLuNW10tpdNIT0Q== + version "2.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.11.tgz#c25fa6cfebe1ca7964329b54c44526a782391234" + integrity sha512-5tTJr9UyW+H0HnV3bu8MkKcy+K9Gi6gaHZ+1WK8LQvba/T38ay//9Gg6dZWmhPT9mKIlW4s0zjOYkjQwq7W7fw== dependencies: - "@keep-network/random-beacon" "2.0.0-dev.78" + "@keep-network/random-beacon" "2.1.0-dev.10" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@threshold-network/solidity-contracts" "1.3.0-dev.0" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" "@keep-network/hardhat-helpers@0.6.0-pre.18": version "0.6.0-pre.18" resolved "https://registry.yarnpkg.com/@keep-network/hardhat-helpers/-/hardhat-helpers-0.6.0-pre.18.tgz#1c962af23714920c8eeae9b13a8e0e8681e5440b" integrity sha512-9jF3ypoW8qqVl+hZmGgVVfLYNAjgUZrM+jOGYs69QHKPU2RFgx4v+wIvm02GnEtZbX4FGj5itb84QQY7EOssUA== -"@keep-network/hardhat-helpers@^0.6.0-pre.15": - version "0.6.0-pre.17" - resolved "https://registry.yarnpkg.com/@keep-network/hardhat-helpers/-/hardhat-helpers-0.6.0-pre.17.tgz#de085c8f5d684cc7e4ae793fdc6c104a09fd03ce" - integrity sha512-G3Jp+I77po8e4moOrUY/wQCRYGt/g1aBoDjL2cbxMkAWFFrb9OBu1a5Vi5eOwO4ttWthN5c9vZKWJicR6kwOLg== - "@keep-network/hardhat-local-networks-config@^0.1.0-pre.4": version "0.1.0-pre.4" resolved "https://registry.yarnpkg.com/@keep-network/hardhat-local-networks-config/-/hardhat-local-networks-config-0.1.0-pre.4.tgz#cc0c8ac1f5e30f33378e7451f696ab17d504ab86" @@ -1649,26 +1644,15 @@ "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" -"@keep-network/random-beacon@2.0.0-dev.78": - version "2.0.0-dev.78" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.0.0-dev.78.tgz#d38f77d8a14e4d9cb0d59cf6532527160406f22a" - integrity sha512-t1Jxaps0bcSQxS50T4IGPAPmTN68AsZ+WfumVPW90PhP1yISBWU1VRuM/kUIUCilC0ng0FYB939FexnFcyy0pg== +"@keep-network/random-beacon@2.1.0-dev.10", "@keep-network/random-beacon@development": + version "2.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.10.tgz#61c9d3e98257f40292264f4b9e1991acdc11f3c3" + integrity sha512-NJtmjrzFimL20bul6g8lKxUPNc+lpiu9BJ3uheJOCWDL5vQ+hJGctmWqd63mvtjgO8Ks9IQsDg9wpValzSzGXg== dependencies: - "@keep-network/hardhat-helpers" "^0.6.0-pre.15" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.2.0-dev.24" - -"@keep-network/random-beacon@development": - version "2.1.0-dev.0" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.0.tgz#b74dd3297ec89def2370c73d59410ed9fb4e9292" - integrity sha512-B+uAzt62yKBSzeEe+4l4zwQzLTwWCp3HRUinWyuDyHmfJlRhYMKo9UBB3+l/Oxotr6JUgMAQpLIOwvAtcSS+2Q== - dependencies: - "@keep-network/sortition-pools" "^2.0.0-pre.16" - "@openzeppelin/contracts" "^4.6.0" - "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.0" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" "@keep-network/sortition-pools@1.2.0-dev.1": version "1.2.0-dev.1" @@ -2014,9 +1998,9 @@ "@types/web3" "1.0.19" "@openzeppelin/contracts-upgradeable@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.6.0.tgz#1bf55f230f008554d4c6fe25eb165b85112108b0" - integrity sha512-5OnVuO4HlkjSCJO165a4i2Pu1zQGzMs//o54LPrwUgxvEO2P3ax1QuaSI0cEHHTveA77guS0PnNugpR2JMsPfA== + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.1.tgz#03e33b8059ce43884995e69e4479f5a7f084b404" + integrity sha512-UZf5/VdaBA/0kxF7/gg+2UrC8k+fbgiUM0Qw1apAhwpBWBxULbsHw0ZRMgT53nd6N8hr53XFjhcWNeTRGIiCVw== "@openzeppelin/contracts-upgradeable@^4.8.1": version "4.8.1" @@ -2038,15 +2022,10 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.2.0.tgz#260d921d99356e48013d9d760caaa6cea35dc642" integrity sha512-LD4NnkKpHHSMo5z9MvFsG4g1xxZUDqV3A3Futu3nvyfs4wPwXxqOgMaxOoa2PeyGL2VNeSlbxT54enbQzGcgJQ== -"@openzeppelin/contracts@^4.3.2": - version "4.7.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e" - integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== - -"@openzeppelin/contracts@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.6.0.tgz#c91cf64bc27f573836dba4122758b4743418c1b3" - integrity sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg== +"@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.1.tgz#afa804d2c68398704b0175acc94d91a54f203645" + integrity sha512-aLDTLu/If1qYIFW5g4ZibuQaUsFGWQPBq1mZKp/txaebUnGHDmmiBhRLY1tDNedN0m+fJtKZ1zAODS9Yk+V6uA== "@openzeppelin/contracts@^4.8.1": version "4.8.1" @@ -2398,20 +2377,10 @@ dependencies: "@openzeppelin/contracts" "^4.1.0" -"@threshold-network/solidity-contracts@1.2.0-dev.24": - version "1.2.0-dev.24" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.2.0-dev.24.tgz#a6ec0d22bebd0829a70663bc72a6a49713b6fec8" - integrity sha512-lNNrsTDhOyqZNNfJ/1lffcCTRoV5CepTvHQWlsIQS5ku/QYFU8MldfRxITNbJSkySYdBA9VGSyiGYM3zSyJAOg== - dependencies: - "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" - "@openzeppelin/contracts" "~4.5.0" - "@openzeppelin/contracts-upgradeable" "~4.5.2" - "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - -"@threshold-network/solidity-contracts@1.3.0-dev.0": - version "1.3.0-dev.0" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.0.tgz#0b954fe1621ea847d1fb843dc9525183ca095045" - integrity sha512-rEj1wxH9CK/1bWgLYKGKJGqfZHgCdw4udJ2nZIPFb7l2t2ox5UhsOv+1CD4jnHOBqFS7ooDgHWm2S8m+J17img== +"@threshold-network/solidity-contracts@1.3.0-dev.5": + version "1.3.0-dev.5" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" + integrity sha512-AInTKQkJ0PKa32q2m8GnZFPYEArsnvOwhIFdBFaHdq9r4EGyqHMf4YY1WjffkheBZ7AQ0DNA8Lst30kBoQd0SA== dependencies: "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" "@openzeppelin/contracts" "~4.5.0" @@ -2780,9 +2749,9 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"@umpirsky/country-list@git+https://github.com/umpirsky/country-list#05fda51": +"@umpirsky/country-list@git://github.com/umpirsky/country-list#05fda51": version "1.0.0" - resolved "git+https://github.com/umpirsky/country-list#05fda51cd97b3294e8175ffed06104c44b3c71d7" + resolved "git://github.com/umpirsky/country-list#05fda51cd97b3294e8175ffed06104c44b3c71d7" "@web3-js/scrypt-shim@^0.1.0": version "0.1.0" diff --git a/typescript/yarn.lock b/typescript/yarn.lock index 2378ac9e1..1d40622e0 100644 --- a/typescript/yarn.lock +++ b/typescript/yarn.lock @@ -391,21 +391,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/abi@5.6.2", "@ethersproject/abi@^5.6.0", "@ethersproject/abi@^5.6.1": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.2.tgz#f2956f2ac724cd720e581759d9e3840cd9744818" - integrity sha512-40Ixjhy+YzFtnvzIqFU13FW9hd1gMoLa3cJfSDnfnL4o8EnEG1qLiV8sNJo3sHYi9UYMfFeRuZ7kv5+vhzU7gQ== - dependencies: - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/hash" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -421,6 +406,21 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" +"@ethersproject/abi@^5.6.0", "@ethersproject/abi@^5.6.1": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.2.tgz#f2956f2ac724cd720e581759d9e3840cd9744818" + integrity sha512-40Ixjhy+YzFtnvzIqFU13FW9hd1gMoLa3cJfSDnfnL4o8EnEG1qLiV8sNJo3sHYi9UYMfFeRuZ7kv5+vhzU7gQ== + dependencies: + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/abstract-provider@5.5.1", "@ethersproject/abstract-provider@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" @@ -482,17 +482,6 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/abstract-signer@5.6.1", "@ethersproject/abstract-signer@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.1.tgz#54df786bdf1aabe20d0ed508ec05e0aa2d06674f" - integrity sha512-xhSLo6y0nGJS7NxfvOSzCaWKvWb1TLT7dQ0nnpHZrDnC67xfnWm9NXflTMFPUXXMtjr33CdV0kWDEmnbrQZ74Q== - dependencies: - "@ethersproject/abstract-provider" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" @@ -504,6 +493,17 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" +"@ethersproject/abstract-signer@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.1.tgz#54df786bdf1aabe20d0ed508ec05e0aa2d06674f" + integrity sha512-xhSLo6y0nGJS7NxfvOSzCaWKvWb1TLT7dQ0nnpHZrDnC67xfnWm9NXflTMFPUXXMtjr33CdV0kWDEmnbrQZ74Q== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/address@5.5.0", "@ethersproject/address@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" @@ -515,7 +515,7 @@ "@ethersproject/logger" "^5.5.0" "@ethersproject/rlp" "^5.5.0" -"@ethersproject/address@5.6.0", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.6.0": +"@ethersproject/address@5.6.0", "@ethersproject/address@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.0.tgz#13c49836d73e7885fc148ad633afad729da25012" integrity sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ== @@ -526,7 +526,7 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.0" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -600,16 +600,7 @@ "@ethersproject/logger" "^5.6.0" bn.js "^4.11.9" -"@ethersproject/bignumber@5.6.1", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.1.tgz#d5e0da518eb82ab8d08ca9db501888bbf5f0c8fb" - integrity sha512-UtMeZ3GaUuF9sx2u9nPZiPP3ULcAFmXyvynR7oHl/tPrM+vldZh7ocMsoa1PqKYGnQnqUZJoqxZnGN6J0qdipA== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - bn.js "^4.11.9" - -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== @@ -618,6 +609,15 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" +"@ethersproject/bignumber@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.1.tgz#d5e0da518eb82ab8d08ca9db501888bbf5f0c8fb" + integrity sha512-UtMeZ3GaUuF9sx2u9nPZiPP3ULcAFmXyvynR7oHl/tPrM+vldZh7ocMsoa1PqKYGnQnqUZJoqxZnGN6J0qdipA== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + bn.js "^4.11.9" + "@ethersproject/bytes@5.5.0", "@ethersproject/bytes@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" @@ -625,14 +625,14 @@ dependencies: "@ethersproject/logger" "^5.5.0" -"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.6.0", "@ethersproject/bytes@^5.6.1": +"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.6.0", "@ethersproject/bytes@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== @@ -646,14 +646,14 @@ dependencies: "@ethersproject/bignumber" "^5.5.0" -"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.6.0": +"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.0.tgz#55e3eb0918584d3acc0688e9958b0cedef297088" integrity sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA== dependencies: "@ethersproject/bignumber" "^5.6.0" -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== @@ -692,22 +692,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/transactions" "^5.6.0" -"@ethersproject/contracts@5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.1.tgz#c0eba3f8a2226456f92251a547344fd0593281d2" - integrity sha512-0fpBBDoPqJMsutE6sNjg6pvCJaIcl7tliMQTMRcoUWDACfjO68CpKOJBlsEhEhmzdnu/41KbrfAeg+sB3y35MQ== - dependencies: - "@ethersproject/abi" "^5.6.0" - "@ethersproject/abstract-provider" "^5.6.0" - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/contracts@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" @@ -738,7 +722,7 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" -"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.6.0": +"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.0.tgz#d24446a5263e02492f9808baa99b6e2b4c3429a2" integrity sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA== @@ -752,7 +736,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -803,24 +787,6 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" -"@ethersproject/hdnode@5.6.1", "@ethersproject/hdnode@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.1.tgz#37fa1eb91f6e20ca39cc5fcb7acd3da263d85dab" - integrity sha512-6IuYDmbH5Bv/WH/A2cUd0FjNr4qTLAvyHAECiFZhNZp69pPvU7qIDwJ7CU7VAkwm4IVBzqdYy9mpMAGhQdwCDA== - dependencies: - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/basex" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/sha2" "^5.6.0" - "@ethersproject/signing-key" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/wordlists" "^5.6.0" - "@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" @@ -839,6 +805,24 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" +"@ethersproject/hdnode@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.1.tgz#37fa1eb91f6e20ca39cc5fcb7acd3da263d85dab" + integrity sha512-6IuYDmbH5Bv/WH/A2cUd0FjNr4qTLAvyHAECiFZhNZp69pPvU7qIDwJ7CU7VAkwm4IVBzqdYy9mpMAGhQdwCDA== + dependencies: + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/basex" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/wordlists" "^5.6.0" + "@ethersproject/json-wallets@5.5.0", "@ethersproject/json-wallets@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz#dd522d4297e15bccc8e1427d247ec8376b60e325" @@ -904,7 +888,7 @@ "@ethersproject/bytes" "^5.5.0" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.6.0": +"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.0.tgz#fea4bb47dbf8f131c2e1774a1cecbfeb9d606459" integrity sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w== @@ -912,7 +896,7 @@ "@ethersproject/bytes" "^5.6.0" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -925,12 +909,12 @@ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== -"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.6.0": +"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== @@ -949,13 +933,6 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/networks@5.6.2", "@ethersproject/networks@^5.6.0": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" - integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA== - dependencies: - "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" @@ -963,6 +940,13 @@ dependencies: "@ethersproject/logger" "^5.7.0" +"@ethersproject/networks@^5.6.0": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" + integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2@5.5.0", "@ethersproject/pbkdf2@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz#e25032cdf02f31505d47afbf9c3e000d95c4a050" @@ -994,14 +978,14 @@ dependencies: "@ethersproject/logger" "^5.5.0" -"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.6.0": +"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== @@ -1058,31 +1042,6 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/providers@5.6.6": - version "5.6.6" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.6.tgz#1967149cb4557d253f8c176a44aabda155f228cd" - integrity sha512-6X6agj3NeQ4tgnvBMCjHK+CjQbz+Qmn20JTxCYZ/uymrgCEOpJtY9zeRxJIDsSi0DPw8xNAxypj95JMCsapUfA== - dependencies: - "@ethersproject/abstract-provider" "^5.6.0" - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/address" "^5.6.0" - "@ethersproject/basex" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/hash" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.0" - "@ethersproject/rlp" "^5.6.0" - "@ethersproject/sha2" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/web" "^5.6.0" - bech32 "1.1.4" - ws "7.4.6" - "@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" @@ -1234,18 +1193,6 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/signing-key@5.6.1", "@ethersproject/signing-key@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.1.tgz#31b0a531520616254eb0465b9443e49515c4d457" - integrity sha512-XvqQ20DH0D+bS3qlrrgh+axRMth5kD1xuvqUQUTeezxUTXBOeR6hWz2/C6FBEu39FRytyybIWrYf7YLSAKr1LQ== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - "@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" @@ -1258,6 +1205,18 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/signing-key@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.1.tgz#31b0a531520616254eb0465b9443e49515c4d457" + integrity sha512-XvqQ20DH0D+bS3qlrrgh+axRMth5kD1xuvqUQUTeezxUTXBOeR6hWz2/C6FBEu39FRytyybIWrYf7YLSAKr1LQ== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + "@ethersproject/solidity@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.5.0.tgz#2662eb3e5da471b85a20531e420054278362f93f" @@ -1303,7 +1262,7 @@ "@ethersproject/constants" "^5.5.0" "@ethersproject/logger" "^5.5.0" -"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.6.0": +"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.0.tgz#9891b26709153d996bf1303d39a7f4bc047878fd" integrity sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg== @@ -1312,7 +1271,7 @@ "@ethersproject/constants" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -1336,7 +1295,7 @@ "@ethersproject/rlp" "^5.5.0" "@ethersproject/signing-key" "^5.5.0" -"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.6.0": +"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.0.tgz#4b594d73a868ef6e1529a2f8f94a785e6791ae4e" integrity sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg== @@ -1351,7 +1310,7 @@ "@ethersproject/rlp" "^5.6.0" "@ethersproject/signing-key" "^5.6.0" -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -1435,27 +1394,6 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" -"@ethersproject/wallet@5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.1.tgz#5df4f75f848ed84ca30fd6ca75d2c66b19c5552b" - integrity sha512-oXWoOslEWtwZiViIMlGVjeKDQz/tI7JF9UkyzN9jaGj8z7sXt2SyFMb0Ev6vSAqjIzrCrNrJ/+MkAhtKnGOfZw== - dependencies: - "@ethersproject/abstract-provider" "^5.6.0" - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/hash" "^5.6.0" - "@ethersproject/hdnode" "^5.6.0" - "@ethersproject/json-wallets" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.0" - "@ethersproject/signing-key" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/wordlists" "^5.6.0" - "@ethersproject/wallet@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" @@ -1624,21 +1562,21 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.2", "@keep-network/ecdsa@development": - version "2.1.0-dev.2" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.2.tgz#bb130ef37d6374909dc4bde858d5664e08b1ebce" - integrity sha512-ERzuqvQFkyN5+2MAGiCgDW2kroTrm1Dnd7yRch3yf+HctjPZ6ocfgubhgqFGwCqG4VLXfS/NIezqORege3N6og== +"@keep-network/ecdsa@2.1.0-dev.11", "@keep-network/ecdsa@development": + version "2.1.0-dev.11" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.11.tgz#c25fa6cfebe1ca7964329b54c44526a782391234" + integrity sha512-5tTJr9UyW+H0HnV3bu8MkKcy+K9Gi6gaHZ+1WK8LQvba/T38ay//9Gg6dZWmhPT9mKIlW4s0zjOYkjQwq7W7fw== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.1" + "@keep-network/random-beacon" "2.1.0-dev.10" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" -"@keep-network/keep-core@1.8.0-dev.5": - version "1.8.0-dev.5" - resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.0-dev.5.tgz#8b4d08ec437f29c94723ee54fcf76456ba5408c3" - integrity sha512-QVkpO5X28Vczj/xHezV0z2UuMw8QFaR3C8x/d6+3adedsL3nCxgveIGTUcXSuYpBqfx0v4/xT+9bIK7BwLkGPw== +"@keep-network/keep-core@1.8.1-goerli.0": + version "1.8.1-goerli.0" + resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.1-goerli.0.tgz#238485aab51902021d42357bf59695225002f0ab" + integrity sha512-h3La/RqbyEZjBBPg8V+pcRFo3UpWZUF4CxWfXHZnUR4PnkZKnIDrTNFQPhpV2uYFZwrbJxTR9mzOq/DOAiXPwA== dependencies: "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.4.0" @@ -1652,11 +1590,11 @@ openzeppelin-solidity "2.4.0" "@keep-network/keep-ecdsa@>1.9.0-dev <1.9.0-ropsten": - version "1.9.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-dev.1.tgz#7522b47dd639ddd7479a0e71dc328a9e0bba7cae" - integrity sha512-FRIDejTUiQO7c9gBXgjtTp2sXkEQKFBBqVjYoZE20OCGRxbgum9FbgD/B5RWIctBy4GGr5wJHnA1789iaK3X6A== + version "1.9.0-goerli.0" + resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-goerli.0.tgz#ce58b6639062bb4f73a257557aebb16447889e08" + integrity sha512-EA/oTcxmia5nznQ35ub9/5xBqBK4T+78oWYxASCc+THdPLalzriSAtQ517R4QnvkHi82NFhJjZH8WBoRXniddA== dependencies: - "@keep-network/keep-core" "1.8.0-dev.5" + "@keep-network/keep-core" "1.8.1-goerli.0" "@keep-network/sortition-pools" "1.2.0-dev.1" "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" @@ -1665,25 +1603,15 @@ version "0.0.1" resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/a1a333e7ac49928a0f6ed39421906dd1e46ab0f3" -"@keep-network/random-beacon@2.1.0-dev.1": - version "2.1.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.1.tgz#197422cef030cb61b0b88fc08a59292a9efb3b28" - integrity sha512-ppCPriGEhyc2Aw30wu0ujLphs6wRUdPYR345Knts8tx/z+D49Xg+3JA5tcUiPgXBnJnJJ00sk6uHXdhUS3LLDg== +"@keep-network/random-beacon@2.1.0-dev.10": + version "2.1.0-dev.10" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.10.tgz#61c9d3e98257f40292264f4b9e1991acdc11f3c3" + integrity sha512-NJtmjrzFimL20bul6g8lKxUPNc+lpiu9BJ3uheJOCWDL5vQ+hJGctmWqd63mvtjgO8Ks9IQsDg9wpValzSzGXg== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" - -"@keep-network/random-beacon@2.1.0-dev.2": - version "2.1.0-dev.2" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.2.tgz#aaf5bb4780b6aac6e71ba6ed8ecb29b4ccf6ae81" - integrity sha512-Xc4MIQ65etB11GDLBPUvO8XRs6f2DVY0FmPF2uU00x8/fOIg12jjyyBQwNP1jJ+OLf7W36+CAZcUtj6kI87EAQ== - dependencies: - "@keep-network/sortition-pools" "^2.0.0-pre.16" - "@openzeppelin/contracts" "^4.6.0" - "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" "@keep-network/sortition-pools@1.2.0-dev.1": version "1.2.0-dev.1" @@ -1701,17 +1629,16 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "0.1.1-dev.120" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-0.1.1-dev.120.tgz#ee97a1fd1deaa64154ab3de4d49d7ba49782eeab" - integrity sha512-xNjg+uN18vw02b/mhczx7V5nbt13G3nlNlDRXXtBNSXtgsaudQ9iIvgRRNGR92N4sIgsMLHeZcaNkIMW2NYZaA== + version "1.5.0-dev.2" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.5.0-dev.2.tgz#2e5b6adb5b265e998e2d296883c68d6587a7fedb" + integrity sha512-L3lPNzVb1N6uEMABixx/5hR3t6dxGFMEuuCVWqaQ/jTocODru+0pwd5obYoD9aNIqtzuboezoBBorZsOoheiPw== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.2" - "@keep-network/random-beacon" "2.1.0-dev.2" + "@keep-network/ecdsa" "2.1.0-dev.11" + "@keep-network/random-beacon" "2.1.0-dev.10" "@keep-network/tbtc" "1.1.2-dev.1" - "@openzeppelin/contracts" "^4.6.0" - "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@tenderly/hardhat-tenderly" ">=1.0.12 <1.2.0" + "@openzeppelin/contracts" "^4.8.1" + "@openzeppelin/contracts-upgradeable" "^4.8.1" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc@1.1.2-dev.1": @@ -1794,15 +1721,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomiclabs/hardhat-ethers@^2.0.6": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz#8057b43566a0e41abeb8142064a3c0d3f23dca86" - integrity sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg== - -"@openzeppelin/contracts-upgradeable@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.6.0.tgz#1bf55f230f008554d4c6fe25eb165b85112108b0" - integrity sha512-5OnVuO4HlkjSCJO165a4i2Pu1zQGzMs//o54LPrwUgxvEO2P3ax1QuaSI0cEHHTveA77guS0PnNugpR2JMsPfA== +"@openzeppelin/contracts-upgradeable@^4.6.0", "@openzeppelin/contracts-upgradeable@^4.8.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.1.tgz#03e33b8059ce43884995e69e4479f5a7f084b404" + integrity sha512-UZf5/VdaBA/0kxF7/gg+2UrC8k+fbgiUM0Qw1apAhwpBWBxULbsHw0ZRMgT53nd6N8hr53XFjhcWNeTRGIiCVw== "@openzeppelin/contracts-upgradeable@~4.5.2": version "4.5.2" @@ -1814,10 +1736,10 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== -"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.6.0.tgz#c91cf64bc27f573836dba4122758b4743418c1b3" - integrity sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg== +"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0", "@openzeppelin/contracts@^4.8.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.1.tgz#afa804d2c68398704b0175acc94d91a54f203645" + integrity sha512-aLDTLu/If1qYIFW5g4ZibuQaUsFGWQPBq1mZKp/txaebUnGHDmmiBhRLY1tDNedN0m+fJtKZ1zAODS9Yk+V6uA== "@openzeppelin/contracts@~4.5.0": version "4.5.0" @@ -1921,10 +1843,15 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== +"@sindresorhus/is@^4.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + "@solidity-parser/parser@^0.14.1": - version "0.14.1" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.1.tgz#179afb29f4e295a77cc141151f26b3848abc3c46" - integrity sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw== + version "0.14.5" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.5.tgz#87bc3cc7b068e08195c219c91cd8ddff5ef1a804" + integrity sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg== dependencies: antlr4ts "^0.5.0-alpha.4" @@ -1990,18 +1917,12 @@ dependencies: defer-to-connect "^1.0.1" -"@tenderly/hardhat-tenderly@>=1.0.12 <1.2.0": - version "1.1.6" - resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.1.6.tgz#b706c7c337ebae7ecd314df3e8ee3d244ed1de08" - integrity sha512-B6vVdDAxQwjahrvsxjNirJW2ynDENLBD8LLFy8sYVJ+RCb4B8HXT1IGSceqpySNPr2iLYcD5cKC/YCHX+/O48Q== +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== dependencies: - "@ethersproject/bignumber" "^5.6.2" - "@nomiclabs/hardhat-ethers" "^2.0.6" - axios "^0.21.1" - ethers "^5.6.8" - fs-extra "^9.0.1" - hardhat-deploy "^0.11.10" - js-yaml "^3.14.0" + defer-to-connect "^2.0.0" "@thesis/solidity-contracts@github:thesis/solidity-contracts#4985bcf": version "0.0.1" @@ -2009,10 +1930,10 @@ dependencies: "@openzeppelin/contracts" "^4.1.0" -"@threshold-network/solidity-contracts@1.3.0-dev.2": - version "1.3.0-dev.2" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.2.tgz#e3589004aff366d9f034e51b1be8832d01c81d47" - integrity sha512-qJulhTwYW7ZKVIgpqWVdQE9R45OgxjmqLaGp2gAv3hvlAUUsC+dnxub1kaQfDqQcZmwzZvtHcxLXYtHg4Cs2ug== +"@threshold-network/solidity-contracts@1.3.0-dev.5": + version "1.3.0-dev.5" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" + integrity sha512-AInTKQkJ0PKa32q2m8GnZFPYEArsnvOwhIFdBFaHdq9r4EGyqHMf4YY1WjffkheBZ7AQ0DNA8Lst30kBoQd0SA== dependencies: "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" "@openzeppelin/contracts" "~4.5.0" @@ -2074,10 +1995,10 @@ dependencies: bignumber.js "*" -"@types/bn.js@*", "@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== +"@types/bn.js@*": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" + integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== dependencies: "@types/node" "*" @@ -2088,6 +2009,23 @@ dependencies: "@types/node" "*" +"@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + dependencies: + "@types/node" "*" + +"@types/cacheable-request@^6.0.1": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" + integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "^3.1.4" + "@types/node" "*" + "@types/responselike" "^1.0.0" + "@types/cbor@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/cbor/-/cbor-2.0.0.tgz#c627afc2ee22f23f2337fecb34628a4f97c6afbb" @@ -2113,9 +2051,9 @@ integrity sha512-lIxCk6G7AwmUagQ4gIQGxUBnvAq664prFD9nSAz6dgd1XmBXBtZABV/op+QsJsIyaP1GZsf/iXhYKHX3azSRCw== "@types/debug@^4.1.5": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" - integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== + version "4.1.8" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" + integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== dependencies: "@types/ms" "*" @@ -2139,11 +2077,23 @@ resolved "https://registry.yarnpkg.com/@types/google-libphonenumber/-/google-libphonenumber-7.4.23.tgz#c44c9125d45f042943694d605fd8d8d796cafc3b" integrity sha512-C3ydakLTQa8HxtYf9ge4q6uT9krDX8smSIxmmW3oACFi5g5vv6T068PRExF7UyWbWpuYiDG8Nm24q2X5XhcZWw== +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + "@types/json-schema@^7.0.7": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== +"@types/keyv@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + "@types/level-errors@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.0.tgz#15c1f4915a5ef763b51651b15e90f6dc081b96a8" @@ -2159,9 +2109,9 @@ "@types/node" "*" "@types/lodash@^4.14.170": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== + version "4.14.195" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" + integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== "@types/mkdirp@^0.5.2": version "0.5.2" @@ -2209,9 +2159,9 @@ integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== "@types/node@^12.11.7", "@types/node@^12.12.6", "@types/node@^12.6.1": - version "12.20.52" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.52.tgz#2fd2dc6bfa185601b15457398d4ba1ef27f81251" - integrity sha512-cfkwWw72849SNYp3Zx0IcIs25vABmFh73xicxhCkTcvtZQeIez15PpwQN8fY3RD7gv1Wrxlc9MEtfMORZDEsGw== + version "12.20.55" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" + integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== "@types/node@^16.3.1": version "16.11.14" @@ -2230,11 +2180,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.1.tgz#76e72d8a775eef7ce649c63c8acae1a0824bbaed" integrity sha512-XFjFHmaLVifrAKaZ+EKghFHtHSUonyw8P2Qmy2/+osBnrKbH9UYtlK10zg8/kCt47MFilll/DEDKy3DHfJ0URw== -"@types/qs@^6.9.7": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - "@types/randombytes@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" @@ -2242,6 +2187,13 @@ dependencies: "@types/node" "*" +"@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + "@types/secp256k1@^4.0.1": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" @@ -2528,6 +2480,14 @@ array-back@^4.0.1, array-back@^4.0.2: resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -2538,6 +2498,17 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +array.prototype.reduce@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" + integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + es-array-method-boxes-properly "^1.0.0" + is-string "^1.0.7" + asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -2594,11 +2565,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -2622,13 +2588,6 @@ axios@^0.18.0: follow-redirects "1.5.10" is-buffer "^2.0.2" -axios@^0.21.1: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2761,9 +2720,9 @@ bigi@^1.1.0: integrity sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw== bignumber.js@*, bignumber.js@^9.0.0, bignumber.js@^9.0.1: - version "9.0.2" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" - integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== + version "9.1.1" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" + integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== bignumber.js@^7.2.0: version "7.2.1" @@ -2912,20 +2871,20 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^ resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -bn.js@^5.2.1: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.0, body-parser@^1.16.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" - integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== +bn.js@^5.1.2, bn.js@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" + integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== dependencies: bytes "3.1.2" content-type "~1.0.4" @@ -2935,11 +2894,29 @@ body-parser@1.20.0, body-parser@^1.16.0: http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.10.3" + qs "6.11.0" raw-body "2.5.1" type-is "~1.6.18" unpipe "1.0.0" +body-parser@^1.16.0: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3182,6 +3159,11 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -3195,6 +3177,19 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -3251,13 +3246,13 @@ chai-as-promised@^7.1.1: check-error "^1.0.2" chai@^4.2.0: - version "4.3.6" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" - integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== + version "4.3.7" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" + integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" - deep-eql "^3.0.1" + deep-eql "^4.1.2" get-func-name "^2.0.0" loupe "^2.3.1" pathval "^1.1.1" @@ -3284,7 +3279,7 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3312,21 +3307,6 @@ chokidar@3.5.2: optionalDependencies: fsevents "~2.3.2" -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -3391,9 +3371,9 @@ cliui@^7.0.2: wrap-ansi "^7.0.0" clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== dependencies: mimic-response "^1.0.0" @@ -3494,15 +3474,15 @@ content-hash@^2.5.2: multicodec "^0.5.5" multihashes "^0.4.15" -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== cookie@0.5.0: version "0.5.0" @@ -3510,9 +3490,9 @@ cookie@0.5.0: integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== cookiejar@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" - integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== + version "2.1.4" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" + integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw== core-js-pure@^3.0.1: version "3.22.6" @@ -3540,7 +3520,7 @@ cors@^2.8.1: country-data@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/country-data/-/country-data-0.0.31.tgz#80966b8e1d147fa6d6a589d32933f8793774956d" - integrity sha1-gJZrjh0Uf6bWpYnTKTP4eTd0lW0= + integrity sha512-YqlY/i6ikZwoBFfdjK+hJTGaBdTgDpXLI15MCj2UsXZ2cPBb+Kx86AXmDH7PRGt0LUleck0cCgNdWeIhfbcxkQ== dependencies: currency-symbol-map "~2" underscore ">1.4.4" @@ -3595,11 +3575,11 @@ cross-fetch@3.0.4: whatwg-fetch "3.0.0" cross-fetch@^3.0.6: - version "3.1.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" - integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + version "3.1.6" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c" + integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g== dependencies: - node-fetch "2.6.7" + node-fetch "^2.6.11" cross-spawn@^7.0.2: version "7.0.3" @@ -3635,7 +3615,7 @@ crypto-js@^3.1.9-1: currency-symbol-map@~2: version "2.2.0" resolved "https://registry.yarnpkg.com/currency-symbol-map/-/currency-symbol-map-2.2.0.tgz#2b3c1872ff1ac2ce595d8273e58e1fff0272aea2" - integrity sha1-KzwYcv8aws5ZXYJz5Y4f/wJyrqI= + integrity sha512-fPZJ3jqM68+AAgqQ7UaGbgHL/39rp6l7GyqS2k1HJPu/kpS8D07x/+Uup6a9tCUKIlOFcRrDCf1qxSt8jnI5BA== d@1, d@^1.0.1: version "1.0.1" @@ -3694,7 +3674,7 @@ debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3704,7 +3684,7 @@ debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decamelize@^4.0.0: version "4.0.0" @@ -3712,17 +3692,24 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= + integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== dependencies: mimic-response "^1.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" @@ -3755,7 +3742,7 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= + integrity sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw== dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -3783,6 +3770,13 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" +deep-eql@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -3798,6 +3792,11 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + deferred-leveldown@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" @@ -3806,10 +3805,10 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== dependencies: has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -3822,7 +3821,7 @@ delayed-stream@~1.0.0: delimit-stream@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= + integrity sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ== depd@2.0.0: version "2.0.0" @@ -3830,9 +3829,9 @@ depd@2.0.0: integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -3891,9 +3890,9 @@ dotenv@^8.2.0: integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + version "0.1.5" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" + integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== ecc-jsbn@~0.1.1: version "0.1.2" @@ -3906,7 +3905,7 @@ ecc-jsbn@~0.1.1: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== "electrum-client-js@git+https://github.com/keep-network/electrum-client-js.git#v0.1.1": version "0.1.1" @@ -3917,7 +3916,7 @@ ee-first@1.1.1: elliptic@6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= + integrity sha512-cIky9SO2H8W2eU1NOLySnhOYJnuEWCq9ZJeHvHd/lXzEL9vyraIMfilZSn57X3aVX+wkfYmqkch2LvmTzkjFpA== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -3952,15 +3951,10 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encode-utf8@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" - integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== encoding-down@^6.3.0: version "6.3.0" @@ -3979,7 +3973,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5, enquirer@^2.3.6: +enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -4000,34 +3994,59 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.5, es-abstract@^1.20.0: - version "1.20.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" - integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== +es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: + version "1.21.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" + integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== dependencies: + array-buffer-byte-length "^1.0.0" + available-typed-arrays "^1.0.5" call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" - function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.1.1" + get-intrinsic "^1.2.0" get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" + has-proto "^1.0.1" has-symbols "^1.0.3" - internal-slot "^1.0.3" - is-callable "^1.2.4" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" + is-typed-array "^1.1.10" is-weakref "^1.0.2" - object-inspect "^1.12.0" + object-inspect "^1.12.3" object-keys "^1.1.1" - object.assign "^4.1.2" + object.assign "^4.1.4" regexp.prototype.flags "^1.4.3" - string.prototype.trimend "^1.0.5" - string.prototype.trimstart "^1.0.5" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + +es-array-method-boxes-properly@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + +es-set-tostringtag@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" + integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== + dependencies: + get-intrinsic "^1.1.3" + has "^1.0.3" + has-tostringtag "^1.0.0" es-to-primitive@^1.2.1: version "1.2.1" @@ -4072,7 +4091,7 @@ escalade@^3.1.1: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" @@ -4242,12 +4261,12 @@ esutils@^2.0.2: etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= + integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== dependencies: idna-uts46-hx "^2.3.1" js-sha3 "^0.5.7" @@ -4255,7 +4274,7 @@ eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= + integrity sha512-VqEBQKH92jNsaE8lG9CTq8M/bc12gdAfb5MY8Ro1hVyXkh7rOtY3m5tRHK3Hus5HqIAAwU2ivcUjTLVwsvf/kw== dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -4460,40 +4479,40 @@ ethers@^4.0.20: xmlhttprequest "1.8.0" ethers@^5.2.0: - version "5.6.6" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.6.tgz#a37aa7e265a484a1b4d2ef91d4d89d6b43808a57" - integrity sha512-2B2ZmSGvRcJpHnFMBk58mkXP50njFipUBCgLK8jUTFbomhVs501cLzyMU6+Vx8YnUDQxywC3qkZvd33xWS+2FA== + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== dependencies: - "@ethersproject/abi" "5.6.2" - "@ethersproject/abstract-provider" "5.6.0" - "@ethersproject/abstract-signer" "5.6.1" - "@ethersproject/address" "5.6.0" - "@ethersproject/base64" "5.6.0" - "@ethersproject/basex" "5.6.0" - "@ethersproject/bignumber" "5.6.1" - "@ethersproject/bytes" "5.6.1" - "@ethersproject/constants" "5.6.0" - "@ethersproject/contracts" "5.6.1" - "@ethersproject/hash" "5.6.0" - "@ethersproject/hdnode" "5.6.1" - "@ethersproject/json-wallets" "5.6.0" - "@ethersproject/keccak256" "5.6.0" - "@ethersproject/logger" "5.6.0" - "@ethersproject/networks" "5.6.2" - "@ethersproject/pbkdf2" "5.6.0" - "@ethersproject/properties" "5.6.0" - "@ethersproject/providers" "5.6.6" - "@ethersproject/random" "5.6.0" - "@ethersproject/rlp" "5.6.0" - "@ethersproject/sha2" "5.6.0" - "@ethersproject/signing-key" "5.6.1" - "@ethersproject/solidity" "5.6.0" - "@ethersproject/strings" "5.6.0" - "@ethersproject/transactions" "5.6.0" - "@ethersproject/units" "5.6.0" - "@ethersproject/wallet" "5.6.1" - "@ethersproject/web" "5.6.0" - "@ethersproject/wordlists" "5.6.0" + "@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" ethers@^5.5.2: version "5.5.2" @@ -4531,42 +4550,6 @@ ethers@^5.5.2: "@ethersproject/web" "5.5.1" "@ethersproject/wordlists" "5.5.0" -ethers@^5.5.3, ethers@^5.6.8: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4607,13 +4590,13 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: safe-buffer "^5.1.1" express@^4.14.0: - version "4.18.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" - integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.0" + body-parser "1.20.1" content-disposition "0.5.4" content-type "~1.0.4" cookie "0.5.0" @@ -4632,7 +4615,7 @@ express@^4.14.0: parseurl "~1.3.3" path-to-regexp "0.1.7" proxy-addr "~2.0.7" - qs "6.10.3" + qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" send "0.18.0" @@ -4706,7 +4689,7 @@ fastq@^1.6.0: fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= + integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== dependencies: pend "~1.2.0" @@ -4720,12 +4703,12 @@ file-entry-cache@^6.0.1: file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= + integrity sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA== file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha1-LdvqfHP/42No365J3DOMBYwritY= + integrity sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ== file-type@^6.1.0: version "6.2.0" @@ -4790,7 +4773,7 @@ find-up@^1.0.0: find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== dependencies: locate-path "^2.0.0" @@ -4819,13 +4802,6 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== -fmix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" - integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w== - dependencies: - imul "^1.0.0" - follow-redirects@1.5.10: version "1.5.10" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" @@ -4833,11 +4809,6 @@ follow-redirects@1.5.10: dependencies: debug "=3.1.0" -follow-redirects@^1.14.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" - integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== - for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -4859,15 +4830,6 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4890,7 +4852,7 @@ fp-ts@2.1.1: fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== fs-constants@^1.0.0: version "1.0.0" @@ -4908,15 +4870,6 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^10.0.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -4935,16 +4888,6 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -4982,15 +4925,15 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== futoin-hkdf@^1.0.3: - version "1.5.0" - resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.0.tgz#f10cc4d32f1e26568ded58d5a6535a97aa3a064c" - integrity sha512-4CerDhtTgx4i5PKccQIpEp4T9wqmosPIP9Kep35SdCpYkQeriD3zddUVhrO1Fc4QvGhsAnd2rXyoOr5047mJEg== + version "1.5.2" + resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.2.tgz#d316623d29f45fe5e6f136f435eccd74096bf676" + integrity sha512-Bnytx8kQJQoEAPGgTZw3kVPy8e/n9CDftPzc0okgaujmbdF1x7w8wg+u2xS0CML233HgruNk6VQW28CzuUFMKw== ganache@7.0.3: version "7.0.3" @@ -5021,14 +4964,15 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== dependencies: function-bind "^1.1.1" has "^1.0.3" - has-symbols "^1.0.1" + has-proto "^1.0.1" + has-symbols "^1.0.3" get-stdin@^6.0.0: version "6.0.0" @@ -5038,7 +4982,7 @@ get-stdin@^6.0.0: get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= + integrity sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA== dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -5046,7 +4990,7 @@ get-stream@^2.2.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== get-stream@^4.1.0: version "4.1.0" @@ -5135,6 +5079,13 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@^11.0.3: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" @@ -5148,9 +5099,16 @@ globby@^11.0.3: slash "^3.0.0" google-libphonenumber@^3.2.15, google-libphonenumber@^3.2.4: - version "3.2.27" - resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.27.tgz#06a0c1d42be712a6fd4189e2e3b07fc36cacee01" - integrity sha512-et3QlrfWemNPhyUfXZmJG8TfzitfAN71ygNI15+B35zNge/7vyZxkpDsc13oninkf8RAtN2kNEzvMr4L1n3vfQ== + version "3.2.32" + resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.32.tgz#63c48a9c247b64a3bc2eec21bdf3fcfbf2e148c0" + integrity sha512-mcNgakausov/B/eTgVeX8qc8IwWjRrupk9UzZZ/QDEvdh5fAjE7Aa211bkZpZj42zKkeS6MTT8avHUwjcLxuGQ== + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" got@9.6.0: version "9.6.0" @@ -5169,6 +5127,23 @@ got@9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" +got@^11.8.5: + version "11.8.6" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" + integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" @@ -5189,7 +5164,12 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.10: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5212,25 +5192,6 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -hardhat-deploy@^0.11.10: - version "0.11.22" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.22.tgz#9799c0266a0fc40c84690de54760f1b4dae5e487" - integrity sha512-ZhHVNB7Jo2l8Is+KIAk9F8Q3d7pptyiX+nsNbIFXztCz81kaP+6kxNODRBqRCy7SOD3It4+iKCL6tWsPAA/jVQ== - dependencies: - "@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.8.1" - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -5253,12 +5214,17 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -5329,9 +5295,9 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== http-errors@2.0.0: version "2.0.0" @@ -5347,7 +5313,7 @@ http-errors@2.0.0: http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= + integrity sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg== http-signature@~1.2.0: version "1.2.0" @@ -5358,6 +5324,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -5405,11 +5379,6 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -imul@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" - integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5428,12 +5397,12 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== dependencies: - get-intrinsic "^1.1.0" + get-intrinsic "^1.2.0" has "^1.0.3" side-channel "^1.0.4" @@ -5467,6 +5436,15 @@ is-arguments@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -5499,10 +5477,10 @@ is-buffer@^2.0.2, is-buffer@^2.0.5, is-buffer@~2.0.3: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== is-core-module@^2.8.1: version "2.9.0" @@ -5533,7 +5511,7 @@ is-fullwidth-code-point@^1.0.0: is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -5567,7 +5545,7 @@ is-hex-prefixed@1.0.0: is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= + integrity sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ== is-negative-zero@^2.0.2: version "2.0.2" @@ -5594,7 +5572,7 @@ is-object@^1.0.1: is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== is-plain-obj@^2.1.0: version "2.1.0" @@ -5624,7 +5602,7 @@ is-shared-array-buffer@^1.0.2: is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" @@ -5640,15 +5618,15 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.3, is-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.9.tgz#246d77d2871e7d9f5aeb1d54b9f52c71329ece67" - integrity sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A== +is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: + version "1.1.10" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" + integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" - es-abstract "^1.20.0" for-each "^0.3.3" + gopd "^1.0.1" has-tostringtag "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: @@ -5678,10 +5656,15 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== isexe@^2.0.0: version "2.0.0" @@ -5704,7 +5687,7 @@ isurl@^1.0.0-alpha5: js-sha3@0.5.7, js-sha3@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= + integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" @@ -5731,7 +5714,7 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.1, js-yaml@^3.14.0: +js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5747,7 +5730,12 @@ jsbn@~0.1.0: json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= + integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== json-schema-traverse@^0.4.1: version "0.4.1" @@ -5777,7 +5765,7 @@ json-stringify-safe@~5.0.1: json-text-sequence@^0.1: version "0.1.1" resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= + integrity sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w== dependencies: delimit-stream "0.1.0" @@ -5795,15 +5783,6 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -5831,7 +5810,7 @@ keccak@3.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -keccak@^3.0.0, keccak@^3.0.2: +keccak@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== @@ -5840,6 +5819,15 @@ keccak@^3.0.0, keccak@^3.0.2: node-gyp-build "^4.2.0" readable-stream "^3.6.0" +keccak@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" + integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -5847,6 +5835,13 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +keyv@^4.0.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" + integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== + dependencies: + json-buffer "3.0.1" + klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" @@ -5979,7 +5974,7 @@ load-json-file@^1.0.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -6047,9 +6042,9 @@ loose-envify@^1.0.0: js-tokens "^3.0.0 || ^4.0.0" loupe@^2.3.1: - version "2.3.4" - resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3" - integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== + version "2.3.6" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" + integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== dependencies: get-func-name "^2.0.0" @@ -6094,11 +6089,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -match-all@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" - integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== - mcl-wasm@^0.7.1: version "0.7.9" resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" @@ -6116,7 +6106,7 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== memdown@^5.0.0: version "5.1.0" @@ -6138,7 +6128,7 @@ memorystream@^0.3.1: merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== merge2@^1.3.0: version "1.4.1" @@ -6160,7 +6150,7 @@ merkle-patricia-tree@^4.2.2, merkle-patricia-tree@^4.2.4: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== micromatch@^4.0.4: version "4.0.4" @@ -6205,10 +6195,15 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= + integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== dependencies: dom-walk "^0.1.0" @@ -6229,7 +6224,12 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== @@ -6252,14 +6252,14 @@ minizlib@^1.3.3: mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= + integrity sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w== dependencies: mkdirp "*" -mkdirp@*, mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mkdirp@*: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== mkdirp@0.5.4: version "0.5.4" @@ -6275,6 +6275,11 @@ mkdirp@^0.5.1, mkdirp@^0.5.5: dependencies: minimist "^1.2.6" +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + mocha@^6.2.2: version "6.2.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" @@ -6399,23 +6404,14 @@ multihashes@^0.4.15, multihashes@~0.4.15: multibase "^0.7.0" varint "^5.0.0" -murmur-128@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" - integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== - dependencies: - encode-utf8 "^1.0.2" - fmix "^0.1.0" - imul "^1.0.0" - "n64@git+https://github.com/chjj/n64.git#semver:~0.2.10": version "0.2.10" resolved "git+https://github.com/chjj/n64.git#34f981f1441f569821d97a31f8cf21a3fc11b8f6" nan@^2.13.2, nan@^2.14.0: - version "2.15.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" - integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + version "2.17.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" + integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== "nan@git+https://github.com/braydonf/nan.git#semver:=2.14.0": version "2.14.0" @@ -6424,7 +6420,7 @@ nan@^2.13.2, nan@^2.14.0: nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= + integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== nanoid@3.1.25: version "3.1.25" @@ -6469,7 +6465,14 @@ node-fetch@2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-fetch@2.6.7, node-fetch@^2.6.7: +node-fetch@^2.6.11: + version "2.6.11" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" + integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -6511,6 +6514,11 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -6527,7 +6535,7 @@ number-to-bn@1.7.0: numeral@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506" - integrity sha1-StCAk21EPCVhrtnyGX7//iX05QY= + integrity sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA== oauth-sign@~0.9.0: version "0.9.0" @@ -6537,12 +6545,12 @@ oauth-sign@~0.9.0: object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.0, object-inspect@^1.9.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== +object-inspect@^1.12.3, object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== object-keys@^1.0.11, object-keys@^1.1.1: version "1.1.1" @@ -6559,36 +6567,38 @@ object.assign@4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== +object.assign@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" - integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== + version "2.1.6" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz#5e5c384dd209fa4efffead39e3a0512770ccc312" + integrity sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ== dependencies: + array.prototype.reduce "^1.0.5" call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.2.0" + es-abstract "^1.21.2" + safe-array-concat "^1.0.0" oboe@2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" - integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= + integrity sha512-ymBJ4xSC6GBXLT9Y7lirj+xbqBLa+jADGJldGEYG7u8sZbS9GyG+u1Xk9c5cbriKwSpCg41qUhPjvU5xOpvIyQ== dependencies: http-https "^1.0.0" oboe@2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha1-VVQoTFQ6ImbXo48X4HOCH73jk80= + integrity sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA== dependencies: http-https "^1.0.0" @@ -6657,10 +6667,15 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== p-limit@^1.1.0: version "1.3.0" @@ -6686,7 +6701,7 @@ p-limit@^3.0.2: p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== dependencies: p-limit "^1.1.0" @@ -6707,7 +6722,7 @@ p-locate@^5.0.0: p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= + integrity sha512-gb0ryzr+K2qFqFv6qi3khoeqMZF/+ajxQipEF6NteZVnvz9tzdsfAVj3lYtn1gAXvH5lfLwfxEII799gt/mRIA== dependencies: p-finally "^1.0.0" @@ -6719,7 +6734,7 @@ p-timeout@^4.1.0: p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== p-try@^2.0.0: version "2.2.0" @@ -6776,7 +6791,7 @@ path-exists@^2.0.0: path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: version "4.0.0" @@ -6801,7 +6816,7 @@ path-parse@^1.0.7: path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== path-type@^1.0.0: version "1.1.0" @@ -6836,7 +6851,7 @@ pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= + integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== performance-now@^2.1.0: version "2.1.0" @@ -6851,12 +6866,12 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== pinkie-promise@^2.0.0: version "2.0.1" @@ -6878,12 +6893,12 @@ prelude-ls@^1.2.1: prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= + integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== prettier-linter-helpers@^1.0.0: version "1.0.0" @@ -6910,7 +6925,7 @@ process-nextick-args@~2.0.0: process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== progress@^2.0.0: version "2.0.3" @@ -6970,14 +6985,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.10.3: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== - dependencies: - side-channel "^1.0.4" - -qs@^6.9.4: +qs@6.11.0: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== @@ -7008,6 +7016,11 @@ queue-microtask@^1.2.2, queue-microtask@^1.2.3: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -7038,6 +7051,16 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -7056,9 +7079,9 @@ read-pkg@^1.0.0: path-type "^1.0.0" readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7090,13 +7113,13 @@ reduce-flatten@^2.0.0: integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== regexp.prototype.flags@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" - integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + version "1.5.0" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" + integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - functions-have-names "^1.2.2" + define-properties "^1.2.0" + functions-have-names "^1.2.3" regexpp@^3.1.0: version "3.2.0" @@ -7154,6 +7177,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -7171,10 +7199,17 @@ resolve@^1.10.0: responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= + integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== dependencies: lowercase-keys "^1.0.0" +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== + dependencies: + lowercase-keys "^2.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -7243,6 +7278,16 @@ rxjs@6: dependencies: tslib "^1.9.0" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -7253,6 +7298,15 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-regex-test@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" + integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + is-regex "^1.1.4" + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -7261,7 +7315,7 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= + integrity sha512-d8DzQxNivoNDogyYmb/9RD5mEQE/Q7vG2dLDUgvfPmKL9xCVzgqUntOdS0me9Cq9Sh9VxIZuoNEFcsfyXRnyUw== scrypt-js@2.0.4: version "2.0.4" @@ -7392,7 +7446,7 @@ set-blocking@^2.0.0: setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= + integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== setimmediate@^1.0.5: version "1.0.5" @@ -7567,7 +7621,7 @@ statuses@2.0.1: strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= + integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== string-format@^2.0.0: version "2.0.0" @@ -7609,23 +7663,32 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" -string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== +string.prototype.trimend@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + +string.prototype.trimstart@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string_decoder@^1.1.1: version "1.3.0" @@ -7651,7 +7714,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== dependencies: ansi-regex "^3.0.0" @@ -7693,7 +7756,7 @@ strip-hex-prefix@1.0.0: strip-json-comments@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" @@ -7752,15 +7815,15 @@ swarm-js@0.1.39: xhr-request-promise "^0.1.2" swarm-js@^0.1.40: - version "0.1.40" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" - integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== + version "0.1.42" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" + integrity sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ== dependencies: bluebird "^3.5.0" buffer "^5.0.5" eth-lib "^0.1.26" fs-extra "^4.0.2" - got "^7.1.0" + got "^11.8.5" mime-types "^2.1.16" mkdirp-promise "^5.0.1" mock-fs "^4.1.0" @@ -7828,12 +7891,12 @@ text-table@^0.2.0: through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== tiny-secp256k1@^1.1.3: version "1.1.6" @@ -7951,7 +8014,7 @@ tslib@^1.8.1, tslib@^1.9.0: tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== tsutils@^3.21.0: version "3.21.0" @@ -8039,6 +8102,15 @@ typechain@^8.1.1: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" +typed-array-length@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + is-typed-array "^1.1.9" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -8105,24 +8177,19 @@ underscore@1.9.1: integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== underscore@>1.4.4: - version "1.13.3" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.3.tgz#54bc95f7648c5557897e5e968d0f76bc062c34ee" - integrity sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA== + version "1.13.6" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== uri-js@^4.2.2: version "4.4.1" @@ -8134,26 +8201,26 @@ uri-js@^4.2.2: url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + integrity sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA== dependencies: prepend-http "^1.0.1" url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= + integrity sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ== dependencies: prepend-http "^2.0.0" url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= + integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= + integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== url@^0.11.0: version "0.11.0" @@ -8188,26 +8255,25 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util@^0.12.0: - version "0.12.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" - integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== dependencies: inherits "^2.0.3" is-arguments "^1.0.4" is-generator-function "^1.0.7" is-typed-array "^1.1.3" - safe-buffer "^5.1.2" which-typed-array "^1.1.2" utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= + integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== uuid@3.3.2: version "3.3.2" @@ -8240,7 +8306,7 @@ varint@^5.0.0: vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== verror@1.10.0: version "1.10.0" @@ -9038,21 +9104,21 @@ which-module@^1.0.0: integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + version "2.0.1" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" + integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.2: - version "1.1.8" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.8.tgz#0cfd53401a6f334d90ed1125754a42ed663eb01f" - integrity sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw== +which-typed-array@^1.1.2, which-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" + integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" - es-abstract "^1.20.0" for-each "^0.3.3" + gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.9" + is-typed-array "^1.1.10" which@1.3.1: version "1.3.1" @@ -9078,7 +9144,7 @@ wide-align@1.1.3: wif@2.0.6, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" - integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= + integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== dependencies: bs58check "<3.0.0" @@ -9173,7 +9239,7 @@ xhr-request@^1.0.1, xhr-request@^1.1.0: xhr2-cookies@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= + integrity sha512-hjXUA6q+jl/bd8ADHcVfFsSPIf+tyLIjuO9TwJC9WI6JP2zKcS7C+p56I9kCLLsaCiNT035iYvEUUzdEFj/8+g== dependencies: cookiejar "^2.1.1" @@ -9190,7 +9256,7 @@ xhr@^2.0.4, xhr@^2.3.3: xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= + integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0: version "4.0.2" @@ -9324,7 +9390,7 @@ yargs@^4.7.1: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= + integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" @@ -9338,8 +9404,3 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zksync-web3@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" - integrity sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw== From b62ab4c1410eca2098363487e58e4197ebf11363 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 9 Jun 2023 08:00:08 +0200 Subject: [PATCH 117/198] Update the `TBTCToken` interface Add the `approveAndCall` function that calls `receiveApproval` function on spender previously approving the spender to withdraw from the caller multiple times, up to the `amount` amount. If this function is called again, it overwrites the current allowance with `amount`. We need this function because we want to call redemption request in one tx instead of two(approve + requestRedemption). --- typescript/src/chain.ts | 16 ++++++++++++++++ typescript/src/ethereum.ts | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index dae8606d2..61c8d71bb 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -396,4 +396,20 @@ export interface TBTCToken { // TODO: Consider adding a custom type to handle conversion from ERC with 1e18 // precision to Bitcoin in 1e8 precision (satoshi). totalSupply(blockNumber?: number): Promise + + /** + * Calls `receiveApproval` function on spender previously approving the spender + * to withdraw from the caller multiple times, up to the `amount` amount. If + * this function is called again, it overwrites the current allowance with + * `amount`. + * @param spender Address of contract authorized to spend. + * @param amount The max amount they can spend. + * @param extraData Extra information to send to the approved contract. + * @returns Transaction hash of the approve and call transaction. + */ + approveAndCall( + spender: Identifier, + amount: BigNumber, + extraData: Hex + ): Promise } diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 69cf0c86e..32deceee3 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -1099,4 +1099,20 @@ export class TBTCToken blockTag: blockNumber ?? "latest", }) } + + async approveAndCall( + spender: ChainIdentifier, + amount: BigNumber, + extraData: Hex + ): Promise { + const tx = await sendWithRetry(async () => { + return await this._instance.approveAndCall( + spender.identifierHex, + amount, + extraData.toPrefixedString() + ) + }, this._totalRetryAttempts) + + return Hex.from(tx.hash) + } } From bc7bf177f7db0102112eff8c6dbf5d3fe5c61296 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 9 Jun 2023 08:35:25 +0200 Subject: [PATCH 118/198] Update the `Bridge` interface Add the `buildRedemptionData` fn that builds the redemption data required to request a redemption via `TBTCToken.approveAndCall` function. The built data should be passed as `extraData` to this function. --- typescript/src/chain.ts | 20 ++++++++++ typescript/src/ethereum.ts | 77 ++++++++++++++++++++++++++++++++++---- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index 61c8d71bb..4d76fbbd3 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -244,6 +244,26 @@ export interface Bridge { * Returns the attached WalletRegistry instance. */ walletRegistry(): Promise + + /** + * Builds the redemption data required to request a redemption via + * @see TBTCToken#approveAndCall - the built data should be passed as + * `extraData` the @see TBTCToken#approveAndCall function. + * @param redeemer On-chain identifier of the redeemer. + * @param walletPublicKey The Bitcoin public key of the wallet. Must be in the + * compressed form (33 bytes long with 02 or 03 prefix). + * @param mainUtxo The main UTXO of the wallet. Must match the main UTXO + * held by the on-chain Bridge contract. + * @param redeemerOutputScript The output script that the redeemed funds will + * be locked to. Must be un-prefixed and not prepended with length. + * @returns The + */ + buildRedemptionData( + redeemer: Identifier, + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string + ): Hex } /** diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 32deceee3..2c3c96260 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -488,6 +488,39 @@ export class Bridge redeemerOutputScript: string, amount: BigNumber ): Promise { + const redemptionData = this.parseRequestRedemptionTransactionData( + walletPublicKey, + mainUtxo, + redeemerOutputScript + ) + + await sendWithRetry(async () => { + return await this._instance.requestRedemption( + redemptionData.walletPublicKeyHash, + redemptionData.mainUtxo, + redemptionData.prefixedRawRedeemerOutputScript, + amount + ) + }, this._totalRetryAttempts) + } + + /** + * Parses the request redemption data to the proper form. + * @param walletPublicKey - The Bitcoin public key of the wallet. Must be in + * the compressed form (33 bytes long with 02 or 03 prefix). + * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO + * held by the on-chain contract. + * @param redeemerOutputScript - The output script that the redeemed funds + * will be locked to. Must be un-prefixed and not prepended with + * length. + * @returns Parsed data that can be passed to the contract to request + * redemption. + */ + private parseRequestRedemptionTransactionData = ( + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string + ) => { const walletPublicKeyHash = `0x${computeHash160(walletPublicKey)}` const mainUtxoParam = { @@ -506,14 +539,11 @@ export class Bridge rawRedeemerOutputScript, ]).toString("hex")}` - await sendWithRetry(async () => { - return await this._instance.requestRedemption( - walletPublicKeyHash, - mainUtxoParam, - prefixedRawRedeemerOutputScript, - amount - ) - }, this._totalRetryAttempts) + return { + walletPublicKeyHash, + mainUtxo: mainUtxoParam, + prefixedRawRedeemerOutputScript, + } } // eslint-disable-next-line valid-jsdoc @@ -694,6 +724,37 @@ export class Bridge signerOrProvider: this._instance.signer || this._instance.provider, }) } + + // eslint-disable-next-line valid-jsdoc + /** + * @see {ChainBridge#buildRedemptionData} + */ + buildRedemptionData( + redeemer: ChainIdentifier, + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string + ): Hex { + const redemptionData = this.parseRequestRedemptionTransactionData( + walletPublicKey, + mainUtxo, + redeemerOutputScript + ) + + return Hex.from( + utils.defaultAbiCoder.encode( + ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], + [ + redeemer.identifierHex, + redemptionData.walletPublicKeyHash, + redemptionData.mainUtxo.txHash, + redemptionData.mainUtxo.txOutputIndex, + redemptionData.mainUtxo.txOutputValue, + redemptionData.prefixedRawRedeemerOutputScript, + ] + ) + ) + } } /** From 9605398dc922445b9a122021126aa1d85d896150 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 9 Jun 2023 08:37:24 +0200 Subject: [PATCH 119/198] Refactor `requestRedemption` fn Request a redemption via `TBTCToken` interface using the `approveAndCall` function- thanks to this we can request redemption in one transaction. --- typescript/src/redemption.ts | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index ec96659d5..fd1f0325f 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -8,8 +8,9 @@ import { Client as BitcoinClient, TransactionHash, } from "./bitcoin" -import { Bridge, Identifier } from "./chain" +import { Bridge, Identifier, TBTCToken } from "./chain" import { assembleTransactionProof } from "./proof" +import { Hex } from "./hex" /** * Represents a redemption request. @@ -55,29 +56,39 @@ export interface RedemptionRequest { /** * Requests a redemption from the on-chain Bridge contract. + * @param redeemer - On-chain identifier of the redeemer. * @param walletPublicKey - The Bitcoin public key of the wallet. Must be in the * compressed form (33 bytes long with 02 or 03 prefix). - * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO - * held by the on-chain Bridge contract. + * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO held + * by the on-chain Bridge contract. * @param redeemerOutputScript - The output script that the redeemed funds will * be locked to. Must be un-prefixed and not prepended with length. - * @param amount - The amount to be redeemed in satoshis. + * @param amount - The amount to be redeemed with the precision of the tBTC + * on-chain token contract. + * @param vault - The vault address. * @param bridge - Handle to the Bridge on-chain contract. - * @returns Empty promise. + * @param tBTCToken - Handle to the TBTCToken on-chain contract. + * @returns Transaction hash of the request redemption transaction. */ export async function requestRedemption( + redeemer: Identifier, walletPublicKey: string, mainUtxo: UnspentTransactionOutput, redeemerOutputScript: string, amount: BigNumber, - bridge: Bridge -): Promise { - await bridge.requestRedemption( + vault: Identifier, + bridge: Bridge, + tBTCToken: TBTCToken +): Promise { + const redemptionData = bridge.buildRedemptionData( + redeemer, walletPublicKey, mainUtxo, - redeemerOutputScript, - amount + // TODO: We should pass `redeemerOutputScript` in that form. + bcoin.Script.fromAddress(redeemerOutputScript).toRaw().toString("hex") ) + + return await tBTCToken.approveAndCall(vault, amount, redemptionData) } /** From c64f0b7409b9db0e9711a7cd29763955e5da1e24 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 9 Jun 2023 11:27:59 +0200 Subject: [PATCH 120/198] Update the `findWalletForRedemption` fn Keep the wallet data in object instead of variables and return the `walletPublicKey`(compressed public key of the ECDSA Wallet) instead of the hash(20-byte public key hash of the ECDSA Wallet) because the compressed public key is required in `requestRedemption` fn. --- typescript/src/redemption.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 6256b3057..093d2975d 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -424,17 +424,25 @@ export async function findWalletForRedemption( bitcoinClient: BitcoinClient, bitcoinNetwork: BitcoinNetwork ): Promise<{ - walletPublicKeyHash: string + walletPublicKey: string mainUTXO: UnspentTransactionOutput }> { const wallets = await bridge.getNewWalletRegisteredEvents() - let walletPublicKeyHash - let mainUTXO + let walletData: + | { + walletPublicKey: string + mainUTXO: UnspentTransactionOutput + } + | undefined = undefined let maxAmount = BigNumber.from(0) + for (const wallet of wallets) { - const _walletPublicKeyHash = wallet.walletPublicKeyHash.toPrefixedString() - const { state, mainUtxoHash } = await bridge.wallets(_walletPublicKeyHash) + const prefixedWalletPublicKeyHash = + wallet.walletPublicKeyHash.toPrefixedString() + const { state, mainUtxoHash, walletPublicKey } = await bridge.wallets( + prefixedWalletPublicKeyHash + ) // Wallet must be in Live state. if (state !== WalletState.Live) continue @@ -461,17 +469,19 @@ export async function findWalletForRedemption( maxAmount = utxo.value.gt(maxAmount) ? utxo.value : maxAmount if (utxo.value.gte(amount)) { - walletPublicKeyHash = _walletPublicKeyHash - mainUTXO = utxo + walletData = { + walletPublicKey: walletPublicKey.toString(), + mainUTXO: utxo, + } break } } - if (!walletPublicKeyHash || !mainUTXO) + if (!walletData) throw new Error( `Could not find a wallet with enough funds. Maximum redemption amount is ${maxAmount} Satoshi.` ) - return { walletPublicKeyHash, mainUTXO } + return walletData } From c5131877b9d6bd9b2815b6eced6a0793fbe78420 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 12 Jun 2023 15:02:54 +0200 Subject: [PATCH 121/198] Expose `submitRedemptionProposal` function Here we expose a function allowing to submit a redemption proposal along with some initial parameters meant to steer the redemption proposal process. --- .../contracts/bridge/WalletCoordinator.sol | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 3f56171b7..c84dbd1a7 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -120,6 +120,19 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { bytes4 refundLocktime; } + /// @notice Helper structure representing a redemption proposal. + struct RedemptionProposal { + // 20-byte public key hash of the target wallet. + bytes20 walletPubKeyHash; + // Array of the redeemers' output scripts that should be part of + // the redemption. Each output script MUST BE prefixed by its byte + // length, i.e. passed in the exactly same format as during the + // `Bridge.requestRedemption` transaction. + bytes[] redeemersOutputScripts; + // Proposed BTC fee for the entire transaction. + uint256 redemptionTxFee; + } + /// @notice Mapping that holds addresses allowed to submit proposals and /// request heartbeats. mapping(address => bool) public isCoordinator; @@ -195,6 +208,22 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// the current conditions. uint32 public depositSweepProposalSubmissionGasOffset; + /// @notice Determines the redemption proposal validity time. In other + /// words, this is the worst-case time for a redemption during + /// which the wallet is busy and cannot take another actions. This + /// is also the duration of the time lock applied to the wallet + /// once a new redemption proposal is submitted. + /// + /// For example, if a redemption proposal was submitted at + /// 2 pm and redemptionProposalValidity is 2 hours, the next + /// proposal (of any type) can be submitted after 4 pm. + uint32 public redemptionProposalValidity; + + /// @notice Gas that is meant to balance the redemption proposal + /// submission overall cost. Can be updated by the owner based on + /// the current conditions. + uint32 public redemptionProposalSubmissionGasOffset; + event CoordinatorAdded(address indexed coordinator); event CoordinatorRemoved(address indexed coordinator); @@ -225,6 +254,16 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { address indexed coordinator ); + event RedemptionProposalParametersUpdated( + uint32 redemptionProposalValidity, + uint32 redemptionProposalSubmissionGasOffset + ); + + event RedemptionProposalSubmitted( + RedemptionProposal proposal, + address indexed coordinator + ); + modifier onlyCoordinator() { require(isCoordinator[msg.sender], "Caller is not a coordinator"); _; @@ -259,6 +298,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { depositRefundSafetyMargin = 24 hours; depositSweepMaxSize = 5; depositSweepProposalSubmissionGasOffset = 20_000; // optimized for 10 inputs + + redemptionProposalValidity = 1 hours; + redemptionProposalSubmissionGasOffset = 20_000; } /// @notice Adds the given address to the set of coordinator addresses. @@ -687,4 +729,82 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { revert("Extra info funding output script does not match"); } + + /// @notice Updates parameters related to redemption proposal. + /// @param _redemptionProposalValidity The new value of `redemptionProposalValidity`. + /// @param _redemptionProposalSubmissionGasOffset The new value of `redemptionProposalSubmissionGasOffset`. + /// @dev Requirements: + /// - The caller must be the owner. + function updateRedemptionProposalParameters( + uint32 _redemptionProposalValidity, + uint32 _redemptionProposalSubmissionGasOffset + ) external onlyOwner { + redemptionProposalValidity = _redemptionProposalValidity; + redemptionProposalSubmissionGasOffset = _redemptionProposalSubmissionGasOffset; + + emit RedemptionProposalParametersUpdated( + _redemptionProposalValidity, + _redemptionProposalSubmissionGasOffset + ); + } + + /// @notice Submits a redemption proposal. Locks the target wallet + /// for a specific time, equal to the proposal validity period. + /// This function does not store the proposal in the state but + /// just emits an event that serves as a guiding light for wallet + /// off-chain members. Wallet members are supposed to validate + /// the proposal on their own, before taking any action. + /// @param proposal The redemption proposal + /// @dev Requirements: + /// - The caller is a coordinator, + /// - The wallet is not time-locked. + function submitRedemptionProposal(RedemptionProposal calldata proposal) + public + onlyCoordinator + onlyAfterWalletLock(proposal.walletPubKeyHash) + { + walletLock[proposal.walletPubKeyHash] = WalletLock( + /* solhint-disable-next-line not-rely-on-time */ + uint32(block.timestamp) + redemptionProposalValidity, + WalletAction.Redemption + ); + + emit RedemptionProposalSubmitted(proposal, msg.sender); + } + + /// @notice Wraps `submitRedemptionProposal` call and reimburses the + /// caller's transaction cost. + /// @dev See `submitRedemptionProposal` function documentation. + function submitRedemptionProposalWithReimbursement( + RedemptionProposal calldata proposal + ) external { + uint256 gasStart = gasleft(); + + submitRedemptionProposal(proposal); + + reimbursementPool.refund( + (gasStart - gasleft()) + redemptionProposalSubmissionGasOffset, + msg.sender + ); + } + + /// @notice View function encapsulating the main rules of a valid redemption + /// proposal. This function is meant to facilitate the off-chain + /// validation of the incoming proposals. Thanks to it, most + /// of the work can be done using a single readonly contract call. + /// @param proposal The redemption proposal to validate. + /// @return True if the proposal is valid. Reverts otherwise. + /// @dev Requirements: + /// - To be determined + function validateRedemptionProposal() + external + view + returns ( + // RedemptionProposal calldata proposal + bool + ) + { + // TODO: Implementation. + revert("not implemented yet"); + } } From b52d529c2a16cfa1e54b5ac11b63d544642faba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 13 Jun 2023 10:49:01 +0200 Subject: [PATCH 122/198] Fix commiter's email The correct noreply address for Valkyrie contains the `users.` part. --- .github/workflows/contracts-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 574ed45f3..142f2fc4f 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -79,7 +79,7 @@ jobs: destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBaseBranch: main - userEmail: 8324465+thesis-valkyrie@noreply.github.com + userEmail: 8324465+thesis-valkyrie@users.noreply.github.com userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} From 26948132dfb50df39897573ffb95a7685c4e9cd9 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 13 Jun 2023 18:24:20 +0200 Subject: [PATCH 123/198] Revert "Don't run postinstall script separately from yarn install" This reverts commit 2c7c63e15e3b7af800710770a458f93ff67eb1cc. --- monitoring/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitoring/Dockerfile b/monitoring/Dockerfile index b65cbb238..2212d741e 100644 --- a/monitoring/Dockerfile +++ b/monitoring/Dockerfile @@ -24,7 +24,8 @@ COPY package.json yarn.lock ./ COPY tsconfig.json ./ COPY src ./src -RUN yarn install --frozen-lockfile +RUN yarn install --frozen-lockfile --ignore-scripts +RUN yarn run postinstall RUN yarn build From bc7ef6f7246ade93f03daf2aeaa7e8186e26bd1b Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 14 Jun 2023 09:41:30 +0200 Subject: [PATCH 124/198] Update `requestRedemption` fn For testing purposes, we were passing the BTC address as `redeemerOutputScript` and then created the output script based on this address. Here we remove this code snipped because the output script that the redeemed funds will be locked to is expected to be un-prefixed and not prepended with length and we should pass the output script in a proper form to the `requestRedemption` function. --- typescript/src/redemption.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index fd1f0325f..6742e70fb 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -84,8 +84,7 @@ export async function requestRedemption( redeemer, walletPublicKey, mainUtxo, - // TODO: We should pass `redeemerOutputScript` in that form. - bcoin.Script.fromAddress(redeemerOutputScript).toRaw().toString("hex") + redeemerOutputScript ) return await tBTCToken.approveAndCall(vault, amount, redemptionData) From 0dbddae5bb48f2654f79dcc088b04c65e464e52d Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 14 Jun 2023 09:49:12 +0200 Subject: [PATCH 125/198] Add bitcoin helper function That creates the output script from the BTC address. --- typescript/src/bitcoin.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index 98b8e0e27..f4bcdbdb5 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -1,4 +1,4 @@ -import bcoin, { TX } from "bcoin" +import bcoin, { TX, Script } from "bcoin" import wif from "wif" import bufio from "bufio" import hash160 from "bcrypto/lib/hash160" @@ -603,3 +603,12 @@ export function locktimeToNumber(locktimeLE: Buffer | string): number { const locktimeBE: Buffer = Hex.from(locktimeLE).reverse().toBuffer() return BigNumber.from(locktimeBE).toNumber() } + +/** + * Creates the output script from the BTC address. + * @param address BTC address. + * @returns The un-prefixed and not prepended with length otput script. + */ +export function createOutputScriptFromAddress(address: string): string { + return Script.fromAddress(address).toRaw().toString("hex") +} From 0fdb9c69ed340e44edd5830953519462d857a9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Wed, 14 Jun 2023 14:02:08 +0200 Subject: [PATCH 126/198] Revert changes to the `tbtc-v2.ts`'s lockfile We decided to deliver the changes as part of a separate PR. --- typescript/yarn.lock | 1427 ++++++++++++++++++++---------------------- 1 file changed, 683 insertions(+), 744 deletions(-) diff --git a/typescript/yarn.lock b/typescript/yarn.lock index 1d40622e0..2378ac9e1 100644 --- a/typescript/yarn.lock +++ b/typescript/yarn.lock @@ -391,6 +391,21 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" +"@ethersproject/abi@5.6.2", "@ethersproject/abi@^5.6.0", "@ethersproject/abi@^5.6.1": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.2.tgz#f2956f2ac724cd720e581759d9e3840cd9744818" + integrity sha512-40Ixjhy+YzFtnvzIqFU13FW9hd1gMoLa3cJfSDnfnL4o8EnEG1qLiV8sNJo3sHYi9UYMfFeRuZ7kv5+vhzU7gQ== + dependencies: + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -406,21 +421,6 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/abi@^5.6.0", "@ethersproject/abi@^5.6.1": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.2.tgz#f2956f2ac724cd720e581759d9e3840cd9744818" - integrity sha512-40Ixjhy+YzFtnvzIqFU13FW9hd1gMoLa3cJfSDnfnL4o8EnEG1qLiV8sNJo3sHYi9UYMfFeRuZ7kv5+vhzU7gQ== - dependencies: - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/hash" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/abstract-provider@5.5.1", "@ethersproject/abstract-provider@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" @@ -482,6 +482,17 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" +"@ethersproject/abstract-signer@5.6.1", "@ethersproject/abstract-signer@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.1.tgz#54df786bdf1aabe20d0ed508ec05e0aa2d06674f" + integrity sha512-xhSLo6y0nGJS7NxfvOSzCaWKvWb1TLT7dQ0nnpHZrDnC67xfnWm9NXflTMFPUXXMtjr33CdV0kWDEmnbrQZ74Q== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" @@ -493,17 +504,6 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/abstract-signer@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.1.tgz#54df786bdf1aabe20d0ed508ec05e0aa2d06674f" - integrity sha512-xhSLo6y0nGJS7NxfvOSzCaWKvWb1TLT7dQ0nnpHZrDnC67xfnWm9NXflTMFPUXXMtjr33CdV0kWDEmnbrQZ74Q== - dependencies: - "@ethersproject/abstract-provider" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/address@5.5.0", "@ethersproject/address@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" @@ -515,7 +515,7 @@ "@ethersproject/logger" "^5.5.0" "@ethersproject/rlp" "^5.5.0" -"@ethersproject/address@5.6.0", "@ethersproject/address@^5.6.0": +"@ethersproject/address@5.6.0", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.0.tgz#13c49836d73e7885fc148ad633afad729da25012" integrity sha512-6nvhYXjbXsHPS+30sHZ+U4VMagFC/9zAk6Gd/h3S21YW4+yfb0WfRtaAIZ4kfM4rrVwqiy284LP0GtL5HXGLxQ== @@ -526,7 +526,7 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.0" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.4", "@ethersproject/address@^5.7.0": +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -600,16 +600,7 @@ "@ethersproject/logger" "^5.6.0" bn.js "^4.11.9" -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" - integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - bn.js "^5.2.1" - -"@ethersproject/bignumber@^5.6.0": +"@ethersproject/bignumber@5.6.1", "@ethersproject/bignumber@^5.0.7", "@ethersproject/bignumber@^5.6.0": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.1.tgz#d5e0da518eb82ab8d08ca9db501888bbf5f0c8fb" integrity sha512-UtMeZ3GaUuF9sx2u9nPZiPP3ULcAFmXyvynR7oHl/tPrM+vldZh7ocMsoa1PqKYGnQnqUZJoqxZnGN6J0qdipA== @@ -618,6 +609,15 @@ "@ethersproject/logger" "^5.6.0" bn.js "^4.11.9" +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + "@ethersproject/bytes@5.5.0", "@ethersproject/bytes@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" @@ -625,14 +625,14 @@ dependencies: "@ethersproject/logger" "^5.5.0" -"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.6.0", "@ethersproject/bytes@^5.6.1": +"@ethersproject/bytes@5.6.1", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.6.0", "@ethersproject/bytes@^5.6.1": version "5.6.1" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7" integrity sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.0.4", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== @@ -646,14 +646,14 @@ dependencies: "@ethersproject/bignumber" "^5.5.0" -"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.6.0": +"@ethersproject/constants@5.6.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.0.tgz#55e3eb0918584d3acc0688e9958b0cedef297088" integrity sha512-SrdaJx2bK0WQl23nSpV/b1aq293Lh0sUaZT/yYKPDKn4tlAbkH96SPJwIhwSwTsoQQZxuh1jnqsKwyymoiBdWA== dependencies: "@ethersproject/bignumber" "^5.6.0" -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.0.4", "@ethersproject/constants@^5.7.0": +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== @@ -692,6 +692,22 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/transactions" "^5.6.0" +"@ethersproject/contracts@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.1.tgz#c0eba3f8a2226456f92251a547344fd0593281d2" + integrity sha512-0fpBBDoPqJMsutE6sNjg6pvCJaIcl7tliMQTMRcoUWDACfjO68CpKOJBlsEhEhmzdnu/41KbrfAeg+sB3y35MQ== + dependencies: + "@ethersproject/abi" "^5.6.0" + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/contracts@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" @@ -722,7 +738,7 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" -"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.6.0": +"@ethersproject/hash@5.6.0", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.6.0.tgz#d24446a5263e02492f9808baa99b6e2b4c3429a2" integrity sha512-fFd+k9gtczqlr0/BruWLAu7UAOas1uRRJvOR84uDf4lNZ+bTkGl366qvniUZHKtlqxBRU65MkOobkmvmpHU+jA== @@ -736,7 +752,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.0.4", "@ethersproject/hash@^5.7.0": +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -787,6 +803,24 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" +"@ethersproject/hdnode@5.6.1", "@ethersproject/hdnode@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.1.tgz#37fa1eb91f6e20ca39cc5fcb7acd3da263d85dab" + integrity sha512-6IuYDmbH5Bv/WH/A2cUd0FjNr4qTLAvyHAECiFZhNZp69pPvU7qIDwJ7CU7VAkwm4IVBzqdYy9mpMAGhQdwCDA== + dependencies: + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/basex" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/pbkdf2" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/wordlists" "^5.6.0" + "@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" @@ -805,24 +839,6 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/hdnode@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.1.tgz#37fa1eb91f6e20ca39cc5fcb7acd3da263d85dab" - integrity sha512-6IuYDmbH5Bv/WH/A2cUd0FjNr4qTLAvyHAECiFZhNZp69pPvU7qIDwJ7CU7VAkwm4IVBzqdYy9mpMAGhQdwCDA== - dependencies: - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/basex" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/sha2" "^5.6.0" - "@ethersproject/signing-key" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/wordlists" "^5.6.0" - "@ethersproject/json-wallets@5.5.0", "@ethersproject/json-wallets@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz#dd522d4297e15bccc8e1427d247ec8376b60e325" @@ -888,7 +904,7 @@ "@ethersproject/bytes" "^5.5.0" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.6.0": +"@ethersproject/keccak256@5.6.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.6.0.tgz#fea4bb47dbf8f131c2e1774a1cecbfeb9d606459" integrity sha512-tk56BJ96mdj/ksi7HWZVWGjCq0WVl/QvfhFQNeL8fxhBlGoP+L80uDCiQcpJPd+2XxkivS3lwRm3E0CXTfol0w== @@ -896,7 +912,7 @@ "@ethersproject/bytes" "^5.6.0" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.0.3", "@ethersproject/keccak256@^5.7.0": +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -909,12 +925,12 @@ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== -"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.6.0": +"@ethersproject/logger@5.6.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.0.5", "@ethersproject/logger@^5.7.0": +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== @@ -933,6 +949,13 @@ dependencies: "@ethersproject/logger" "^5.6.0" +"@ethersproject/networks@5.6.2", "@ethersproject/networks@^5.6.0": + version "5.6.2" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" + integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA== + dependencies: + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" @@ -940,13 +963,6 @@ dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/networks@^5.6.0": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.2.tgz#2bacda62102c0b1fcee408315f2bed4f6fbdf336" - integrity sha512-9uEzaJY7j5wpYGTojGp8U89mSsgQLc40PCMJLMCnFXTs7nhBveZ0t7dbqWUNrepWTszDbFkYD6WlL8DKx5huHA== - dependencies: - "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2@5.5.0", "@ethersproject/pbkdf2@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz#e25032cdf02f31505d47afbf9c3e000d95c4a050" @@ -978,14 +994,14 @@ dependencies: "@ethersproject/logger" "^5.5.0" -"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.6.0": +"@ethersproject/properties@5.6.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.6.0.tgz#38904651713bc6bdd5bdd1b0a4287ecda920fa04" integrity sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg== dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.0.3", "@ethersproject/properties@^5.7.0": +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== @@ -1042,6 +1058,31 @@ bech32 "1.1.4" ws "7.4.6" +"@ethersproject/providers@5.6.6": + version "5.6.6" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.6.tgz#1967149cb4557d253f8c176a44aabda155f228cd" + integrity sha512-6X6agj3NeQ4tgnvBMCjHK+CjQbz+Qmn20JTxCYZ/uymrgCEOpJtY9zeRxJIDsSi0DPw8xNAxypj95JMCsapUfA== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/basex" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/constants" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/networks" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.0" + "@ethersproject/rlp" "^5.6.0" + "@ethersproject/sha2" "^5.6.0" + "@ethersproject/strings" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/web" "^5.6.0" + bech32 "1.1.4" + ws "7.4.6" + "@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" @@ -1193,6 +1234,18 @@ elliptic "6.5.4" hash.js "1.1.7" +"@ethersproject/signing-key@5.6.1", "@ethersproject/signing-key@^5.6.0": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.1.tgz#31b0a531520616254eb0465b9443e49515c4d457" + integrity sha512-XvqQ20DH0D+bS3qlrrgh+axRMth5kD1xuvqUQUTeezxUTXBOeR6hWz2/C6FBEu39FRytyybIWrYf7YLSAKr1LQ== + dependencies: + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + bn.js "^4.11.9" + elliptic "6.5.4" + hash.js "1.1.7" + "@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" @@ -1205,18 +1258,6 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/signing-key@^5.6.0": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.1.tgz#31b0a531520616254eb0465b9443e49515c4d457" - integrity sha512-XvqQ20DH0D+bS3qlrrgh+axRMth5kD1xuvqUQUTeezxUTXBOeR6hWz2/C6FBEu39FRytyybIWrYf7YLSAKr1LQ== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - "@ethersproject/solidity@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.5.0.tgz#2662eb3e5da471b85a20531e420054278362f93f" @@ -1262,7 +1303,7 @@ "@ethersproject/constants" "^5.5.0" "@ethersproject/logger" "^5.5.0" -"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.6.0": +"@ethersproject/strings@5.6.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.6.0.tgz#9891b26709153d996bf1303d39a7f4bc047878fd" integrity sha512-uv10vTtLTZqrJuqBZR862ZQjTIa724wGPWQqZrofaPI/kUsf53TBG0I0D+hQ1qyNtllbNzaW+PDPHHUI6/65Mg== @@ -1271,7 +1312,7 @@ "@ethersproject/constants" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.0.4", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -1295,7 +1336,7 @@ "@ethersproject/rlp" "^5.5.0" "@ethersproject/signing-key" "^5.5.0" -"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.6.0": +"@ethersproject/transactions@5.6.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.6.0.tgz#4b594d73a868ef6e1529a2f8f94a785e6791ae4e" integrity sha512-4HX+VOhNjXHZyGzER6E/LVI2i6lf9ejYeWD6l4g50AdmimyuStKc39kvKf1bXWQMg7QNVh+uC7dYwtaZ02IXeg== @@ -1310,7 +1351,7 @@ "@ethersproject/rlp" "^5.6.0" "@ethersproject/signing-key" "^5.6.0" -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.0.0-beta.135", "@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -1394,6 +1435,27 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" +"@ethersproject/wallet@5.6.1": + version "5.6.1" + resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.1.tgz#5df4f75f848ed84ca30fd6ca75d2c66b19c5552b" + integrity sha512-oXWoOslEWtwZiViIMlGVjeKDQz/tI7JF9UkyzN9jaGj8z7sXt2SyFMb0Ev6vSAqjIzrCrNrJ/+MkAhtKnGOfZw== + dependencies: + "@ethersproject/abstract-provider" "^5.6.0" + "@ethersproject/abstract-signer" "^5.6.0" + "@ethersproject/address" "^5.6.0" + "@ethersproject/bignumber" "^5.6.0" + "@ethersproject/bytes" "^5.6.0" + "@ethersproject/hash" "^5.6.0" + "@ethersproject/hdnode" "^5.6.0" + "@ethersproject/json-wallets" "^5.6.0" + "@ethersproject/keccak256" "^5.6.0" + "@ethersproject/logger" "^5.6.0" + "@ethersproject/properties" "^5.6.0" + "@ethersproject/random" "^5.6.0" + "@ethersproject/signing-key" "^5.6.0" + "@ethersproject/transactions" "^5.6.0" + "@ethersproject/wordlists" "^5.6.0" + "@ethersproject/wallet@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" @@ -1562,21 +1624,21 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.11", "@keep-network/ecdsa@development": - version "2.1.0-dev.11" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.11.tgz#c25fa6cfebe1ca7964329b54c44526a782391234" - integrity sha512-5tTJr9UyW+H0HnV3bu8MkKcy+K9Gi6gaHZ+1WK8LQvba/T38ay//9Gg6dZWmhPT9mKIlW4s0zjOYkjQwq7W7fw== +"@keep-network/ecdsa@2.1.0-dev.2", "@keep-network/ecdsa@development": + version "2.1.0-dev.2" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.2.tgz#bb130ef37d6374909dc4bde858d5664e08b1ebce" + integrity sha512-ERzuqvQFkyN5+2MAGiCgDW2kroTrm1Dnd7yRch3yf+HctjPZ6ocfgubhgqFGwCqG4VLXfS/NIezqORege3N6og== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.10" + "@keep-network/random-beacon" "2.1.0-dev.1" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@threshold-network/solidity-contracts" "1.3.0-dev.5" + "@threshold-network/solidity-contracts" "1.3.0-dev.2" -"@keep-network/keep-core@1.8.1-goerli.0": - version "1.8.1-goerli.0" - resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.1-goerli.0.tgz#238485aab51902021d42357bf59695225002f0ab" - integrity sha512-h3La/RqbyEZjBBPg8V+pcRFo3UpWZUF4CxWfXHZnUR4PnkZKnIDrTNFQPhpV2uYFZwrbJxTR9mzOq/DOAiXPwA== +"@keep-network/keep-core@1.8.0-dev.5": + version "1.8.0-dev.5" + resolved "https://registry.yarnpkg.com/@keep-network/keep-core/-/keep-core-1.8.0-dev.5.tgz#8b4d08ec437f29c94723ee54fcf76456ba5408c3" + integrity sha512-QVkpO5X28Vczj/xHezV0z2UuMw8QFaR3C8x/d6+3adedsL3nCxgveIGTUcXSuYpBqfx0v4/xT+9bIK7BwLkGPw== dependencies: "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.4.0" @@ -1590,11 +1652,11 @@ openzeppelin-solidity "2.4.0" "@keep-network/keep-ecdsa@>1.9.0-dev <1.9.0-ropsten": - version "1.9.0-goerli.0" - resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-goerli.0.tgz#ce58b6639062bb4f73a257557aebb16447889e08" - integrity sha512-EA/oTcxmia5nznQ35ub9/5xBqBK4T+78oWYxASCc+THdPLalzriSAtQ517R4QnvkHi82NFhJjZH8WBoRXniddA== + version "1.9.0-dev.1" + resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-dev.1.tgz#7522b47dd639ddd7479a0e71dc328a9e0bba7cae" + integrity sha512-FRIDejTUiQO7c9gBXgjtTp2sXkEQKFBBqVjYoZE20OCGRxbgum9FbgD/B5RWIctBy4GGr5wJHnA1789iaK3X6A== dependencies: - "@keep-network/keep-core" "1.8.1-goerli.0" + "@keep-network/keep-core" "1.8.0-dev.5" "@keep-network/sortition-pools" "1.2.0-dev.1" "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.3.0" @@ -1603,15 +1665,25 @@ version "0.0.1" resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/a1a333e7ac49928a0f6ed39421906dd1e46ab0f3" -"@keep-network/random-beacon@2.1.0-dev.10": - version "2.1.0-dev.10" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.10.tgz#61c9d3e98257f40292264f4b9e1991acdc11f3c3" - integrity sha512-NJtmjrzFimL20bul6g8lKxUPNc+lpiu9BJ3uheJOCWDL5vQ+hJGctmWqd63mvtjgO8Ks9IQsDg9wpValzSzGXg== +"@keep-network/random-beacon@2.1.0-dev.1": + version "2.1.0-dev.1" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.1.tgz#197422cef030cb61b0b88fc08a59292a9efb3b28" + integrity sha512-ppCPriGEhyc2Aw30wu0ujLphs6wRUdPYR345Knts8tx/z+D49Xg+3JA5tcUiPgXBnJnJJ00sk6uHXdhUS3LLDg== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.5" + "@threshold-network/solidity-contracts" "1.3.0-dev.2" + +"@keep-network/random-beacon@2.1.0-dev.2": + version "2.1.0-dev.2" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.2.tgz#aaf5bb4780b6aac6e71ba6ed8ecb29b4ccf6ae81" + integrity sha512-Xc4MIQ65etB11GDLBPUvO8XRs6f2DVY0FmPF2uU00x8/fOIg12jjyyBQwNP1jJ+OLf7W36+CAZcUtj6kI87EAQ== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "^4.6.0" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.2" "@keep-network/sortition-pools@1.2.0-dev.1": version "1.2.0-dev.1" @@ -1629,16 +1701,17 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "1.5.0-dev.2" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.5.0-dev.2.tgz#2e5b6adb5b265e998e2d296883c68d6587a7fedb" - integrity sha512-L3lPNzVb1N6uEMABixx/5hR3t6dxGFMEuuCVWqaQ/jTocODru+0pwd5obYoD9aNIqtzuboezoBBorZsOoheiPw== + version "0.1.1-dev.120" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-0.1.1-dev.120.tgz#ee97a1fd1deaa64154ab3de4d49d7ba49782eeab" + integrity sha512-xNjg+uN18vw02b/mhczx7V5nbt13G3nlNlDRXXtBNSXtgsaudQ9iIvgRRNGR92N4sIgsMLHeZcaNkIMW2NYZaA== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.11" - "@keep-network/random-beacon" "2.1.0-dev.10" + "@keep-network/ecdsa" "2.1.0-dev.2" + "@keep-network/random-beacon" "2.1.0-dev.2" "@keep-network/tbtc" "1.1.2-dev.1" - "@openzeppelin/contracts" "^4.8.1" - "@openzeppelin/contracts-upgradeable" "^4.8.1" + "@openzeppelin/contracts" "^4.6.0" + "@openzeppelin/contracts-upgradeable" "^4.6.0" + "@tenderly/hardhat-tenderly" ">=1.0.12 <1.2.0" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc@1.1.2-dev.1": @@ -1721,10 +1794,15 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@openzeppelin/contracts-upgradeable@^4.6.0", "@openzeppelin/contracts-upgradeable@^4.8.1": - version "4.9.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.1.tgz#03e33b8059ce43884995e69e4479f5a7f084b404" - integrity sha512-UZf5/VdaBA/0kxF7/gg+2UrC8k+fbgiUM0Qw1apAhwpBWBxULbsHw0ZRMgT53nd6N8hr53XFjhcWNeTRGIiCVw== +"@nomiclabs/hardhat-ethers@^2.0.6": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz#8057b43566a0e41abeb8142064a3c0d3f23dca86" + integrity sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg== + +"@openzeppelin/contracts-upgradeable@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.6.0.tgz#1bf55f230f008554d4c6fe25eb165b85112108b0" + integrity sha512-5OnVuO4HlkjSCJO165a4i2Pu1zQGzMs//o54LPrwUgxvEO2P3ax1QuaSI0cEHHTveA77guS0PnNugpR2JMsPfA== "@openzeppelin/contracts-upgradeable@~4.5.2": version "4.5.2" @@ -1736,10 +1814,10 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== -"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0", "@openzeppelin/contracts@^4.8.1": - version "4.9.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.1.tgz#afa804d2c68398704b0175acc94d91a54f203645" - integrity sha512-aLDTLu/If1qYIFW5g4ZibuQaUsFGWQPBq1mZKp/txaebUnGHDmmiBhRLY1tDNedN0m+fJtKZ1zAODS9Yk+V6uA== +"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.6.0.tgz#c91cf64bc27f573836dba4122758b4743418c1b3" + integrity sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg== "@openzeppelin/contracts@~4.5.0": version "4.5.0" @@ -1843,15 +1921,10 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea" integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ== -"@sindresorhus/is@^4.0.0": - version "4.6.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" - integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== - "@solidity-parser/parser@^0.14.1": - version "0.14.5" - resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.5.tgz#87bc3cc7b068e08195c219c91cd8ddff5ef1a804" - integrity sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg== + version "0.14.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.14.1.tgz#179afb29f4e295a77cc141151f26b3848abc3c46" + integrity sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw== dependencies: antlr4ts "^0.5.0-alpha.4" @@ -1917,12 +1990,18 @@ dependencies: defer-to-connect "^1.0.1" -"@szmarczak/http-timer@^4.0.5": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" - integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== +"@tenderly/hardhat-tenderly@>=1.0.12 <1.2.0": + version "1.1.6" + resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.1.6.tgz#b706c7c337ebae7ecd314df3e8ee3d244ed1de08" + integrity sha512-B6vVdDAxQwjahrvsxjNirJW2ynDENLBD8LLFy8sYVJ+RCb4B8HXT1IGSceqpySNPr2iLYcD5cKC/YCHX+/O48Q== dependencies: - defer-to-connect "^2.0.0" + "@ethersproject/bignumber" "^5.6.2" + "@nomiclabs/hardhat-ethers" "^2.0.6" + axios "^0.21.1" + ethers "^5.6.8" + fs-extra "^9.0.1" + hardhat-deploy "^0.11.10" + js-yaml "^3.14.0" "@thesis/solidity-contracts@github:thesis/solidity-contracts#4985bcf": version "0.0.1" @@ -1930,10 +2009,10 @@ dependencies: "@openzeppelin/contracts" "^4.1.0" -"@threshold-network/solidity-contracts@1.3.0-dev.5": - version "1.3.0-dev.5" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" - integrity sha512-AInTKQkJ0PKa32q2m8GnZFPYEArsnvOwhIFdBFaHdq9r4EGyqHMf4YY1WjffkheBZ7AQ0DNA8Lst30kBoQd0SA== +"@threshold-network/solidity-contracts@1.3.0-dev.2": + version "1.3.0-dev.2" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.2.tgz#e3589004aff366d9f034e51b1be8832d01c81d47" + integrity sha512-qJulhTwYW7ZKVIgpqWVdQE9R45OgxjmqLaGp2gAv3hvlAUUsC+dnxub1kaQfDqQcZmwzZvtHcxLXYtHg4Cs2ug== dependencies: "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" "@openzeppelin/contracts" "~4.5.0" @@ -1995,10 +2074,10 @@ dependencies: bignumber.js "*" -"@types/bn.js@*": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== +"@types/bn.js@*", "@types/bn.js@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" + integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== dependencies: "@types/node" "*" @@ -2009,23 +2088,6 @@ dependencies: "@types/node" "*" -"@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - -"@types/cacheable-request@^6.0.1": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" - integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "^3.1.4" - "@types/node" "*" - "@types/responselike" "^1.0.0" - "@types/cbor@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/cbor/-/cbor-2.0.0.tgz#c627afc2ee22f23f2337fecb34628a4f97c6afbb" @@ -2051,9 +2113,9 @@ integrity sha512-lIxCk6G7AwmUagQ4gIQGxUBnvAq664prFD9nSAz6dgd1XmBXBtZABV/op+QsJsIyaP1GZsf/iXhYKHX3azSRCw== "@types/debug@^4.1.5": - version "4.1.8" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" - integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" + integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== dependencies: "@types/ms" "*" @@ -2077,23 +2139,11 @@ resolved "https://registry.yarnpkg.com/@types/google-libphonenumber/-/google-libphonenumber-7.4.23.tgz#c44c9125d45f042943694d605fd8d8d796cafc3b" integrity sha512-C3ydakLTQa8HxtYf9ge4q6uT9krDX8smSIxmmW3oACFi5g5vv6T068PRExF7UyWbWpuYiDG8Nm24q2X5XhcZWw== -"@types/http-cache-semantics@*": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" - integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== - "@types/json-schema@^7.0.7": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== -"@types/keyv@^3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" - integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== - dependencies: - "@types/node" "*" - "@types/level-errors@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.0.tgz#15c1f4915a5ef763b51651b15e90f6dc081b96a8" @@ -2109,9 +2159,9 @@ "@types/node" "*" "@types/lodash@^4.14.170": - version "4.14.195" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" - integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== + version "4.14.182" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" + integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== "@types/mkdirp@^0.5.2": version "0.5.2" @@ -2159,9 +2209,9 @@ integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== "@types/node@^12.11.7", "@types/node@^12.12.6", "@types/node@^12.6.1": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== + version "12.20.52" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.52.tgz#2fd2dc6bfa185601b15457398d4ba1ef27f81251" + integrity sha512-cfkwWw72849SNYp3Zx0IcIs25vABmFh73xicxhCkTcvtZQeIez15PpwQN8fY3RD7gv1Wrxlc9MEtfMORZDEsGw== "@types/node@^16.3.1": version "16.11.14" @@ -2180,6 +2230,11 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.1.tgz#76e72d8a775eef7ce649c63c8acae1a0824bbaed" integrity sha512-XFjFHmaLVifrAKaZ+EKghFHtHSUonyw8P2Qmy2/+osBnrKbH9UYtlK10zg8/kCt47MFilll/DEDKy3DHfJ0URw== +"@types/qs@^6.9.7": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + "@types/randombytes@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" @@ -2187,13 +2242,6 @@ dependencies: "@types/node" "*" -"@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - "@types/secp256k1@^4.0.1": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.3.tgz#1b8e55d8e00f08ee7220b4d59a6abe89c37a901c" @@ -2480,14 +2528,6 @@ array-back@^4.0.1, array-back@^4.0.2: resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== -array-buffer-byte-length@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" - integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== - dependencies: - call-bind "^1.0.2" - is-array-buffer "^3.0.1" - array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -2498,17 +2538,6 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== -array.prototype.reduce@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" - integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - es-array-method-boxes-properly "^1.0.0" - is-string "^1.0.7" - asn1.js@^5.2.0: version "5.4.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" @@ -2565,6 +2594,11 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== +at-least-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" + integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -2588,6 +2622,13 @@ axios@^0.18.0: follow-redirects "1.5.10" is-buffer "^2.0.2" +axios@^0.21.1: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -2720,9 +2761,9 @@ bigi@^1.1.0: integrity sha512-ddkU+dFIuEIW8lE7ZwdIAf2UPoM90eaprg5m3YXAVVTmKlqV/9BX4A2M8BOK2yOq6/VgZFVhK6QAxJebhlbhzw== bignumber.js@*, bignumber.js@^9.0.0, bignumber.js@^9.0.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.1.tgz#c4df7dc496bd849d4c9464344c1aa74228b4dac6" - integrity sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig== + version "9.0.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.2.tgz#71c6c6bed38de64e24a65ebe16cfcf23ae693673" + integrity sha512-GAcQvbpsM0pUb0zw1EI0KhQEZ+lRwR5fYaAp3vPOYuP7aDvGy6cVN6XHLauvF8SOga2y0dcLcjt3iQDTSEliyw== bignumber.js@^7.2.0: version "7.2.1" @@ -2871,20 +2912,20 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^ resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - -bn.js@^5.1.2, bn.js@^5.2.0: +bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +body-parser@1.20.0, body-parser@^1.16.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" + integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== dependencies: bytes "3.1.2" content-type "~1.0.4" @@ -2894,29 +2935,11 @@ body-parser@1.20.1: http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" + qs "6.10.3" raw-body "2.5.1" type-is "~1.6.18" unpipe "1.0.0" -body-parser@^1.16.0: - version "1.20.2" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" - integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== - dependencies: - bytes "3.1.2" - content-type "~1.0.5" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.2" - type-is "~1.6.18" - unpipe "1.0.0" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3159,11 +3182,6 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -3177,19 +3195,6 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -cacheable-request@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" - integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^6.0.1" - responselike "^2.0.0" - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -3246,13 +3251,13 @@ chai-as-promised@^7.1.1: check-error "^1.0.2" chai@^4.2.0: - version "4.3.7" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51" - integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A== + version "4.3.6" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c" + integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q== dependencies: assertion-error "^1.1.0" check-error "^1.0.2" - deep-eql "^4.1.2" + deep-eql "^3.0.1" get-func-name "^2.0.0" loupe "^2.3.1" pathval "^1.1.1" @@ -3279,7 +3284,7 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3307,6 +3312,21 @@ chokidar@3.5.2: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.5.2: + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -3371,9 +3391,9 @@ cliui@^7.0.2: wrap-ansi "^7.0.0" clone-response@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" - integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" + integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= dependencies: mimic-response "^1.0.0" @@ -3474,15 +3494,15 @@ content-hash@^2.5.2: multicodec "^0.5.5" multihashes "^0.4.15" -content-type@~1.0.4, content-type@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" - integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= cookie@0.5.0: version "0.5.0" @@ -3490,9 +3510,9 @@ cookie@0.5.0: integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== cookiejar@^2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b" - integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw== + version "2.1.3" + resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" + integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== core-js-pure@^3.0.1: version "3.22.6" @@ -3520,7 +3540,7 @@ cors@^2.8.1: country-data@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/country-data/-/country-data-0.0.31.tgz#80966b8e1d147fa6d6a589d32933f8793774956d" - integrity sha512-YqlY/i6ikZwoBFfdjK+hJTGaBdTgDpXLI15MCj2UsXZ2cPBb+Kx86AXmDH7PRGt0LUleck0cCgNdWeIhfbcxkQ== + integrity sha1-gJZrjh0Uf6bWpYnTKTP4eTd0lW0= dependencies: currency-symbol-map "~2" underscore ">1.4.4" @@ -3575,11 +3595,11 @@ cross-fetch@3.0.4: whatwg-fetch "3.0.0" cross-fetch@^3.0.6: - version "3.1.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c" - integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g== + version "3.1.5" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" + integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== dependencies: - node-fetch "^2.6.11" + node-fetch "2.6.7" cross-spawn@^7.0.2: version "7.0.3" @@ -3615,7 +3635,7 @@ crypto-js@^3.1.9-1: currency-symbol-map@~2: version "2.2.0" resolved "https://registry.yarnpkg.com/currency-symbol-map/-/currency-symbol-map-2.2.0.tgz#2b3c1872ff1ac2ce595d8273e58e1fff0272aea2" - integrity sha512-fPZJ3jqM68+AAgqQ7UaGbgHL/39rp6l7GyqS2k1HJPu/kpS8D07x/+Uup6a9tCUKIlOFcRrDCf1qxSt8jnI5BA== + integrity sha1-KzwYcv8aws5ZXYJz5Y4f/wJyrqI= d@1, d@^1.0.1: version "1.0.1" @@ -3674,7 +3694,7 @@ debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@^4.3.3, debug@^4.3.4: +debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3684,7 +3704,7 @@ debug@^4.3.3, debug@^4.3.4: decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decamelize@^4.0.0: version "4.0.0" @@ -3692,24 +3712,17 @@ decamelize@^4.0.0: integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== decode-uri-component@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" - integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= decompress-response@^3.2.0, decompress-response@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" - integrity sha512-BzRPQuY1ip+qDonAOz42gRm/pg9F768C+npV/4JOsxRC2sq+Rlk+Q4ZCAsOhnIaMrgarILY+RMUIvMmmX1qAEA== + integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M= dependencies: mimic-response "^1.0.0" -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - decompress-tar@^4.0.0, decompress-tar@^4.1.0, decompress-tar@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/decompress-tar/-/decompress-tar-4.1.1.tgz#718cbd3fcb16209716e70a26b84e7ba4592e5af1" @@ -3742,7 +3755,7 @@ decompress-targz@^4.0.0: decompress-unzip@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/decompress-unzip/-/decompress-unzip-4.0.1.tgz#deaaccdfd14aeaf85578f733ae8210f9b4848f69" - integrity sha512-1fqeluvxgnn86MOh66u8FjbtJpAFv5wgCT9Iw8rcBqQcCo5tO8eiJw7NNTrvt9n4CRBVq7CstiS922oPgyGLrw== + integrity sha1-3qrM39FK6vhVePczroIQ+bSEj2k= dependencies: file-type "^3.8.0" get-stream "^2.2.0" @@ -3770,13 +3783,6 @@ deep-eql@^3.0.1: dependencies: type-detect "^4.0.0" -deep-eql@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" - integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== - dependencies: - type-detect "^4.0.0" - deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -3792,11 +3798,6 @@ defer-to-connect@^1.0.1: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591" integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ== -defer-to-connect@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - deferred-leveldown@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" @@ -3805,10 +3806,10 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" - integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== +define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== dependencies: has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -3821,7 +3822,7 @@ delayed-stream@~1.0.0: delimit-stream@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" - integrity sha512-a02fiQ7poS5CnjiJBAsjGLPp5EwVoGHNeu9sziBd9huppRfsAFIpv5zNLv0V1gbop53ilngAf5Kf331AwcoRBQ== + integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= depd@2.0.0: version "2.0.0" @@ -3829,9 +3830,9 @@ depd@2.0.0: integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== des.js@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" - integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -3890,9 +3891,9 @@ dotenv@^8.2.0: integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== duplexer3@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.5.tgz#0b5e4d7bad5de8901ea4440624c8e1d20099217e" - integrity sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA== + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= ecc-jsbn@~0.1.1: version "0.1.2" @@ -3905,7 +3906,7 @@ ecc-jsbn@~0.1.1: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= "electrum-client-js@git+https://github.com/keep-network/electrum-client-js.git#v0.1.1": version "0.1.1" @@ -3916,7 +3917,7 @@ ee-first@1.1.1: elliptic@6.3.3: version "6.3.3" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.3.tgz#5482d9646d54bcb89fd7d994fc9e2e9568876e3f" - integrity sha512-cIky9SO2H8W2eU1NOLySnhOYJnuEWCq9ZJeHvHd/lXzEL9vyraIMfilZSn57X3aVX+wkfYmqkch2LvmTzkjFpA== + integrity sha1-VILZZG1UvLif19mU/J4ulWiHbj8= dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -3951,10 +3952,15 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +encode-utf8@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" + integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= encoding-down@^6.3.0: version "6.3.0" @@ -3973,7 +3979,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5: +enquirer@^2.3.5, enquirer@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -3994,59 +4000,34 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.19.0, es-abstract@^1.20.4, es-abstract@^1.21.2: - version "1.21.2" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" - integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== +es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.5, es-abstract@^1.20.0: + version "1.20.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" + integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== dependencies: - array-buffer-byte-length "^1.0.0" - available-typed-arrays "^1.0.5" call-bind "^1.0.2" - es-set-tostringtag "^2.0.1" es-to-primitive "^1.2.1" + function-bind "^1.1.1" function.prototype.name "^1.1.5" - get-intrinsic "^1.2.0" + get-intrinsic "^1.1.1" get-symbol-description "^1.0.0" - globalthis "^1.0.3" - gopd "^1.0.1" has "^1.0.3" has-property-descriptors "^1.0.0" - has-proto "^1.0.1" has-symbols "^1.0.3" - internal-slot "^1.0.5" - is-array-buffer "^3.0.2" - is-callable "^1.2.7" + internal-slot "^1.0.3" + is-callable "^1.2.4" is-negative-zero "^2.0.2" is-regex "^1.1.4" is-shared-array-buffer "^1.0.2" is-string "^1.0.7" - is-typed-array "^1.1.10" is-weakref "^1.0.2" - object-inspect "^1.12.3" + object-inspect "^1.12.0" object-keys "^1.1.1" - object.assign "^4.1.4" + object.assign "^4.1.2" regexp.prototype.flags "^1.4.3" - safe-regex-test "^1.0.0" - string.prototype.trim "^1.2.7" - string.prototype.trimend "^1.0.6" - string.prototype.trimstart "^1.0.6" - typed-array-length "^1.0.4" + string.prototype.trimend "^1.0.5" + string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" - which-typed-array "^1.1.9" - -es-array-method-boxes-properly@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" - integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== - -es-set-tostringtag@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz#338d502f6f674301d710b80c8592de8a15f09cd8" - integrity sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg== - dependencies: - get-intrinsic "^1.1.3" - has "^1.0.3" - has-tostringtag "^1.0.0" es-to-primitive@^1.2.1: version "1.2.1" @@ -4091,7 +4072,7 @@ escalade@^3.1.1: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" @@ -4261,12 +4242,12 @@ esutils@^2.0.2: etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== + integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= dependencies: idna-uts46-hx "^2.3.1" js-sha3 "^0.5.7" @@ -4274,7 +4255,7 @@ eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca" - integrity sha512-VqEBQKH92jNsaE8lG9CTq8M/bc12gdAfb5MY8Ro1hVyXkh7rOtY3m5tRHK3Hus5HqIAAwU2ivcUjTLVwsvf/kw== + integrity sha1-L5Pxex4jrsN1nNSj/iDBKGo/wco= dependencies: bn.js "^4.11.6" elliptic "^6.4.0" @@ -4479,40 +4460,40 @@ ethers@^4.0.20: xmlhttprequest "1.8.0" ethers@^5.2.0: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + version "5.6.6" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.6.tgz#a37aa7e265a484a1b4d2ef91d4d89d6b43808a57" + integrity sha512-2B2ZmSGvRcJpHnFMBk58mkXP50njFipUBCgLK8jUTFbomhVs501cLzyMU6+Vx8YnUDQxywC3qkZvd33xWS+2FA== 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" + "@ethersproject/abi" "5.6.2" + "@ethersproject/abstract-provider" "5.6.0" + "@ethersproject/abstract-signer" "5.6.1" + "@ethersproject/address" "5.6.0" + "@ethersproject/base64" "5.6.0" + "@ethersproject/basex" "5.6.0" + "@ethersproject/bignumber" "5.6.1" + "@ethersproject/bytes" "5.6.1" + "@ethersproject/constants" "5.6.0" + "@ethersproject/contracts" "5.6.1" + "@ethersproject/hash" "5.6.0" + "@ethersproject/hdnode" "5.6.1" + "@ethersproject/json-wallets" "5.6.0" + "@ethersproject/keccak256" "5.6.0" + "@ethersproject/logger" "5.6.0" + "@ethersproject/networks" "5.6.2" + "@ethersproject/pbkdf2" "5.6.0" + "@ethersproject/properties" "5.6.0" + "@ethersproject/providers" "5.6.6" + "@ethersproject/random" "5.6.0" + "@ethersproject/rlp" "5.6.0" + "@ethersproject/sha2" "5.6.0" + "@ethersproject/signing-key" "5.6.1" + "@ethersproject/solidity" "5.6.0" + "@ethersproject/strings" "5.6.0" + "@ethersproject/transactions" "5.6.0" + "@ethersproject/units" "5.6.0" + "@ethersproject/wallet" "5.6.1" + "@ethersproject/web" "5.6.0" + "@ethersproject/wordlists" "5.6.0" ethers@^5.5.2: version "5.5.2" @@ -4550,6 +4531,42 @@ ethers@^5.5.2: "@ethersproject/web" "5.5.1" "@ethersproject/wordlists" "5.5.0" +ethers@^5.5.3, ethers@^5.6.8: + version "5.7.2" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" + integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== + dependencies: + "@ethersproject/abi" "5.7.0" + "@ethersproject/abstract-provider" "5.7.0" + "@ethersproject/abstract-signer" "5.7.0" + "@ethersproject/address" "5.7.0" + "@ethersproject/base64" "5.7.0" + "@ethersproject/basex" "5.7.0" + "@ethersproject/bignumber" "5.7.0" + "@ethersproject/bytes" "5.7.0" + "@ethersproject/constants" "5.7.0" + "@ethersproject/contracts" "5.7.0" + "@ethersproject/hash" "5.7.0" + "@ethersproject/hdnode" "5.7.0" + "@ethersproject/json-wallets" "5.7.0" + "@ethersproject/keccak256" "5.7.0" + "@ethersproject/logger" "5.7.0" + "@ethersproject/networks" "5.7.1" + "@ethersproject/pbkdf2" "5.7.0" + "@ethersproject/properties" "5.7.0" + "@ethersproject/providers" "5.7.2" + "@ethersproject/random" "5.7.0" + "@ethersproject/rlp" "5.7.0" + "@ethersproject/sha2" "5.7.0" + "@ethersproject/signing-key" "5.7.0" + "@ethersproject/solidity" "5.7.0" + "@ethersproject/strings" "5.7.0" + "@ethersproject/transactions" "5.7.0" + "@ethersproject/units" "5.7.0" + "@ethersproject/wallet" "5.7.0" + "@ethersproject/web" "5.7.1" + "@ethersproject/wordlists" "5.7.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4590,13 +4607,13 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: safe-buffer "^5.1.1" express@^4.14.0: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.18.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" + integrity sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.0" content-disposition "0.5.4" content-type "~1.0.4" cookie "0.5.0" @@ -4615,7 +4632,7 @@ express@^4.14.0: parseurl "~1.3.3" path-to-regexp "0.1.7" proxy-addr "~2.0.7" - qs "6.11.0" + qs "6.10.3" range-parser "~1.2.1" safe-buffer "5.2.1" send "0.18.0" @@ -4689,7 +4706,7 @@ fastq@^1.6.0: fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== + integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= dependencies: pend "~1.2.0" @@ -4703,12 +4720,12 @@ file-entry-cache@^6.0.1: file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" - integrity sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA== + integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek= file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" - integrity sha512-Iq1nJ6D2+yIO4c8HHg4fyVb8mAJieo1Oloy1mLLaB2PvezNedhBVm+QU7g0qM42aiMbRXTxKKwGD17rjKNJYVQ== + integrity sha1-LdvqfHP/42No365J3DOMBYwritY= file-type@^6.1.0: version "6.2.0" @@ -4773,7 +4790,7 @@ find-up@^1.0.0: find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" @@ -4802,6 +4819,13 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== +fmix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" + integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w== + dependencies: + imul "^1.0.0" + follow-redirects@1.5.10: version "1.5.10" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" @@ -4809,6 +4833,11 @@ follow-redirects@1.5.10: dependencies: debug "=3.1.0" +follow-redirects@^1.14.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" + integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -4830,6 +4859,15 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4852,7 +4890,7 @@ fp-ts@2.1.1: fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= fs-constants@^1.0.0: version "1.0.0" @@ -4870,6 +4908,15 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" +fs-extra@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -4888,6 +4935,16 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^9.0.1: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -4925,15 +4982,15 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== futoin-hkdf@^1.0.3: - version "1.5.2" - resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.2.tgz#d316623d29f45fe5e6f136f435eccd74096bf676" - integrity sha512-Bnytx8kQJQoEAPGgTZw3kVPy8e/n9CDftPzc0okgaujmbdF1x7w8wg+u2xS0CML233HgruNk6VQW28CzuUFMKw== + version "1.5.0" + resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.0.tgz#f10cc4d32f1e26568ded58d5a6535a97aa3a064c" + integrity sha512-4CerDhtTgx4i5PKccQIpEp4T9wqmosPIP9Kep35SdCpYkQeriD3zddUVhrO1Fc4QvGhsAnd2rXyoOr5047mJEg== ganache@7.0.3: version "7.0.3" @@ -4964,15 +5021,14 @@ get-func-name@^2.0.0: resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= -get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" - integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" + integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== dependencies: function-bind "^1.1.1" has "^1.0.3" - has-proto "^1.0.1" - has-symbols "^1.0.3" + has-symbols "^1.0.1" get-stdin@^6.0.0: version "6.0.0" @@ -4982,7 +5038,7 @@ get-stdin@^6.0.0: get-stream@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - integrity sha512-AUGhbbemXxrZJRD5cDvKtQxLuYaIbNtDTK8YqupCI393Q2KSTreEsLUN3ZxAWFGiKTzL6nKuzfcIvieflUX9qA== + integrity sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4= dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" @@ -4990,7 +5046,7 @@ get-stream@^2.2.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ== + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= get-stream@^4.1.0: version "4.1.0" @@ -5079,13 +5135,6 @@ globals@^13.6.0, globals@^13.9.0: dependencies: type-fest "^0.20.2" -globalthis@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" - integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== - dependencies: - define-properties "^1.1.3" - globby@^11.0.3: version "11.0.4" resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" @@ -5099,16 +5148,9 @@ globby@^11.0.3: slash "^3.0.0" google-libphonenumber@^3.2.15, google-libphonenumber@^3.2.4: - version "3.2.32" - resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.32.tgz#63c48a9c247b64a3bc2eec21bdf3fcfbf2e148c0" - integrity sha512-mcNgakausov/B/eTgVeX8qc8IwWjRrupk9UzZZ/QDEvdh5fAjE7Aa211bkZpZj42zKkeS6MTT8avHUwjcLxuGQ== - -gopd@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" - integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== - dependencies: - get-intrinsic "^1.1.3" + version "3.2.27" + resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.27.tgz#06a0c1d42be712a6fd4189e2e3b07fc36cacee01" + integrity sha512-et3QlrfWemNPhyUfXZmJG8TfzitfAN71ygNI15+B35zNge/7vyZxkpDsc13oninkf8RAtN2kNEzvMr4L1n3vfQ== got@9.6.0: version "9.6.0" @@ -5127,23 +5169,6 @@ got@9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -got@^11.8.5: - version "11.8.6" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" - integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.2" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - got@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/got/-/got-7.1.0.tgz#05450fd84094e6bbea56f451a43a9c289166385a" @@ -5164,12 +5189,7 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10: - version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5192,6 +5212,25 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" +hardhat-deploy@^0.11.10: + version "0.11.22" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.22.tgz#9799c0266a0fc40c84690de54760f1b4dae5e487" + integrity sha512-ZhHVNB7Jo2l8Is+KIAk9F8Q3d7pptyiX+nsNbIFXztCz81kaP+6kxNODRBqRCy7SOD3It4+iKCL6tWsPAA/jVQ== + dependencies: + "@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.8.1" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -5214,17 +5253,12 @@ has-property-descriptors@^1.0.0: dependencies: get-intrinsic "^1.1.1" -has-proto@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" - integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== - has-symbol-support-x@^1.4.1: version "1.4.2" resolved "https://registry.yarnpkg.com/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz#1409f98bc00247da45da67cee0a36f282ff26455" integrity sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw== -has-symbols@^1.0.0, has-symbols@^1.0.2, has-symbols@^1.0.3: +has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== @@ -5295,9 +5329,9 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== http-cache-semantics@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" - integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + version "4.1.0" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" + integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== http-errors@2.0.0: version "2.0.0" @@ -5313,7 +5347,7 @@ http-errors@2.0.0: http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" - integrity sha512-o0PWwVCSp3O0wS6FvNr6xfBCHgt0m1tvPLFOCc2iFDKTRAXhB7m8klDf7ErowFH8POa6dVdGatKU5I1YYwzUyg== + integrity sha1-L5CN1fHbQGjAWM1ubUzjkskTOJs= http-signature@~1.2.0: version "1.2.0" @@ -5324,14 +5358,6 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -5379,6 +5405,11 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" +imul@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" + integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5397,12 +5428,12 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -internal-slot@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" - integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== dependencies: - get-intrinsic "^1.2.0" + get-intrinsic "^1.1.0" has "^1.0.3" side-channel "^1.0.4" @@ -5436,15 +5467,6 @@ is-arguments@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" -is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" - integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.0" - is-typed-array "^1.1.10" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -5477,10 +5499,10 @@ is-buffer@^2.0.2, is-buffer@^2.0.5, is-buffer@~2.0.3: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" - integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== is-core-module@^2.8.1: version "2.9.0" @@ -5511,7 +5533,7 @@ is-fullwidth-code-point@^1.0.0: is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -5545,7 +5567,7 @@ is-hex-prefixed@1.0.0: is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" - integrity sha512-Y4LTamMe0DDQIIAlaer9eKebAlDSV6huy+TWhJVPlzZh2o4tRP5SQWFlLn5N0To4mDD22/qdOq+veo1cSISLgQ== + integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= is-negative-zero@^2.0.2: version "2.0.2" @@ -5572,7 +5594,7 @@ is-object@^1.0.1: is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg== + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-obj@^2.1.0: version "2.1.0" @@ -5602,7 +5624,7 @@ is-shared-array-buffer@^1.0.2: is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ== + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= is-string@^1.0.5, is-string@^1.0.7: version "1.0.7" @@ -5618,15 +5640,15 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" -is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: - version "1.1.10" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" - integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== +is-typed-array@^1.1.3, is-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.9.tgz#246d77d2871e7d9f5aeb1d54b9f52c71329ece67" + integrity sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" + es-abstract "^1.20.0" for-each "^0.3.3" - gopd "^1.0.1" has-tostringtag "^1.0.0" is-typedarray@^1.0.0, is-typedarray@~1.0.0: @@ -5656,15 +5678,10 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" @@ -5687,7 +5704,7 @@ isurl@^1.0.0-alpha5: js-sha3@0.5.7, js-sha3@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== + integrity sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc= js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" @@ -5714,7 +5731,7 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.1: +js-yaml@^3.13.1, js-yaml@^3.14.0: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5730,12 +5747,7 @@ jsbn@~0.1.0: json-buffer@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= json-schema-traverse@^0.4.1: version "0.4.1" @@ -5765,7 +5777,7 @@ json-stringify-safe@~5.0.1: json-text-sequence@^0.1: version "0.1.1" resolved "https://registry.yarnpkg.com/json-text-sequence/-/json-text-sequence-0.1.1.tgz#a72f217dc4afc4629fff5feb304dc1bd51a2f3d2" - integrity sha512-L3mEegEWHRekSHjc7+sc8eJhba9Clq1PZ8kMkzf8OxElhXc8O4TS5MwcVlj9aEbm5dr81N90WHC5nAz3UO971w== + integrity sha1-py8hfcSvxGKf/1/rME3BvVGi89I= dependencies: delimit-stream "0.1.0" @@ -5783,6 +5795,15 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" + optionalDependencies: + graceful-fs "^4.1.6" + jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -5810,7 +5831,7 @@ keccak@3.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -keccak@^3.0.0: +keccak@^3.0.0, keccak@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== @@ -5819,15 +5840,6 @@ keccak@^3.0.0: node-gyp-build "^4.2.0" readable-stream "^3.6.0" -keccak@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.3.tgz#4bc35ad917be1ef54ff246f904c2bbbf9ac61276" - integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - keyv@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" @@ -5835,13 +5847,6 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" -keyv@^4.0.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" - integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== - dependencies: - json-buffer "3.0.1" - klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" @@ -5974,7 +5979,7 @@ load-json-file@^1.0.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -6042,9 +6047,9 @@ loose-envify@^1.0.0: js-tokens "^3.0.0 || ^4.0.0" loupe@^2.3.1: - version "2.3.6" - resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" - integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== + version "2.3.4" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3" + integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ== dependencies: get-func-name "^2.0.0" @@ -6089,6 +6094,11 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +match-all@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" + integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== + mcl-wasm@^0.7.1: version "0.7.9" resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" @@ -6106,7 +6116,7 @@ md5.js@^1.3.4: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= memdown@^5.0.0: version "5.1.0" @@ -6128,7 +6138,7 @@ memorystream@^0.3.1: merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= merge2@^1.3.0: version "1.4.1" @@ -6150,7 +6160,7 @@ merkle-patricia-tree@^4.2.2, merkle-patricia-tree@^4.2.4: methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= micromatch@^4.0.4: version "4.0.4" @@ -6195,15 +6205,10 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" - integrity sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ== + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= dependencies: dom-walk "^0.1.0" @@ -6224,12 +6229,7 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5: - version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -minimist@^1.2.6: +minimist@^1.2.5, minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== @@ -6252,14 +6252,14 @@ minizlib@^1.3.3: mkdirp-promise@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" - integrity sha512-Hepn5kb1lJPtVW84RFT40YG1OddBNTOVUZR2bzQUHc+Z03en8/3uX0+060JDhcEzyO08HmipsN9DcnFMxhIL9w== + integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= dependencies: mkdirp "*" -mkdirp@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" - integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== +mkdirp@*, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== mkdirp@0.5.4: version "0.5.4" @@ -6275,11 +6275,6 @@ mkdirp@^0.5.1, mkdirp@^0.5.5: dependencies: minimist "^1.2.6" -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - mocha@^6.2.2: version "6.2.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.3.tgz#e648432181d8b99393410212664450a4c1e31912" @@ -6404,14 +6399,23 @@ multihashes@^0.4.15, multihashes@~0.4.15: multibase "^0.7.0" varint "^5.0.0" +murmur-128@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" + integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== + dependencies: + encode-utf8 "^1.0.2" + fmix "^0.1.0" + imul "^1.0.0" + "n64@git+https://github.com/chjj/n64.git#semver:~0.2.10": version "0.2.10" resolved "git+https://github.com/chjj/n64.git#34f981f1441f569821d97a31f8cf21a3fc11b8f6" nan@^2.13.2, nan@^2.14.0: - version "2.17.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.17.0.tgz#c0150a2368a182f033e9aa5195ec76ea41a199cb" - integrity sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ== + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== "nan@git+https://github.com/braydonf/nan.git#semver:=2.14.0": version "2.14.0" @@ -6420,7 +6424,7 @@ nan@^2.13.2, nan@^2.14.0: nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" - integrity sha512-9MqxMH/BSJC7dnLsEMPyfN5Dvoo49IsPFYMcHw3Bcfc2kN0lpHRBSzlMSVx4HGyJ7s9B31CyBTVehWJoQ8Ctew== + integrity sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18= nanoid@3.1.25: version "3.1.25" @@ -6465,14 +6469,7 @@ node-fetch@2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-fetch@^2.6.11: - version "2.6.11" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== - dependencies: - whatwg-url "^5.0.0" - -node-fetch@^2.6.7: +node-fetch@2.6.7, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -6514,11 +6511,6 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -6535,7 +6527,7 @@ number-to-bn@1.7.0: numeral@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506" - integrity sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA== + integrity sha1-StCAk21EPCVhrtnyGX7//iX05QY= oauth-sign@~0.9.0: version "0.9.0" @@ -6545,12 +6537,12 @@ oauth-sign@~0.9.0: object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.12.3, object-inspect@^1.9.0: - version "1.12.3" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" - integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== +object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== object-keys@^1.0.11, object-keys@^1.1.1: version "1.1.1" @@ -6567,38 +6559,36 @@ object.assign@4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.assign@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== +object.assign@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" + integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - has-symbols "^1.0.3" + call-bind "^1.0.0" + define-properties "^1.1.3" + has-symbols "^1.0.1" object-keys "^1.1.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.6" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz#5e5c384dd209fa4efffead39e3a0512770ccc312" - integrity sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ== + version "2.1.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz#b223cf38e17fefb97a63c10c91df72ccb386df9e" + integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== dependencies: - array.prototype.reduce "^1.0.5" call-bind "^1.0.2" - define-properties "^1.2.0" - es-abstract "^1.21.2" - safe-array-concat "^1.0.0" + define-properties "^1.1.3" + es-abstract "^1.19.1" oboe@2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" - integrity sha512-ymBJ4xSC6GBXLT9Y7lirj+xbqBLa+jADGJldGEYG7u8sZbS9GyG+u1Xk9c5cbriKwSpCg41qUhPjvU5xOpvIyQ== + integrity sha1-IMiM2wwVNxuwQRklfU/dNLCqSfY= dependencies: http-https "^1.0.0" oboe@2.1.5: version "2.1.5" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.5.tgz#5554284c543a2266d7a38f17e073821fbde393cd" - integrity sha512-zRFWiF+FoicxEs3jNI/WYUrVEgA7DeET/InK0XQuudGHRg8iIob3cNPrJTKaz4004uaA9Pbe+Dwa8iluhjLZWA== + integrity sha1-VVQoTFQ6ImbXo48X4HOCH73jk80= dependencies: http-https "^1.0.0" @@ -6667,15 +6657,10 @@ p-cancelable@^1.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= p-limit@^1.1.0: version "1.3.0" @@ -6701,7 +6686,7 @@ p-limit@^3.0.2: p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" @@ -6722,7 +6707,7 @@ p-locate@^5.0.0: p-timeout@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.1.tgz#5eb3b353b7fce99f101a1038880bb054ebbea386" - integrity sha512-gb0ryzr+K2qFqFv6qi3khoeqMZF/+ajxQipEF6NteZVnvz9tzdsfAVj3lYtn1gAXvH5lfLwfxEII799gt/mRIA== + integrity sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y= dependencies: p-finally "^1.0.0" @@ -6734,7 +6719,7 @@ p-timeout@^4.1.0: p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: version "2.2.0" @@ -6791,7 +6776,7 @@ path-exists@^2.0.0: path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-exists@^4.0.0: version "4.0.0" @@ -6816,7 +6801,7 @@ path-parse@^1.0.7: path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= path-type@^1.0.0: version "1.1.0" @@ -6851,7 +6836,7 @@ pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== + integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= performance-now@^2.1.0: version "2.1.0" @@ -6866,12 +6851,12 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pinkie-promise@^2.0.0: version "2.0.1" @@ -6893,12 +6878,12 @@ prelude-ls@^1.2.1: prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg== + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" - integrity sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA== + integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= prettier-linter-helpers@^1.0.0: version "1.0.0" @@ -6925,7 +6910,7 @@ process-nextick-args@~2.0.0: process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= progress@^2.0.0: version "2.0.3" @@ -6985,7 +6970,14 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.11.0: +qs@6.10.3: + version "6.10.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" + integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== + dependencies: + side-channel "^1.0.4" + +qs@^6.9.4: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== @@ -7016,11 +7008,6 @@ queue-microtask@^1.2.2, queue-microtask@^1.2.3: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -7051,16 +7038,6 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" -raw-body@2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -7079,9 +7056,9 @@ read-pkg@^1.0.0: path-type "^1.0.0" readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.8" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7113,13 +7090,13 @@ reduce-flatten@^2.0.0: integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== regexp.prototype.flags@^1.4.3: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== dependencies: call-bind "^1.0.2" - define-properties "^1.2.0" - functions-have-names "^1.2.3" + define-properties "^1.1.3" + functions-have-names "^1.2.2" regexpp@^3.1.0: version "3.2.0" @@ -7177,11 +7154,6 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -resolve-alpn@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" - integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -7199,17 +7171,10 @@ resolve@^1.10.0: responselike@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7" - integrity sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ== + integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec= dependencies: lowercase-keys "^1.0.0" -responselike@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" - integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== - dependencies: - lowercase-keys "^2.0.0" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -7278,16 +7243,6 @@ rxjs@6: dependencies: tslib "^1.9.0" -safe-array-concat@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" - integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.2.0" - has-symbols "^1.0.3" - isarray "^2.0.5" - safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -7298,15 +7253,6 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-regex-test@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.0.tgz#793b874d524eb3640d1873aad03596db2d4f2295" - integrity sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.3" - is-regex "^1.1.4" - "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -7315,7 +7261,7 @@ safe-regex-test@^1.0.0: scrypt-js@2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.3.tgz#bb0040be03043da9a012a2cea9fc9f852cfc87d4" - integrity sha512-d8DzQxNivoNDogyYmb/9RD5mEQE/Q7vG2dLDUgvfPmKL9xCVzgqUntOdS0me9Cq9Sh9VxIZuoNEFcsfyXRnyUw== + integrity sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q= scrypt-js@2.0.4: version "2.0.4" @@ -7446,7 +7392,7 @@ set-blocking@^2.0.0: setimmediate@1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== + integrity sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48= setimmediate@^1.0.5: version "1.0.5" @@ -7621,7 +7567,7 @@ statuses@2.0.1: strict-uri-encode@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ== + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= string-format@^2.0.0: version "2.0.0" @@ -7663,32 +7609,23 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" + integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.20.4" + es-abstract "^1.19.5" -string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== +string.prototype.trimstart@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" + integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.20.4" + es-abstract "^1.19.5" string_decoder@^1.1.1: version "1.3.0" @@ -7714,7 +7651,7 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" @@ -7756,7 +7693,7 @@ strip-hex-prefix@1.0.0: strip-json-comments@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" @@ -7815,15 +7752,15 @@ swarm-js@0.1.39: xhr-request-promise "^0.1.2" swarm-js@^0.1.40: - version "0.1.42" - resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" - integrity sha512-BV7c/dVlA3R6ya1lMlSSNPLYrntt0LUq4YMgy3iwpCIc6rZnS5W2wUoctarZ5pXlpKtxDDf9hNziEkcfrxdhqQ== + version "0.1.40" + resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.40.tgz#b1bc7b6dcc76061f6c772203e004c11997e06b99" + integrity sha512-yqiOCEoA4/IShXkY3WKwP5PvZhmoOOD8clsKA7EEcRILMkTEYHCQ21HDCAcVpmIxZq4LyZvWeRJ6quIyHk1caA== dependencies: bluebird "^3.5.0" buffer "^5.0.5" eth-lib "^0.1.26" fs-extra "^4.0.2" - got "^11.8.5" + got "^7.1.0" mime-types "^2.1.16" mkdirp-promise "^5.0.1" mock-fs "^4.1.0" @@ -7891,12 +7828,12 @@ text-table@^0.2.0: through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" - integrity sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA== + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= tiny-secp256k1@^1.1.3: version "1.1.6" @@ -8014,7 +7951,7 @@ tslib@^1.8.1, tslib@^1.9.0: tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" - integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= tsutils@^3.21.0: version "3.21.0" @@ -8102,15 +8039,6 @@ typechain@^8.1.1: ts-command-line-args "^2.2.0" ts-essentials "^7.0.1" -typed-array-length@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" - integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== - dependencies: - call-bind "^1.0.2" - for-each "^0.3.3" - is-typed-array "^1.1.9" - typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -8177,19 +8105,24 @@ underscore@1.9.1: integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== underscore@>1.4.4: - version "1.13.6" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" - integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== + version "1.13.3" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.3.tgz#54bc95f7648c5557897e5e968d0f76bc062c34ee" + integrity sha512-QvjkYpiD+dJJraRA8+dGAU4i7aBbb2s0S3jA45TFOvg2VgqvdCDd/3N6CqA8gluk1W91GLoXg5enMUx560QzuA== universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= uri-js@^4.2.2: version "4.4.1" @@ -8201,26 +8134,26 @@ uri-js@^4.2.2: url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" - integrity sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA== + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= dependencies: prepend-http "^1.0.1" url-parse-lax@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c" - integrity sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ== + integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww= dependencies: prepend-http "^2.0.0" url-set-query@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339" - integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg== + integrity sha1-AW6M/Xwg7gXK/neV6JK9BwL6ozk= url-to-options@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9" - integrity sha512-0kQLIzG4fdk/G5NONku64rSH/x32NOA39LVQqlK8Le6lvTF6GGRJpqaQFGgU+CLwySIqBSMdwYM0sYcW9f6P4A== + integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k= url@^0.11.0: version "0.11.0" @@ -8255,25 +8188,26 @@ util-deprecate@^1.0.1, util-deprecate@~1.0.1: integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= util@^0.12.0: - version "0.12.5" - resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" - integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== + version "0.12.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" + integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== dependencies: inherits "^2.0.3" is-arguments "^1.0.4" is-generator-function "^1.0.7" is-typed-array "^1.1.3" + safe-buffer "^5.1.2" which-typed-array "^1.1.2" utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= uuid@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== + integrity sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w= uuid@3.3.2: version "3.3.2" @@ -8306,7 +8240,7 @@ varint@^5.0.0: vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= verror@1.10.0: version "1.10.0" @@ -9104,21 +9038,21 @@ which-module@^1.0.0: integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" - integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which-typed-array@^1.1.2, which-typed-array@^1.1.9: - version "1.1.9" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" - integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA== +which-typed-array@^1.1.2: + version "1.1.8" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.8.tgz#0cfd53401a6f334d90ed1125754a42ed663eb01f" + integrity sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw== dependencies: available-typed-arrays "^1.0.5" call-bind "^1.0.2" + es-abstract "^1.20.0" for-each "^0.3.3" - gopd "^1.0.1" has-tostringtag "^1.0.0" - is-typed-array "^1.1.10" + is-typed-array "^1.1.9" which@1.3.1: version "1.3.1" @@ -9144,7 +9078,7 @@ wide-align@1.1.3: wif@2.0.6, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" - integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== + integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= dependencies: bs58check "<3.0.0" @@ -9239,7 +9173,7 @@ xhr-request@^1.0.1, xhr-request@^1.1.0: xhr2-cookies@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/xhr2-cookies/-/xhr2-cookies-1.1.0.tgz#7d77449d0999197f155cb73b23df72505ed89d48" - integrity sha512-hjXUA6q+jl/bd8ADHcVfFsSPIf+tyLIjuO9TwJC9WI6JP2zKcS7C+p56I9kCLLsaCiNT035iYvEUUzdEFj/8+g== + integrity sha1-fXdEnQmZGX8VXLc7I99yUF7YnUg= dependencies: cookiejar "^2.1.1" @@ -9256,7 +9190,7 @@ xhr@^2.0.4, xhr@^2.3.3: xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== + integrity sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw= xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0: version "4.0.2" @@ -9390,7 +9324,7 @@ yargs@^4.7.1: yauzl@^2.4.2: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== + integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= dependencies: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" @@ -9404,3 +9338,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zksync-web3@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" + integrity sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw== From 9f77c7a0657dffbc6eb946c2dcd2e2cd3cd2ec23 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 14:21:37 +0200 Subject: [PATCH 127/198] Add remaining governable parameters for redemption proposals --- .../contracts/bridge/WalletCoordinator.sol | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index c84dbd1a7..1580d1250 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -219,6 +219,39 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// proposal (of any type) can be submitted after 4 pm. uint32 public redemptionProposalValidity; + /// @notice The minimum time that must elapse since the redemption request + /// creation before a request becomes eligible for a processing. + /// + /// For example, if a request was created at 9 am and + /// redemptionRequestMinAge is 2 hours, the request is eligible for + /// processing after 11 am. + /// + /// @dev Forcing request minimum age ensures block finality for Ethereum. + uint32 public redemptionRequestMinAge; + + /// @notice Each redemption request can be technically handled until it + /// reaches its timeout timestamp after which it can be reported + /// as timed out. However, allowing the wallet to handle requests + /// that are close to their timeout timestamp may cause a race + /// between the wallet and the redeemer. In result, the wallet may + /// redeem the requested funds even though the redeemer already + /// received back their tBTC (locked during redemption request) upon + /// reporting the request timeout. In effect, the redeemer may end + /// out with both tBTC and redeemed BTC in their hands which has + /// a negative impact on the tBTC <-> BTC peg. In order to mitigate + /// that problem, this parameter determines a safety margin that + /// puts the latest moment a request can be handled far before the + /// point after which the request can be reported as timed out. + /// + /// For example, if a request times out after 8 pm and + /// redemptionRequestTimeoutSafetyMargin is 2 hours, the request is + /// valid for processing only before 6 pm. + uint32 public redemptionRequestTimeoutSafetyMargin; + + /// @notice The maximum count of redemption requests that can be processed + /// within a single redemption. + uint16 public redemptionMaxSize; + /// @notice Gas that is meant to balance the redemption proposal /// submission overall cost. Can be updated by the owner based on /// the current conditions. @@ -256,6 +289,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { event RedemptionProposalParametersUpdated( uint32 redemptionProposalValidity, + uint32 redemptionRequestMinAge, + uint32 redemptionRequestTimeoutSafetyMargin, + uint16 redemptionMaxSize, uint32 redemptionProposalSubmissionGasOffset ); @@ -300,6 +336,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { depositSweepProposalSubmissionGasOffset = 20_000; // optimized for 10 inputs redemptionProposalValidity = 1 hours; + redemptionRequestMinAge = 600; // 10 minutes or ~50 blocks. + redemptionRequestTimeoutSafetyMargin = 2 hours; + redemptionMaxSize = 20; redemptionProposalSubmissionGasOffset = 20_000; } @@ -737,13 +776,22 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// - The caller must be the owner. function updateRedemptionProposalParameters( uint32 _redemptionProposalValidity, + uint32 _redemptionRequestMinAge, + uint32 _redemptionRequestTimeoutSafetyMargin, + uint16 _redemptionMaxSize, uint32 _redemptionProposalSubmissionGasOffset ) external onlyOwner { redemptionProposalValidity = _redemptionProposalValidity; + redemptionRequestMinAge = _redemptionRequestMinAge; + redemptionRequestTimeoutSafetyMargin = _redemptionRequestTimeoutSafetyMargin; + redemptionMaxSize = _redemptionMaxSize; redemptionProposalSubmissionGasOffset = _redemptionProposalSubmissionGasOffset; emit RedemptionProposalParametersUpdated( _redemptionProposalValidity, + _redemptionRequestMinAge, + _redemptionRequestTimeoutSafetyMargin, + _redemptionMaxSize, _redemptionProposalSubmissionGasOffset ); } From 590248549c0365d963d20b668cdfba47c99770fc Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 14:22:26 +0200 Subject: [PATCH 128/198] Implementation of `validateRedemptionProposal` function --- .../contracts/bridge/WalletCoordinator.sol | 125 ++++++++++++++++-- 1 file changed, 117 insertions(+), 8 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 1580d1250..a9a194c51 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -25,6 +25,7 @@ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./BitcoinTx.sol"; import "./Bridge.sol"; import "./Deposit.sol"; +import "./Redemption.sol"; import "./Wallets.sol"; /// @title Wallet coordinator. @@ -843,16 +844,124 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @param proposal The redemption proposal to validate. /// @return True if the proposal is valid. Reverts otherwise. /// @dev Requirements: - /// - To be determined - function validateRedemptionProposal() + /// - The target wallet must be in the Live state, + /// - The number of redemption requests included in the redemption + /// proposal must be in the range [1, `redemptionMaxSize`], + /// - The proposed redemption tx fee must be grater than zero, + /// - The proposed redemption tx fee must be lesser than or equal to + /// the maximum total fee allowed by the Bridge + /// (`Bridge.redemptionTxMaxTotalFee`), + /// - The proposed maximum per-request redemption tx fee share must be + /// lesser than or equal to the maximum fee share allowed by the + /// given request (`RedemptionRequest.txMaxFee`), + /// - Each request must be a pending request registered in the Bridge, + /// - Each request must be old enough, i.e. at least `redemptionRequestMinAge` + /// elapsed since their creation time, + /// - Each request must have the timeout safety margin preserved. + function validateRedemptionProposal(RedemptionProposal calldata proposal) external view - returns ( - // RedemptionProposal calldata proposal - bool - ) + returns (bool) { - // TODO: Implementation. - revert("not implemented yet"); + require( + bridge.wallets(proposal.walletPubKeyHash).state == + Wallets.WalletState.Live, + "Wallet is not in Live state" + ); + + uint256 requestsCount = proposal.redeemersOutputScripts.length; + + require(requestsCount > 0, "Redemption below the min size"); + + require( + requestsCount <= redemptionMaxSize, + "Redemption exceeds the max size" + ); + + ( + , + , + , + uint64 redemptionTxMaxTotalFee, + uint32 redemptionTimeout, + , + + ) = bridge.redemptionParameters(); + + require( + proposal.redemptionTxFee > 0, + "Proposed transaction fee cannot be zero" + ); + + // Make sure the proposed fee does not exceed the total fee limit. + require( + proposal.redemptionTxFee <= redemptionTxMaxTotalFee, + "Proposed transaction fee is too high" + ); + + // Compute the indivisible remainder that remains after dividing the + // redemption transaction fee over all requests evenly. + uint256 redemptionTxFeeRemainder = proposal.redemptionTxFee % + requestsCount; + // Compute the transaction fee per request by dividing the redemption + // transaction fee (reduced by the remainder) by the number of requests. + uint256 redemptionTxFeePerRequest = (proposal.redemptionTxFee - + redemptionTxFeeRemainder) / requestsCount; + + for (uint256 i = 0; i < requestsCount; i++) { + bytes memory script = proposal.redeemersOutputScripts[i]; + + // As the wallet public key hash is part of the redemption key, + // we have an implicit guarantee that all requests being part + // of the proposal target the same wallet. + uint256 redemptionKey = uint256( + keccak256( + abi.encodePacked( + keccak256(script), + proposal.walletPubKeyHash + ) + ) + ); + + Redemption.RedemptionRequest memory redemptionRequest = bridge + .pendingRedemptions(redemptionKey); + + require( + redemptionRequest.requestedAt != 0, + "Not a pending redemption request" + ); + + require( + /* solhint-disable-next-line not-rely-on-time */ + block.timestamp > + redemptionRequest.requestedAt + redemptionRequestMinAge, + "Redemption request min age not achieved yet" + ); + + // Calculate the timeout the given request times out at. + uint32 requestTimeout = redemptionRequest.requestedAt + + redemptionTimeout; + // Make sure we are far enough from the moment the request times out. + require( + /* solhint-disable-next-line not-rely-on-time */ + block.timestamp < + requestTimeout - redemptionRequestTimeoutSafetyMargin, + "Redemption request timeout safety margin is not preserved" + ); + + uint256 feePerRequest = redemptionTxFeePerRequest; + // The last request incurs the fee remainder. + if (i == requestsCount - 1) { + feePerRequest += redemptionTxFeeRemainder; + } + // Make sure the redemption transaction fee share incurred by + // the given request fits in the limit for that request. + require( + feePerRequest <= redemptionRequest.txMaxFee, + "Proposed transaction per-request fee share is too high" + ); + } + + return true; } } From c5cb81907ec97e208b4795a0dba2d077a252b552 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 14 Jun 2023 14:42:29 +0200 Subject: [PATCH 129/198] Fix failing tests Adjust the `requestRedemption` tests to the new implementation. --- typescript/test/redemption.test.ts | 20 ++++++++-- typescript/test/utils/mock-bridge.ts | 48 ++++++++++++++++++++++++ typescript/test/utils/mock-tbtc-token.ts | 33 ++++++++++++++++ 3 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 typescript/test/utils/mock-tbtc-token.ts diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index a32a09ae3..c159016c5 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -34,6 +34,8 @@ import * as chai from "chai" import chaiAsPromised from "chai-as-promised" import { expect } from "chai" import { BigNumberish, BigNumber } from "ethers" +import { Address } from "../src/ethereum" +import { MockTBTCToken } from "./utils/mock-tbtc-token" chai.use(chaiAsPromised) @@ -45,28 +47,40 @@ describe("Redemption", () => { data.pendingRedemptions[0].pendingRedemption.redeemerOutputScript const amount = data.pendingRedemptions[0].pendingRedemption.requestedAmount const bridge: MockBridge = new MockBridge() + const vault = Address.from("0xb622eA9D678ddF15135a20d59Ff26D28eC246bfB") + const token: MockTBTCToken = new MockTBTCToken() + const redeemer = Address.from("0x117284D8C50f334a1E2b7712649cB23C7a04Ae74") beforeEach(async () => { bcoin.set("testnet") await requestRedemption( + redeemer, walletPublicKey, mainUtxo, redeemerOutputScript, amount, - bridge + vault, + bridge, + token ) }) it("should submit redemption proof with correct arguments", () => { - const bridgeLog = bridge.requestRedemptionLog + const bridgeLog = bridge.buildRedemptionDataLog + const tokenLog = token.approveAndCallLog + expect(bridgeLog.length).to.equal(1) expect(bridgeLog[0].walletPublicKey).to.equal( redemptionProof.expectedRedemptionProof.walletPublicKey ) expect(bridgeLog[0].mainUtxo).to.equal(mainUtxo) expect(bridgeLog[0].redeemerOutputScript).to.equal(redeemerOutputScript) - expect(bridgeLog[0].amount).to.equal(amount) + expect(bridgeLog[0].redeemer).to.equal(redeemer) + + expect(tokenLog.length).to.equal(1) + expect(tokenLog[0].spender).to.equal(vault) + expect(tokenLog[0].amount).to.equal(amount) }) }) diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index d342357c2..2466c145f 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -43,6 +43,13 @@ interface RedemptionProofLogEntry { walletPublicKey: string } +interface BuildRedemptionDataLogEntry { + redeemer: Identifier + walletPublicKey: string + mainUtxo: UnspentTransactionOutput + redeemerOutputScript: string +} + /** * Mock Bridge used for test purposes. */ @@ -56,6 +63,7 @@ export class MockBridge implements Bridge { private _redemptionProofLog: RedemptionProofLogEntry[] = [] private _deposits = new Map() private _activeWalletPublicKey: string | undefined + private _buildRedemptionDataLog: BuildRedemptionDataLogEntry[] = [] setPendingRedemptions(value: Map) { this._pendingRedemptions = value @@ -81,6 +89,10 @@ export class MockBridge implements Bridge { return this._redemptionProofLog } + get buildRedemptionDataLog(): BuildRedemptionDataLogEntry[] { + return this._buildRedemptionDataLog + } + setDeposits(value: Map) { this._deposits = value } @@ -314,4 +326,40 @@ export class MockBridge implements Bridge { walletRegistry(): Promise { throw new Error("not implemented") } + + buildRedemptionData( + redeemer: Identifier, + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string + ): Hex { + this._buildRedemptionDataLog.push({ + redeemer, + walletPublicKey, + mainUtxo, + redeemerOutputScript, + }) + + // Convert the output script to raw bytes buffer. + const rawRedeemerOutputScript = Buffer.from(redeemerOutputScript, "hex") + // Prefix the output script bytes buffer with 0x and its own length. + const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ + Buffer.from([rawRedeemerOutputScript.length]), + rawRedeemerOutputScript, + ]).toString("hex")}` + + return Hex.from( + utils.defaultAbiCoder.encode( + ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], + [ + redeemer.identifierHex, + `0x${computeHash160(walletPublicKey)}`, + mainUtxo.transactionHash.reverse().toPrefixedString(), + mainUtxo.outputIndex, + mainUtxo.value, + prefixedRawRedeemerOutputScript, + ] + ) + ) + } } diff --git a/typescript/test/utils/mock-tbtc-token.ts b/typescript/test/utils/mock-tbtc-token.ts new file mode 100644 index 000000000..5c101ff28 --- /dev/null +++ b/typescript/test/utils/mock-tbtc-token.ts @@ -0,0 +1,33 @@ +import { Identifier, TBTCToken } from "../../src/chain" +import { Hex } from "../../src/hex" +import { BigNumber } from "ethers" + +interface ApproveAndCallLog { + spender: Identifier + amount: BigNumber + extraData: Hex +} + +export class MockTBTCToken implements TBTCToken { + private _approveAndCallLog: ApproveAndCallLog[] = [] + + get approveAndCallLog() { + return this._approveAndCallLog + } + + totalSupply(blockNumber?: number | undefined): Promise { + throw new Error("Method not implemented.") + } + async approveAndCall( + spender: Identifier, + amount: BigNumber, + extraData: Hex + ): Promise { + this._approveAndCallLog.push({ spender, amount, extraData }) + + // Random tx hash + return Hex.from( + "0xf7d0c92c8de4d117d915c2a8a54ee550047f926bc00b91b651c40628751cfe29" + ) + } +} From 5d1bb8380e0954ef099a29db88fbc51bd4d4f559 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 14:58:20 +0200 Subject: [PATCH 130/198] Suppress Slither warning --- solidity/contracts/bridge/WalletCoordinator.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index a9a194c51..526974ee3 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -923,6 +923,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { ) ); + // slither-disable-next-line calls-loop Redemption.RedemptionRequest memory redemptionRequest = bridge .pendingRedemptions(redemptionKey); From cb74a0d42df2633c4081026f11a1feb3bc717c69 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 15:19:52 +0200 Subject: [PATCH 131/198] Unit tests for `updateRedemptionProposalParameters` function --- .../test/bridge/WalletCoordinator.test.ts | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 4b6f6a7bf..2cb2fadba 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2040,6 +2040,64 @@ describe("WalletCoordinator", () => { }) }) }) + + describe("updateRedemptionProposalParameters", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when called by a third party", () => { + it("should revert", async () => { + await expect( + walletCoordinator + .connect(thirdParty) + .updateRedemptionProposalParameters(101, 102, 103, 104, 105) + ).to.be.revertedWith("Ownable: caller is not the owner") + }) + }) + + context("when called by the owner", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + tx = await walletCoordinator + .connect(owner) + .updateRedemptionProposalParameters(101, 102, 103, 104, 105) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should update redemption proposal parameters", async () => { + expect( + await walletCoordinator.redemptionProposalValidity() + ).to.be.equal(101) + expect(await walletCoordinator.redemptionRequestMinAge()).to.be.equal( + 102 + ) + expect( + await walletCoordinator.redemptionRequestTimeoutSafetyMargin() + ).to.be.equal(103) + expect(await walletCoordinator.redemptionMaxSize()).to.be.equal(104) + expect( + await walletCoordinator.redemptionProposalSubmissionGasOffset() + ).to.be.equal(105) + }) + + it("should emit the RedemptionProposalParametersUpdated event", async () => { + await expect(tx) + .to.emit(walletCoordinator, "RedemptionProposalParametersUpdated") + .withArgs(101, 102, 103, 104, 105) + }) + }) + }) }) const depositKey = ( From 72b400689f796619a26b604db96a6cab3fb8e34c Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 15:34:31 +0200 Subject: [PATCH 132/198] Unit tests for `submitRedemptionProposal` function --- .../test/bridge/WalletCoordinator.test.ts | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 2cb2fadba..149dc762b 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2098,6 +2098,174 @@ describe("WalletCoordinator", () => { }) }) }) + + describe("submitRedemptionProposal", () => { + const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" + + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .submitRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) + + context("when the caller is a coordinator", () => { + before(async () => { + await createSnapshot() + + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + context("when wallet is time-locked", () => { + before(async () => { + await createSnapshot() + + // Submit a proposal to set a wallet time lock. + await walletCoordinator.connect(thirdParty).submitRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + // Jump to the end of the lock period but not beyond it. + await increaseTime( + (await walletCoordinator.redemptionProposalValidity()) - 1 + ) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + await expect( + walletCoordinator.connect(thirdParty).submitRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + ).to.be.revertedWith("Wallet locked") + }) + }) + + context("when wallet is not time-locked", () => { + let tx: ContractTransaction + + before(async () => { + await createSnapshot() + + // Submit a proposal to set a wallet time lock. + await walletCoordinator.connect(thirdParty).submitRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + // Jump beyond the lock period. + await increaseTime( + await walletCoordinator.redemptionProposalValidity() + ) + + tx = await walletCoordinator + .connect(thirdParty) + .submitRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 6000, + }) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should time lock the wallet", async () => { + const lockedUntil = + (await lastBlockTime()) + + (await walletCoordinator.redemptionProposalValidity()) + + const walletLock = await walletCoordinator.walletLock( + walletPubKeyHash + ) + + expect(walletLock.expiresAt).to.be.equal(lockedUntil) + expect(walletLock.cause).to.be.equal(walletAction.Redemption) + }) + + it("should emit the RedemptionProposalSubmitted event", async () => { + await expect(tx).to.emit( + walletCoordinator, + "RedemptionProposalSubmitted" + ) + + // The `expect.to.emit.withArgs` assertion has troubles with + // matching complex event arguments as it uses strict equality + // underneath. To overcome that problem, we manually get event's + // arguments and check it against the expected ones using deep + // equality assertion (eql). + const receipt = await ethers.provider.getTransactionReceipt(tx.hash) + expect(receipt.logs.length).to.be.equal(1) + expect( + walletCoordinator.interface.parseLog(receipt.logs[0]).args + ).to.be.eql([ + [ + walletPubKeyHash, + [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + BigNumber.from(6000), + ], + thirdParty.address, + ]) + }) + }) + }) + }) }) const depositKey = ( From 5d26e0031bfef1b8deb57fbb2414789de113733b Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 15:51:04 +0200 Subject: [PATCH 133/198] Unit tests for `submitRedemptionProposalWithReimbursement` function --- .../test/bridge/WalletCoordinator.test.ts | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 149dc762b..a78651bcf 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2266,6 +2266,102 @@ describe("WalletCoordinator", () => { }) }) }) + + describe("submitRedemptionProposalWithReimbursement", () => { + const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" + + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + // Just double check that `submitRedemptionProposalWithReimbursement` has + // the same ACL as `submitRedemptionProposal`. + context("when the caller is not a coordinator", () => { + before(async () => { + await createSnapshot() + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should revert", async () => { + const tx = walletCoordinator + .connect(thirdParty) + .submitRedemptionProposalWithReimbursement({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + await expect(tx).to.be.revertedWith("Caller is not a coordinator") + }) + }) + + // Here we just check that the reimbursement works. Detailed + // assertions are already done within the scenario stressing the + // `submitRedemptionProposal` function. + context("when the caller is a coordinator", () => { + let coordinatorBalanceBefore: BigNumber + let coordinatorBalanceAfter: BigNumber + + before(async () => { + await createSnapshot() + + await walletCoordinator + .connect(owner) + .addCoordinator(thirdParty.address) + + // The first-ever proposal will be more expensive given it has to set + // fields to non-zero values. We shouldn't adjust gas offset based on it. + await walletCoordinator + .connect(thirdParty) + .submitRedemptionProposalWithReimbursement({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + // Jump beyond the lock period. + await increaseTime(await walletCoordinator.redemptionProposalValidity()) + + coordinatorBalanceBefore = await provider.getBalance(thirdParty.address) + + await walletCoordinator + .connect(thirdParty) + .submitRedemptionProposalWithReimbursement({ + walletPubKeyHash, + redeemersOutputScripts: [ + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + ], + redemptionTxFee: 5000, + }) + + coordinatorBalanceAfter = await provider.getBalance(thirdParty.address) + }) + + after(async () => { + await restoreSnapshot() + }) + + it("should do the refund", async () => { + const diff = coordinatorBalanceAfter.sub(coordinatorBalanceBefore) + expect(diff).to.be.gt(0) + expect(diff).to.be.lt(ethers.utils.parseUnits("4000000", "gwei")) // 0,004 ETH + }) + }) + }) }) const depositKey = ( From 0c8bc69b316c4afe7db7ce5c274f130213fa13ec Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Jun 2023 17:37:29 +0200 Subject: [PATCH 134/198] Unit tests for `validateRedemptionProposal` function --- .../test/bridge/WalletCoordinator.test.ts | 655 ++++++++++++++++++ 1 file changed, 655 insertions(+) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index a78651bcf..72387a413 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2362,6 +2362,613 @@ describe("WalletCoordinator", () => { }) }) }) + + describe("validateRedemptionProposal", () => { + const walletPubKeyHash = "0x7ac2d9378a1c47e589dfb8095ca95ed2140d2726" + const ecdsaWalletID = + "0x4ad6b3ccbca81645865d8d0d575797a15528e98ced22f29a6f906d3259569863" + + const bridgeRedemptionTxMaxTotalFee = 10000 + const bridgeRedemptionTimeout = 5 * 86400 // 5 days + + before(async () => { + await createSnapshot() + + bridge.redemptionParameters.returns([ + 0, + 0, + 0, + bridgeRedemptionTxMaxTotalFee, + bridgeRedemptionTimeout, + 0, + 0, + ]) + }) + + after(async () => { + bridge.redemptionParameters.reset() + + await restoreSnapshot() + }) + + context("when wallet is not Live", () => { + const testData = [ + { + testName: "when wallet state is Unknown", + walletState: walletState.Unknown, + }, + { + testName: "when wallet state is MovingFunds", + walletState: walletState.MovingFunds, + }, + { + testName: "when wallet state is Closing", + walletState: walletState.Closing, + }, + { + testName: "when wallet state is Closed", + walletState: walletState.Closed, + }, + { + testName: "when wallet state is Terminated", + walletState: walletState.Terminated, + }, + ] + + testData.forEach((test) => { + context(test.testName, () => { + before(async () => { + await createSnapshot() + + bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ + ecdsaWalletID, + mainUtxoHash: HashZero, + pendingRedemptionsValue: 0, + createdAt: 0, + movingFundsRequestedAt: 0, + closingStartedAt: 0, + pendingMovedFundsSweepRequestsCount: 0, + state: test.walletState, + movingFundsTargetWalletsCommitmentHash: HashZero, + }) + }) + + after(async () => { + bridge.wallets.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + await expect( + // Only walletPubKeyHash argument is relevant in this scenario. + walletCoordinator.validateRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [], + redemptionTxFee: 0, + }) + ).to.be.revertedWith("Wallet is not in Live state") + }) + }) + }) + }) + + context("when wallet is Live", () => { + before(async () => { + await createSnapshot() + + bridge.wallets.whenCalledWith(walletPubKeyHash).returns({ + ecdsaWalletID, + mainUtxoHash: HashZero, + pendingRedemptionsValue: 0, + createdAt: 0, + movingFundsRequestedAt: 0, + closingStartedAt: 0, + pendingMovedFundsSweepRequestsCount: 0, + state: walletState.Live, + movingFundsTargetWalletsCommitmentHash: HashZero, + }) + }) + + after(async () => { + bridge.wallets.reset() + + await restoreSnapshot() + }) + + context("when redemption is below the min size", () => { + it("should revert", async () => { + await expect( + walletCoordinator.validateRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [], // Set size to 0. + redemptionTxFee: 0, // Not relevant in this scenario. + }) + ).to.be.revertedWith("Redemption below the min size") + }) + }) + + context("when redemption is above the min size", () => { + context("when redemption exceeds the max size", () => { + it("should revert", async () => { + const maxSize = await walletCoordinator.redemptionMaxSize() + + // Pick more redemption requests than allowed. + const redeemersOutputScripts = new Array(maxSize + 1).fill( + createTestRedemptionRequest(walletPubKeyHash).key + .redeemerOutputScript + ) + + await expect( + walletCoordinator.validateRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts, + redemptionTxFee: 0, // Not relevant in this scenario. + }) + ).to.be.revertedWith("Redemption exceeds the max size") + }) + }) + + context("when redemption does not exceed the max size", () => { + context("when proposed redemption tx fee is invalid", () => { + context("when proposed redemption tx fee is zero", () => { + it("should revert", async () => { + await expect( + walletCoordinator.validateRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + createTestRedemptionRequest(walletPubKeyHash).key + .redeemerOutputScript, + ], + redemptionTxFee: 0, + }) + ).to.be.revertedWith("Proposed transaction fee cannot be zero") + }) + }) + + context( + "when proposed redemption tx fee is greater than the allowed total fee", + () => { + it("should revert", async () => { + await expect( + walletCoordinator.validateRedemptionProposal({ + walletPubKeyHash, + redeemersOutputScripts: [ + createTestRedemptionRequest(walletPubKeyHash).key + .redeemerOutputScript, + ], + // Exceed the max per-request fee by one. + redemptionTxFee: bridgeRedemptionTxMaxTotalFee + 1, + }) + ).to.be.revertedWith("Proposed transaction fee is too high") + }) + } + ) + }) + + context("when proposed redemption tx fee is valid", () => { + const redemptionTxFee = 9000 + + context("when there is a non-pending request", () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + requestTwo = createTestRedemptionRequest(walletPubKeyHash) + + // Request one is a proper one. + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + // Simulate the request two is non-pending. + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns({ + ...requestTwo.content, + requestedAt: 0, + }) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + await expect( + walletCoordinator.validateRedemptionProposal(proposal) + ).to.be.revertedWith("Not a pending redemption request") + }) + }) + + context("when all requests are pending", () => { + context("when there is an immature request", () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + requestTwo = createTestRedemptionRequest(walletPubKeyHash) + + // Request one is a proper one. + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + // Simulate the request two has just been created thus not + // achieved the min age yet. + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns({ + ...requestTwo.content, + requestedAt: await lastBlockTime(), + }) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + await expect( + walletCoordinator.validateRedemptionProposal(proposal) + ).to.be.revertedWith( + "Redemption request min age not achieved yet" + ) + }) + }) + + context("when all requests achieved the min age", () => { + context( + "when there is a request that violates the timeout safety margin", + () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + // Request one is a proper one. + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + + // Simulate that request two violates the timeout safety margin. + // In order to do so, we need to use `createTestRedemptionRequest` + // with a custom request creation time that will produce + // a timeout timestamp being closer to the current + // moment than allowed by the refund safety margin. + const safetyMarginViolatedAt = await lastBlockTime() + const requestTimedOutAt = + safetyMarginViolatedAt + + (await walletCoordinator.redemptionRequestTimeoutSafetyMargin()) + const requestCreatedAt = + requestTimedOutAt - bridgeRedemptionTimeout + + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 0, + requestCreatedAt + ) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + await expect( + walletCoordinator.validateRedemptionProposal(proposal) + ).to.be.revertedWith( + "Redemption request timeout safety margin is not preserved" + ) + }) + } + ) + + context( + "when all requests preserve the timeout safety margin", + () => { + context( + "when there is a request that incurs an unacceptable tx fee share", + () => { + context("when there is no fee remainder", () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + // Request one is a proper one. + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 4500 // necessary to pass the fee share validation + ) + + // Simulate that request two takes an unacceptable + // tx fee share. Because redemptionTxFee used + // in the proposal is 9000, the actual fee share + // per-request is 4500. In order to test this case + // the second request must allow for 4499 as allowed + // fee share at maximum. + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 4499 + ) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + await expect( + walletCoordinator.validateRedemptionProposal( + proposal + ) + ).to.be.revertedWith( + "Proposed transaction per-request fee share is too high" + ) + }) + }) + + context("when there is a fee remainder", () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + // Request one is a proper one. + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 4500 // necessary to pass the fee share validation + ) + + // Simulate that request two takes an unacceptable + // tx fee share. Because redemptionTxFee used + // in the proposal is 9001, the actual fee share + // per-request is 4500 and 4501 for the last request + // which takes the remainder. In order to test this + // case the second (last) request must allow for + // 4500 as allowed fee share at maximum. + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 4500 + ) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee: 9001, + } + + await expect( + walletCoordinator.validateRedemptionProposal( + proposal + ) + ).to.be.revertedWith( + "Proposed transaction per-request fee share is too high" + ) + }) + }) + } + ) + + context( + "when all requests incur an acceptable tx fee share", + () => { + let requestOne + let requestTwo + + before(async () => { + await createSnapshot() + + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should succeed", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + const result = + await walletCoordinator.validateRedemptionProposal( + proposal + ) + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(result).to.be.true + }) + } + ) + } + ) + }) + }) + }) + }) + }) + }) + }) }) const depositKey = ( @@ -2464,3 +3071,51 @@ const createTestDeposit = ( }, } } + +const redemptionKey = ( + walletPubKeyHash: BytesLike, + redeemerOutputScript: BytesLike +) => { + const scriptHash = ethers.utils.solidityKeccak256( + ["bytes"], + [redeemerOutputScript] + ) + + return ethers.utils.solidityKeccak256( + ["bytes32", "bytes20"], + [scriptHash, walletPubKeyHash] + ) +} + +const createTestRedemptionRequest = ( + walletPubKeyHash: string, + txMaxFee?: BigNumberish, + requestedAt?: number +) => { + let resolvedRequestedAt = requestedAt + + if (!resolvedRequestedAt) { + // If the request creation time is not explicitly set, use `now - 1 day` to + // ensure request minimum age is achieved by default. + const now = Math.floor(Date.now() / 1000) + resolvedRequestedAt = now - day + } + + const redeemer = `0x${crypto.randomBytes(20).toString("hex")}` + + const redeemerOutputScript = `0x${crypto.randomBytes(32).toString("hex")}` + + return { + key: { + walletPubKeyHash, + redeemerOutputScript, + }, + content: { + redeemer, + requestedAmount: 0, // not relevant + treasuryFee: 0, // not relevant + txMaxFee: txMaxFee ?? 0, + requestedAt: resolvedRequestedAt, + }, + } +} From 2d68ac5ac77efaaf6e56b2862b2b37377bf15d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Thu, 15 Jun 2023 09:04:20 +0200 Subject: [PATCH 135/198] Update dependencies to `keep-ecdsa` and `tbtc-v2` packages We have published new `@keep-network/ecdsa` and `@keep-network/tbtc-v2` packages. Those packages no longer include the `prepare-dependencies.sh` script from `@threshold-network/solidity-contracts` which was causing random failures during `yarn install`. As in some CI jobs we install the dependencies based on the lockfile (with the `--frozen-lockfile` flag), we need to update dependencies in the lockfile so that the new, improved packages would be used. --- typescript/yarn.lock | 502 +++++++++---------------------------------- 1 file changed, 96 insertions(+), 406 deletions(-) diff --git a/typescript/yarn.lock b/typescript/yarn.lock index 2378ac9e1..561d0069a 100644 --- a/typescript/yarn.lock +++ b/typescript/yarn.lock @@ -406,21 +406,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" - integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== - dependencies: - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/abstract-provider@5.5.1", "@ethersproject/abstract-provider@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" @@ -447,7 +432,7 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/web" "^5.6.0" -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": +"@ethersproject/abstract-provider@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== @@ -493,7 +478,7 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": +"@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== @@ -526,7 +511,7 @@ "@ethersproject/logger" "^5.6.0" "@ethersproject/rlp" "^5.6.0" -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.7.0": +"@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -551,7 +536,7 @@ dependencies: "@ethersproject/bytes" "^5.6.0" -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": +"@ethersproject/base64@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== @@ -574,7 +559,7 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/properties" "^5.6.0" -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": +"@ethersproject/basex@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== @@ -609,7 +594,7 @@ "@ethersproject/logger" "^5.6.0" bn.js "^4.11.9" -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": +"@ethersproject/bignumber@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== @@ -632,7 +617,7 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== @@ -653,7 +638,7 @@ dependencies: "@ethersproject/bignumber" "^5.6.0" -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": +"@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== @@ -708,22 +693,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/transactions" "^5.6.0" -"@ethersproject/contracts@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" - integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg== - dependencies: - "@ethersproject/abi" "^5.7.0" - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/hash@5.5.0", "@ethersproject/hash@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" @@ -752,7 +721,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": +"@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -821,24 +790,6 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" - integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - "@ethersproject/json-wallets@5.5.0", "@ethersproject/json-wallets@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz#dd522d4297e15bccc8e1427d247ec8376b60e325" @@ -877,25 +828,6 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" - integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== - dependencies: - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/pbkdf2" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - "@ethersproject/keccak256@5.5.0", "@ethersproject/keccak256@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" @@ -912,7 +844,7 @@ "@ethersproject/bytes" "^5.6.0" js-sha3 "0.8.0" -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": +"@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -930,7 +862,7 @@ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a" integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg== -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": +"@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== @@ -956,7 +888,7 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0": +"@ethersproject/networks@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== @@ -979,14 +911,6 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/sha2" "^5.6.0" -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" - integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/properties@5.5.0", "@ethersproject/properties@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" @@ -1001,7 +925,7 @@ dependencies: "@ethersproject/logger" "^5.6.0" -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": +"@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== @@ -1083,32 +1007,6 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": - version "5.7.2" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" - integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/base64" "^5.7.0" - "@ethersproject/basex" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/networks" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/rlp" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/web" "^5.7.0" - bech32 "1.1.4" - ws "7.4.6" - "@ethersproject/providers@^5.6.2": version "5.6.7" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.7.tgz#1f88ec94febb79a90e33f7e0100354878fb4dabe" @@ -1135,6 +1033,32 @@ bech32 "1.1.4" ws "7.4.6" +"@ethersproject/providers@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" + integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/basex" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/sha2" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + bech32 "1.1.4" + ws "7.4.6" + "@ethersproject/random@5.5.0", "@ethersproject/random@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.5.0.tgz#305ed9e033ca537735365ac12eed88580b0f81f9" @@ -1151,7 +1075,7 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": +"@ethersproject/random@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== @@ -1175,7 +1099,7 @@ "@ethersproject/bytes" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": +"@ethersproject/rlp@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== @@ -1201,7 +1125,7 @@ "@ethersproject/logger" "^5.6.0" hash.js "1.1.7" -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": +"@ethersproject/sha2@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== @@ -1246,7 +1170,7 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": +"@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== @@ -1282,18 +1206,6 @@ "@ethersproject/sha2" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/solidity@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" - integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/sha2" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ethersproject/strings@5.5.0", "@ethersproject/strings@^5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" @@ -1312,7 +1224,7 @@ "@ethersproject/constants" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -1351,7 +1263,7 @@ "@ethersproject/rlp" "^5.6.0" "@ethersproject/signing-key" "^5.6.0" -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -1384,15 +1296,6 @@ "@ethersproject/constants" "^5.6.0" "@ethersproject/logger" "^5.6.0" -"@ethersproject/units@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" - integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg== - dependencies: - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/constants" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/wallet@5.5.0": version "5.5.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.5.0.tgz#322a10527a440ece593980dca6182f17d54eae75" @@ -1456,27 +1359,6 @@ "@ethersproject/transactions" "^5.6.0" "@ethersproject/wordlists" "^5.6.0" -"@ethersproject/wallet@5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" - integrity sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA== - dependencies: - "@ethersproject/abstract-provider" "^5.7.0" - "@ethersproject/abstract-signer" "^5.7.0" - "@ethersproject/address" "^5.7.0" - "@ethersproject/bignumber" "^5.7.0" - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/hdnode" "^5.7.0" - "@ethersproject/json-wallets" "^5.7.0" - "@ethersproject/keccak256" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/random" "^5.7.0" - "@ethersproject/signing-key" "^5.7.0" - "@ethersproject/transactions" "^5.7.0" - "@ethersproject/wordlists" "^5.7.0" - "@ethersproject/web@5.5.1", "@ethersproject/web@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.1.tgz#cfcc4a074a6936c657878ac58917a61341681316" @@ -1499,7 +1381,7 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": +"@ethersproject/web@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== @@ -1532,17 +1414,6 @@ "@ethersproject/properties" "^5.6.0" "@ethersproject/strings" "^5.6.0" -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" - integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== - dependencies: - "@ethersproject/bytes" "^5.7.0" - "@ethersproject/hash" "^5.7.0" - "@ethersproject/logger" "^5.7.0" - "@ethersproject/properties" "^5.7.0" - "@ethersproject/strings" "^5.7.0" - "@ganache/ethereum-address@0.1.4": version "0.1.4" resolved "https://registry.yarnpkg.com/@ganache/ethereum-address/-/ethereum-address-0.1.4.tgz#0e6d66f4a24f64bf687cb3ff7358fb85b9d9005e" @@ -1624,16 +1495,16 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.2", "@keep-network/ecdsa@development": - version "2.1.0-dev.2" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.2.tgz#bb130ef37d6374909dc4bde858d5664e08b1ebce" - integrity sha512-ERzuqvQFkyN5+2MAGiCgDW2kroTrm1Dnd7yRch3yf+HctjPZ6ocfgubhgqFGwCqG4VLXfS/NIezqORege3N6og== +"@keep-network/ecdsa@2.1.0-dev.13", "@keep-network/ecdsa@development": + version "2.1.0-dev.13" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.13.tgz#31f2f28e74485dcbe03f782f5f67ac299203f3f1" + integrity sha512-Gv9nNQQkE/VTitFSiJqQUXczIbHWOBVG7UH6h3MDo7Pcgl4iuXhM5nmQdRd9vqjU42rI+TyPuSErWjg2+QEEEw== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.1" + "@keep-network/random-beacon" "2.1.0-dev.13" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" "@keep-network/keep-core@1.8.0-dev.5": version "1.8.0-dev.5" @@ -1651,7 +1522,7 @@ "@openzeppelin/upgrades" "^2.7.2" openzeppelin-solidity "2.4.0" -"@keep-network/keep-ecdsa@>1.9.0-dev <1.9.0-ropsten": +"@keep-network/keep-ecdsa@1.9.0-dev.1", "@keep-network/keep-ecdsa@>1.9.0-dev <1.9.0-ropsten": version "1.9.0-dev.1" resolved "https://registry.yarnpkg.com/@keep-network/keep-ecdsa/-/keep-ecdsa-1.9.0-dev.1.tgz#7522b47dd639ddd7479a0e71dc328a9e0bba7cae" integrity sha512-FRIDejTUiQO7c9gBXgjtTp2sXkEQKFBBqVjYoZE20OCGRxbgum9FbgD/B5RWIctBy4GGr5wJHnA1789iaK3X6A== @@ -1665,25 +1536,25 @@ version "0.0.1" resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/a1a333e7ac49928a0f6ed39421906dd1e46ab0f3" -"@keep-network/random-beacon@2.1.0-dev.1": - version "2.1.0-dev.1" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.1.tgz#197422cef030cb61b0b88fc08a59292a9efb3b28" - integrity sha512-ppCPriGEhyc2Aw30wu0ujLphs6wRUdPYR345Knts8tx/z+D49Xg+3JA5tcUiPgXBnJnJJ00sk6uHXdhUS3LLDg== +"@keep-network/random-beacon@2.1.0-dev.13": + version "2.1.0-dev.13" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.13.tgz#8b4d20456e17cb76531a25c98370d3a6da8c8be5" + integrity sha512-o5+LvzQB5Sqnpbu5Wr97HvU63rlw9v/O5ZGxDiWe4XwzFhC/FEnza+uWgWm1IJkFVrQj/DzYokqkzgANx/lBnA== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" - "@openzeppelin/contracts" "^4.6.0" + "@openzeppelin/contracts" "4.7.3" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" -"@keep-network/random-beacon@2.1.0-dev.2": - version "2.1.0-dev.2" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.2.tgz#aaf5bb4780b6aac6e71ba6ed8ecb29b4ccf6ae81" - integrity sha512-Xc4MIQ65etB11GDLBPUvO8XRs6f2DVY0FmPF2uU00x8/fOIg12jjyyBQwNP1jJ+OLf7W36+CAZcUtj6kI87EAQ== +"@keep-network/random-beacon@2.1.0-dev.14": + version "2.1.0-dev.14" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.14.tgz#d9fac9fa8a5a06ea0985114c4ca79e4805c16d55" + integrity sha512-FdVSW2VtUIcwPCrnrWUudbXOFi+SKZ6cEz7P3+gO+49DFas4ApH6lkRILD/DUHQDMV7D56TxAdw/DHt0dbA+wg== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" - "@openzeppelin/contracts" "^4.6.0" + "@openzeppelin/contracts" "4.7.3" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.2" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" "@keep-network/sortition-pools@1.2.0-dev.1": version "1.2.0-dev.1" @@ -1701,17 +1572,16 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2@development": - version "0.1.1-dev.120" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-0.1.1-dev.120.tgz#ee97a1fd1deaa64154ab3de4d49d7ba49782eeab" - integrity sha512-xNjg+uN18vw02b/mhczx7V5nbt13G3nlNlDRXXtBNSXtgsaudQ9iIvgRRNGR92N4sIgsMLHeZcaNkIMW2NYZaA== + version "1.5.0-dev.3" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.5.0-dev.3.tgz#814682bf9f627780137430c3ad5a6eaf5638eb3c" + integrity sha512-Vf/NOBf0ybN5cPP/R0LXJbZeMWVEkga7mWqie1HyktqJi8pp4XbHoJ6WIro+qrH47AymWv/S2mGYlU4Smsihrw== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.2" - "@keep-network/random-beacon" "2.1.0-dev.2" + "@keep-network/ecdsa" "2.1.0-dev.13" + "@keep-network/random-beacon" "2.1.0-dev.14" "@keep-network/tbtc" "1.1.2-dev.1" - "@openzeppelin/contracts" "^4.6.0" - "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@tenderly/hardhat-tenderly" ">=1.0.12 <1.2.0" + "@openzeppelin/contracts" "^4.8.1" + "@openzeppelin/contracts-upgradeable" "^4.8.1" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc@1.1.2-dev.1": @@ -1794,21 +1664,26 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomiclabs/hardhat-ethers@^2.0.6": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.1.tgz#8057b43566a0e41abeb8142064a3c0d3f23dca86" - integrity sha512-RHWYwnxryWR8hzRmU4Jm/q4gzvXpetUOJ4OPlwH2YARcDB+j79+yAYCwO0lN1SUOb4++oOTJEe6AWLEc42LIvg== - "@openzeppelin/contracts-upgradeable@^4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.6.0.tgz#1bf55f230f008554d4c6fe25eb165b85112108b0" integrity sha512-5OnVuO4HlkjSCJO165a4i2Pu1zQGzMs//o54LPrwUgxvEO2P3ax1QuaSI0cEHHTveA77guS0PnNugpR2JMsPfA== +"@openzeppelin/contracts-upgradeable@^4.8.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.1.tgz#03e33b8059ce43884995e69e4479f5a7f084b404" + integrity sha512-UZf5/VdaBA/0kxF7/gg+2UrC8k+fbgiUM0Qw1apAhwpBWBxULbsHw0ZRMgT53nd6N8hr53XFjhcWNeTRGIiCVw== + "@openzeppelin/contracts-upgradeable@~4.5.2": version "4.5.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz#90d9e47bacfd8693bfad0ac8a394645575528d05" integrity sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA== +"@openzeppelin/contracts@4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e" + integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== + "@openzeppelin/contracts@^2.4.0": version "2.5.1" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" @@ -1819,6 +1694,11 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.6.0.tgz#c91cf64bc27f573836dba4122758b4743418c1b3" integrity sha512-8vi4d50NNya/bQqCmaVzvHNmwHvS0OBKb7HNtuNwEE3scXWrP31fKQoGxNMT+KbzmrNZzatE3QK5p2gFONI/hg== +"@openzeppelin/contracts@^4.8.1": + version "4.9.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.1.tgz#afa804d2c68398704b0175acc94d91a54f203645" + integrity sha512-aLDTLu/If1qYIFW5g4ZibuQaUsFGWQPBq1mZKp/txaebUnGHDmmiBhRLY1tDNedN0m+fJtKZ1zAODS9Yk+V6uA== + "@openzeppelin/contracts@~4.5.0": version "4.5.0" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.5.0.tgz#3fd75d57de172b3743cdfc1206883f56430409cc" @@ -1990,29 +1870,16 @@ dependencies: defer-to-connect "^1.0.1" -"@tenderly/hardhat-tenderly@>=1.0.12 <1.2.0": - version "1.1.6" - resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.1.6.tgz#b706c7c337ebae7ecd314df3e8ee3d244ed1de08" - integrity sha512-B6vVdDAxQwjahrvsxjNirJW2ynDENLBD8LLFy8sYVJ+RCb4B8HXT1IGSceqpySNPr2iLYcD5cKC/YCHX+/O48Q== - dependencies: - "@ethersproject/bignumber" "^5.6.2" - "@nomiclabs/hardhat-ethers" "^2.0.6" - axios "^0.21.1" - ethers "^5.6.8" - fs-extra "^9.0.1" - hardhat-deploy "^0.11.10" - js-yaml "^3.14.0" - "@thesis/solidity-contracts@github:thesis/solidity-contracts#4985bcf": version "0.0.1" resolved "https://codeload.github.com/thesis/solidity-contracts/tar.gz/4985bcfc28e36eed9838993b16710e1b500f9e85" dependencies: "@openzeppelin/contracts" "^4.1.0" -"@threshold-network/solidity-contracts@1.3.0-dev.2": - version "1.3.0-dev.2" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.2.tgz#e3589004aff366d9f034e51b1be8832d01c81d47" - integrity sha512-qJulhTwYW7ZKVIgpqWVdQE9R45OgxjmqLaGp2gAv3hvlAUUsC+dnxub1kaQfDqQcZmwzZvtHcxLXYtHg4Cs2ug== +"@threshold-network/solidity-contracts@1.3.0-dev.5": + version "1.3.0-dev.5" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" + integrity sha512-AInTKQkJ0PKa32q2m8GnZFPYEArsnvOwhIFdBFaHdq9r4EGyqHMf4YY1WjffkheBZ7AQ0DNA8Lst30kBoQd0SA== dependencies: "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" "@openzeppelin/contracts" "~4.5.0" @@ -2230,11 +2097,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.1.tgz#76e72d8a775eef7ce649c63c8acae1a0824bbaed" integrity sha512-XFjFHmaLVifrAKaZ+EKghFHtHSUonyw8P2Qmy2/+osBnrKbH9UYtlK10zg8/kCt47MFilll/DEDKy3DHfJ0URw== -"@types/qs@^6.9.7": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - "@types/randombytes@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@types/randombytes/-/randombytes-2.0.0.tgz#0087ff5e60ae68023b9bc4398b406fea7ad18304" @@ -2594,11 +2456,6 @@ asynckit@^0.4.0: resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -2622,13 +2479,6 @@ axios@^0.18.0: follow-redirects "1.5.10" is-buffer "^2.0.2" -axios@^0.21.1: - version "0.21.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" - integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== - dependencies: - follow-redirects "^1.14.0" - balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -3284,7 +3134,7 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3312,21 +3162,6 @@ chokidar@3.5.2: optionalDependencies: fsevents "~2.3.2" -chokidar@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - chownr@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -3694,7 +3529,7 @@ debug@^4.0.1, debug@^4.1.1, debug@^4.3.1: dependencies: ms "2.1.2" -debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: +debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3952,11 +3787,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encode-utf8@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" - integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3979,7 +3809,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enquirer@^2.3.5, enquirer@^2.3.6: +enquirer@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== @@ -4531,42 +4361,6 @@ ethers@^5.5.2: "@ethersproject/web" "5.5.1" "@ethersproject/wordlists" "5.5.0" -ethers@^5.5.3, ethers@^5.6.8: - version "5.7.2" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" - integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== - dependencies: - "@ethersproject/abi" "5.7.0" - "@ethersproject/abstract-provider" "5.7.0" - "@ethersproject/abstract-signer" "5.7.0" - "@ethersproject/address" "5.7.0" - "@ethersproject/base64" "5.7.0" - "@ethersproject/basex" "5.7.0" - "@ethersproject/bignumber" "5.7.0" - "@ethersproject/bytes" "5.7.0" - "@ethersproject/constants" "5.7.0" - "@ethersproject/contracts" "5.7.0" - "@ethersproject/hash" "5.7.0" - "@ethersproject/hdnode" "5.7.0" - "@ethersproject/json-wallets" "5.7.0" - "@ethersproject/keccak256" "5.7.0" - "@ethersproject/logger" "5.7.0" - "@ethersproject/networks" "5.7.1" - "@ethersproject/pbkdf2" "5.7.0" - "@ethersproject/properties" "5.7.0" - "@ethersproject/providers" "5.7.2" - "@ethersproject/random" "5.7.0" - "@ethersproject/rlp" "5.7.0" - "@ethersproject/sha2" "5.7.0" - "@ethersproject/signing-key" "5.7.0" - "@ethersproject/solidity" "5.7.0" - "@ethersproject/strings" "5.7.0" - "@ethersproject/transactions" "5.7.0" - "@ethersproject/units" "5.7.0" - "@ethersproject/wallet" "5.7.0" - "@ethersproject/web" "5.7.1" - "@ethersproject/wordlists" "5.7.0" - ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4819,13 +4613,6 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== -fmix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/fmix/-/fmix-0.1.0.tgz#c7bbf124dec42c9d191cfb947d0a9778dd986c0c" - integrity sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w== - dependencies: - imul "^1.0.0" - follow-redirects@1.5.10: version "1.5.10" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a" @@ -4833,11 +4620,6 @@ follow-redirects@1.5.10: dependencies: debug "=3.1.0" -follow-redirects@^1.14.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" - integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== - for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -4859,15 +4641,6 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -4908,15 +4681,6 @@ fs-extra@^0.30.0: path-is-absolute "^1.0.0" rimraf "^2.2.8" -fs-extra@^10.0.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -4935,16 +4699,6 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-minipass@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" @@ -5189,7 +4943,7 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5212,25 +4966,6 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -hardhat-deploy@^0.11.10: - version "0.11.22" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.22.tgz#9799c0266a0fc40c84690de54760f1b4dae5e487" - integrity sha512-ZhHVNB7Jo2l8Is+KIAk9F8Q3d7pptyiX+nsNbIFXztCz81kaP+6kxNODRBqRCy7SOD3It4+iKCL6tWsPAA/jVQ== - dependencies: - "@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.8.1" - has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -5405,11 +5140,6 @@ import-fresh@^3.0.0, import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -imul@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" - integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5731,7 +5461,7 @@ js-yaml@4.1.0: dependencies: argparse "^2.0.1" -js-yaml@^3.13.1, js-yaml@^3.14.0: +js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5795,15 +5525,6 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -6094,11 +5815,6 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -match-all@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/match-all/-/match-all-1.2.6.tgz#66d276ad6b49655551e63d3a6ee53e8be0566f8d" - integrity sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ== - mcl-wasm@^0.7.1: version "0.7.9" resolved "https://registry.yarnpkg.com/mcl-wasm/-/mcl-wasm-0.7.9.tgz#c1588ce90042a8700c3b60e40efb339fc07ab87f" @@ -6399,15 +6115,6 @@ multihashes@^0.4.15, multihashes@~0.4.15: multibase "^0.7.0" varint "^5.0.0" -murmur-128@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/murmur-128/-/murmur-128-0.2.1.tgz#a9f6568781d2350ecb1bf80c14968cadbeaa4b4d" - integrity sha512-WseEgiRkI6aMFBbj8Cg9yBj/y+OdipwVC7zUo3W2W1JAJITwouUOtpqsmGSg67EQmwwSyod7hsVsWY5LsrfQVg== - dependencies: - encode-utf8 "^1.0.2" - fmix "^0.1.0" - imul "^1.0.0" - "n64@git+https://github.com/chjj/n64.git#semver:~0.2.10": version "0.2.10" resolved "git+https://github.com/chjj/n64.git#34f981f1441f569821d97a31f8cf21a3fc11b8f6" @@ -6977,13 +6684,6 @@ qs@6.10.3: dependencies: side-channel "^1.0.4" -qs@^6.9.4: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - qs@~6.5.2: version "6.5.3" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" @@ -8114,11 +7814,6 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -9338,8 +9033,3 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zksync-web3@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" - integrity sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw== From bf9d976c6d63b40f95081ed101eb6ddbae87c325 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Jun 2023 09:41:07 +0200 Subject: [PATCH 136/198] Add duplicates check to the `validateRedemptionProposal` function --- .../contracts/bridge/WalletCoordinator.sol | 15 +- .../test/bridge/WalletCoordinator.test.ts | 167 +++++++++++++----- 2 files changed, 137 insertions(+), 45 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 526974ee3..ea459f712 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -857,7 +857,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// - Each request must be a pending request registered in the Bridge, /// - Each request must be old enough, i.e. at least `redemptionRequestMinAge` /// elapsed since their creation time, - /// - Each request must have the timeout safety margin preserved. + /// - Each request must have the timeout safety margin preserved, + /// - Each request must be unique. function validateRedemptionProposal(RedemptionProposal calldata proposal) external view @@ -908,6 +909,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { uint256 redemptionTxFeePerRequest = (proposal.redemptionTxFee - redemptionTxFeeRemainder) / requestsCount; + uint256[] memory processedRedemptionKeys = new uint256[](requestsCount); + for (uint256 i = 0; i < requestsCount; i++) { bytes memory script = proposal.redeemersOutputScripts[i]; @@ -961,6 +964,16 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { feePerRequest <= redemptionRequest.txMaxFee, "Proposed transaction per-request fee share is too high" ); + + // Make sure there are no duplicates in the requests list. + for (uint256 j = 0; j < i; j++) { + require( + processedRedemptionKeys[j] != redemptionKey, + "Duplicated request" + ); + } + + processedRedemptionKeys[i] = redemptionKey; } return true; diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 72387a413..d135393bc 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2899,64 +2899,143 @@ describe("WalletCoordinator", () => { context( "when all requests incur an acceptable tx fee share", () => { - let requestOne - let requestTwo + context("when there are duplicated requests", () => { + let requestOne + let requestTwo + let requestThree - before(async () => { - await createSnapshot() + before(async () => { + await createSnapshot() - requestOne = createTestRedemptionRequest( - walletPubKeyHash, - 5000 // necessary to pass the fee share validation - ) + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 2500 // necessary to pass the fee share validation + ) - requestTwo = createTestRedemptionRequest( - walletPubKeyHash, - 5000 // necessary to pass the fee share validation - ) + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 2500 // necessary to pass the fee share validation + ) - bridge.pendingRedemptions - .whenCalledWith( - redemptionKey( - requestOne.key.walletPubKeyHash, - requestOne.key.redeemerOutputScript - ) + requestThree = createTestRedemptionRequest( + walletPubKeyHash, + 2500 // necessary to pass the fee share validation ) - .returns(requestOne.content) - bridge.pendingRedemptions - .whenCalledWith( - redemptionKey( - requestTwo.key.walletPubKeyHash, - requestTwo.key.redeemerOutputScript + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) ) - ) - .returns(requestTwo.content) - }) + .returns(requestOne.content) - after(async () => { - bridge.pendingRedemptions.reset() + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestThree.key.walletPubKeyHash, + requestThree.key.redeemerOutputScript + ) + ) + .returns(requestThree.content) + }) - await restoreSnapshot() + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should revert", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + requestThree.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, // duplicate + ], + redemptionTxFee, + } + + await expect( + walletCoordinator.validateRedemptionProposal( + proposal + ) + ).to.be.revertedWith("Duplicated request") + }) }) - it("should succeed", async () => { - const proposal = { - walletPubKeyHash, - redeemersOutputScripts: [ - requestOne.key.redeemerOutputScript, - requestTwo.key.redeemerOutputScript, - ], - redemptionTxFee, - } + context("when all requests are unique", () => { + let requestOne + let requestTwo - const result = - await walletCoordinator.validateRedemptionProposal( - proposal + before(async () => { + await createSnapshot() + + requestOne = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation ) - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(result).to.be.true + requestTwo = createTestRedemptionRequest( + walletPubKeyHash, + 5000 // necessary to pass the fee share validation + ) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestOne.key.walletPubKeyHash, + requestOne.key.redeemerOutputScript + ) + ) + .returns(requestOne.content) + + bridge.pendingRedemptions + .whenCalledWith( + redemptionKey( + requestTwo.key.walletPubKeyHash, + requestTwo.key.redeemerOutputScript + ) + ) + .returns(requestTwo.content) + }) + + after(async () => { + bridge.pendingRedemptions.reset() + + await restoreSnapshot() + }) + + it("should succeed", async () => { + const proposal = { + walletPubKeyHash, + redeemersOutputScripts: [ + requestOne.key.redeemerOutputScript, + requestTwo.key.redeemerOutputScript, + ], + redemptionTxFee, + } + + const result = + await walletCoordinator.validateRedemptionProposal( + proposal + ) + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(result).to.be.true + }) }) } ) From 4266cf5af1c711b9f0e75d1542c9792c97d01668 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Jun 2023 11:16:37 +0200 Subject: [PATCH 137/198] Add duplicates check to the `validateDepositSweepProposal` function --- .../contracts/bridge/WalletCoordinator.sol | 33 ++- .../test/bridge/WalletCoordinator.test.ts | 216 +++++++++++++----- 2 files changed, 182 insertions(+), 67 deletions(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index ea459f712..8efd4c3a8 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -549,7 +549,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// - Each deposit must have valid extra data (see `validateDepositExtraInfo`), /// - Each deposit must have the refund safety margin preserved, /// - Each deposit must be controlled by the same wallet, - /// - Each deposit must target the same vault. + /// - Each deposit must target the same vault, + /// - Each deposit must be unique. /// /// The following off-chain validation must be performed as a bare minimum: /// - Inputs used for the sweep transaction have enough Bitcoin confirmations, @@ -580,22 +581,26 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { address proposalVault = address(0); + uint256[] memory processedDepositKeys = new uint256[](proposal.depositsKeys.length); + for (uint256 i = 0; i < proposal.depositsKeys.length; i++) { DepositKey memory depositKey = proposal.depositsKeys[i]; DepositExtraInfo memory depositExtraInfo = depositsExtraInfo[i]; - // slither-disable-next-line calls-loop - Deposit.DepositRequest memory depositRequest = bridge.deposits( - uint256( - keccak256( - abi.encodePacked( - depositKey.fundingTxHash, - depositKey.fundingOutputIndex - ) + uint256 depositKeyUint = uint256( + keccak256( + abi.encodePacked( + depositKey.fundingTxHash, + depositKey.fundingOutputIndex ) ) ); + // slither-disable-next-line calls-loop + Deposit.DepositRequest memory depositRequest = bridge.deposits( + depositKeyUint + ); + require(depositRequest.revealedAt != 0, "Deposit not revealed"); require( @@ -636,6 +641,16 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { depositRequest.vault == proposalVault, "Deposit targets different vault" ); + + // Make sure there are no duplicates in the deposits list. + for (uint256 j = 0; j < i; j++) { + require( + processedDepositKeys[j] != depositKeyUint, + "Duplicated deposit" + ); + } + + processedDepositKeys[i] = depositKeyUint; } return true; diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index d135393bc..1c5d3b2ff 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -1956,74 +1956,174 @@ describe("WalletCoordinator", () => { context( "when all deposits targets the same vault", () => { - let depositOne - let depositTwo - - before(async () => { - await createSnapshot() - - depositOne = createTestDeposit( - walletPubKeyHash, - vault, - true - ) - - depositTwo = createTestDeposit( - walletPubKeyHash, - vault, - false - ) + context( + "when there are duplicated deposits", + () => { + let depositOne + let depositTwo + let depositThree + + before(async () => { + await createSnapshot() + + depositOne = createTestDeposit( + walletPubKeyHash, + vault, + true + ) - bridge.deposits - .whenCalledWith( - depositKey( - depositOne.key.fundingTxHash, - depositOne.key.fundingOutputIndex + depositTwo = createTestDeposit( + walletPubKeyHash, + vault, + false ) - ) - .returns(depositOne.request) - bridge.deposits - .whenCalledWith( - depositKey( - depositTwo.key.fundingTxHash, - depositTwo.key.fundingOutputIndex + depositThree = createTestDeposit( + walletPubKeyHash, + vault, + false ) - ) - .returns(depositTwo.request) - }) - after(async () => { - bridge.deposits.reset() + bridge.deposits + .whenCalledWith( + depositKey( + depositOne.key.fundingTxHash, + depositOne.key.fundingOutputIndex + ) + ) + .returns(depositOne.request) + + bridge.deposits + .whenCalledWith( + depositKey( + depositTwo.key.fundingTxHash, + depositTwo.key.fundingOutputIndex + ) + ) + .returns(depositTwo.request) + + bridge.deposits + .whenCalledWith( + depositKey( + depositThree.key.fundingTxHash, + depositThree.key + .fundingOutputIndex + ) + ) + .returns(depositThree.request) + }) + + after(async () => { + bridge.deposits.reset() + + await restoreSnapshot() + }) + + it("should succeed", async () => { + const proposal = { + walletPubKeyHash, + depositsKeys: [ + depositOne.key, + depositTwo.key, + depositThree.key, + depositTwo.key, // duplicate + ], + sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. + } + + const depositsExtraInfo = [ + depositOne.extraInfo, + depositTwo.extraInfo, + depositThree.extraInfo, + depositTwo.extraInfo, // duplicate + ] + + await expect( + walletCoordinator.validateDepositSweepProposal( + proposal, + depositsExtraInfo + ) + ).to.be.revertedWith( + "Duplicated deposit" + ) + }) + } + ) - await restoreSnapshot() - }) + context( + "when all deposits are unique", + () => { + let depositOne + let depositTwo - it("should succeed", async () => { - const proposal = { - walletPubKeyHash, - depositsKeys: [ - depositOne.key, - depositTwo.key, - ], - sweepTxFee, - depositsRevealBlocks: [], // Not relevant in this scenario. - } + before(async () => { + await createSnapshot() - const depositsExtraInfo = [ - depositOne.extraInfo, - depositTwo.extraInfo, - ] + depositOne = createTestDeposit( + walletPubKeyHash, + vault, + true + ) - const result = - await walletCoordinator.validateDepositSweepProposal( - proposal, - depositsExtraInfo - ) + depositTwo = createTestDeposit( + walletPubKeyHash, + vault, + false + ) - // eslint-disable-next-line @typescript-eslint/no-unused-expressions - expect(result).to.be.true - }) + bridge.deposits + .whenCalledWith( + depositKey( + depositOne.key.fundingTxHash, + depositOne.key.fundingOutputIndex + ) + ) + .returns(depositOne.request) + + bridge.deposits + .whenCalledWith( + depositKey( + depositTwo.key.fundingTxHash, + depositTwo.key.fundingOutputIndex + ) + ) + .returns(depositTwo.request) + }) + + after(async () => { + bridge.deposits.reset() + + await restoreSnapshot() + }) + + it("should succeed", async () => { + const proposal = { + walletPubKeyHash, + depositsKeys: [ + depositOne.key, + depositTwo.key, + ], + sweepTxFee, + depositsRevealBlocks: [], // Not relevant in this scenario. + } + + const depositsExtraInfo = [ + depositOne.extraInfo, + depositTwo.extraInfo, + ] + + const result = + await walletCoordinator.validateDepositSweepProposal( + proposal, + depositsExtraInfo + ) + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + expect(result).to.be.true + }) + } + ) } ) } From 33760eb9cda267f8410f1758bd3d5a64ab404c31 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Jun 2023 11:24:41 +0200 Subject: [PATCH 138/198] Make formatter happy --- solidity/contracts/bridge/WalletCoordinator.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 8efd4c3a8..455cc330d 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -581,7 +581,9 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { address proposalVault = address(0); - uint256[] memory processedDepositKeys = new uint256[](proposal.depositsKeys.length); + uint256[] memory processedDepositKeys = new uint256[]( + proposal.depositsKeys.length + ); for (uint256 i = 0; i < proposal.depositsKeys.length; i++) { DepositKey memory depositKey = proposal.depositsKeys[i]; From e0bcc8a32995613c45cb1c3bd1e627d61ec795b7 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Fri, 16 Jun 2023 11:16:59 +0200 Subject: [PATCH 139/198] Set initial value of `redemptionProposalValidity` to 2 hours --- solidity/contracts/bridge/WalletCoordinator.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index 455cc330d..a01ad662a 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -336,7 +336,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { depositSweepMaxSize = 5; depositSweepProposalSubmissionGasOffset = 20_000; // optimized for 10 inputs - redemptionProposalValidity = 1 hours; + redemptionProposalValidity = 2 hours; redemptionRequestMinAge = 600; // 10 minutes or ~50 blocks. redemptionRequestTimeoutSafetyMargin = 2 hours; redemptionMaxSize = 20; From d668d5ca67b8b777464e2f7bad7c285a64b6c5b2 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Fri, 16 Jun 2023 11:24:38 +0200 Subject: [PATCH 140/198] Add comment about per-redemption fee test case --- solidity/test/bridge/WalletCoordinator.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 1c5d3b2ff..591133ad7 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2644,6 +2644,11 @@ describe("WalletCoordinator", () => { }) } ) + + // The context block covering the per-redemption fee checks is + // declared at the end of the `validateRedemptionProposal` test suite + // due to the actual order of checks performed by this function. + // See: "when there is a request that incurs an unacceptable tx fee share" }) context("when proposed redemption tx fee is valid", () => { From 41476d20de158908e4bf21e1ec66d64f8fdc8d84 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Fri, 16 Jun 2023 11:27:53 +0200 Subject: [PATCH 141/198] Minor fixes regarding test names --- solidity/test/bridge/WalletCoordinator.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solidity/test/bridge/WalletCoordinator.test.ts b/solidity/test/bridge/WalletCoordinator.test.ts index 591133ad7..3e4bf96a6 100644 --- a/solidity/test/bridge/WalletCoordinator.test.ts +++ b/solidity/test/bridge/WalletCoordinator.test.ts @@ -2019,7 +2019,7 @@ describe("WalletCoordinator", () => { await restoreSnapshot() }) - it("should succeed", async () => { + it("should revert", async () => { const proposal = { walletPubKeyHash, depositsKeys: [ @@ -2323,7 +2323,7 @@ describe("WalletCoordinator", () => { await restoreSnapshot() }) - it("should time lock the wallet", async () => { + it("should time-lock the wallet", async () => { const lockedUntil = (await lastBlockTime()) + (await walletCoordinator.redemptionProposalValidity()) From 0bb0fc102137d888077abcc3b01b545f64f86446 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Fri, 16 Jun 2023 11:30:00 +0200 Subject: [PATCH 142/198] Improve docstring of `updateRedemptionProposalParameters` --- solidity/contracts/bridge/WalletCoordinator.sol | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/solidity/contracts/bridge/WalletCoordinator.sol b/solidity/contracts/bridge/WalletCoordinator.sol index a01ad662a..b5311db7d 100644 --- a/solidity/contracts/bridge/WalletCoordinator.sol +++ b/solidity/contracts/bridge/WalletCoordinator.sol @@ -789,7 +789,12 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable { /// @notice Updates parameters related to redemption proposal. /// @param _redemptionProposalValidity The new value of `redemptionProposalValidity`. - /// @param _redemptionProposalSubmissionGasOffset The new value of `redemptionProposalSubmissionGasOffset`. + /// @param _redemptionRequestMinAge The new value of `redemptionRequestMinAge`. + /// @param _redemptionRequestTimeoutSafetyMargin The new value of + /// `redemptionRequestTimeoutSafetyMargin`. + /// @param _redemptionMaxSize The new value of `redemptionMaxSize`. + /// @param _redemptionProposalSubmissionGasOffset The new value of + /// `redemptionProposalSubmissionGasOffset`. /// @dev Requirements: /// - The caller must be the owner. function updateRedemptionProposalParameters( From 626045de6b2af4d3def582331e3671241e519277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 20 Jun 2023 10:07:13 +0200 Subject: [PATCH 143/198] Use correct id in committer's e-mail --- .github/workflows/contracts-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 142f2fc4f..4f88ab6ae 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -79,7 +79,7 @@ jobs: destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBaseBranch: main - userEmail: 8324465+thesis-valkyrie@users.noreply.github.com + userEmail: 38324465+thesis-valkyrie@users.noreply.github.com userName: Valkyrie secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} From 97d3c65776fb95d95c4e0976004f708865d14f29 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 20 Jun 2023 14:53:10 +0200 Subject: [PATCH 144/198] Add unit tests for `findWalletForRedemption` fn --- typescript/test/data/redemption.ts | 121 +++++++++++++++++++++++ typescript/test/redemption.test.ts | 138 +++++++++++++++++++++++++++ typescript/test/utils/mock-bridge.ts | 38 +++++++- 3 files changed, 294 insertions(+), 3 deletions(-) diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 8a361c746..0080de3a2 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -11,6 +11,7 @@ import { import { RedemptionRequest } from "../../src/redemption" import { Address } from "../../src/ethereum" import { Hex } from "../../src" +import { NewWalletRegisteredEvent, WalletState } from "../../src/wallet" /** * Private key (testnet) of the wallet. @@ -666,3 +667,123 @@ export const redemptionProof: RedemptionProofTestData = { "03989d253b17a6a0f41838b84ff0d20e8898f9d7b1a98f2564da4cc29dcf8581d9", }, } + +export const findWalletForRedemptionData: { + newWalletRegisteredEvents: NewWalletRegisteredEvent[] + wallets: { + [walletPublicKeyHash: string]: { + state: WalletState + mainUtxoHash: Hex + walletPublicKey: Hex + btcAddress: string + utxos: UnspentTransactionOutput[] + } + } +} = { + newWalletRegisteredEvents: [ + { + blockNumber: 8367602, + blockHash: Hex.from( + "0x908ea9c82b388a760e6dd070522e5421d88b8931fbac6702119f9e9a483dd022" + ), + transactionHash: Hex.from( + "0xc1e995d0ac451cc9ffc9d43f105eddbaf2eb45ea57a61074a84fc022ecf5bda9" + ), + ecdsaWalletID: Hex.from( + "0x5314e0e5a62b173f52ea424958e5bc04bd77e2159478934a89d4fa193c7b3b72" + ), + walletPublicKeyHash: Hex.from( + "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e" + ), + }, + { + blockNumber: 8502240, + blockHash: Hex.from( + "0x4baab7520cf79a05f22723688bcd1f2805778829aa4362250b8ee702f34f4daf" + ), + transactionHash: Hex.from( + "0xe88761c7203335e237366ec2ffca1e7cf2690eab343ad700e6a6e6dc236638b1" + ), + ecdsaWalletID: Hex.from( + "0x0c70f262eaff2cdaaddb5a5e4ecfdda6edad7f1789954ad287bfa7e594173c64" + ), + walletPublicKeyHash: Hex.from( + "0x7670343fc00ccc2d0cd65360e6ad400697ea0fed" + ), + }, + { + blockNumber: 8981644, + blockHash: Hex.from( + "0x6681b1bb168fb86755c2a796169cb0e06949caac9fc7145d527d94d5209a64ad" + ), + transactionHash: Hex.from( + "0xea3a8853c658145c95165d7847152aeedc3ff29406ec263abfc9b1436402b7b7" + ), + ecdsaWalletID: Hex.from( + "0x7a1437d67f49adfd44e03ddc85be0f6988715d7c39dfb0ca9780f1a88bcdca25" + ), + walletPublicKeyHash: Hex.from( + "0x328d992e5f5b71de51a1b40fcc4056b99a88a647" + ), + }, + ], + wallets: { + "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e": { + state: WalletState.Live, + mainUtxoHash: Hex.from( + "0x3ded9dcfce0ffe479640013ebeeb69b6a82306004f9525b1346ca3b553efc6aa" + ), + walletPublicKey: Hex.from( + "0x028ed84936be6a9f594a2dcc636d4bebf132713da3ce4dac5c61afbf8bbb47d6f7" + ), + btcAddress: "tb1qqwm566yn44rdlhgph8sw8vecta8uutg79afuja", + utxos: [ + { + transactionHash: Hex.from( + "0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb" + ), + outputIndex: 0, + value: BigNumber.from("791613461"), + }, + ], + }, + "0x7670343fc00ccc2d0cd65360e6ad400697ea0fed": { + state: WalletState.Live, + mainUtxoHash: Hex.from( + "0x3ea242dd8a7f7f7abd548ca6590de70a1e992cbd6e4ae18b7a91c9b899067626" + ), + walletPublicKey: Hex.from( + "0x025183c15164e1b2211eb359fce2ceeefc3abad3af6d760cc6355f9de99bf60229" + ), + btcAddress: "tb1qwecrg07qpnxz6rxk2dswdt2qq6t75rldweydm2", + utxos: [ + { + transactionHash: Hex.from( + "0xda0e364abb3ed952bcc694e48bbcff19131ba9513fe981b303fa900cff0f9fbc" + ), + outputIndex: 0, + value: BigNumber.from("164380000"), + }, + ], + }, + "0x328d992e5f5b71de51a1b40fcc4056b99a88a647": { + state: WalletState.Live, + mainUtxoHash: Hex.from( + "0xb3024ef698084cfdfba459338864a595d31081748b28aa5eb02312671a720531" + ), + walletPublicKey: Hex.from( + "0x02ab193a63b3523bfab77d3645d11da10722393687458c4213b350b7e08f50b7ee" + ), + btcAddress: "tb1qx2xejtjltdcau5dpks8ucszkhxdg3fj88404lh", + utxos: [ + { + transactionHash: Hex.from( + "0x81c4884a8c2fccbeb57745a5e59f895a9c1bb8fc42eecc82269100a1a46bbb85" + ), + outputIndex: 0, + value: BigNumber.from("3370000"), + }, + ], + }, + }, +} diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index a32a09ae3..45d2d186c 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -20,9 +20,11 @@ import { p2pkhWalletAddress, p2wpkhWalletAddress, RedemptionTestData, + findWalletForRedemptionData, } from "./data/redemption" import { assembleRedemptionTransaction, + findWalletForRedemption, getRedemptionRequest, RedemptionRequest, requestRedemption, @@ -34,6 +36,8 @@ import * as chai from "chai" import chaiAsPromised from "chai-as-promised" import { expect } from "chai" import { BigNumberish, BigNumber } from "ethers" +import { BitcoinNetwork } from "../src/bitcoin-network" +import { Wallet } from "../src/wallet" chai.use(chaiAsPromised) @@ -1432,6 +1436,140 @@ describe("Redemption", () => { }) }) }) + + describe("findWalletForRedemption", () => { + let bridge: MockBridge + let bitcoinClient: MockBitcoinClient + + context( + "when there are no wallets in the network that can hanlde redemption", + () => { + const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC + beforeEach(() => { + bitcoinClient = new MockBitcoinClient() + bridge = new MockBridge() + bridge.newWalletRegisteredEvents = [] + }) + + it("should throw an error", async () => { + await expect( + findWalletForRedemption( + amount, + bridge, + bitcoinClient, + BitcoinNetwork.Testnet + ) + ).to.be.rejectedWith( + "Could not find a wallet with enough funds. Maximum redemption amount is 0 Satoshi." + ) + }) + } + ) + + context("when there are registered wallets in the network", () => { + let result: Awaited | never> + + beforeEach(async () => { + bitcoinClient = new MockBitcoinClient() + bridge = new MockBridge() + bridge.newWalletRegisteredEvents = + findWalletForRedemptionData.newWalletRegisteredEvents + const walletsUnspentTransacionOutputs = new Map< + string, + UnspentTransactionOutput[] + >() + for (const [ + key, + { state, mainUtxoHash, walletPublicKey, btcAddress, utxos }, + ] of Object.entries(findWalletForRedemptionData.wallets)) { + bridge.setWallet(key, { + state, + mainUtxoHash, + walletPublicKey, + } as Wallet) + walletsUnspentTransacionOutputs.set(btcAddress, utxos) + } + + bitcoinClient.unspentTransactionOutputs = + walletsUnspentTransacionOutputs + }) + + context( + "when there is a wallet that can handle the redemption request", + () => { + const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC + beforeEach(async () => { + result = await findWalletForRedemption( + amount, + bridge, + bitcoinClient, + BitcoinNetwork.Testnet + ) + }) + + it("should get all registered wallets", () => { + const bridgeQueryEventsLog = bridge.newWalletRegisteredEventsLog + + expect(bridgeQueryEventsLog.length).to.equal(1) + expect(bridgeQueryEventsLog[0]).to.deep.equal({ + options: undefined, + filterArgs: [], + }) + }) + + it("should get wallet data details", () => { + const bridgeWalletDetailsLogs = bridge.walletsLog + + expect(bridgeWalletDetailsLogs.length).to.eql(1) + expect(bridgeWalletDetailsLogs[0].walletPublicKeyHash).to.eql( + findWalletForRedemptionData.newWalletRegisteredEvents[0].walletPublicKeyHash.toPrefixedString() + ) + }) + + it("should return the wallet data that can handle redemption request", () => { + const expectedWalletPublicKeyHash = + findWalletForRedemptionData.newWalletRegisteredEvents[0] + .walletPublicKeyHash + const expectedWalletData = + findWalletForRedemptionData.wallets[ + expectedWalletPublicKeyHash.toPrefixedString() + ] + expect(result).to.deep.eq({ + walletPublicKey: expectedWalletData.walletPublicKey.toString(), + mainUTXO: expectedWalletData.utxos[0], + }) + }) + } + ) + + context( + "when the redemption request amount is too large and no wallet can handle the request", + () => { + const amount = BigNumber.from("10000000000") // 1 000 BTC + const expectedMaxAmount = Object.values( + findWalletForRedemptionData.wallets + ) + .map((wallet) => wallet.utxos) + .flat() + .map((utxo) => utxo.value) + .sort((a, b) => (b.gt(a) ? 0 : -1))[0] + + it("should throw an error", async () => { + await expect( + findWalletForRedemption( + amount, + bridge, + bitcoinClient, + BitcoinNetwork.Testnet + ) + ).to.be.rejectedWith( + `Could not find a wallet with enough funds. Maximum redemption amount is ${expectedMaxAmount.toString()} Satoshi.` + ) + }) + } + ) + }) + }) }) async function runRedemptionScenario( diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index cb4e4064a..f9f9a7b36 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -43,6 +43,15 @@ interface RedemptionProofLogEntry { walletPublicKey: string } +interface NewWalletRegisteredEventsLog { + options?: GetEvents.Options + filterArgs: unknown[] +} + +interface WalletLog { + walletPublicKeyHash: string +} + /** * Mock Bridge used for test purposes. */ @@ -56,6 +65,10 @@ export class MockBridge implements Bridge { private _redemptionProofLog: RedemptionProofLogEntry[] = [] private _deposits = new Map() private _activeWalletPublicKey: string | undefined + private _newWalletRegisteredEvents: NewWalletRegisteredEvent[] = [] + private _newWalletRegisteredEventsLog: NewWalletRegisteredEventsLog[] = [] + private _wallets = new Map() + private _walletsLog: WalletLog[] = [] setPendingRedemptions(value: Map) { this._pendingRedemptions = value @@ -65,6 +78,14 @@ export class MockBridge implements Bridge { this._timedOutRedemptions = value } + setWallet(key: string, value: Wallet) { + this._wallets.set(key, value) + } + + set newWalletRegisteredEvents(value: NewWalletRegisteredEvent[]) { + this._newWalletRegisteredEvents = value + } + get depositSweepProofLog(): DepositSweepProofLogEntry[] { return this._depositSweepProofLog } @@ -81,6 +102,14 @@ export class MockBridge implements Bridge { return this._redemptionProofLog } + get newWalletRegisteredEventsLog(): NewWalletRegisteredEventsLog[] { + return this._newWalletRegisteredEventsLog + } + + get walletsLog(): WalletLog[] { + return this._walletsLog + } + setDeposits(value: Map) { this._deposits = value } @@ -308,15 +337,18 @@ export class MockBridge implements Bridge { options?: GetEvents.Options, ...filterArgs: Array ): Promise { - throw new Error("not implemented") + this._newWalletRegisteredEventsLog.push({ options, filterArgs }) + return this._newWalletRegisteredEvents } walletRegistry(): Promise { throw new Error("not implemented") } - wallets(walletPublicKeyHash: string): Promise { - throw new Error("not implemented") + async wallets(walletPublicKeyHash: string): Promise { + this._walletsLog.push({ walletPublicKeyHash }) + const wallet = this._wallets.get(walletPublicKeyHash) + return wallet! } buildUTXOHash(utxo: UnspentTransactionOutput): Hex { From dee70200681af683e84a5e9c6f95d191b0165f36 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 20 Jun 2023 15:01:05 +0200 Subject: [PATCH 145/198] Improve docs in the Ethereum Bridge implementation --- typescript/src/ethereum.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index d64c98a4c..f3d229585 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -698,6 +698,10 @@ export class Bridge }) } + // eslint-disable-next-line valid-jsdoc + /** + * @see {ChainBridge#wallets} + */ async wallets(walletPublicKeyHash: string): Promise { const wallet = await backoffRetrier( this._totalRetryAttempts @@ -708,6 +712,11 @@ export class Bridge return this.parseWalletDetails(wallet) } + /** + * Parses a wallet data using data fetched from the on-chain contract. + * @param wallet Data of the wallet. + * @returns Parsed wallet data. + */ private async parseWalletDetails( wallet: Wallets.WalletStructOutput ): Promise { @@ -730,11 +739,12 @@ export class Bridge } } + // eslint-disable-next-line valid-jsdoc /** * Builds the UTXO hash based on the UTXO components. UTXO hash is computed as * `keccak256(txHash | txOutputIndex | txOutputValue)`. - * @param utxo UTXO components. - * @returns The hash of the UTXO. + * + * @see {ChainBridge#buildUTXOHash} */ buildUTXOHash(utxo: UnspentTransactionOutput): Hex { return Hex.from( From 7d41bc93990e708aa45f7068a778f6cb34b1c811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michalina=20Ciencia=C5=82a?= Date: Tue, 20 Jun 2023 12:55:54 +0200 Subject: [PATCH 146/198] Remove testing configuration The workflow was confirmed to work ok, we can remove the configuration that was used for testing purposes. --- .github/workflows/contracts-docs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 4f88ab6ae..394d7afe9 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -39,7 +39,7 @@ jobs: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' - uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@fix-docs-generation # TODO: change to `main` + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` @@ -62,9 +62,8 @@ jobs: contracts-docs-publish: name: Publish contracts documentation needs: docs-detect-changes - # TODO: remove last OR - if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/584/merge' - uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@fix-docs-generation # TODO: change to `main` + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/') + uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main with: projectDir: /solidity # We need to remove unnecessary `//` comment used in the `@dev` From 6e37e663919126ff8588c9fd644346f6c5b8068b Mon Sep 17 00:00:00 2001 From: Michalina Date: Wed, 28 Jun 2023 10:08:18 +0200 Subject: [PATCH 147/198] Use the path filter when triggering `contracts-docs-publish-preview` Instead of running the `contracts-docs-publish-preview` job on update of every PR, we want to run it only when PR modifies contracts or the workflow itself. --- .github/workflows/contracts-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 394d7afe9..162e54cc9 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -36,7 +36,7 @@ jobs: name: Publish preview of contracts documentation needs: docs-detect-changes if: | - github.event_name == 'pull_request' + needs.docs-detect-changes.outputs.path-filter == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main From 226bc08f3927bcc37958cf994ab8c09c4780e9af Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 28 Jun 2023 13:29:52 +0200 Subject: [PATCH 148/198] Make `buildRedemptionKey` function static To be able to use it outside of the `Bridge` contract handle. --- typescript/src/ethereum.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 69cf0c86e..be9260382 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -289,7 +289,7 @@ export class Bridge walletPublicKey: string, redeemerOutputScript: string ): Promise { - const redemptionKey = this.buildRedemptionKey( + const redemptionKey = Bridge.buildRedemptionKey( computeHash160(walletPublicKey), redeemerOutputScript ) @@ -312,7 +312,7 @@ export class Bridge walletPublicKey: string, redeemerOutputScript: string ): Promise { - const redemptionKey = this.buildRedemptionKey( + const redemptionKey = Bridge.buildRedemptionKey( computeHash160(walletPublicKey), redeemerOutputScript ) @@ -337,7 +337,7 @@ export class Bridge * un-prefixed and not prepended with length. * @returns The redemption key. */ - private buildRedemptionKey( + static buildRedemptionKey( walletPublicKeyHash: string, redeemerOutputScript: string ): string { From 8682e648454d7f1605c90d109c07cbece0fb30ec Mon Sep 17 00:00:00 2001 From: Michalina Date: Wed, 28 Jun 2023 16:11:20 +0200 Subject: [PATCH 149/198] Split contracts API doc into multiple files Having all the contracts documented in one common file turned out to be hard to render by the GitBook. We're switching to documenting each contract file in a separate Markdown file. As the generated files will be much smaller now and GitBook has its own file `ON THIS PAGE` section, we don't need to generate Table of Contents. The one thing that we also change as part of this PR is `rsyncDelete` setting - we'll have it set to `true`, in order to delete documentation of contracts which get removed from the repo. As we're not working directly on a `main` branch, this isn't dangerous (we'll see all the delitions in the PR diff). --- .github/workflows/contracts-docs.yml | 3 +++ solidity/hardhat.config.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 162e54cc9..6a713b8dd 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -50,6 +50,7 @@ jobs: # newline and does this in a loop. preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol publish: false + addTOC: false commentPR: true exportAsGHArtifacts: true @@ -74,12 +75,14 @@ jobs: # newline and does this in a loop. preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol publish: true + addTOC: false verifyCommits: true destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBaseBranch: main userEmail: 38324465+thesis-valkyrie@users.noreply.github.com userName: Valkyrie + rsyncDelete: true secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }} diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 09206d9bc..1cb7b16a1 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -261,7 +261,7 @@ const config: HardhatUserConfig = { docgen: { outputDir: "generated-docs", templates: "docgen-templates", - pages: "single", // `single`, `items` or `files` + pages: "files", // `single`, `items` or `files` exclude: ["./test"], }, } From ea80cac0621889d0a98ad475e8508fede5ca2814 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 15:59:42 +0200 Subject: [PATCH 150/198] Rename private fn in Ethereum Bridge handle `toCompressedWalletPublicKey` -> `getWalletCompressedPublicKey` --- typescript/src/ethereum.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index f3d229585..7bc965986 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -644,10 +644,10 @@ export class Bridge const { ecdsaWalletID } = await this.wallets(activeWalletPublicKeyHash) - return (await this.toCompressedWalletPublicKey(ecdsaWalletID)).toString() + return (await this.getWalletCompressedPublicKey(ecdsaWalletID)).toString() } - private async toCompressedWalletPublicKey(ecdsaWalletID: Hex): Promise { + private async getWalletCompressedPublicKey(ecdsaWalletID: Hex): Promise { const walletRegistry = await this.walletRegistry() const uncompressedPublicKey = await walletRegistry.getWalletPublicKey( ecdsaWalletID @@ -724,7 +724,7 @@ export class Bridge return { ecdsaWalletID, - walletPublicKey: await this.toCompressedWalletPublicKey(ecdsaWalletID), + walletPublicKey: await this.getWalletCompressedPublicKey(ecdsaWalletID), mainUtxoHash: Hex.from(wallet.mainUtxoHash), pendingRedemptionsValue: wallet.pendingRedemptionsValue, createdAt: wallet.createdAt, From 8d8982aca20df8e8674370610d7bda815125aea3 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:01:25 +0200 Subject: [PATCH 151/198] Rename fn in Ethereum Bridge handle `buildUTXOHash` -> `buildUtxoHash`. To be consistent with the naming convention we use across the library. --- typescript/src/chain.ts | 2 +- typescript/src/ethereum.ts | 4 ++-- typescript/src/redemption.ts | 2 +- typescript/test/utils/mock-bridge.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index cb7f2a873..246a23afd 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -259,7 +259,7 @@ export interface Bridge { * @param utxo UTXO components. * @returns The hash of the UTXO. */ - buildUTXOHash(utxo: UnspentTransactionOutput): Hex + buildUtxoHash(utxo: UnspentTransactionOutput): Hex } /** diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 7bc965986..3cac6a496 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -744,9 +744,9 @@ export class Bridge * Builds the UTXO hash based on the UTXO components. UTXO hash is computed as * `keccak256(txHash | txOutputIndex | txOutputValue)`. * - * @see {ChainBridge#buildUTXOHash} + * @see {ChainBridge#buildUtxoHash} */ - buildUTXOHash(utxo: UnspentTransactionOutput): Hex { + buildUtxoHash(utxo: UnspentTransactionOutput): Hex { return Hex.from( utils.solidityKeccak256( ["bytes32", "uint32", "uint64"], diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 093d2975d..f8307ce49 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -460,7 +460,7 @@ export async function findWalletForRedemption( // We need to find correct utxo- utxo components must point to the recent // main UTXO of the given wallet, as currently known on the chain. const utxo = utxos.find((utxo) => - mainUtxoHash.equals(bridge.buildUTXOHash(utxo)) + mainUtxoHash.equals(bridge.buildUtxoHash(utxo)) ) if (!utxo) continue diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index f9f9a7b36..992d043f2 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -351,7 +351,7 @@ export class MockBridge implements Bridge { return wallet! } - buildUTXOHash(utxo: UnspentTransactionOutput): Hex { + buildUtxoHash(utxo: UnspentTransactionOutput): Hex { return Hex.from( utils.solidityKeccak256( ["bytes32", "uint32", "uint64"], From b5a8e47728917a0b599100e214f82bf984676fb4 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:04:01 +0200 Subject: [PATCH 152/198] Update docs for `findWalletForRedemption` fn Clarify in docs that the `amount` param should be in satoshis. --- typescript/src/redemption.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index f8307ce49..1c8fd60bf 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -412,7 +412,7 @@ export async function getRedemptionRequest( /** * Finds the oldest active wallet that has enough BTC to handle a redemption request. - * @param amount The amount to be redeemed. + * @param amount The amount to be redeemed in satoshis. * @param bridge The handle to the Bridge on-chain contract. * @param bitcoinClient Bitcoin client used to interact with the network. * @param bitcoinNetwork Bitcoin network. From 9a0adab2396834e71d159b6a580cc1380c98e02d Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:14:37 +0200 Subject: [PATCH 153/198] Update `findWalletForRedemption` fn Rename the field in object returned by the `findWalletForRedemption` fn. `mainUTXO` -> `mainUtxo`. To be consistent with the naming convention we use across the library. --- typescript/src/redemption.ts | 6 +++--- typescript/test/redemption.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 1c8fd60bf..b93d106d4 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -425,14 +425,14 @@ export async function findWalletForRedemption( bitcoinNetwork: BitcoinNetwork ): Promise<{ walletPublicKey: string - mainUTXO: UnspentTransactionOutput + mainUtxo: UnspentTransactionOutput }> { const wallets = await bridge.getNewWalletRegisteredEvents() let walletData: | { walletPublicKey: string - mainUTXO: UnspentTransactionOutput + mainUtxo: UnspentTransactionOutput } | undefined = undefined let maxAmount = BigNumber.from(0) @@ -471,7 +471,7 @@ export async function findWalletForRedemption( if (utxo.value.gte(amount)) { walletData = { walletPublicKey: walletPublicKey.toString(), - mainUTXO: utxo, + mainUtxo: utxo, } break diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 45d2d186c..e9d493d06 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1536,7 +1536,7 @@ describe("Redemption", () => { ] expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), - mainUTXO: expectedWalletData.utxos[0], + mainUtxo: expectedWalletData.utxos[0], }) }) } From 5b42133eccfc20edd4fd8885554c17109fd48fbb Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:26:44 +0200 Subject: [PATCH 154/198] Refactor the `wallets` fn from `Bridge` interface Accept the wallet public key hash as `Hex` instead of `string` and include the required conversion to prefixed string in the implementation of the Bridge handle. It simplifies the usage of `wallets` method in the `findWalletForRedemption` fn. --- typescript/src/chain.ts | 2 +- typescript/src/ethereum.ts | 10 +++++++--- typescript/src/redemption.ts | 4 +--- typescript/test/utils/mock-bridge.ts | 8 +++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index 246a23afd..d2240e7c6 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -252,7 +252,7 @@ export interface Bridge { * using Bitcoin HASH160 over the compressed ECDSA public key). * @returns Promise with the wallet details. */ - wallets(walletPublicKeyHash: string): Promise + wallets(walletPublicKeyHash: Hex): Promise /** * Builds the UTXO hash based on the UTXO components. diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 3cac6a496..1d4e1a562 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -642,7 +642,9 @@ export class Bridge return undefined } - const { ecdsaWalletID } = await this.wallets(activeWalletPublicKeyHash) + const { ecdsaWalletID } = await this.wallets( + Hex.from(activeWalletPublicKeyHash) + ) return (await this.getWalletCompressedPublicKey(ecdsaWalletID)).toString() } @@ -702,11 +704,13 @@ export class Bridge /** * @see {ChainBridge#wallets} */ - async wallets(walletPublicKeyHash: string): Promise { + async wallets(walletPublicKeyHash: Hex): Promise { const wallet = await backoffRetrier( this._totalRetryAttempts )(async () => { - return await this._instance.wallets(walletPublicKeyHash) + return await this._instance.wallets( + walletPublicKeyHash.toPrefixedString() + ) }) return this.parseWalletDetails(wallet) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index b93d106d4..237ca1653 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -438,10 +438,8 @@ export async function findWalletForRedemption( let maxAmount = BigNumber.from(0) for (const wallet of wallets) { - const prefixedWalletPublicKeyHash = - wallet.walletPublicKeyHash.toPrefixedString() const { state, mainUtxoHash, walletPublicKey } = await bridge.wallets( - prefixedWalletPublicKeyHash + wallet.walletPublicKeyHash ) // Wallet must be in Live state. diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index 992d043f2..6a429c655 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -345,9 +345,11 @@ export class MockBridge implements Bridge { throw new Error("not implemented") } - async wallets(walletPublicKeyHash: string): Promise { - this._walletsLog.push({ walletPublicKeyHash }) - const wallet = this._wallets.get(walletPublicKeyHash) + async wallets(walletPublicKeyHash: Hex): Promise { + this._walletsLog.push({ + walletPublicKeyHash: walletPublicKeyHash.toPrefixedString(), + }) + const wallet = this._wallets.get(walletPublicKeyHash.toPrefixedString()) return wallet! } From fb6009a4987edf524583cd860db3a96603f5b156 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:33:08 +0200 Subject: [PATCH 155/198] Rename variable in `findWalletForRedemption` fn `utxo` -> `mainUtxo` - for better readability. --- typescript/src/redemption.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 237ca1653..10b0e03b5 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -457,19 +457,19 @@ export async function findWalletForRedemption( // We need to find correct utxo- utxo components must point to the recent // main UTXO of the given wallet, as currently known on the chain. - const utxo = utxos.find((utxo) => + const mainUtxo = utxos.find((utxo) => mainUtxoHash.equals(bridge.buildUtxoHash(utxo)) ) - if (!utxo) continue + if (!mainUtxo) continue // Save the max possible redemption amount. - maxAmount = utxo.value.gt(maxAmount) ? utxo.value : maxAmount + maxAmount = mainUtxo.value.gt(maxAmount) ? mainUtxo.value : maxAmount - if (utxo.value.gte(amount)) { + if (mainUtxo.value.gte(amount)) { walletData = { walletPublicKey: walletPublicKey.toString(), - mainUtxo: utxo, + mainUtxo, } break From 96b1cfefcbf40b98352ac35dd8ce97efa1ae5209 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:43:59 +0200 Subject: [PATCH 156/198] Update `findWalletForRedemption` fn Make sure `mainUtxoHash` is non-zero before we proceed- in that case there is no need to verify this wallet because it cannot handle the redemption request. --- typescript/src/redemption.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 10b0e03b5..5be71f6c0 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -13,6 +13,7 @@ import { Bridge, Identifier } from "./chain" import { assembleTransactionProof } from "./proof" import { WalletState } from "./wallet" import { BitcoinNetwork } from "./bitcoin-network" +import { Hex } from "./hex" /** * Represents a redemption request. @@ -443,7 +444,15 @@ export async function findWalletForRedemption( ) // Wallet must be in Live state. - if (state !== WalletState.Live) continue + if ( + state !== WalletState.Live || + mainUtxoHash.equals( + Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ) + ) + ) + continue const walletBitcoinAddress = encodeToBitcoinAddress( wallet.walletPublicKeyHash.toString(), From c9209640eecca52008ff13f65c6004c44637e0e1 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 16:59:36 +0200 Subject: [PATCH 157/198] Add debug logs to the `findWalletForRedemption` fn Add debug logs for cases when we continue the loop execution to the next wallet. --- typescript/src/redemption.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 5be71f6c0..741f9e893 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -451,8 +451,13 @@ export async function findWalletForRedemption( "0x0000000000000000000000000000000000000000000000000000000000000000" ) ) - ) + ) { + console.debug( + `Wallet is not in Live state or main utxo is not set. \ + Continue the loop execution to the next wallet...` + ) continue + } const walletBitcoinAddress = encodeToBitcoinAddress( wallet.walletPublicKeyHash.toString(), @@ -470,7 +475,14 @@ export async function findWalletForRedemption( mainUtxoHash.equals(bridge.buildUtxoHash(utxo)) ) - if (!mainUtxo) continue + if (!mainUtxo) { + console.debug( + `Could not find matching UTXO on chains for wallet public key hash \ + (${wallet.walletPublicKeyHash.toPrefixedString()}). Continue the loop \ + execution to the next wallet...` + ) + continue + } // Save the max possible redemption amount. maxAmount = mainUtxo.value.gt(maxAmount) ? mainUtxo.value : maxAmount @@ -483,6 +495,12 @@ export async function findWalletForRedemption( break } + + console.debug( + `The wallet (${wallet.walletPublicKeyHash.toPrefixedString()}) \ + cannot handle the redemption request. Continue the loop execution to the \ + next wallet...` + ) } if (!walletData) From 3a9d84230386a3ac0d3d980b6c8217583974a27b Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 17:15:19 +0200 Subject: [PATCH 158/198] Fix typo in docs `otput` -> `output`. --- typescript/src/bitcoin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index f4bcdbdb5..df0bc83bb 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -607,7 +607,7 @@ export function locktimeToNumber(locktimeLE: Buffer | string): number { /** * Creates the output script from the BTC address. * @param address BTC address. - * @returns The un-prefixed and not prepended with length otput script. + * @returns The un-prefixed and not prepended with length output script. */ export function createOutputScriptFromAddress(address: string): string { return Script.fromAddress(address).toRaw().toString("hex") From 07693eb9e59fd5f78bb462cc11a925a4fae2d4b7 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 17:36:47 +0200 Subject: [PATCH 159/198] Add unit test for `createOutputScriptFromAddress` Cover the `createOutputScriptFromAddress` function with tests to ensure that the output script is created correctly for all supported types of addresses by bridge. --- typescript/test/bitcoin.test.ts | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index 7321c99c7..2313061df 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -11,6 +11,7 @@ import { hashLEToBigNumber, bitsToTarget, targetToDifficulty, + createOutputScriptFromAddress, } from "../src/bitcoin" import { calculateDepositRefundLocktime } from "../src/deposit" import { BitcoinNetwork } from "../src/bitcoin-network" @@ -464,4 +465,55 @@ describe("Bitcoin", () => { expect(targetToDifficulty(target)).to.equal(expectedDifficulty) }) }) + + describe("createOutputScriptFromAddress", () => { + const btcAddresses = { + P2PKH: { + address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", + redeemerOutputScript: + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + }, + P2WPKH: { + address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", + redeemerOutputScript: + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + }, + P2SH: { + address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", + redeemerOutputScript: + "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + }, + P2WSH: { + address: + "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", + redeemerOutputScript: + "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + }, + } + + Object.entries(btcAddresses).forEach( + ([ + addressType, + { address, redeemerOutputScript: expectedRedeemerOutputScript }, + ]) => { + it(`should create correct output script for ${addressType} address type`, () => { + const result = createOutputScriptFromAddress(address) + + // Check if we can build the prefixed raw redeemer output script based + // on the result. + // Convert the output script to raw bytes buffer. + const rawRedeemerOutputScript = Buffer.from(result, "hex") + // Prefix the output script bytes buffer with 0x and its own length. + const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ + Buffer.from([rawRedeemerOutputScript.length]), + rawRedeemerOutputScript, + ]).toString("hex")}` + + expect(prefixedRawRedeemerOutputScript).to.eq( + expectedRedeemerOutputScript + ) + }) + } + ) + }) }) From 759cc78fb5f1bd3189a9285bf483723384c3290e Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 17:46:25 +0200 Subject: [PATCH 160/198] Update the `createOutputScriptFromAddress` fn Return `Hex` instead of `string`- we want to operate on `Hex`. --- typescript/src/bitcoin.ts | 4 ++-- typescript/test/bitcoin.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index df0bc83bb..bb330be3f 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -609,6 +609,6 @@ export function locktimeToNumber(locktimeLE: Buffer | string): number { * @param address BTC address. * @returns The un-prefixed and not prepended with length output script. */ -export function createOutputScriptFromAddress(address: string): string { - return Script.fromAddress(address).toRaw().toString("hex") +export function createOutputScriptFromAddress(address: string): Hex { + return Hex.from(Script.fromAddress(address).toRaw().toString("hex")) } diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index 2313061df..93b849ae8 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -502,7 +502,7 @@ describe("Bitcoin", () => { // Check if we can build the prefixed raw redeemer output script based // on the result. // Convert the output script to raw bytes buffer. - const rawRedeemerOutputScript = Buffer.from(result, "hex") + const rawRedeemerOutputScript = Buffer.from(result.toString(), "hex") // Prefix the output script bytes buffer with 0x and its own length. const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ Buffer.from([rawRedeemerOutputScript.length]), From 9249ee5ca9c71cf6754c68c5d3d891e19d77d567 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 4 Jul 2023 18:32:19 +0200 Subject: [PATCH 161/198] Refactor the `requestRedemption` fn We do not want to expose the low-level function from chain handles(see `buildRedemptionData` from `EthereumBridge` handle). The goal of `src/ethereum.ts` is to translate domain-level objects into low-level Ethereum chain primitives and perform a call. Instead of having `buildRedemptionData` in `Bridge` interface here we modify the `approveAndCall` interface and replace `extraData: Hex` with domain-level objects, as accepted by `buildRedemptionData`. Here we also rename the `approveAndCall` to `requestRedemption` and explain in the docs it happens via `approveAndCall`- although `requestRedemption` does not exist on the Solidity code of TBTC token, having it in `TBTCToken` Typescript API is fine given we abstract the complexity and make the API human-readable. --- typescript/src/chain.ts | 73 ++++++----- typescript/src/ethereum.ts | 148 +++++++++++------------ typescript/src/redemption.ts | 12 +- typescript/test/redemption.test.ts | 23 ++-- typescript/test/utils/mock-tbtc-token.ts | 24 ++-- 5 files changed, 138 insertions(+), 142 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index 4d76fbbd3..93e3407f1 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -244,26 +244,6 @@ export interface Bridge { * Returns the attached WalletRegistry instance. */ walletRegistry(): Promise - - /** - * Builds the redemption data required to request a redemption via - * @see TBTCToken#approveAndCall - the built data should be passed as - * `extraData` the @see TBTCToken#approveAndCall function. - * @param redeemer On-chain identifier of the redeemer. - * @param walletPublicKey The Bitcoin public key of the wallet. Must be in the - * compressed form (33 bytes long with 02 or 03 prefix). - * @param mainUtxo The main UTXO of the wallet. Must match the main UTXO - * held by the on-chain Bridge contract. - * @param redeemerOutputScript The output script that the redeemed funds will - * be locked to. Must be un-prefixed and not prepended with length. - * @returns The - */ - buildRedemptionData( - redeemer: Identifier, - walletPublicKey: string, - mainUtxo: UnspentTransactionOutput, - redeemerOutputScript: string - ): Hex } /** @@ -401,6 +381,40 @@ export interface TBTCVault { getOptimisticMintingFinalizedEvents: GetEvents.Function } +/** + * Represnts data required to request redemption. + */ +export interface RequestRedemptionData { + /** + * On-chain identifier of the redeemer. + */ + redeemer: Identifier + /** + * The Bitcoin public key of the wallet. Must be in the compressed form (33 + * bytes long with 02 or 03 prefix). + */ + walletPublicKey: string + /** + * The main UTXO of the wallet. Must match the main UTXO held by the on-chain + * Bridge contract. + */ + mainUtxo: UnspentTransactionOutput + /** + * The output script that the redeemed funds will be locked to. Must be + * un-prefixed and not prepended with length. + */ + redeemerOutputScript: string + /** + * The amount to be redeemed with the precision of the tBTC on-chain token + * contract. + */ + amount: BigNumber + /** + * The vault address. + */ + vault: Identifier +} + /** * Interface for communication with the TBTC v2 token on-chain contract. */ @@ -418,18 +432,13 @@ export interface TBTCToken { totalSupply(blockNumber?: number): Promise /** - * Calls `receiveApproval` function on spender previously approving the spender - * to withdraw from the caller multiple times, up to the `amount` amount. If - * this function is called again, it overwrites the current allowance with - * `amount`. - * @param spender Address of contract authorized to spend. - * @param amount The max amount they can spend. - * @param extraData Extra information to send to the approved contract. + * Requests redemption in one transacion using the `approveAndCall` function + * from the tBTC on-chain token contract. Then the tBTC token contract calls + * the `receiveApproval` function from the `TBTCVault` contract which burns + * tBTC tokens and requests redemption. + * @param requestRedemptionData Data required to request redemption @see + * {@link RequestRedemptionData}. * @returns Transaction hash of the approve and call transaction. */ - approveAndCall( - spender: Identifier, - amount: BigNumber, - extraData: Hex - ): Promise + requestRedemption(requestRedemptionData: RequestRedemptionData): Promise } diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 2c3c96260..d69ec026b 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -5,6 +5,7 @@ import { TBTCToken as ChainTBTCToken, Identifier as ChainIdentifier, GetEvents, + RequestRedemptionData, } from "./chain" import { BigNumber, @@ -488,39 +489,6 @@ export class Bridge redeemerOutputScript: string, amount: BigNumber ): Promise { - const redemptionData = this.parseRequestRedemptionTransactionData( - walletPublicKey, - mainUtxo, - redeemerOutputScript - ) - - await sendWithRetry(async () => { - return await this._instance.requestRedemption( - redemptionData.walletPublicKeyHash, - redemptionData.mainUtxo, - redemptionData.prefixedRawRedeemerOutputScript, - amount - ) - }, this._totalRetryAttempts) - } - - /** - * Parses the request redemption data to the proper form. - * @param walletPublicKey - The Bitcoin public key of the wallet. Must be in - * the compressed form (33 bytes long with 02 or 03 prefix). - * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO - * held by the on-chain contract. - * @param redeemerOutputScript - The output script that the redeemed funds - * will be locked to. Must be un-prefixed and not prepended with - * length. - * @returns Parsed data that can be passed to the contract to request - * redemption. - */ - private parseRequestRedemptionTransactionData = ( - walletPublicKey: string, - mainUtxo: UnspentTransactionOutput, - redeemerOutputScript: string - ) => { const walletPublicKeyHash = `0x${computeHash160(walletPublicKey)}` const mainUtxoParam = { @@ -539,11 +507,14 @@ export class Bridge rawRedeemerOutputScript, ]).toString("hex")}` - return { - walletPublicKeyHash, - mainUtxo: mainUtxoParam, - prefixedRawRedeemerOutputScript, - } + await sendWithRetry(async () => { + return await this._instance.requestRedemption( + walletPublicKeyHash, + mainUtxoParam, + prefixedRawRedeemerOutputScript, + amount + ) + }, this._totalRetryAttempts) } // eslint-disable-next-line valid-jsdoc @@ -724,37 +695,6 @@ export class Bridge signerOrProvider: this._instance.signer || this._instance.provider, }) } - - // eslint-disable-next-line valid-jsdoc - /** - * @see {ChainBridge#buildRedemptionData} - */ - buildRedemptionData( - redeemer: ChainIdentifier, - walletPublicKey: string, - mainUtxo: UnspentTransactionOutput, - redeemerOutputScript: string - ): Hex { - const redemptionData = this.parseRequestRedemptionTransactionData( - walletPublicKey, - mainUtxo, - redeemerOutputScript - ) - - return Hex.from( - utils.defaultAbiCoder.encode( - ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], - [ - redeemer.identifierHex, - redemptionData.walletPublicKeyHash, - redemptionData.mainUtxo.txHash, - redemptionData.mainUtxo.txOutputIndex, - redemptionData.mainUtxo.txOutputValue, - redemptionData.prefixedRawRedeemerOutputScript, - ] - ) - ) - } } /** @@ -1161,14 +1101,20 @@ export class TBTCToken }) } - async approveAndCall( - spender: ChainIdentifier, - amount: BigNumber, - extraData: Hex + // eslint-disable-next-line valid-jsdoc + /** + * @see {ChainTBTCToken#requestRedemption} + */ + async requestRedemption( + requestRedemptionData: RequestRedemptionData ): Promise { + const { vault, amount, ...restData } = requestRedemptionData + + const extraData = this.buildRequestRedemptionData(restData) + const tx = await sendWithRetry(async () => { return await this._instance.approveAndCall( - spender.identifierHex, + vault.identifierHex, amount, extraData.toPrefixedString() ) @@ -1176,4 +1122,58 @@ export class TBTCToken return Hex.from(tx.hash) } + + private buildRequestRedemptionData( + requestRedemptionData: Omit + ): Hex { + const { redeemer, ...restData } = requestRedemptionData + const { walletPublicKeyHash, mainUtxo, prefixedRawRedeemerOutputScript } = + this.buildBridgeRequestRedemptionData(restData) + + return Hex.from( + utils.defaultAbiCoder.encode( + ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], + [ + redeemer.identifierHex, + walletPublicKeyHash, + mainUtxo.txHash, + mainUtxo.txOutputIndex, + mainUtxo.txOutputValue, + prefixedRawRedeemerOutputScript, + ] + ) + ) + } + + private buildBridgeRequestRedemptionData( + data: Pick< + RequestRedemptionData, + "mainUtxo" | "walletPublicKey" | "redeemerOutputScript" + > + ) { + const { walletPublicKey, mainUtxo, redeemerOutputScript } = data + const walletPublicKeyHash = `0x${computeHash160(walletPublicKey)}` + + const mainUtxoParam = { + // The Ethereum Bridge expects this hash to be in the Bitcoin internal + // byte order. + txHash: mainUtxo.transactionHash.reverse().toPrefixedString(), + txOutputIndex: mainUtxo.outputIndex, + txOutputValue: mainUtxo.value, + } + + // Convert the output script to raw bytes buffer. + const rawRedeemerOutputScript = Buffer.from(redeemerOutputScript, "hex") + // Prefix the output script bytes buffer with 0x and its own length. + const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ + Buffer.from([rawRedeemerOutputScript.length]), + rawRedeemerOutputScript, + ]).toString("hex")}` + + return { + walletPublicKeyHash, + mainUtxo: mainUtxoParam, + prefixedRawRedeemerOutputScript, + } + } } diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 6742e70fb..f52b8b3d1 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -66,7 +66,6 @@ export interface RedemptionRequest { * @param amount - The amount to be redeemed with the precision of the tBTC * on-chain token contract. * @param vault - The vault address. - * @param bridge - Handle to the Bridge on-chain contract. * @param tBTCToken - Handle to the TBTCToken on-chain contract. * @returns Transaction hash of the request redemption transaction. */ @@ -77,17 +76,16 @@ export async function requestRedemption( redeemerOutputScript: string, amount: BigNumber, vault: Identifier, - bridge: Bridge, tBTCToken: TBTCToken ): Promise { - const redemptionData = bridge.buildRedemptionData( + return await tBTCToken.requestRedemption({ redeemer, walletPublicKey, mainUtxo, - redeemerOutputScript - ) - - return await tBTCToken.approveAndCall(vault, amount, redemptionData) + redeemerOutputScript, + amount, + vault, + }) } /** diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index c159016c5..d682f96fe 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -46,7 +46,6 @@ describe("Redemption", () => { const redeemerOutputScript = data.pendingRedemptions[0].pendingRedemption.redeemerOutputScript const amount = data.pendingRedemptions[0].pendingRedemption.requestedAmount - const bridge: MockBridge = new MockBridge() const vault = Address.from("0xb622eA9D678ddF15135a20d59Ff26D28eC246bfB") const token: MockTBTCToken = new MockTBTCToken() const redeemer = Address.from("0x117284D8C50f334a1E2b7712649cB23C7a04Ae74") @@ -61,26 +60,22 @@ describe("Redemption", () => { redeemerOutputScript, amount, vault, - bridge, token ) }) it("should submit redemption proof with correct arguments", () => { - const bridgeLog = bridge.buildRedemptionDataLog - const tokenLog = token.approveAndCallLog - - expect(bridgeLog.length).to.equal(1) - expect(bridgeLog[0].walletPublicKey).to.equal( - redemptionProof.expectedRedemptionProof.walletPublicKey - ) - expect(bridgeLog[0].mainUtxo).to.equal(mainUtxo) - expect(bridgeLog[0].redeemerOutputScript).to.equal(redeemerOutputScript) - expect(bridgeLog[0].redeemer).to.equal(redeemer) + const tokenLog = token.requestRedemptionLog expect(tokenLog.length).to.equal(1) - expect(tokenLog[0].spender).to.equal(vault) - expect(tokenLog[0].amount).to.equal(amount) + expect(tokenLog[0]).to.deep.equal({ + redeemer, + walletPublicKey, + mainUtxo, + redeemerOutputScript, + amount, + vault, + }) }) }) diff --git a/typescript/test/utils/mock-tbtc-token.ts b/typescript/test/utils/mock-tbtc-token.ts index 5c101ff28..cb0f8e93e 100644 --- a/typescript/test/utils/mock-tbtc-token.ts +++ b/typescript/test/utils/mock-tbtc-token.ts @@ -1,31 +1,25 @@ -import { Identifier, TBTCToken } from "../../src/chain" +import { RequestRedemptionData, TBTCToken } from "../../src/chain" import { Hex } from "../../src/hex" import { BigNumber } from "ethers" -interface ApproveAndCallLog { - spender: Identifier - amount: BigNumber - extraData: Hex -} +interface RequestRedemptionLog extends RequestRedemptionData {} export class MockTBTCToken implements TBTCToken { - private _approveAndCallLog: ApproveAndCallLog[] = [] + private _requestRedemptionLog: RequestRedemptionLog[] = [] - get approveAndCallLog() { - return this._approveAndCallLog + get requestRedemptionLog() { + return this._requestRedemptionLog } totalSupply(blockNumber?: number | undefined): Promise { throw new Error("Method not implemented.") } - async approveAndCall( - spender: Identifier, - amount: BigNumber, - extraData: Hex + + async requestRedemption( + requestRedemptionData: RequestRedemptionData ): Promise { - this._approveAndCallLog.push({ spender, amount, extraData }) + this._requestRedemptionLog.push(requestRedemptionData) - // Random tx hash return Hex.from( "0xf7d0c92c8de4d117d915c2a8a54ee550047f926bc00b91b651c40628751cfe29" ) From 67641fbb8493a1b65f9f4278be615cdec7214e49 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 5 Jul 2023 12:34:05 +0200 Subject: [PATCH 162/198] Deployment script for WalletCoordinator upgrade We add a script for WalletCoordinator contract upgrade. The current WalletCoordinator contract deployed to mainnet is owned by Threshold Council, so it cannot be upgraded right away by the deployer. The deployer will deploy a fresh WalletCoordinator contract implementation, then Threshold Council need to execute transactions to upgrade the WalletCoordinator proxy to the new implementation and set the initial values for newely added parameters. --- .../81_upgrade_wallet_coordinator_v2.ts | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 solidity/deploy/81_upgrade_wallet_coordinator_v2.ts diff --git a/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts new file mode 100644 index 000000000..5428dbb5b --- /dev/null +++ b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts @@ -0,0 +1,98 @@ +import { Artifact, HardhatRuntimeEnvironment } from "hardhat/types" +import { DeployFunction, Deployment } from "hardhat-deploy/types" +import { ContractFactory } from "ethers" +import { ProxyAdmin, WalletCoordinator } from "../typechain" + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { ethers, helpers, deployments } = hre + + const { deployer } = await helpers.signers.getNamedSigners() + + const proxyDeployment: Deployment = await deployments.get("WalletCoordinator") + const implementationContractFactory: ContractFactory = + await ethers.getContractFactory("WalletCoordinator", { + signer: deployer, + }) + + // Deploy new implementation contract + const newImplementationAddress: string = (await hre.upgrades.prepareUpgrade( + proxyDeployment, + implementationContractFactory, + { + kind: "transparent", + } + )) as string + + deployments.log( + `new implementation contract deployed at: ${newImplementationAddress}` + ) + + // Assemble proxy upgrade transaction. + const proxyAdmin: ProxyAdmin = await hre.upgrades.admin.getInstance() + const proxyAdminOwner = await proxyAdmin.owner() + + const upgradeTxData = await proxyAdmin.interface.encodeFunctionData( + "upgrade", + [proxyDeployment.address, newImplementationAddress] + ) + + deployments.log( + `proxy admin owner ${proxyAdminOwner} is required to upgrade proxy implementation with transaction:\n` + + `\t\tfrom: ${proxyAdminOwner}\n` + + `\t\tto: ${proxyAdmin.address}\n` + + `\t\tdata: ${upgradeTxData}` + ) + + // Assemble parameters upgrade transaction. + const walletCoordinator: WalletCoordinator = + await helpers.contracts.getContract("WalletCoordinator") + + const walletCoordinatorOwner = await walletCoordinator.owner() + + const updateRedemptionProposalParametersTxData = + walletCoordinator.interface.encodeFunctionData( + "updateRedemptionProposalParameters", + [7200, 600, 7200, 20, 20000] + ) + + deployments.log( + `WalletCoordinator owner ${walletCoordinatorOwner} is required to update redemption proposal parameters with transaction:\n` + + `\t\tfrom: ${walletCoordinatorOwner}\n` + + `\t\tto: ${walletCoordinator.address}\n` + + `\t\tdata: ${updateRedemptionProposalParametersTxData}` + ) + + // Update Deployment Artifact + const walletCoordinatorArtifact: Artifact = + hre.artifacts.readArtifactSync("WalletCoordinator") + + await deployments.save("WalletCoordinator", { + ...proxyDeployment, + abi: walletCoordinatorArtifact.abi, + implementation: newImplementationAddress, + }) + + if (hre.network.tags.etherscan) { + // We use `verify` instead of `verify:verify` as the `verify` task is defined + // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification + // of Proxy and Implementation contracts. + await hre.run("verify", { + address: proxyDeployment.address, + constructorArgsParams: proxyDeployment.args, + }) + } + + if (hre.network.tags.tenderly) { + await hre.tenderly.verify({ + name: "WalletCoordinator", + address: newImplementationAddress, + }) + } +} + +export default func + +func.tags = ["UpgradeWalletCoordinator"] +// When running an upgrade uncomment the skip below and run the command: +// yarn deploy --tags UpgradeWalletCoordinator --network +func.skip = async () => true From 0c405da4fda019fe7a8294329bf55dd9f0704af3 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 5 Jul 2023 13:49:02 +0200 Subject: [PATCH 163/198] Updates to WalletCoordinator upgrade script - cast type of proxy admin instance - update deployment artifact before referencing it in by `getContract("WalletCoordinator")` - verify implementation contract --- .../81_upgrade_wallet_coordinator_v2.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts index 5428dbb5b..09f34895a 100644 --- a/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts +++ b/solidity/deploy/81_upgrade_wallet_coordinator_v2.ts @@ -28,7 +28,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { ) // Assemble proxy upgrade transaction. - const proxyAdmin: ProxyAdmin = await hre.upgrades.admin.getInstance() + const proxyAdmin: ProxyAdmin = + (await hre.upgrades.admin.getInstance()) as ProxyAdmin const proxyAdminOwner = await proxyAdmin.owner() const upgradeTxData = await proxyAdmin.interface.encodeFunctionData( @@ -43,6 +44,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { `\t\tdata: ${upgradeTxData}` ) + // Update Deployment Artifact + const walletCoordinatorArtifact: Artifact = + hre.artifacts.readArtifactSync("WalletCoordinator") + + await deployments.save("WalletCoordinator", { + ...proxyDeployment, + abi: walletCoordinatorArtifact.abi, + implementation: newImplementationAddress, + }) + // Assemble parameters upgrade transaction. const walletCoordinator: WalletCoordinator = await helpers.contracts.getContract("WalletCoordinator") @@ -62,22 +73,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { `\t\tdata: ${updateRedemptionProposalParametersTxData}` ) - // Update Deployment Artifact - const walletCoordinatorArtifact: Artifact = - hre.artifacts.readArtifactSync("WalletCoordinator") - - await deployments.save("WalletCoordinator", { - ...proxyDeployment, - abi: walletCoordinatorArtifact.abi, - implementation: newImplementationAddress, - }) - if (hre.network.tags.etherscan) { // We use `verify` instead of `verify:verify` as the `verify` task is defined // in "@openzeppelin/hardhat-upgrades" to perform Etherscan verification // of Proxy and Implementation contracts. await hre.run("verify", { - address: proxyDeployment.address, + address: newImplementationAddress, constructorArgsParams: proxyDeployment.args, }) } From b339d7bb306f68fa883f1f09e50122b408fc102c Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Wed, 5 Jul 2023 13:51:49 +0200 Subject: [PATCH 164/198] Upgraded WalletCoordinator mainnet artifact --- solidity/.openzeppelin/mainnet.json | 270 +++++++++++++++++ .../mainnet/WalletCoordinator.json | 271 +++++++++++++++++- solidity/export.json | 267 +++++++++++++++++ 3 files changed, 806 insertions(+), 2 deletions(-) diff --git a/solidity/.openzeppelin/mainnet.json b/solidity/.openzeppelin/mainnet.json index b21fce9c9..c9e658efc 100644 --- a/solidity/.openzeppelin/mainnet.json +++ b/solidity/.openzeppelin/mainnet.json @@ -1646,6 +1646,276 @@ } } } + }, + "ce16848058a776a80d070af74d85fb4d1e632b07a9857bddcd0276c13aaf20c6": { + "address": "0x10Fb5943E2F4F67Ee6a533DaE49B6d4cC443ffE5", + "txHash": "0xe13747dba11729d2fd7aa9eca5ebba44073591c774122760008a3dd6e2dced76", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "reimbursementPool", + "offset": 0, + "slot": "101", + "type": "t_contract(ReimbursementPool)8816", + "contract": "Reimbursable", + "src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "Reimbursable", + "src": "@keep-network/random-beacon/contracts/Reimbursable.sol:51" + }, + { + "label": "isCoordinator", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_address,t_bool)", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:150" + }, + { + "label": "walletLock", + "offset": 0, + "slot": "152", + "type": "t_mapping(t_bytes20,t_struct(WalletLock)34672_storage)", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:152" + }, + { + "label": "bridge", + "offset": 0, + "slot": "153", + "type": "t_contract(Bridge)25740", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:154" + }, + { + "label": "heartbeatRequestValidity", + "offset": 20, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:165" + }, + { + "label": "heartbeatRequestGasOffset", + "offset": 24, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:169" + }, + { + "label": "depositSweepProposalValidity", + "offset": 28, + "slot": "153", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:181" + }, + { + "label": "depositMinAge", + "offset": 0, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:191" + }, + { + "label": "depositRefundSafetyMargin", + "offset": 4, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:212" + }, + { + "label": "depositSweepMaxSize", + "offset": 8, + "slot": "154", + "type": "t_uint16", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:214" + }, + { + "label": "depositSweepProposalSubmissionGasOffset", + "offset": 10, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:218" + }, + { + "label": "redemptionProposalValidity", + "offset": 14, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:230" + }, + { + "label": "redemptionRequestMinAge", + "offset": 18, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:238" + }, + { + "label": "redemptionRequestTimeoutSafetyMargin", + "offset": 22, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:261" + }, + { + "label": "redemptionMaxSize", + "offset": 26, + "slot": "154", + "type": "t_uint16", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:265" + }, + { + "label": "redemptionProposalSubmissionGasOffset", + "offset": 28, + "slot": "154", + "type": "t_uint32", + "contract": "WalletCoordinator", + "src": "contracts/bridge/WalletCoordinator.sol:274" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes20": { + "label": "bytes20", + "numberOfBytes": "20" + }, + "t_contract(Bridge)25740": { + "label": "contract Bridge", + "numberOfBytes": "20" + }, + "t_contract(ReimbursementPool)8816": { + "label": "contract ReimbursementPool", + "numberOfBytes": "20" + }, + "t_enum(WalletAction)34664": { + "label": "enum WalletCoordinator.WalletAction", + "members": [ + "Idle", + "Heartbeat", + "DepositSweep", + "Redemption", + "MovingFunds", + "MovedFundsSweep" + ], + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes20,t_struct(WalletLock)34672_storage)": { + "label": "mapping(bytes20 => struct WalletCoordinator.WalletLock)", + "numberOfBytes": "32" + }, + "t_struct(WalletLock)34672_storage": { + "label": "struct WalletCoordinator.WalletLock", + "members": [ + { + "label": "expiresAt", + "type": "t_uint32", + "offset": 0, + "slot": "0" + }, + { + "label": "cause", + "type": "t_enum(WalletAction)34664", + "offset": 4, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint16": { + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/solidity/deployments/mainnet/WalletCoordinator.json b/solidity/deployments/mainnet/WalletCoordinator.json index feefc6882..3e5b15065 100644 --- a/solidity/deployments/mainnet/WalletCoordinator.json +++ b/solidity/deployments/mainnet/WalletCoordinator.json @@ -193,6 +193,79 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionProposalValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionRequestMinAge", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionRequestTimeoutSafetyMargin", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "redemptionMaxSize", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "RedemptionProposalParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "RedemptionProposalSubmitted", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -381,6 +454,71 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "redemptionMaxSize", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionProposalSubmissionGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionProposalValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionRequestMinAge", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionRequestTimeoutSafetyMargin", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "reimbursementPool", @@ -544,6 +682,66 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitRedemptionProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitRedemptionProposalWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -621,6 +819,39 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_redemptionProposalValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_redemptionRequestMinAge", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_redemptionRequestTimeoutSafetyMargin", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_redemptionMaxSize", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "_redemptionProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "updateRedemptionProposalParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -741,6 +972,42 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "validateRedemptionProposal", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -834,7 +1101,7 @@ "status": 1, "byzantium": true }, - "numDeployments": 1, - "implementation": "0x9eAE6e8e99d27D377F1EA0659b0CB16ce8aD32bA", + "numDeployments": 3, + "implementation": "0x10Fb5943E2F4F67Ee6a533DaE49B6d4cC443ffE5", "devdoc": "Contract deployed as upgradable proxy" } \ No newline at end of file diff --git a/solidity/export.json b/solidity/export.json index cef4b247b..d3b83c7ee 100644 --- a/solidity/export.json +++ b/solidity/export.json @@ -11385,6 +11385,79 @@ "name": "OwnershipTransferred", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionProposalValidity", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionRequestMinAge", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionRequestTimeoutSafetyMargin", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "redemptionMaxSize", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "redemptionProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "RedemptionProposalParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + }, + { + "indexed": true, + "internalType": "address", + "name": "coordinator", + "type": "address" + } + ], + "name": "RedemptionProposalSubmitted", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -11573,6 +11646,71 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "redemptionMaxSize", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionProposalSubmissionGasOffset", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionProposalValidity", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionRequestMinAge", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "redemptionRequestTimeoutSafetyMargin", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "reimbursementPool", @@ -11736,6 +11874,66 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitRedemptionProposal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "submitRedemptionProposalWithReimbursement", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -11813,6 +12011,39 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "_redemptionProposalValidity", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_redemptionRequestMinAge", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_redemptionRequestTimeoutSafetyMargin", + "type": "uint32" + }, + { + "internalType": "uint16", + "name": "_redemptionMaxSize", + "type": "uint16" + }, + { + "internalType": "uint32", + "name": "_redemptionProposalSubmissionGasOffset", + "type": "uint32" + } + ], + "name": "updateRedemptionProposalParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -11933,6 +12164,42 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes[]", + "name": "redeemersOutputScripts", + "type": "bytes[]" + }, + { + "internalType": "uint256", + "name": "redemptionTxFee", + "type": "uint256" + } + ], + "internalType": "struct WalletCoordinator.RedemptionProposal", + "name": "proposal", + "type": "tuple" + } + ], + "name": "validateRedemptionProposal", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { From b5190e10129859f2264c91e3cddebd21f9946431 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 5 Jul 2023 15:50:08 +0200 Subject: [PATCH 165/198] Add unit tests for `createOutputScriptFromAddress` Test this fn with mainnet addressess: - P2PKH (`1*`) - P2WPKH (`bc1q*`) - P2SH (`3*`) - P2WSH (`bc1q*`) --- typescript/test/bitcoin.test.ts | 161 ++++++++++++++++++++++---------- 1 file changed, 114 insertions(+), 47 deletions(-) diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index 93b849ae8..a1bb5da82 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -467,53 +467,120 @@ describe("Bitcoin", () => { }) describe("createOutputScriptFromAddress", () => { - const btcAddresses = { - P2PKH: { - address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", - redeemerOutputScript: - "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", - }, - P2WPKH: { - address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", - redeemerOutputScript: - "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", - }, - P2SH: { - address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", - redeemerOutputScript: - "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", - }, - P2WSH: { - address: - "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", - redeemerOutputScript: - "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", - }, - } - - Object.entries(btcAddresses).forEach( - ([ - addressType, - { address, redeemerOutputScript: expectedRedeemerOutputScript }, - ]) => { - it(`should create correct output script for ${addressType} address type`, () => { - const result = createOutputScriptFromAddress(address) - - // Check if we can build the prefixed raw redeemer output script based - // on the result. - // Convert the output script to raw bytes buffer. - const rawRedeemerOutputScript = Buffer.from(result.toString(), "hex") - // Prefix the output script bytes buffer with 0x and its own length. - const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ - Buffer.from([rawRedeemerOutputScript.length]), - rawRedeemerOutputScript, - ]).toString("hex")}` - - expect(prefixedRawRedeemerOutputScript).to.eq( - expectedRedeemerOutputScript - ) - }) + context("with testnet addresses", () => { + const btcAddresses = { + P2PKH: { + address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", + redeemerOutputScript: + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + outputScript: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + }, + P2WPKH: { + address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", + redeemerOutputScript: + "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + outputScript: "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + }, + P2SH: { + address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", + redeemerOutputScript: + "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + outputScript: "a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + }, + P2WSH: { + address: + "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", + redeemerOutputScript: + "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + outputScript: + "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + }, } - ) + + Object.entries(btcAddresses).forEach( + ([ + addressType, + { + address, + redeemerOutputScript: expectedRedeemerOutputScript, + outputScript: expectedOutputScript, + }, + ]) => { + it(`should create correct output script for ${addressType} address type`, () => { + const result = createOutputScriptFromAddress(address) + + expect(result.toString()).to.eq(expectedOutputScript) + // Check if we can build the prefixed raw redeemer output script based + // on the result. + expect(buildRawPrefixedOutputScript(result.toString())).to.eq( + expectedRedeemerOutputScript + ) + }) + } + ) + }) + + context("with mainnet addresses", () => { + const btcAddresses = { + P2PKH: { + address: "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", + redeemerOutputScript: + "0x1976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", + outputScript: "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", + }, + P2WPKH: { + address: "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", + redeemerOutputScript: + "0x1600148d7a0a3461e3891723e5fdf8129caa0075060cff", + outputScript: "00148d7a0a3461e3891723e5fdf8129caa0075060cff", + }, + P2SH: { + address: "342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey", + redeemerOutputScript: + "0x17a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", + outputScript: "a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", + }, + P2WSH: { + address: + "bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak", + redeemerOutputScript: + "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + outputScript: + "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + }, + } + + Object.entries(btcAddresses).forEach( + ([ + addressType, + { + address, + redeemerOutputScript: expectedRedeemerOutputScript, + outputScript: expectedOutputScript, + }, + ]) => { + it(`should create correct output script for ${addressType} address type`, () => { + const result = createOutputScriptFromAddress(address) + + expect(result.toString()).to.eq(expectedOutputScript) + // Check if we can build the prefixed raw redeemer output script based + // on the result. + expect(buildRawPrefixedOutputScript(result.toString())).to.eq( + expectedRedeemerOutputScript + ) + }) + } + ) + }) }) }) + +const buildRawPrefixedOutputScript = (outputScript: string) => { + // Convert the output script to raw bytes buffer. + const rawRedeemerOutputScript = Buffer.from(outputScript.toString(), "hex") + // Prefix the output script bytes buffer with 0x and its own length. + return `0x${Buffer.concat([ + Buffer.from([rawRedeemerOutputScript.length]), + rawRedeemerOutputScript, + ]).toString("hex")}` +} From 06601b951b668fdda9680e1f9879dbbcf6755f4a Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 5 Jul 2023 16:07:07 +0200 Subject: [PATCH 166/198] Simplify `requestRedemption` API Get rid of two parms: - `vault`- `requestRedemption` is exposed on `TBTCToken` and there is no other choice than working with `TBTCVault` contract for this interaction. We should limit the surface of developer errors- we can resolve the `vault` address in the `TBTCToken` handle implementation from the `TBTCTokenContract.owner()` call. - `redeemer`- we can get the address from the contract instance using `this._instance.signer.getAddress()`. The `TBTCToken` contract always passes `msg.sender` to the `receiveApproval` fn so it's not possible to request redemption for someone else using approve and call pattern. --- typescript/src/chain.ts | 52 +++++++----------------- typescript/src/ethereum.ts | 52 ++++++++++++++++-------- typescript/src/redemption.ts | 14 ++----- typescript/test/redemption.test.ts | 7 ---- typescript/test/utils/mock-tbtc-token.ts | 22 ++++++++-- 5 files changed, 72 insertions(+), 75 deletions(-) diff --git a/typescript/src/chain.ts b/typescript/src/chain.ts index 93e3407f1..e422e7a68 100644 --- a/typescript/src/chain.ts +++ b/typescript/src/chain.ts @@ -381,40 +381,6 @@ export interface TBTCVault { getOptimisticMintingFinalizedEvents: GetEvents.Function } -/** - * Represnts data required to request redemption. - */ -export interface RequestRedemptionData { - /** - * On-chain identifier of the redeemer. - */ - redeemer: Identifier - /** - * The Bitcoin public key of the wallet. Must be in the compressed form (33 - * bytes long with 02 or 03 prefix). - */ - walletPublicKey: string - /** - * The main UTXO of the wallet. Must match the main UTXO held by the on-chain - * Bridge contract. - */ - mainUtxo: UnspentTransactionOutput - /** - * The output script that the redeemed funds will be locked to. Must be - * un-prefixed and not prepended with length. - */ - redeemerOutputScript: string - /** - * The amount to be redeemed with the precision of the tBTC on-chain token - * contract. - */ - amount: BigNumber - /** - * The vault address. - */ - vault: Identifier -} - /** * Interface for communication with the TBTC v2 token on-chain contract. */ @@ -436,9 +402,21 @@ export interface TBTCToken { * from the tBTC on-chain token contract. Then the tBTC token contract calls * the `receiveApproval` function from the `TBTCVault` contract which burns * tBTC tokens and requests redemption. - * @param requestRedemptionData Data required to request redemption @see - * {@link RequestRedemptionData}. + * @param walletPublicKey - The Bitcoin public key of the wallet. Must be in + * the compressed form (33 bytes long with 02 or 03 prefix). + * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO + * held by the on-chain Bridge contract. + * @param redeemerOutputScript - The output script that the redeemed funds + * will be locked to. Must be un-prefixed and not prepended with + * length. + * @param amount - The amount to be redeemed with the precision of the tBTC + * on-chain token contract. * @returns Transaction hash of the approve and call transaction. */ - requestRedemption(requestRedemptionData: RequestRedemptionData): Promise + requestRedemption( + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string, + amount: BigNumber + ): Promise } diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index d69ec026b..5f0eb6a68 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -5,7 +5,6 @@ import { TBTCToken as ChainTBTCToken, Identifier as ChainIdentifier, GetEvents, - RequestRedemptionData, } from "./chain" import { BigNumber, @@ -1106,15 +1105,27 @@ export class TBTCToken * @see {ChainTBTCToken#requestRedemption} */ async requestRedemption( - requestRedemptionData: RequestRedemptionData + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string, + amount: BigNumber ): Promise { - const { vault, amount, ...restData } = requestRedemptionData + const redeemer = await this._instance?.signer?.getAddress() + if (!redeemer) { + throw new Error("Signer not provided.") + } - const extraData = this.buildRequestRedemptionData(restData) + const vault = await this._instance.owner() + const extraData = this.buildRequestRedemptionData( + Address.from(redeemer), + walletPublicKey, + mainUtxo, + redeemerOutputScript + ) const tx = await sendWithRetry(async () => { return await this._instance.approveAndCall( - vault.identifierHex, + vault, amount, extraData.toPrefixedString() ) @@ -1124,11 +1135,20 @@ export class TBTCToken } private buildRequestRedemptionData( - requestRedemptionData: Omit + redeemer: Address, + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string ): Hex { - const { redeemer, ...restData } = requestRedemptionData - const { walletPublicKeyHash, mainUtxo, prefixedRawRedeemerOutputScript } = - this.buildBridgeRequestRedemptionData(restData) + const { + walletPublicKeyHash, + prefixedRawRedeemerOutputScript, + mainUtxo: _mainUtxo, + } = this.buildBridgeRequestRedemptionData( + walletPublicKey, + mainUtxo, + redeemerOutputScript + ) return Hex.from( utils.defaultAbiCoder.encode( @@ -1136,9 +1156,9 @@ export class TBTCToken [ redeemer.identifierHex, walletPublicKeyHash, - mainUtxo.txHash, - mainUtxo.txOutputIndex, - mainUtxo.txOutputValue, + _mainUtxo.txHash, + _mainUtxo.txOutputIndex, + _mainUtxo.txOutputValue, prefixedRawRedeemerOutputScript, ] ) @@ -1146,12 +1166,10 @@ export class TBTCToken } private buildBridgeRequestRedemptionData( - data: Pick< - RequestRedemptionData, - "mainUtxo" | "walletPublicKey" | "redeemerOutputScript" - > + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string ) { - const { walletPublicKey, mainUtxo, redeemerOutputScript } = data const walletPublicKeyHash = `0x${computeHash160(walletPublicKey)}` const mainUtxoParam = { diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index f52b8b3d1..e3b65c986 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -55,8 +55,7 @@ export interface RedemptionRequest { } /** - * Requests a redemption from the on-chain Bridge contract. - * @param redeemer - On-chain identifier of the redeemer. + * Requests a redemption of tBTC into BTC. * @param walletPublicKey - The Bitcoin public key of the wallet. Must be in the * compressed form (33 bytes long with 02 or 03 prefix). * @param mainUtxo - The main UTXO of the wallet. Must match the main UTXO held @@ -65,27 +64,22 @@ export interface RedemptionRequest { * be locked to. Must be un-prefixed and not prepended with length. * @param amount - The amount to be redeemed with the precision of the tBTC * on-chain token contract. - * @param vault - The vault address. * @param tBTCToken - Handle to the TBTCToken on-chain contract. * @returns Transaction hash of the request redemption transaction. */ export async function requestRedemption( - redeemer: Identifier, walletPublicKey: string, mainUtxo: UnspentTransactionOutput, redeemerOutputScript: string, amount: BigNumber, - vault: Identifier, tBTCToken: TBTCToken ): Promise { - return await tBTCToken.requestRedemption({ - redeemer, + return await tBTCToken.requestRedemption( walletPublicKey, mainUtxo, redeemerOutputScript, - amount, - vault, - }) + amount + ) } /** diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index d682f96fe..04072c3d0 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -34,7 +34,6 @@ import * as chai from "chai" import chaiAsPromised from "chai-as-promised" import { expect } from "chai" import { BigNumberish, BigNumber } from "ethers" -import { Address } from "../src/ethereum" import { MockTBTCToken } from "./utils/mock-tbtc-token" chai.use(chaiAsPromised) @@ -46,20 +45,16 @@ describe("Redemption", () => { const redeemerOutputScript = data.pendingRedemptions[0].pendingRedemption.redeemerOutputScript const amount = data.pendingRedemptions[0].pendingRedemption.requestedAmount - const vault = Address.from("0xb622eA9D678ddF15135a20d59Ff26D28eC246bfB") const token: MockTBTCToken = new MockTBTCToken() - const redeemer = Address.from("0x117284D8C50f334a1E2b7712649cB23C7a04Ae74") beforeEach(async () => { bcoin.set("testnet") await requestRedemption( - redeemer, walletPublicKey, mainUtxo, redeemerOutputScript, amount, - vault, token ) }) @@ -69,12 +64,10 @@ describe("Redemption", () => { expect(tokenLog.length).to.equal(1) expect(tokenLog[0]).to.deep.equal({ - redeemer, walletPublicKey, mainUtxo, redeemerOutputScript, amount, - vault, }) }) }) diff --git a/typescript/test/utils/mock-tbtc-token.ts b/typescript/test/utils/mock-tbtc-token.ts index cb0f8e93e..2e37d3e68 100644 --- a/typescript/test/utils/mock-tbtc-token.ts +++ b/typescript/test/utils/mock-tbtc-token.ts @@ -1,8 +1,14 @@ -import { RequestRedemptionData, TBTCToken } from "../../src/chain" +import { TBTCToken } from "../../src/chain" import { Hex } from "../../src/hex" import { BigNumber } from "ethers" +import { UnspentTransactionOutput } from "../../src/bitcoin" -interface RequestRedemptionLog extends RequestRedemptionData {} +interface RequestRedemptionLog { + walletPublicKey: string + mainUtxo: UnspentTransactionOutput + redeemerOutputScript: string + amount: BigNumber +} export class MockTBTCToken implements TBTCToken { private _requestRedemptionLog: RequestRedemptionLog[] = [] @@ -16,9 +22,17 @@ export class MockTBTCToken implements TBTCToken { } async requestRedemption( - requestRedemptionData: RequestRedemptionData + walletPublicKey: string, + mainUtxo: UnspentTransactionOutput, + redeemerOutputScript: string, + amount: BigNumber ): Promise { - this._requestRedemptionLog.push(requestRedemptionData) + this._requestRedemptionLog.push({ + walletPublicKey, + mainUtxo, + redeemerOutputScript, + amount, + }) return Hex.from( "0xf7d0c92c8de4d117d915c2a8a54ee550047f926bc00b91b651c40628751cfe29" From 5c3aba9d26f30258caaa795c31348f524eda801f Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 5 Jul 2023 18:36:42 +0200 Subject: [PATCH 167/198] Add unit tests Cover the `requestRedemption` fn from Ethereum Bridge handle with unit tests. --- typescript/test/ethereum.test.ts | 89 ++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/typescript/test/ethereum.test.ts b/typescript/test/ethereum.test.ts index 6bc3ad4bb..780180ffa 100644 --- a/typescript/test/ethereum.test.ts +++ b/typescript/test/ethereum.test.ts @@ -1,15 +1,17 @@ -import { Address, Bridge } from "../src/ethereum" +import { Address, Bridge, TBTCToken } from "../src/ethereum" import { deployMockContract, MockContract, } from "@ethereum-waffle/mock-contract" import chai, { assert, expect } from "chai" -import { BigNumber, constants } from "ethers" +import { BigNumber, Wallet, constants, utils } from "ethers" import { abi as BridgeABI } from "@keep-network/tbtc-v2/artifacts/Bridge.json" +import { abi as TBTCTokenABI } from "@keep-network/tbtc-v2/artifacts/TBTC.json" import { abi as WalletRegistryABI } from "@keep-network/ecdsa/artifacts/WalletRegistry.json" import { MockProvider } from "@ethereum-waffle/provider" import { waffleChai } from "@ethereum-waffle/chai" -import { TransactionHash } from "../src/bitcoin" +import { TransactionHash, computeHash160 } from "../src/bitcoin" +import { Hex } from "../src/hex" chai.use(waffleChai) @@ -470,4 +472,85 @@ describe("Ethereum", () => { "Expected contract function was not called" ) } + + describe("TBTCToken", () => { + let tbtcToken: MockContract + let tokenHandle: TBTCToken + const signer: Wallet = new MockProvider().getWallets()[0] + + beforeEach(async () => { + tbtcToken = await deployMockContract( + signer, + `${JSON.stringify(TBTCTokenABI)}` + ) + + tokenHandle = new TBTCToken({ + address: tbtcToken.address, + signerOrProvider: signer, + }) + }) + + describe("requestRedemption", () => { + const data = { + vault: Address.from("0x24BE35e7C04E2e0a628614Ce0Ed58805e1C894F7"), + walletPublicKey: + "03989d253b17a6a0f41838b84ff0d20e8898f9d7b1a98f2564da4cc29dcf8581d9", + mainUtxo: { + transactionHash: TransactionHash.from( + "f8eaf242a55ea15e602f9f990e33f67f99dfbe25d1802bbde63cc1caabf99668" + ), + outputIndex: 8, + value: BigNumber.from(9999), + }, + redeemer: Address.from(signer.address), + amount: BigNumber.from(10000), + redeemerOutputScript: { + unprefixed: + "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + prefixed: + "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + }, + } + + beforeEach(async () => { + await tbtcToken.mock.owner.returns(data.vault.identifierHex) + await tbtcToken.mock.approveAndCall.returns(true) + + await tokenHandle.requestRedemption( + data.walletPublicKey, + data.mainUtxo, + data.redeemerOutputScript.unprefixed, + data.amount + ) + }) + + it("should request the redemption", async () => { + const { + walletPublicKey, + mainUtxo, + redeemerOutputScript, + redeemer, + vault, + amount, + } = data + const expectedExtraData = utils.defaultAbiCoder.encode( + ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], + [ + redeemer.identifierHex, + Hex.from(computeHash160(walletPublicKey)).toPrefixedString(), + mainUtxo.transactionHash.reverse().toPrefixedString(), + mainUtxo.outputIndex, + mainUtxo.value, + redeemerOutputScript.prefixed, + ] + ) + + assertContractCalledWith(tbtcToken, "approveAndCall", [ + vault.identifierHex, + amount, + expectedExtraData, + ]) + }) + }) + }) }) From cd11ab9eb369797c41368101a4f5b0120924381b Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Thu, 6 Jul 2023 11:13:25 +0200 Subject: [PATCH 168/198] Start solidity/v1.6.0-dev version solidity/v1.5.0 was already published, so we need to start a new version development. --- solidity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solidity/package.json b/solidity/package.json index 2abcb51cf..1cf41a0a5 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -1,6 +1,6 @@ { "name": "@keep-network/tbtc-v2", - "version": "1.5.0-dev", + "version": "1.6.0-dev", "license": "GPL-3.0-only", "files": [ "artifacts/", From ea33c654385722a9198dd11053e30dea080a82f6 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 6 Jul 2023 12:10:28 +0200 Subject: [PATCH 169/198] Add `getAddressFromScriptPubKey` fn Add the new function that returns the Bitcoin address based on the script pub key placed on the output of a Bitcoin transaction. --- typescript/src/bitcoin.ts | 19 ++++- typescript/test/bitcoin.test.ts | 145 ++++++++++---------------------- typescript/test/data/bitcoin.ts | 65 ++++++++++++++ 3 files changed, 128 insertions(+), 101 deletions(-) create mode 100644 typescript/test/data/bitcoin.ts diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index bb330be3f..7941b802b 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -1,4 +1,4 @@ -import bcoin, { TX, Script } from "bcoin" +import bcoin, { TX, Script, Address } from "bcoin" import wif from "wif" import bufio from "bufio" import hash160 from "bcrypto/lib/hash160" @@ -612,3 +612,20 @@ export function locktimeToNumber(locktimeLE: Buffer | string): number { export function createOutputScriptFromAddress(address: string): Hex { return Hex.from(Script.fromAddress(address).toRaw().toString("hex")) } + +/** + * Returns the Bitcoin address based on the script pub key placed on the output + * of a Bitcoin transaction. + * @param scriptPubKey Scirpt pub key placed on the output of a Bitcoin + * transaction. + * @param network Bitcoin network. + * @returns The Bitcoin address. + */ +export function getAddressFromScriptPubKey( + scriptPubKey: string, + network: BitcoinNetwork = BitcoinNetwork.Mainnet +): string { + return Script.fromRaw(scriptPubKey.toString(), "hex") + .getAddress() + ?.toString(toBcoinNetwork(network)) +} diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index a1bb5da82..7c9795e40 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -12,11 +12,13 @@ import { bitsToTarget, targetToDifficulty, createOutputScriptFromAddress, + getAddressFromScriptPubKey, } from "../src/bitcoin" import { calculateDepositRefundLocktime } from "../src/deposit" import { BitcoinNetwork } from "../src/bitcoin-network" import { Hex } from "../src/hex" import { BigNumber } from "ethers" +import { btcAddresses } from "./data/bitcoin" describe("Bitcoin", () => { describe("compressPublicKey", () => { @@ -467,110 +469,53 @@ describe("Bitcoin", () => { }) describe("createOutputScriptFromAddress", () => { - context("with testnet addresses", () => { - const btcAddresses = { - P2PKH: { - address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", - redeemerOutputScript: - "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", - outputScript: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", - }, - P2WPKH: { - address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", - redeemerOutputScript: - "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", - outputScript: "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", - }, - P2SH: { - address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", - redeemerOutputScript: - "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", - outputScript: "a914011beb6fb8499e075a57027fb0a58384f2d3f78487", - }, - P2WSH: { - address: - "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", - redeemerOutputScript: - "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", - outputScript: - "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", - }, - } - - Object.entries(btcAddresses).forEach( - ([ - addressType, - { - address, - redeemerOutputScript: expectedRedeemerOutputScript, - outputScript: expectedOutputScript, - }, - ]) => { - it(`should create correct output script for ${addressType} address type`, () => { - const result = createOutputScriptFromAddress(address) - - expect(result.toString()).to.eq(expectedOutputScript) - // Check if we can build the prefixed raw redeemer output script based - // on the result. - expect(buildRawPrefixedOutputScript(result.toString())).to.eq( - expectedRedeemerOutputScript - ) - }) - } - ) + Object.keys(btcAddresses).forEach((bitcoinNetwork) => { + context(`with ${bitcoinNetwork} addresses`, () => { + Object.entries( + btcAddresses[bitcoinNetwork as keyof typeof btcAddresses] + ).forEach( + ([ + addressType, + { + address, + redeemerOutputScript: expectedRedeemerOutputScript, + scriptPubKey: expectedOutputScript, + }, + ]) => { + it(`should create correct output script for ${addressType} address type`, () => { + const result = createOutputScriptFromAddress(address) + + expect(result.toString()).to.eq(expectedOutputScript) + // Check if we can build the prefixed raw redeemer output script based + // on the result. + expect(buildRawPrefixedOutputScript(result.toString())).to.eq( + expectedRedeemerOutputScript + ) + }) + } + ) + }) }) + }) - context("with mainnet addresses", () => { - const btcAddresses = { - P2PKH: { - address: "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", - redeemerOutputScript: - "0x1976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", - outputScript: "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", - }, - P2WPKH: { - address: "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", - redeemerOutputScript: - "0x1600148d7a0a3461e3891723e5fdf8129caa0075060cff", - outputScript: "00148d7a0a3461e3891723e5fdf8129caa0075060cff", - }, - P2SH: { - address: "342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey", - redeemerOutputScript: - "0x17a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", - outputScript: "a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", - }, - P2WSH: { - address: - "bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak", - redeemerOutputScript: - "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", - outputScript: - "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", - }, - } - - Object.entries(btcAddresses).forEach( - ([ - addressType, - { - address, - redeemerOutputScript: expectedRedeemerOutputScript, - outputScript: expectedOutputScript, - }, - ]) => { - it(`should create correct output script for ${addressType} address type`, () => { - const result = createOutputScriptFromAddress(address) - - expect(result.toString()).to.eq(expectedOutputScript) - // Check if we can build the prefixed raw redeemer output script based - // on the result. - expect(buildRawPrefixedOutputScript(result.toString())).to.eq( - expectedRedeemerOutputScript + describe("getAddressFromScriptPubKey", () => { + Object.keys(btcAddresses).forEach((bitcoinNetwork) => { + context(`with ${bitcoinNetwork} addresses`, () => { + Object.entries( + btcAddresses[bitcoinNetwork as keyof typeof btcAddresses] + ).forEach(([addressType, { address, scriptPubKey }]) => { + it(`should return correct ${addressType} address`, () => { + const result = getAddressFromScriptPubKey( + scriptPubKey, + bitcoinNetwork === "mainnet" + ? BitcoinNetwork.Mainnet + : BitcoinNetwork.Testnet ) + + expect(result.toString()).to.eq(address) }) - } - ) + }) + }) }) }) }) diff --git a/typescript/test/data/bitcoin.ts b/typescript/test/data/bitcoin.ts new file mode 100644 index 000000000..bc266e1a0 --- /dev/null +++ b/typescript/test/data/bitcoin.ts @@ -0,0 +1,65 @@ +import { BitcoinNetwork } from "../../src/bitcoin-network" + +export const btcAddresses: Record< + Exclude, + { + [addressType: string]: { + address: string + redeemerOutputScript: string + scriptPubKey: string + } + } +> = { + testnet: { + P2PKH: { + address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", + redeemerOutputScript: + "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + scriptPubKey: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + }, + P2WPKH: { + address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", + redeemerOutputScript: "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + scriptPubKey: "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + }, + P2SH: { + address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", + redeemerOutputScript: + "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + scriptPubKey: "a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + }, + P2WSH: { + address: "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", + redeemerOutputScript: + "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + scriptPubKey: + "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + }, + }, + mainnet: { + P2PKH: { + address: "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", + redeemerOutputScript: + "0x1976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", + scriptPubKey: "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", + }, + P2WPKH: { + address: "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", + redeemerOutputScript: "0x1600148d7a0a3461e3891723e5fdf8129caa0075060cff", + scriptPubKey: "00148d7a0a3461e3891723e5fdf8129caa0075060cff", + }, + P2SH: { + address: "342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey", + redeemerOutputScript: + "0x17a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", + scriptPubKey: "a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", + }, + P2WSH: { + address: "bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak", + redeemerOutputScript: + "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + scriptPubKey: + "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + }, + }, +} From e814ecaeeb083f4d66a2882007de4b0b7320e4b4 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 6 Jul 2023 13:56:22 +0200 Subject: [PATCH 170/198] Remove unnecessary method from `MockBridge` It's no longer needed since we refactored the `requestRedemption` function in `9249ee5` and `06601b9`. --- typescript/test/utils/mock-bridge.ts | 36 ---------------------------- 1 file changed, 36 deletions(-) diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index 2466c145f..f3b06c658 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -326,40 +326,4 @@ export class MockBridge implements Bridge { walletRegistry(): Promise { throw new Error("not implemented") } - - buildRedemptionData( - redeemer: Identifier, - walletPublicKey: string, - mainUtxo: UnspentTransactionOutput, - redeemerOutputScript: string - ): Hex { - this._buildRedemptionDataLog.push({ - redeemer, - walletPublicKey, - mainUtxo, - redeemerOutputScript, - }) - - // Convert the output script to raw bytes buffer. - const rawRedeemerOutputScript = Buffer.from(redeemerOutputScript, "hex") - // Prefix the output script bytes buffer with 0x and its own length. - const prefixedRawRedeemerOutputScript = `0x${Buffer.concat([ - Buffer.from([rawRedeemerOutputScript.length]), - rawRedeemerOutputScript, - ]).toString("hex")}` - - return Hex.from( - utils.defaultAbiCoder.encode( - ["address", "bytes20", "bytes32", "uint32", "uint64", "bytes"], - [ - redeemer.identifierHex, - `0x${computeHash160(walletPublicKey)}`, - mainUtxo.transactionHash.reverse().toPrefixedString(), - mainUtxo.outputIndex, - mainUtxo.value, - prefixedRawRedeemerOutputScript, - ] - ) - ) - } } From dbd818e25ed83e919b30f33cfd68b7f1d782c0e3 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 6 Jul 2023 14:00:30 +0200 Subject: [PATCH 171/198] Update the error msg in `requestRedemption` Drop the dot `.` from the end of the error message. --- typescript/src/ethereum.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 5f0eb6a68..dc217304e 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -1112,7 +1112,7 @@ export class TBTCToken ): Promise { const redeemer = await this._instance?.signer?.getAddress() if (!redeemer) { - throw new Error("Signer not provided.") + throw new Error("Signer not provided") } const vault = await this._instance.owner() From b9633d18a84759f6e32ff808e8f1f643796ce140 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 6 Jul 2023 14:06:00 +0200 Subject: [PATCH 172/198] Update `createOutputScriptFromAddress` tests `buildRawPrefixedOutputScript` is only converting the string to a buffer and prepends the length. If the result is `expectedOutputScript` this will always work. Here we remove this assertion, the most important part of this test is whether `createOutputScriptFromAddress` recognizes and handles the given address type correctly. --- typescript/test/bitcoin.test.ts | 54 ++------------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index a1bb5da82..6bc7de6c4 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -471,50 +471,30 @@ describe("Bitcoin", () => { const btcAddresses = { P2PKH: { address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", - redeemerOutputScript: - "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", outputScript: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", }, P2WPKH: { address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", - redeemerOutputScript: - "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", outputScript: "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", }, P2SH: { address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", - redeemerOutputScript: - "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", outputScript: "a914011beb6fb8499e075a57027fb0a58384f2d3f78487", }, P2WSH: { address: "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", - redeemerOutputScript: - "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", outputScript: "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", }, } Object.entries(btcAddresses).forEach( - ([ - addressType, - { - address, - redeemerOutputScript: expectedRedeemerOutputScript, - outputScript: expectedOutputScript, - }, - ]) => { + ([addressType, { address, outputScript: expectedOutputScript }]) => { it(`should create correct output script for ${addressType} address type`, () => { const result = createOutputScriptFromAddress(address) expect(result.toString()).to.eq(expectedOutputScript) - // Check if we can build the prefixed raw redeemer output script based - // on the result. - expect(buildRawPrefixedOutputScript(result.toString())).to.eq( - expectedRedeemerOutputScript - ) }) } ) @@ -524,63 +504,33 @@ describe("Bitcoin", () => { const btcAddresses = { P2PKH: { address: "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", - redeemerOutputScript: - "0x1976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", outputScript: "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", }, P2WPKH: { address: "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", - redeemerOutputScript: - "0x1600148d7a0a3461e3891723e5fdf8129caa0075060cff", outputScript: "00148d7a0a3461e3891723e5fdf8129caa0075060cff", }, P2SH: { address: "342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey", - redeemerOutputScript: - "0x17a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", outputScript: "a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", }, P2WSH: { address: "bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak", - redeemerOutputScript: - "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", outputScript: "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", }, } Object.entries(btcAddresses).forEach( - ([ - addressType, - { - address, - redeemerOutputScript: expectedRedeemerOutputScript, - outputScript: expectedOutputScript, - }, - ]) => { + ([addressType, { address, outputScript: expectedOutputScript }]) => { it(`should create correct output script for ${addressType} address type`, () => { const result = createOutputScriptFromAddress(address) expect(result.toString()).to.eq(expectedOutputScript) - // Check if we can build the prefixed raw redeemer output script based - // on the result. - expect(buildRawPrefixedOutputScript(result.toString())).to.eq( - expectedRedeemerOutputScript - ) }) } ) }) }) }) - -const buildRawPrefixedOutputScript = (outputScript: string) => { - // Convert the output script to raw bytes buffer. - const rawRedeemerOutputScript = Buffer.from(outputScript.toString(), "hex") - // Prefix the output script bytes buffer with 0x and its own length. - return `0x${Buffer.concat([ - Buffer.from([rawRedeemerOutputScript.length]), - rawRedeemerOutputScript, - ]).toString("hex")}` -} From 5f0365d67f8f73486fdd3b95fe90b3e4463e36e9 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Thu, 6 Jul 2023 14:54:03 +0200 Subject: [PATCH 173/198] Remove unnecessary fields in `MockBridge` class See e814eca. --- typescript/test/utils/mock-bridge.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/typescript/test/utils/mock-bridge.ts b/typescript/test/utils/mock-bridge.ts index f3b06c658..d342357c2 100644 --- a/typescript/test/utils/mock-bridge.ts +++ b/typescript/test/utils/mock-bridge.ts @@ -43,13 +43,6 @@ interface RedemptionProofLogEntry { walletPublicKey: string } -interface BuildRedemptionDataLogEntry { - redeemer: Identifier - walletPublicKey: string - mainUtxo: UnspentTransactionOutput - redeemerOutputScript: string -} - /** * Mock Bridge used for test purposes. */ @@ -63,7 +56,6 @@ export class MockBridge implements Bridge { private _redemptionProofLog: RedemptionProofLogEntry[] = [] private _deposits = new Map() private _activeWalletPublicKey: string | undefined - private _buildRedemptionDataLog: BuildRedemptionDataLogEntry[] = [] setPendingRedemptions(value: Map) { this._pendingRedemptions = value @@ -89,10 +81,6 @@ export class MockBridge implements Bridge { return this._redemptionProofLog } - get buildRedemptionDataLog(): BuildRedemptionDataLogEntry[] { - return this._buildRedemptionDataLog - } - setDeposits(value: Map) { this._deposits = value } From 5ceed1e5e93c02eca775d559ff94935d066a2a19 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 10:35:49 +0200 Subject: [PATCH 174/198] Remove unnecessary import --- typescript/src/bitcoin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index 7941b802b..c3235cdb4 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -1,4 +1,4 @@ -import bcoin, { TX, Script, Address } from "bcoin" +import bcoin, { TX, Script } from "bcoin" import wif from "wif" import bufio from "bufio" import hash160 from "bcrypto/lib/hash160" From 5df505b18eb818c238c22addcb5c4ab91691e863 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 12:35:35 +0200 Subject: [PATCH 175/198] Update `findWalletForRedemption` We need to check if the redemption key is unique- given wallet public key and redeemer output script pair can be used for only one pending request at the same time. Otherwise we should suggest another wallet that can handle a redemption. --- typescript/src/redemption.ts | 20 ++++++++ typescript/test/data/redemption.ts | 10 ++++ typescript/test/redemption.test.ts | 78 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 741f9e893..6bdf1de4c 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -414,6 +414,9 @@ export async function getRedemptionRequest( /** * Finds the oldest active wallet that has enough BTC to handle a redemption request. * @param amount The amount to be redeemed in satoshis. + * @param redeemerOutputScript The redeemer output script the redeemed funds + * are supposed to be locked on. Must be un-prefixed and not prepended + * with length. * @param bridge The handle to the Bridge on-chain contract. * @param bitcoinClient Bitcoin client used to interact with the network. * @param bitcoinNetwork Bitcoin network. @@ -421,6 +424,7 @@ export async function getRedemptionRequest( */ export async function findWalletForRedemption( amount: BigNumber, + redeemerOutputScript: string, bridge: Bridge, bitcoinClient: BitcoinClient, bitcoinNetwork: BitcoinNetwork @@ -459,6 +463,22 @@ export async function findWalletForRedemption( continue } + const pendingRedemption = await bridge.pendingRedemptions( + walletPublicKey.toString(), + redeemerOutputScript + ) + + if (pendingRedemption.requestedAt != 0) { + console.debug( + `There is a pending redemption request from this wallet to the + same address. Given wallet public key(${walletPublicKey}) and \ + redeemer output script(${redeemerOutputScript}) pair can be \ + used for only one pending request at the same time. \ + Continue the loop execution to the next wallet...` + ) + continue + } + const walletBitcoinAddress = encodeToBitcoinAddress( wallet.walletPublicKeyHash.toString(), true, diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 0080de3a2..147b0da7d 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -679,6 +679,7 @@ export const findWalletForRedemptionData: { utxos: UnspentTransactionOutput[] } } + pendingRedemption: RedemptionRequest } = { newWalletRegisteredEvents: [ { @@ -786,4 +787,13 @@ export const findWalletForRedemptionData: { ], }, }, + pendingRedemption: { + redeemer: Address.from("0xeb9af8E66869902476347a4eFe59a527a57240ED"), + // script for testnet P2PKH address mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc + redeemerOutputScript: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + requestedAmount: BigNumber.from(1000000), + treasuryFee: BigNumber.from(20000), + txMaxFee: BigNumber.from(20000), + requestedAt: 1688724606, + }, } diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index e9d493d06..3d3664a3b 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1440,6 +1440,8 @@ describe("Redemption", () => { describe("findWalletForRedemption", () => { let bridge: MockBridge let bitcoinClient: MockBitcoinClient + const redeemerOutputScript = + findWalletForRedemptionData.pendingRedemption.redeemerOutputScript context( "when there are no wallets in the network that can hanlde redemption", @@ -1455,6 +1457,7 @@ describe("Redemption", () => { await expect( findWalletForRedemption( amount, + redeemerOutputScript, bridge, bitcoinClient, BitcoinNetwork.Testnet @@ -1501,6 +1504,7 @@ describe("Redemption", () => { beforeEach(async () => { result = await findWalletForRedemption( amount, + redeemerOutputScript, bridge, bitcoinClient, BitcoinNetwork.Testnet @@ -1558,6 +1562,7 @@ describe("Redemption", () => { await expect( findWalletForRedemption( amount, + redeemerOutputScript, bridge, bitcoinClient, BitcoinNetwork.Testnet @@ -1568,6 +1573,79 @@ describe("Redemption", () => { }) } ) + + context( + "when there is pending redemption request from a given wallet to the same address", + () => { + beforeEach(async () => { + const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC + + const walletPublicKeyHash = + findWalletForRedemptionData.newWalletRegisteredEvents[0] + .walletPublicKeyHash + const pendingRedemptions = new Map< + BigNumberish, + RedemptionRequest + >() + + const key = MockBridge.buildRedemptionKey( + walletPublicKeyHash.toString(), + redeemerOutputScript + ) + + pendingRedemptions.set( + key, + findWalletForRedemptionData.pendingRedemption + ) + bridge.setPendingRedemptions(pendingRedemptions) + + result = await findWalletForRedemption( + amount, + redeemerOutputScript, + bridge, + bitcoinClient, + BitcoinNetwork.Testnet + ) + }) + + it("should get all registered wallets", () => { + const bridgeQueryEventsLog = bridge.newWalletRegisteredEventsLog + + expect(bridgeQueryEventsLog.length).to.equal(1) + expect(bridgeQueryEventsLog[0]).to.deep.equal({ + options: undefined, + filterArgs: [], + }) + }) + + it("should get wallet data details", () => { + const bridgeWalletDetailsLogs = bridge.walletsLog + + expect(bridgeWalletDetailsLogs.length).to.eql(2) + expect(bridgeWalletDetailsLogs[0].walletPublicKeyHash).to.eql( + findWalletForRedemptionData.newWalletRegisteredEvents[0].walletPublicKeyHash.toPrefixedString() + ) + expect(bridgeWalletDetailsLogs[1].walletPublicKeyHash).to.eql( + findWalletForRedemptionData.newWalletRegisteredEvents[1].walletPublicKeyHash.toPrefixedString() + ) + }) + + it("should skip the wallet for which there is a pending redemption request to the same redeemer output script and return the wallet data that can handle redemption request", () => { + const expectedWalletPublicKeyHash = + findWalletForRedemptionData.newWalletRegisteredEvents[1] + .walletPublicKeyHash + const expectedWalletData = + findWalletForRedemptionData.wallets[ + expectedWalletPublicKeyHash.toPrefixedString() + ] + + expect(result).to.deep.eq({ + walletPublicKey: expectedWalletData.walletPublicKey.toString(), + mainUtxo: expectedWalletData.utxos[0], + }) + }) + } + ) }) }) }) From 0f1183845e7c29d25d03cdd4b047a740da6561d4 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 13:27:15 +0200 Subject: [PATCH 176/198] Fix debug logs format in `findWalletForRedemption` --- typescript/src/redemption.ts | 42 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 6bdf1de4c..d3138d1ba 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -443,13 +443,22 @@ export async function findWalletForRedemption( let maxAmount = BigNumber.from(0) for (const wallet of wallets) { + const { walletPublicKeyHash } = wallet const { state, mainUtxoHash, walletPublicKey } = await bridge.wallets( - wallet.walletPublicKeyHash + walletPublicKeyHash ) // Wallet must be in Live state. + if (state !== WalletState.Live) { + console.debug( + `Wallet is not in Live state ` + + `(wallet public key hash: ${walletPublicKeyHash.toString()}). ` + + `Continue the loop execution to the next wallet...` + ) + continue + } + if ( - state !== WalletState.Live || mainUtxoHash.equals( Hex.from( "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -457,10 +466,10 @@ export async function findWalletForRedemption( ) ) { console.debug( - `Wallet is not in Live state or main utxo is not set. \ - Continue the loop execution to the next wallet...` + `Main utxo not set for wallet public ` + + `key hash(${walletPublicKeyHash.toString()}). ` + + `Continue the loop execution to the next wallet...` ) - continue } const pendingRedemption = await bridge.pendingRedemptions( @@ -470,11 +479,12 @@ export async function findWalletForRedemption( if (pendingRedemption.requestedAt != 0) { console.debug( - `There is a pending redemption request from this wallet to the - same address. Given wallet public key(${walletPublicKey}) and \ - redeemer output script(${redeemerOutputScript}) pair can be \ - used for only one pending request at the same time. \ - Continue the loop execution to the next wallet...` + `There is a pending redemption request from this wallet to the ` + + `same Bitcoin address. Given wallet public key hash` + + `(${walletPublicKeyHash.toString()}) and redeemer output script ` + + `(${redeemerOutputScript}) pair can be used for only one ` + + `pending request at the same time. ` + + `Continue the loop execution to the next wallet...` ) continue } @@ -497,9 +507,9 @@ export async function findWalletForRedemption( if (!mainUtxo) { console.debug( - `Could not find matching UTXO on chains for wallet public key hash \ - (${wallet.walletPublicKeyHash.toPrefixedString()}). Continue the loop \ - execution to the next wallet...` + `Could not find matching UTXO on chains ` + + `for wallet public key hash(${walletPublicKey.toString()}). ` + + `Continue the loop execution to the next wallet...` ) continue } @@ -517,9 +527,9 @@ export async function findWalletForRedemption( } console.debug( - `The wallet (${wallet.walletPublicKeyHash.toPrefixedString()}) \ - cannot handle the redemption request. Continue the loop execution to the \ - next wallet...` + `The wallet (${walletPublicKeyHash.toString()})` + + `cannot handle the redemption request. ` + + `Continue the loop execution to the next wallet...` ) } From dd1af4548c7e76d2dcb76c3aad8fe0daac795daf Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 13:30:46 +0200 Subject: [PATCH 177/198] Fix typo `hanlde` -> `handle` --- typescript/test/redemption.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 3d3664a3b..beb3d545a 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1444,7 +1444,7 @@ describe("Redemption", () => { findWalletForRedemptionData.pendingRedemption.redeemerOutputScript context( - "when there are no wallets in the network that can hanlde redemption", + "when there are no wallets in the network that can handle redemption", () => { const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC beforeEach(() => { From 24ede08deb5571f179f870e3bcad6cbfacbccc63 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:08:36 +0200 Subject: [PATCH 178/198] Improve `findWalletForRedemption` tests Add some wallets that should be skipped by the wallet selection- E.g. some non-live state, main utxo not set. --- typescript/test/data/redemption.ts | 164 +++++++++++++++++++---------- typescript/test/redemption.test.ts | 94 ++++++++++------- 2 files changed, 162 insertions(+), 96 deletions(-) diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 147b0da7d..0960693d4 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -668,21 +668,51 @@ export const redemptionProof: RedemptionProofTestData = { }, } -export const findWalletForRedemptionData: { - newWalletRegisteredEvents: NewWalletRegisteredEvent[] - wallets: { - [walletPublicKeyHash: string]: { - state: WalletState - mainUtxoHash: Hex - walletPublicKey: Hex - btcAddress: string - utxos: UnspentTransactionOutput[] - } +interface FindWalletForRedemptionWaleltData { + data: { + state: WalletState + mainUtxoHash: Hex + walletPublicKey: Hex + btcAddress: string + utxos: UnspentTransactionOutput[] + } + event: { + blockNumber: number + blockHash: Hex + transactionHash: Hex + ecdsaWalletID: Hex + walletPublicKeyHash: Hex } +} + +export const findWalletForRedemptionData: { + liveWallet: FindWalletForRedemptionWaleltData + walletWithoutUtxo: FindWalletForRedemptionWaleltData + nonLiveWallet: FindWalletForRedemptionWaleltData + walletWithPendingRedemption: FindWalletForRedemptionWaleltData pendingRedemption: RedemptionRequest } = { - newWalletRegisteredEvents: [ - { + liveWallet: { + data: { + state: WalletState.Live, + mainUtxoHash: Hex.from( + "0x3ded9dcfce0ffe479640013ebeeb69b6a82306004f9525b1346ca3b553efc6aa" + ), + walletPublicKey: Hex.from( + "0x028ed84936be6a9f594a2dcc636d4bebf132713da3ce4dac5c61afbf8bbb47d6f7" + ), + btcAddress: "tb1qqwm566yn44rdlhgph8sw8vecta8uutg79afuja", + utxos: [ + { + transactionHash: Hex.from( + "0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb" + ), + outputIndex: 0, + value: BigNumber.from("791613461"), + }, + ], + }, + event: { blockNumber: 8367602, blockHash: Hex.from( "0x908ea9c82b388a760e6dd070522e5421d88b8931fbac6702119f9e9a483dd022" @@ -697,77 +727,84 @@ export const findWalletForRedemptionData: { "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e" ), }, - { - blockNumber: 8502240, - blockHash: Hex.from( - "0x4baab7520cf79a05f22723688bcd1f2805778829aa4362250b8ee702f34f4daf" - ), - transactionHash: Hex.from( - "0xe88761c7203335e237366ec2ffca1e7cf2690eab343ad700e6a6e6dc236638b1" - ), - ecdsaWalletID: Hex.from( - "0x0c70f262eaff2cdaaddb5a5e4ecfdda6edad7f1789954ad287bfa7e594173c64" + }, + + walletWithoutUtxo: { + data: { + state: WalletState.Live, + mainUtxoHash: Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" ), - walletPublicKeyHash: Hex.from( - "0x7670343fc00ccc2d0cd65360e6ad400697ea0fed" + walletPublicKey: Hex.from( + "0x030fbbae74e6d85342819e719575949a1349e975b69fb382e9fef671a3a74efc52" ), + btcAddress: "tb1qkct7r24k4wutnsun84rvp3qsyt8yfpvqz89d2y", + utxos: [ + { + transactionHash: Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ), + outputIndex: 0, + value: BigNumber.from("0"), + }, + ], }, - { - blockNumber: 8981644, + event: { + blockNumber: 9103428, blockHash: Hex.from( - "0x6681b1bb168fb86755c2a796169cb0e06949caac9fc7145d527d94d5209a64ad" + "0x92ad328db2cb1d2aad60ac809660e05e2b6763ddd376ca21630e304c98f23600" ), transactionHash: Hex.from( - "0xea3a8853c658145c95165d7847152aeedc3ff29406ec263abfc9b1436402b7b7" + "0x309085ebb92e10eb9e665c7d90c94e053f13b36f9bc8017e820bc879ba629b8e" ), ecdsaWalletID: Hex.from( - "0x7a1437d67f49adfd44e03ddc85be0f6988715d7c39dfb0ca9780f1a88bcdca25" + "0xd27bfaaad9c3489e613eb3664c3b9958bd9a494377123689733267cb4a5767ba" ), walletPublicKeyHash: Hex.from( - "0x328d992e5f5b71de51a1b40fcc4056b99a88a647" + "0xb617e1aab6abb8b9c3933d46c0c41022ce448580" ), }, - ], - wallets: { - "0x03b74d6893ad46dfdd01b9e0e3b3385f4fce2d1e": { - state: WalletState.Live, + }, + + nonLiveWallet: { + data: { + state: WalletState.Unknown, mainUtxoHash: Hex.from( - "0x3ded9dcfce0ffe479640013ebeeb69b6a82306004f9525b1346ca3b553efc6aa" + "0x0000000000000000000000000000000000000000000000000000000000000000" ), walletPublicKey: Hex.from( - "0x028ed84936be6a9f594a2dcc636d4bebf132713da3ce4dac5c61afbf8bbb47d6f7" + "0x02633b102417009ae55103798f4d366dfccb081dcf20025088b9bf10a8e15d8ded" ), - btcAddress: "tb1qqwm566yn44rdlhgph8sw8vecta8uutg79afuja", + btcAddress: "tb1qf6jvyd680ncf9dtr5znha9ql5jmw84lupwwuf6", utxos: [ { transactionHash: Hex.from( - "0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb" + "0x0000000000000000000000000000000000000000000000000000000000000000" ), outputIndex: 0, - value: BigNumber.from("791613461"), + value: BigNumber.from("0"), }, ], }, - "0x7670343fc00ccc2d0cd65360e6ad400697ea0fed": { - state: WalletState.Live, - mainUtxoHash: Hex.from( - "0x3ea242dd8a7f7f7abd548ca6590de70a1e992cbd6e4ae18b7a91c9b899067626" + event: { + blockNumber: 9171960, + blockHash: Hex.from( + "0xe9a404b724183cb8f77e45718b365051e8d5ccc4a72dfece30af7596eeee4748" ), - walletPublicKey: Hex.from( - "0x025183c15164e1b2211eb359fce2ceeefc3abad3af6d760cc6355f9de99bf60229" + transactionHash: Hex.from( + "0x867f2c985cbe44f92a7ca2c14268b9ae78275e1c339692e1847548725484e72d" + ), + ecdsaWalletID: Hex.from( + "0x96975ddd76bbb2e15ed4498de6d92187ec5282913b3af3891a4e2d60581a8787" + ), + walletPublicKeyHash: Hex.from( + "0x4ea4c237477cf092b563a0a77e941fa4b6e3d7fc" ), - btcAddress: "tb1qwecrg07qpnxz6rxk2dswdt2qq6t75rldweydm2", - utxos: [ - { - transactionHash: Hex.from( - "0xda0e364abb3ed952bcc694e48bbcff19131ba9513fe981b303fa900cff0f9fbc" - ), - outputIndex: 0, - value: BigNumber.from("164380000"), - }, - ], }, - "0x328d992e5f5b71de51a1b40fcc4056b99a88a647": { + }, + + walletWithPendingRedemption: { + data: { state: WalletState.Live, mainUtxoHash: Hex.from( "0xb3024ef698084cfdfba459338864a595d31081748b28aa5eb02312671a720531" @@ -786,6 +823,21 @@ export const findWalletForRedemptionData: { }, ], }, + event: { + blockNumber: 8981644, + blockHash: Hex.from( + "0x6681b1bb168fb86755c2a796169cb0e06949caac9fc7145d527d94d5209a64ad" + ), + transactionHash: Hex.from( + "0xea3a8853c658145c95165d7847152aeedc3ff29406ec263abfc9b1436402b7b7" + ), + ecdsaWalletID: Hex.from( + "0x7a1437d67f49adfd44e03ddc85be0f6988715d7c39dfb0ca9780f1a88bcdca25" + ), + walletPublicKeyHash: Hex.from( + "0x328d992e5f5b71de51a1b40fcc4056b99a88a647" + ), + }, }, pendingRedemption: { redeemer: Address.from("0xeb9af8E66869902476347a4eFe59a527a57240ED"), diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index beb3d545a..4f75ef490 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1440,8 +1440,10 @@ describe("Redemption", () => { describe("findWalletForRedemption", () => { let bridge: MockBridge let bitcoinClient: MockBitcoinClient + // script for testnet P2WSH address + // tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv const redeemerOutputScript = - findWalletForRedemptionData.pendingRedemption.redeemerOutputScript + "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c" context( "when there are no wallets in the network that can handle redemption", @@ -1471,27 +1473,40 @@ describe("Redemption", () => { context("when there are registered wallets in the network", () => { let result: Awaited | never> + const walletsOrder = [ + findWalletForRedemptionData.nonLiveWallet, + findWalletForRedemptionData.walletWithoutUtxo, + findWalletForRedemptionData.walletWithPendingRedemption, + findWalletForRedemptionData.liveWallet, + ] beforeEach(async () => { bitcoinClient = new MockBitcoinClient() bridge = new MockBridge() - bridge.newWalletRegisteredEvents = - findWalletForRedemptionData.newWalletRegisteredEvents + + bridge.newWalletRegisteredEvents = walletsOrder.map( + (wallet) => wallet.event + ) + const walletsUnspentTransacionOutputs = new Map< string, UnspentTransactionOutput[] >() - for (const [ - key, - { state, mainUtxoHash, walletPublicKey, btcAddress, utxos }, - ] of Object.entries(findWalletForRedemptionData.wallets)) { - bridge.setWallet(key, { - state, - mainUtxoHash, - walletPublicKey, - } as Wallet) + + walletsOrder.forEach((wallet) => { + const { state, mainUtxoHash, walletPublicKey, btcAddress, utxos } = + wallet.data + walletsUnspentTransacionOutputs.set(btcAddress, utxos) - } + bridge.setWallet( + wallet.event.walletPublicKeyHash.toPrefixedString(), + { + state, + mainUtxoHash, + walletPublicKey, + } as Wallet + ) + }) bitcoinClient.unspentTransactionOutputs = walletsUnspentTransacionOutputs @@ -1524,20 +1539,23 @@ describe("Redemption", () => { it("should get wallet data details", () => { const bridgeWalletDetailsLogs = bridge.walletsLog - expect(bridgeWalletDetailsLogs.length).to.eql(1) - expect(bridgeWalletDetailsLogs[0].walletPublicKeyHash).to.eql( - findWalletForRedemptionData.newWalletRegisteredEvents[0].walletPublicKeyHash.toPrefixedString() - ) + const wallets = Array.from(walletsOrder) + // Remove last live wallet. + wallets.pop() + + expect(bridgeWalletDetailsLogs.length).to.eql(wallets.length) + + wallets.forEach((wallet, index) => { + expect(bridgeWalletDetailsLogs[index].walletPublicKeyHash).to.eql( + wallet.event.walletPublicKeyHash.toPrefixedString() + ) + }) }) it("should return the wallet data that can handle redemption request", () => { - const expectedWalletPublicKeyHash = - findWalletForRedemptionData.newWalletRegisteredEvents[0] - .walletPublicKeyHash const expectedWalletData = - findWalletForRedemptionData.wallets[ - expectedWalletPublicKeyHash.toPrefixedString() - ] + findWalletForRedemptionData.walletWithPendingRedemption.data + expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), mainUtxo: expectedWalletData.utxos[0], @@ -1550,9 +1568,8 @@ describe("Redemption", () => { "when the redemption request amount is too large and no wallet can handle the request", () => { const amount = BigNumber.from("10000000000") // 1 000 BTC - const expectedMaxAmount = Object.values( - findWalletForRedemptionData.wallets - ) + const expectedMaxAmount = walletsOrder + .map((wallet) => wallet.data) .map((wallet) => wallet.utxos) .flat() .map((utxo) => utxo.value) @@ -1578,11 +1595,14 @@ describe("Redemption", () => { "when there is pending redemption request from a given wallet to the same address", () => { beforeEach(async () => { + const redeemerOutputScript = + findWalletForRedemptionData.pendingRedemption.redeemerOutputScript const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC const walletPublicKeyHash = - findWalletForRedemptionData.newWalletRegisteredEvents[0] + findWalletForRedemptionData.walletWithPendingRedemption.event .walletPublicKeyHash + const pendingRedemptions = new Map< BigNumberish, RedemptionRequest @@ -1621,23 +1641,17 @@ describe("Redemption", () => { it("should get wallet data details", () => { const bridgeWalletDetailsLogs = bridge.walletsLog - expect(bridgeWalletDetailsLogs.length).to.eql(2) - expect(bridgeWalletDetailsLogs[0].walletPublicKeyHash).to.eql( - findWalletForRedemptionData.newWalletRegisteredEvents[0].walletPublicKeyHash.toPrefixedString() - ) - expect(bridgeWalletDetailsLogs[1].walletPublicKeyHash).to.eql( - findWalletForRedemptionData.newWalletRegisteredEvents[1].walletPublicKeyHash.toPrefixedString() - ) + expect(bridgeWalletDetailsLogs.length).to.eql(walletsOrder.length) + walletsOrder.forEach((wallet, index) => { + expect(bridgeWalletDetailsLogs[index].walletPublicKeyHash).to.eql( + wallet.event.walletPublicKeyHash.toPrefixedString() + ) + }) }) it("should skip the wallet for which there is a pending redemption request to the same redeemer output script and return the wallet data that can handle redemption request", () => { - const expectedWalletPublicKeyHash = - findWalletForRedemptionData.newWalletRegisteredEvents[1] - .walletPublicKeyHash const expectedWalletData = - findWalletForRedemptionData.wallets[ - expectedWalletPublicKeyHash.toPrefixedString() - ] + findWalletForRedemptionData.liveWallet.data expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), From 159ae96292ceae70e0b271352ceb72a2266a4419 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:10:32 +0200 Subject: [PATCH 179/198] Update logs in `findWalletForRedemption` Log wallet public key hash instead of wallet public key- for consistency. --- typescript/src/redemption.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index d3138d1ba..5bce57ec4 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -508,7 +508,7 @@ export async function findWalletForRedemption( if (!mainUtxo) { console.debug( `Could not find matching UTXO on chains ` + - `for wallet public key hash(${walletPublicKey.toString()}). ` + + `for wallet public key hash(${walletPublicKeyHash.toString()}). ` + `Continue the loop execution to the next wallet...` ) continue From ca2191acaf102b0b4d24a9bc80c481f3c3df2eb9 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:18:08 +0200 Subject: [PATCH 180/198] Reorder arguments in `findWalletForRedemption` To be consistent with other functions- pass handles at the end. --- typescript/src/redemption.ts | 4 ++-- typescript/test/redemption.test.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 5bce57ec4..6f728f708 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -417,17 +417,17 @@ export async function getRedemptionRequest( * @param redeemerOutputScript The redeemer output script the redeemed funds * are supposed to be locked on. Must be un-prefixed and not prepended * with length. + * @param bitcoinNetwork Bitcoin network. * @param bridge The handle to the Bridge on-chain contract. * @param bitcoinClient Bitcoin client used to interact with the network. - * @param bitcoinNetwork Bitcoin network. * @returns Promise with the wallet details needed to request a redemption. */ export async function findWalletForRedemption( amount: BigNumber, redeemerOutputScript: string, + bitcoinNetwork: BitcoinNetwork, bridge: Bridge, bitcoinClient: BitcoinClient, - bitcoinNetwork: BitcoinNetwork ): Promise<{ walletPublicKey: string mainUtxo: UnspentTransactionOutput diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 4f75ef490..986582958 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1460,9 +1460,9 @@ describe("Redemption", () => { findWalletForRedemption( amount, redeemerOutputScript, + BitcoinNetwork.Testnet, bridge, - bitcoinClient, - BitcoinNetwork.Testnet + bitcoinClient ) ).to.be.rejectedWith( "Could not find a wallet with enough funds. Maximum redemption amount is 0 Satoshi." @@ -1520,9 +1520,9 @@ describe("Redemption", () => { result = await findWalletForRedemption( amount, redeemerOutputScript, + BitcoinNetwork.Testnet, bridge, bitcoinClient, - BitcoinNetwork.Testnet ) }) @@ -1580,9 +1580,9 @@ describe("Redemption", () => { findWalletForRedemption( amount, redeemerOutputScript, + BitcoinNetwork.Testnet, bridge, bitcoinClient, - BitcoinNetwork.Testnet ) ).to.be.rejectedWith( `Could not find a wallet with enough funds. Maximum redemption amount is ${expectedMaxAmount.toString()} Satoshi.` @@ -1622,9 +1622,9 @@ describe("Redemption", () => { result = await findWalletForRedemption( amount, redeemerOutputScript, + BitcoinNetwork.Testnet, bridge, bitcoinClient, - BitcoinNetwork.Testnet ) }) From d6e86272aac0603278ee6d218e486b697392f88f Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:23:08 +0200 Subject: [PATCH 181/198] Update `activeWalletPublicKey` fn in Eth Bridge We already resolve the compressed public key in wallets function call under `parseWalletDetails`- so there is no need to call `getWalletCompressedPublicKey` again. --- typescript/src/ethereum.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/src/ethereum.ts b/typescript/src/ethereum.ts index 1d4e1a562..ac97da27c 100644 --- a/typescript/src/ethereum.ts +++ b/typescript/src/ethereum.ts @@ -642,11 +642,11 @@ export class Bridge return undefined } - const { ecdsaWalletID } = await this.wallets( + const { walletPublicKey } = await this.wallets( Hex.from(activeWalletPublicKeyHash) ) - return (await this.getWalletCompressedPublicKey(ecdsaWalletID)).toString() + return walletPublicKey.toString() } private async getWalletCompressedPublicKey(ecdsaWalletID: Hex): Promise { From 921349ff07db0effe9bc658afab6961ff262f35f Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:41:47 +0200 Subject: [PATCH 182/198] Fix formatting errors --- typescript/src/redemption.ts | 2 +- typescript/test/data/redemption.ts | 2 +- typescript/test/redemption.test.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 6f728f708..c431604cf 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -427,7 +427,7 @@ export async function findWalletForRedemption( redeemerOutputScript: string, bitcoinNetwork: BitcoinNetwork, bridge: Bridge, - bitcoinClient: BitcoinClient, + bitcoinClient: BitcoinClient ): Promise<{ walletPublicKey: string mainUtxo: UnspentTransactionOutput diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 0960693d4..7724008fb 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -11,7 +11,7 @@ import { import { RedemptionRequest } from "../../src/redemption" import { Address } from "../../src/ethereum" import { Hex } from "../../src" -import { NewWalletRegisteredEvent, WalletState } from "../../src/wallet" +import { WalletState } from "../../src/wallet" /** * Private key (testnet) of the wallet. diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 986582958..e2c8cc4b9 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1522,7 +1522,7 @@ describe("Redemption", () => { redeemerOutputScript, BitcoinNetwork.Testnet, bridge, - bitcoinClient, + bitcoinClient ) }) @@ -1582,7 +1582,7 @@ describe("Redemption", () => { redeemerOutputScript, BitcoinNetwork.Testnet, bridge, - bitcoinClient, + bitcoinClient ) ).to.be.rejectedWith( `Could not find a wallet with enough funds. Maximum redemption amount is ${expectedMaxAmount.toString()} Satoshi.` @@ -1624,7 +1624,7 @@ describe("Redemption", () => { redeemerOutputScript, BitcoinNetwork.Testnet, bridge, - bitcoinClient, + bitcoinClient ) }) From b86e251934c71f25dd5b6fca3b9575bbf44beac1 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Fri, 7 Jul 2023 22:43:38 +0200 Subject: [PATCH 183/198] Add commit hash to the `.git-blame-ignore-revs` --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f85e8bf80..bad52e692 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -11,6 +11,7 @@ e032bba7ce52a877a77573fb5a14944623c77d02 7ad277ff8369b201515ba22872c1251ec93a6b81 5c7e2e3620ec06fb9a7c358c541d491da977ec08 3d8c4861ac467f0390733916775a9ccfafe752e3 +921349ff07db0effe9bc658afab6961ff262f35f # s/btc/BTC da039720b6eb36e5f7102e83a3e2bb95a09b5772 \ No newline at end of file From 9a0f289ac279b3372addcf75d9edb51db6bb5b61 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Mon, 10 Jul 2023 11:39:28 +0200 Subject: [PATCH 184/198] Update `findWalletForRedemption` function Take into account pending redemptions value- say Say the wallet has `100 BTC`, redemptions are processed every 3 hours, and so far, requests for `93 BTC` has been registered in the Bridge. Based on the previous version of the code, that wallet would still be selected for all redemptions `<= 100 BTC` and the transaction to Ethereum requesting redemption higher than `7 BTC` would fail. This commit fixes that issue. --- typescript/src/redemption.ts | 11 +++---- typescript/test/data/redemption.ts | 9 ++++-- typescript/test/redemption.test.ts | 46 ++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index c431604cf..013dbeed8 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -444,9 +444,8 @@ export async function findWalletForRedemption( for (const wallet of wallets) { const { walletPublicKeyHash } = wallet - const { state, mainUtxoHash, walletPublicKey } = await bridge.wallets( - walletPublicKeyHash - ) + const { state, mainUtxoHash, walletPublicKey, pendingRedemptionsValue } = + await bridge.wallets(walletPublicKeyHash) // Wallet must be in Live state. if (state !== WalletState.Live) { @@ -514,10 +513,12 @@ export async function findWalletForRedemption( continue } + const walletBTCBalance = mainUtxo.value.sub(pendingRedemptionsValue) + // Save the max possible redemption amount. - maxAmount = mainUtxo.value.gt(maxAmount) ? mainUtxo.value : maxAmount + maxAmount = walletBTCBalance.gt(maxAmount) ? walletBTCBalance : maxAmount - if (mainUtxo.value.gte(amount)) { + if (walletBTCBalance.gte(amount)) { walletData = { walletPublicKey: walletPublicKey.toString(), mainUtxo, diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 7724008fb..285169c11 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -675,6 +675,7 @@ interface FindWalletForRedemptionWaleltData { walletPublicKey: Hex btcAddress: string utxos: UnspentTransactionOutput[] + pendingRedemptionsValue: BigNumber } event: { blockNumber: number @@ -711,6 +712,7 @@ export const findWalletForRedemptionData: { value: BigNumber.from("791613461"), }, ], + pendingRedemptionsValue: BigNumber.from(0), }, event: { blockNumber: 8367602, @@ -728,7 +730,6 @@ export const findWalletForRedemptionData: { ), }, }, - walletWithoutUtxo: { data: { state: WalletState.Live, @@ -748,6 +749,7 @@ export const findWalletForRedemptionData: { value: BigNumber.from("0"), }, ], + pendingRedemptionsValue: BigNumber.from(0), }, event: { blockNumber: 9103428, @@ -785,6 +787,7 @@ export const findWalletForRedemptionData: { value: BigNumber.from("0"), }, ], + pendingRedemptionsValue: BigNumber.from(0), }, event: { blockNumber: 9171960, @@ -802,7 +805,6 @@ export const findWalletForRedemptionData: { ), }, }, - walletWithPendingRedemption: { data: { state: WalletState.Live, @@ -819,9 +821,10 @@ export const findWalletForRedemptionData: { "0x81c4884a8c2fccbeb57745a5e59f895a9c1bb8fc42eecc82269100a1a46bbb85" ), outputIndex: 0, - value: BigNumber.from("3370000"), + value: BigNumber.from("3370000"), // 0.0337 BTC }, ], + pendingRedemptionsValue: BigNumber.from(2370000), // 0.0237 BTC }, event: { blockNumber: 8981644, diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index e2c8cc4b9..26c58ddc7 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1494,8 +1494,14 @@ describe("Redemption", () => { >() walletsOrder.forEach((wallet) => { - const { state, mainUtxoHash, walletPublicKey, btcAddress, utxos } = - wallet.data + const { + state, + mainUtxoHash, + walletPublicKey, + btcAddress, + utxos, + pendingRedemptionsValue, + } = wallet.data walletsUnspentTransacionOutputs.set(btcAddress, utxos) bridge.setWallet( @@ -1504,6 +1510,7 @@ describe("Redemption", () => { state, mainUtxoHash, walletPublicKey, + pendingRedemptionsValue, } as Wallet ) }) @@ -1660,6 +1667,41 @@ describe("Redemption", () => { }) } ) + + context( + "when wallet has pending redemptions and the requested amount is greater than possible", + () => { + beforeEach(async () => { + const wallet = + findWalletForRedemptionData.walletWithPendingRedemption + const walletBTCBalance = wallet.data.utxos[0].value + + const amount: BigNumber = walletBTCBalance + .sub(wallet.data.pendingRedemptionsValue) + .add(BigNumber.from(500000)) // 0.005 BTC + + console.log("amount", amount.toString()) + + result = await findWalletForRedemption( + amount, + redeemerOutputScript, + BitcoinNetwork.Testnet, + bridge, + bitcoinClient + ) + }) + + it("should skip the wallet wallet with pending redemptions and return the wallet data that can handle redemption request ", () => { + const expectedWalletData = + findWalletForRedemptionData.liveWallet.data + + expect(result).to.deep.eq({ + walletPublicKey: expectedWalletData.walletPublicKey.toString(), + mainUtxo: expectedWalletData.utxos[0], + }) + }) + } + ) }) }) }) From e68a7efadd8bced671901e82a8a2bf327f4b3f3c Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Mon, 10 Jul 2023 13:01:32 +0200 Subject: [PATCH 185/198] Leave TODO in `findWalletForRedemption` function In case a wallet is working on something (e.g. redemption) and a Bitcoin transaction was already submitted by the wallet to the bitcoin chain (new utxo returned from bitcoin client), but proof hasn't been submitted yet to the Bridge (old main utxo returned from the Bridge) the `findWalletForRedemption` function will not find such a wallet. To cover this case, we should take, for example, the last 5 transactions made by the wallet into account. We will address this issue in a follow-up work. --- typescript/src/redemption.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 91d169d37..05a2a6dda 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -495,6 +495,13 @@ export async function findWalletForRedemption( bitcoinNetwork ) + // TODO: In case a wallet is working on something (e.g. redemption) and a + // Bitcoin transaction was already submitted by the wallet to the bitcoin + // chain (new utxo returned from bitcoin client), but proof hasn't been + // submitted yet to the Bridge (old main utxo returned from the Bridge) the + // `findWalletForRedemption` function will not find such a wallet. To cover + // this case, we should take, for example, the last 5 transactions made by + // the wallet into account. We will address this issue in a follow-up work. const utxos = await bitcoinClient.findAllUnspentTransactionOutputs( walletBitcoinAddress ) From 97d56b3fdc0fefb294d141d674a0a13aadce247c Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 11 Jul 2023 13:43:20 +0200 Subject: [PATCH 186/198] Expose `getTransactionHistory` function Here we expose a function allowing to get the transaction history for given Bitcoin address. --- typescript/src/bitcoin.ts | 12 +++++ typescript/src/electrum.ts | 52 ++++++++++++++++++++ typescript/test/electrum.test.ts | 22 +++++++++ typescript/test/utils/mock-bitcoin-client.ts | 24 +++++++++ 4 files changed, 110 insertions(+) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index bb330be3f..735c3dc94 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -333,6 +333,18 @@ export interface Client { address: string ): Promise + /** + * Gets the history of confirmed transactions for given Bitcoin address. + * Returned transactions are sorted from oldest to newest. The returned + * result does not contain unconfirmed transactions living in the mempool + * at the moment of request. + * @param address - Bitcoin address transaction history should be determined for. + * @param limit - Optional parameter that can limit the resulting list to + * a specific number of last transaction. For example, limit = 5 will + * return only the last 5 transactions for the given address. + */ + getTransactionHistory(address: string, limit?: number): Promise + /** * Gets the full transaction object for given transaction hash. * @param transactionHash - Hash of the transaction. diff --git a/typescript/src/electrum.ts b/typescript/src/electrum.ts index a43993209..d467f42f7 100644 --- a/typescript/src/electrum.ts +++ b/typescript/src/electrum.ts @@ -253,6 +253,58 @@ export class Client implements BitcoinClient { ) } + // eslint-disable-next-line valid-jsdoc + /** + * @see {BitcoinClient#getTransactionHistory} + */ + getTransactionHistory( + address: string, + limit?: number + ): Promise { + return this.withElectrum(async (electrum: Electrum) => { + const script = bcoin.Script.fromAddress(address).toRaw().toString("hex") + + // eslint-disable-next-line camelcase + type HistoryItem = { height: number; tx_hash: string } + + let historyItems: HistoryItem[] = await this.withBackoffRetrier< + HistoryItem[] + >()(async () => { + return await electrum.blockchain_scripthash_getHistory( + computeScriptHash(script) + ) + }) + + // According to https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain-scripthash-get-history + // unconfirmed items living in the mempool are appended at the end of the + // returned list and their height value is either -1 or 0. That means + // we need to take all items with height >0 to obtain a confirmed txs + // history. + historyItems = historyItems.filter((item) => item.height > 0) + + // The list returned from blockchain.scripthash.get_history is sorted by + // the block height in the ascending order though we are sorting it + // again just in case (e.g. API contract changes). + historyItems = historyItems.sort( + (item1, item2) => item1.height - item2.height + ) + + if ( + typeof limit !== "undefined" && + limit > 0 && + historyItems.length > limit + ) { + historyItems = historyItems.slice(-limit) + } + + const transactions = historyItems.map((item) => + this.getTransaction(TransactionHash.from(item.tx_hash)) + ) + + return Promise.all(transactions) + }) + } + // eslint-disable-next-line valid-jsdoc /** * @see {BitcoinClient#getTransaction} diff --git a/typescript/test/electrum.test.ts b/typescript/test/electrum.test.ts index c500a7efa..09fca2c2d 100644 --- a/typescript/test/electrum.test.ts +++ b/typescript/test/electrum.test.ts @@ -108,6 +108,28 @@ describe("Electrum", () => { }) }) + describe("getTransactionHistory", () => { + it("should return proper transaction history for the given address", async () => { + // https://live.blockcypher.com/btc-testnet/address/tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx + const transactions = await electrumClient.getTransactionHistory( + "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", + 5 + ) + + const transactionsHashes = transactions.map((t) => + t.transactionHash.toString() + ) + + expect(transactionsHashes).to.be.eql([ + "3ca4ae3f8ee3b48949192bc7a146c8d9862267816258c85e02a44678364551e1", + "f65bc5029251f0042aedb37f90dbb2bfb63a2e81694beef9cae5ec62e954c22e", + "44863a79ce2b8fec9792403d5048506e50ffa7338191db0e6c30d3d3358ea2f6", + "4c6b33b7c0550e0e536a5d119ac7189d71e1296fcb0c258e0c115356895bc0e6", + "605edd75ae0b4fa7cfc7aae8f1399119e9d7ecc212e6253156b60d60f4925d44", + ]) + }) + }) + describe("getTransaction", () => { it("should return proper transaction for the given hash", async () => { const result = await electrumClient.getTransaction( diff --git a/typescript/test/utils/mock-bitcoin-client.ts b/typescript/test/utils/mock-bitcoin-client.ts index 95e4305b1..b37dd7820 100644 --- a/typescript/test/utils/mock-bitcoin-client.ts +++ b/typescript/test/utils/mock-bitcoin-client.ts @@ -27,6 +27,7 @@ export class MockBitcoinClient implements Client { position: 0, } private _broadcastLog: RawTransaction[] = [] + private _transactionHistory = new Map() set unspentTransactionOutputs( value: Map @@ -58,6 +59,10 @@ export class MockBitcoinClient implements Client { this._transactionMerkle = value } + set transactionHistory(value: Map) { + this._transactionHistory = value + } + get broadcastLog(): RawTransaction[] { return this._broadcastLog } @@ -80,6 +85,25 @@ export class MockBitcoinClient implements Client { }) } + getTransactionHistory( + address: string, + limit?: number + ): Promise { + return new Promise((resolve, _) => { + let transactions = this._transactionHistory.get(address) as Transaction[] + + if ( + typeof limit !== "undefined" && + limit > 0 && + transactions.length > limit + ) { + transactions = transactions.slice(-limit) + } + + resolve(transactions) + }) + } + getTransaction(transactionHash: TransactionHash): Promise { return new Promise((resolve, _) => { resolve(this._transactions.get(transactionHash.toString()) as Transaction) From 499467257a3214aacf69e586a3cb412e7bd44fd3 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 11 Jul 2023 17:43:16 +0200 Subject: [PATCH 187/198] Expose `determineWalletMainUtxo` function Here we expose a function allowing to determine the wallet main UTXO based on the wallet recent transactions history and the main UTXO hash stored on the Bridge contract. --- typescript/src/wallet.ts | 124 ++++++++++++++++- typescript/test/wallet.test.ts | 246 +++++++++++++++++++++++++++++++++ 2 files changed, 369 insertions(+), 1 deletion(-) create mode 100644 typescript/test/wallet.test.ts diff --git a/typescript/src/wallet.ts b/typescript/src/wallet.ts index 2a0e0298b..2d1bccbf3 100644 --- a/typescript/src/wallet.ts +++ b/typescript/src/wallet.ts @@ -1,6 +1,14 @@ import { BigNumber } from "ethers" import { Hex } from "./hex" -import { Event, Identifier } from "./chain" +import { Bridge, Event, Identifier } from "./chain" +import { + Client as BitcoinClient, + createOutputScriptFromAddress, + encodeToBitcoinAddress, + TransactionOutput, + UnspentTransactionOutput, +} from "./bitcoin" +import { BitcoinNetwork } from "./bitcoin-network" /* eslint-disable no-unused-vars */ export enum WalletState { @@ -209,3 +217,117 @@ type DkgResult = { */ membersHash: Hex } + +/** + * Determines the plain-text wallet main UTXO currently registered in the + * Bridge on-chain contract. The returned main UTXO can be undefined if the + * wallet does not have a main UTXO registered in the Bridge at the moment. + * + * WARNING: THIS FUNCTION CANNOT DETERMINE THE MAIN UTXO IF IT COMES FROM A + * BITCOIN TRANSACTION THAT IS NOT ONE OF THE LATEST FIVE TRANSACTIONS + * TARGETING THE GIVEN WALLET PUBLIC KEY HASH. HOWEVER, SUCH A CASE IS + * VERY UNLIKELY. + * + * @param walletPublicKeyHash - Public key hash of the wallet. + * @param bridge - The handle to the Bridge on-chain contract. + * @param bitcoinClient - Bitcoin client used to interact with the network. + * @param bitcoinNetwork - Bitcoin network. + * @returns Promise holding the wallet main UTXO or undefined value. + */ +export async function determineWalletMainUtxo( + walletPublicKeyHash: Hex, + bridge: Bridge, + bitcoinClient: BitcoinClient, + bitcoinNetwork: BitcoinNetwork +): Promise { + const { mainUtxoHash } = await bridge.wallets(walletPublicKeyHash) + + // Valid case when the wallet doesn't have a main UTXO registered into + // the Bridge. + if ( + mainUtxoHash.equals( + Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ) + ) + ) { + return undefined + } + + // Declare a helper function that will try to determine the main UTXO for + // the given wallet address type. + const determine = async ( + witnessAddress: boolean + ): Promise => { + // Build the wallet Bitcoin address based on its public key hash. + const walletAddress = encodeToBitcoinAddress( + walletPublicKeyHash.toString(), + witnessAddress, + bitcoinNetwork + ) + + // Get the wallet transaction history. The wallet main UTXO registered in the + // Bridge almost always comes from the latest BTC transaction made by the wallet. + // However, there may be cases where the BTC transaction was made but their + // SPV proof is not yet submitted to the Bridge thus the registered main UTXO + // points to the second last BTC transaction. In theory, such a gap between + // the actual latest BTC transaction and the registered main UTXO in the + // Bridge may be even wider. The exact behavior is a wallet implementation + // detail and not a protocol invariant so, it may be subject of changes. + // To cover the worst possible cases, we always take the five latest + // transactions made by the wallet for consideration. + const walletTransactions = await bitcoinClient.getTransactionHistory( + walletAddress, + 5 + ) + + // Get the wallet script based on the wallet address. This is required + // to find transaction outputs that lock funds on the wallet. + const walletScript = createOutputScriptFromAddress(walletAddress) + const isWalletOutput = (output: TransactionOutput) => + walletScript.equals(output.scriptPubKey) + + // Start iterating from the latest transaction as the chance it matches + // the wallet main UTXO is the highest. + for (let i = walletTransactions.length - 1; i >= 0; i--) { + const walletTransaction = walletTransactions[i] + + // Find the output that locks the funds on the wallet. Only such an output + // can be a wallet main UTXO. + const outputIndex = walletTransaction.outputs.findIndex(isWalletOutput) + + // Should never happen as all transactions come from wallet history. Just + // in case check whether the wallet output was actually found. + if (outputIndex < 0) { + continue + } + + // Build a candidate UTXO instance based on the detected output. + const utxo: UnspentTransactionOutput = { + transactionHash: walletTransaction.transactionHash, + outputIndex: outputIndex, + value: walletTransaction.outputs[outputIndex].value, + } + + // Check whether the candidate UTXO hash matches the main UTXO hash stored + // on the Bridge. + if (mainUtxoHash.equals(bridge.buildUtxoHash(utxo))) { + return utxo + } + } + + return undefined + } + + // The most common case is that the wallet uses a witness address for all + // operations. Try to determine the main UTXO for that address first as the + // chance for success is the highest here. + const mainUtxo = await determine(true) + if (mainUtxo) { + return mainUtxo + } + + // In case the main UTXO was not found for witness address, there is still + // a chance it exists for the legacy wallet address. + return determine(false) +} diff --git a/typescript/test/wallet.test.ts b/typescript/test/wallet.test.ts new file mode 100644 index 000000000..8042be548 --- /dev/null +++ b/typescript/test/wallet.test.ts @@ -0,0 +1,246 @@ +import { MockBitcoinClient } from "./utils/mock-bitcoin-client" +import { MockBridge } from "./utils/mock-bridge" +import { BitcoinNetwork, BitcoinTransaction, Hex } from "../src" +import { determineWalletMainUtxo, Wallet } from "../src/wallet" +import { expect } from "chai" +import { encodeToBitcoinAddress } from "../src/bitcoin" +import { BigNumber } from "ethers" + +describe("Wallet", () => { + describe("determineWalletMainUtxo", () => { + // Just an arbitrary 20-byte wallet public key hash. + const walletPublicKeyHash = Hex.from( + "e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0" + ) + + // Helper function facilitating creation of mock transactions. + const mockTransaction = ( + hash: string, + outputs: Record // key: locking script, value: amount of locked satoshis + ): BitcoinTransaction => { + return { + transactionHash: Hex.from(hash), + inputs: [], // not relevant in this test scenario + outputs: Object.entries(outputs).map( + ([scriptPubKey, value], index) => ({ + outputIndex: index, + value: BigNumber.from(value), + scriptPubKey: Hex.from(scriptPubKey), + }) + ), + } + } + + // Create a fake wallet witness transaction history that consists of 6 transactions. + const walletWitnessTransactionHistory: BitcoinTransaction[] = [ + mockTransaction( + "3ca4ae3f8ee3b48949192bc7a146c8d9862267816258c85e02a44678364551e1", + { + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 100000, // wallet witness output + "00140000000000000000000000000000000000000001": 200000, + } + ), + mockTransaction( + "4c6b33b7c0550e0e536a5d119ac7189d71e1296fcb0c258e0c115356895bc0e6", + { + "00140000000000000000000000000000000000000001": 100000, + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 200000, // wallet witness output + } + ), + mockTransaction( + "44863a79ce2b8fec9792403d5048506e50ffa7338191db0e6c30d3d3358ea2f6", + { + "00140000000000000000000000000000000000000001": 100000, + "00140000000000000000000000000000000000000002": 200000, + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 300000, // wallet witness output + } + ), + mockTransaction( + "f65bc5029251f0042aedb37f90dbb2bfb63a2e81694beef9cae5ec62e954c22e", + { + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 100000, // wallet witness output + "00140000000000000000000000000000000000000001": 200000, + } + ), + mockTransaction( + "2724545276df61f43f1e92c4b9f1dd3c9109595c022dbd9dc003efbad8ded38b", + { + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 100000, // wallet witness output + "00140000000000000000000000000000000000000001": 200000, + } + ), + mockTransaction( + "ea374ab6842723c647c3fc0ab281ca0641eaa768576cf9df695ca5b827140214", + { + "00140000000000000000000000000000000000000001": 100000, + "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0": 200000, // wallet witness output + } + ), + ] + + // Create a fake wallet legacy transaction history that consists of 2 transactions. + const walletLegacyTransactionsHistory: BitcoinTransaction[] = [ + mockTransaction( + "05dabb0291c0a6aa522de5ded5cb6d14ee2159e7ff109d3ef0f21de128b56b94", + { + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 100000, // wallet legacy output + "00140000000000000000000000000000000000000001": 200000, + } + ), + mockTransaction( + "00cc0cd13fc4de7a15cb41ab6d58f8b31c75b6b9b4194958c381441a67d09b08", + { + "00140000000000000000000000000000000000000001": 100000, + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 200000, // wallet legacy output + } + ), + ] + + let bridge: MockBridge + let bitcoinClient: MockBitcoinClient + let bitcoinNetwork: BitcoinNetwork + + beforeEach(async () => { + bridge = new MockBridge() + bitcoinClient = new MockBitcoinClient() + }) + + context("when wallet main UTXO is not set in the Bridge", () => { + beforeEach(async () => { + bridge.setWallet(walletPublicKeyHash.toPrefixedString(), { + mainUtxoHash: Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ), + } as Wallet) + }) + + it("should return undefined", async () => { + const mainUtxo = await determineWalletMainUtxo( + walletPublicKeyHash, + bridge, + bitcoinClient, + bitcoinNetwork + ) + + expect(mainUtxo).to.be.undefined + }) + }) + + context("when wallet main UTXO is set in the Bridge", () => { + const tests = [ + { + testName: "recent witness transaction", + // Set the main UTXO hash based on the latest transaction from walletWitnessTransactionHistory. + actualMainUtxo: { + transactionHash: Hex.from( + "ea374ab6842723c647c3fc0ab281ca0641eaa768576cf9df695ca5b827140214" + ), + outputIndex: 1, + value: BigNumber.from(200000), + }, + expectedMainUtxo: { + transactionHash: Hex.from( + "ea374ab6842723c647c3fc0ab281ca0641eaa768576cf9df695ca5b827140214" + ), + outputIndex: 1, + value: BigNumber.from(200000), + }, + }, + { + testName: "recent legacy transaction", + // Set the main UTXO hash based on the second last transaction from walletLegacyTransactionHistory. + actualMainUtxo: { + transactionHash: Hex.from( + "05dabb0291c0a6aa522de5ded5cb6d14ee2159e7ff109d3ef0f21de128b56b94" + ), + outputIndex: 0, + value: BigNumber.from(100000), + }, + expectedMainUtxo: { + transactionHash: Hex.from( + "05dabb0291c0a6aa522de5ded5cb6d14ee2159e7ff109d3ef0f21de128b56b94" + ), + outputIndex: 0, + value: BigNumber.from(100000), + }, + }, + { + testName: "old witness transaction", + // Set the main UTXO hash based on the oldest transaction from walletWitnessTransactionHistory. + actualMainUtxo: { + transactionHash: Hex.from( + "3ca4ae3f8ee3b48949192bc7a146c8d9862267816258c85e02a44678364551e1" + ), + outputIndex: 0, + value: BigNumber.from(100000), + }, + expectedMainUtxo: undefined, + }, + ] + + tests.forEach(({ testName, actualMainUtxo, expectedMainUtxo }) => { + context(`with main UTXO coming from ${testName}`, () => { + const networkTests = [ + { + networkTestName: "bitcoin testnet", + network: BitcoinNetwork.Testnet, + }, + { + networkTestName: "bitcoin mainnet", + network: BitcoinNetwork.Mainnet, + }, + ] + + networkTests.forEach(({ networkTestName, network }) => { + context(`with ${networkTestName} network`, () => { + beforeEach(async () => { + bitcoinNetwork = network + + const walletWitnessAddress = encodeToBitcoinAddress( + walletPublicKeyHash.toString(), + true, + bitcoinNetwork + ) + const walletLegacyAddress = encodeToBitcoinAddress( + walletPublicKeyHash.toString(), + false, + bitcoinNetwork + ) + + // Record the fake transaction history for both address types. + const transactionHistory = new Map< + string, + BitcoinTransaction[] + >() + transactionHistory.set( + walletWitnessAddress, + walletWitnessTransactionHistory + ) + transactionHistory.set( + walletLegacyAddress, + walletLegacyTransactionsHistory + ) + bitcoinClient.transactionHistory = transactionHistory + + bridge.setWallet(walletPublicKeyHash.toPrefixedString(), { + mainUtxoHash: bridge.buildUtxoHash(actualMainUtxo), + } as Wallet) + }) + + it("should return the expected main UTXO", async () => { + const mainUtxo = await determineWalletMainUtxo( + walletPublicKeyHash, + bridge, + bitcoinClient, + bitcoinNetwork + ) + + expect(mainUtxo).to.be.eql(expectedMainUtxo) + }) + }) + }) + }) + }) + }) + }) +}) From 10ab6dabb5a1e400607ed2b27411a24080569071 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 11 Jul 2023 18:11:53 +0200 Subject: [PATCH 188/198] Make `findWalletForRedemption` use `determineWalletMainUtxo` function The `findWalletForRedemption` function should rely on `determineWalletMainUtxo` wallet while seeking for current wallet main UTXO. Otherwise, it may not find the main UTXO in case there is a wallet state drift between Bitcoin and Ethereum chains. --- typescript/src/redemption.ts | 57 +++++------------- typescript/test/data/redemption.ts | 92 ++++++++++++++++++++---------- typescript/test/redemption.test.ts | 50 ++++------------ 3 files changed, 85 insertions(+), 114 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index 05a2a6dda..f8a0665cf 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -7,11 +7,10 @@ import { UnspentTransactionOutput, Client as BitcoinClient, TransactionHash, - encodeToBitcoinAddress, } from "./bitcoin" import { Bridge, Identifier, TBTCToken } from "./chain" import { assembleTransactionProof } from "./proof" -import { WalletState } from "./wallet" +import { determineWalletMainUtxo, WalletState } from "./wallet" import { BitcoinNetwork } from "./bitcoin-network" import { Hex } from "./hex" @@ -445,7 +444,7 @@ export async function findWalletForRedemption( for (const wallet of wallets) { const { walletPublicKeyHash } = wallet - const { state, mainUtxoHash, walletPublicKey, pendingRedemptionsValue } = + const { state, walletPublicKey, pendingRedemptionsValue } = await bridge.wallets(walletPublicKeyHash) // Wallet must be in Live state. @@ -458,18 +457,20 @@ export async function findWalletForRedemption( continue } - if ( - mainUtxoHash.equals( - Hex.from( - "0x0000000000000000000000000000000000000000000000000000000000000000" - ) - ) - ) { + // Wallet must have a main UTXO that can be determined. + const mainUtxo = await determineWalletMainUtxo( + walletPublicKeyHash, + bridge, + bitcoinClient, + bitcoinNetwork + ) + if (!mainUtxo) { console.debug( - `Main utxo not set for wallet public ` + - `key hash(${walletPublicKeyHash.toString()}). ` + + `Could not find matching UTXO on chains ` + + `for wallet public key hash (${walletPublicKeyHash.toString()}). ` + `Continue the loop execution to the next wallet...` ) + continue } const pendingRedemption = await bridge.pendingRedemptions( @@ -489,38 +490,6 @@ export async function findWalletForRedemption( continue } - const walletBitcoinAddress = encodeToBitcoinAddress( - wallet.walletPublicKeyHash.toString(), - true, - bitcoinNetwork - ) - - // TODO: In case a wallet is working on something (e.g. redemption) and a - // Bitcoin transaction was already submitted by the wallet to the bitcoin - // chain (new utxo returned from bitcoin client), but proof hasn't been - // submitted yet to the Bridge (old main utxo returned from the Bridge) the - // `findWalletForRedemption` function will not find such a wallet. To cover - // this case, we should take, for example, the last 5 transactions made by - // the wallet into account. We will address this issue in a follow-up work. - const utxos = await bitcoinClient.findAllUnspentTransactionOutputs( - walletBitcoinAddress - ) - - // We need to find correct utxo- utxo components must point to the recent - // main UTXO of the given wallet, as currently known on the chain. - const mainUtxo = utxos.find((utxo) => - mainUtxoHash.equals(bridge.buildUtxoHash(utxo)) - ) - - if (!mainUtxo) { - console.debug( - `Could not find matching UTXO on chains ` + - `for wallet public key hash(${walletPublicKeyHash.toString()}). ` + - `Continue the loop execution to the next wallet...` - ) - continue - } - const walletBTCBalance = mainUtxo.value.sub(pendingRedemptionsValue) // Save the max possible redemption amount. diff --git a/typescript/test/data/redemption.ts b/typescript/test/data/redemption.ts index 285169c11..958b9dcc2 100644 --- a/typescript/test/data/redemption.ts +++ b/typescript/test/data/redemption.ts @@ -7,10 +7,11 @@ import { UnspentTransactionOutput, TransactionMerkleBranch, TransactionHash, + createOutputScriptFromAddress, } from "../../src/bitcoin" import { RedemptionRequest } from "../../src/redemption" import { Address } from "../../src/ethereum" -import { Hex } from "../../src" +import { BitcoinTransaction, Hex } from "../../src" import { WalletState } from "../../src/wallet" /** @@ -668,13 +669,14 @@ export const redemptionProof: RedemptionProofTestData = { }, } -interface FindWalletForRedemptionWaleltData { +interface FindWalletForRedemptionWalletData { data: { state: WalletState mainUtxoHash: Hex walletPublicKey: Hex btcAddress: string - utxos: UnspentTransactionOutput[] + mainUtxo: UnspentTransactionOutput + transactions: BitcoinTransaction[] pendingRedemptionsValue: BigNumber } event: { @@ -687,10 +689,10 @@ interface FindWalletForRedemptionWaleltData { } export const findWalletForRedemptionData: { - liveWallet: FindWalletForRedemptionWaleltData - walletWithoutUtxo: FindWalletForRedemptionWaleltData - nonLiveWallet: FindWalletForRedemptionWaleltData - walletWithPendingRedemption: FindWalletForRedemptionWaleltData + liveWallet: FindWalletForRedemptionWalletData + walletWithoutUtxo: FindWalletForRedemptionWalletData + nonLiveWallet: FindWalletForRedemptionWalletData + walletWithPendingRedemption: FindWalletForRedemptionWalletData pendingRedemption: RedemptionRequest } = { liveWallet: { @@ -703,13 +705,28 @@ export const findWalletForRedemptionData: { "0x028ed84936be6a9f594a2dcc636d4bebf132713da3ce4dac5c61afbf8bbb47d6f7" ), btcAddress: "tb1qqwm566yn44rdlhgph8sw8vecta8uutg79afuja", - utxos: [ + mainUtxo: { + transactionHash: Hex.from( + "0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb" + ), + outputIndex: 0, + value: BigNumber.from("791613461"), + }, + transactions: [ { transactionHash: Hex.from( "0x5b6d040eb06b3de1a819890d55d251112e55c31db4a3f5eb7cfacf519fad7adb" ), - outputIndex: 0, - value: BigNumber.from("791613461"), + inputs: [], // not relevant + outputs: [ + { + outputIndex: 0, + value: BigNumber.from("791613461"), + scriptPubKey: createOutputScriptFromAddress( + "tb1qqwm566yn44rdlhgph8sw8vecta8uutg79afuja" + ), + }, + ], }, ], pendingRedemptionsValue: BigNumber.from(0), @@ -740,15 +757,14 @@ export const findWalletForRedemptionData: { "0x030fbbae74e6d85342819e719575949a1349e975b69fb382e9fef671a3a74efc52" ), btcAddress: "tb1qkct7r24k4wutnsun84rvp3qsyt8yfpvqz89d2y", - utxos: [ - { - transactionHash: Hex.from( - "0x0000000000000000000000000000000000000000000000000000000000000000" - ), - outputIndex: 0, - value: BigNumber.from("0"), - }, - ], + mainUtxo: { + transactionHash: Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ), + outputIndex: 0, + value: BigNumber.from("0"), + }, + transactions: [], pendingRedemptionsValue: BigNumber.from(0), }, event: { @@ -778,15 +794,14 @@ export const findWalletForRedemptionData: { "0x02633b102417009ae55103798f4d366dfccb081dcf20025088b9bf10a8e15d8ded" ), btcAddress: "tb1qf6jvyd680ncf9dtr5znha9ql5jmw84lupwwuf6", - utxos: [ - { - transactionHash: Hex.from( - "0x0000000000000000000000000000000000000000000000000000000000000000" - ), - outputIndex: 0, - value: BigNumber.from("0"), - }, - ], + mainUtxo: { + transactionHash: Hex.from( + "0x0000000000000000000000000000000000000000000000000000000000000000" + ), + outputIndex: 0, + value: BigNumber.from("0"), + }, + transactions: [], pendingRedemptionsValue: BigNumber.from(0), }, event: { @@ -815,13 +830,28 @@ export const findWalletForRedemptionData: { "0x02ab193a63b3523bfab77d3645d11da10722393687458c4213b350b7e08f50b7ee" ), btcAddress: "tb1qx2xejtjltdcau5dpks8ucszkhxdg3fj88404lh", - utxos: [ + mainUtxo: { + transactionHash: Hex.from( + "0x81c4884a8c2fccbeb57745a5e59f895a9c1bb8fc42eecc82269100a1a46bbb85" + ), + outputIndex: 0, + value: BigNumber.from("3370000"), // 0.0337 BTC + }, + transactions: [ { transactionHash: Hex.from( "0x81c4884a8c2fccbeb57745a5e59f895a9c1bb8fc42eecc82269100a1a46bbb85" ), - outputIndex: 0, - value: BigNumber.from("3370000"), // 0.0337 BTC + inputs: [], // not relevant + outputs: [ + { + outputIndex: 0, + value: BigNumber.from("3370000"), // 0.0337 BTC + scriptPubKey: createOutputScriptFromAddress( + "tb1qx2xejtjltdcau5dpks8ucszkhxdg3fj88404lh" + ), + }, + ], }, ], pendingRedemptionsValue: BigNumber.from(2370000), // 0.0237 BTC diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 15b321075..e2efa36d1 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -39,6 +39,7 @@ import { BigNumberish, BigNumber } from "ethers" import { BitcoinNetwork } from "../src/bitcoin-network" import { Wallet } from "../src/wallet" import { MockTBTCToken } from "./utils/mock-tbtc-token" +import { BitcoinTransaction } from "../src" chai.use(chaiAsPromised) @@ -1490,9 +1491,9 @@ describe("Redemption", () => { (wallet) => wallet.event ) - const walletsUnspentTransacionOutputs = new Map< + const walletsTransactionHistory = new Map< string, - UnspentTransactionOutput[] + BitcoinTransaction[] >() walletsOrder.forEach((wallet) => { @@ -1501,11 +1502,11 @@ describe("Redemption", () => { mainUtxoHash, walletPublicKey, btcAddress, - utxos, + transactions, pendingRedemptionsValue, } = wallet.data - walletsUnspentTransacionOutputs.set(btcAddress, utxos) + walletsTransactionHistory.set(btcAddress, transactions) bridge.setWallet( wallet.event.walletPublicKeyHash.toPrefixedString(), { @@ -1517,8 +1518,7 @@ describe("Redemption", () => { ) }) - bitcoinClient.unspentTransactionOutputs = - walletsUnspentTransacionOutputs + bitcoinClient.transactionHistory = walletsTransactionHistory }) context( @@ -1545,29 +1545,13 @@ describe("Redemption", () => { }) }) - it("should get wallet data details", () => { - const bridgeWalletDetailsLogs = bridge.walletsLog - - const wallets = Array.from(walletsOrder) - // Remove last live wallet. - wallets.pop() - - expect(bridgeWalletDetailsLogs.length).to.eql(wallets.length) - - wallets.forEach((wallet, index) => { - expect(bridgeWalletDetailsLogs[index].walletPublicKeyHash).to.eql( - wallet.event.walletPublicKeyHash.toPrefixedString() - ) - }) - }) - it("should return the wallet data that can handle redemption request", () => { const expectedWalletData = findWalletForRedemptionData.walletWithPendingRedemption.data expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), - mainUtxo: expectedWalletData.utxos[0], + mainUtxo: expectedWalletData.mainUtxo, }) }) } @@ -1579,8 +1563,7 @@ describe("Redemption", () => { const amount = BigNumber.from("10000000000") // 1 000 BTC const expectedMaxAmount = walletsOrder .map((wallet) => wallet.data) - .map((wallet) => wallet.utxos) - .flat() + .map((wallet) => wallet.mainUtxo) .map((utxo) => utxo.value) .sort((a, b) => (b.gt(a) ? 0 : -1))[0] @@ -1647,24 +1630,13 @@ describe("Redemption", () => { }) }) - it("should get wallet data details", () => { - const bridgeWalletDetailsLogs = bridge.walletsLog - - expect(bridgeWalletDetailsLogs.length).to.eql(walletsOrder.length) - walletsOrder.forEach((wallet, index) => { - expect(bridgeWalletDetailsLogs[index].walletPublicKeyHash).to.eql( - wallet.event.walletPublicKeyHash.toPrefixedString() - ) - }) - }) - it("should skip the wallet for which there is a pending redemption request to the same redeemer output script and return the wallet data that can handle redemption request", () => { const expectedWalletData = findWalletForRedemptionData.liveWallet.data expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), - mainUtxo: expectedWalletData.utxos[0], + mainUtxo: expectedWalletData.mainUtxo, }) }) } @@ -1676,7 +1648,7 @@ describe("Redemption", () => { beforeEach(async () => { const wallet = findWalletForRedemptionData.walletWithPendingRedemption - const walletBTCBalance = wallet.data.utxos[0].value + const walletBTCBalance = wallet.data.mainUtxo.value const amount: BigNumber = walletBTCBalance .sub(wallet.data.pendingRedemptionsValue) @@ -1699,7 +1671,7 @@ describe("Redemption", () => { expect(result).to.deep.eq({ walletPublicKey: expectedWalletData.walletPublicKey.toString(), - mainUtxo: expectedWalletData.utxos[0], + mainUtxo: expectedWalletData.mainUtxo, }) }) } From 0e369b2f3ba1b80e23b324c5a59bcd5bf88c699b Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 12 Jul 2023 11:08:28 +0200 Subject: [PATCH 189/198] Add `console.error` if wallet output not found for wallet transaction --- typescript/src/wallet.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/typescript/src/wallet.ts b/typescript/src/wallet.ts index 2d1bccbf3..7f053b79a 100644 --- a/typescript/src/wallet.ts +++ b/typescript/src/wallet.ts @@ -299,6 +299,9 @@ export async function determineWalletMainUtxo( // Should never happen as all transactions come from wallet history. Just // in case check whether the wallet output was actually found. if (outputIndex < 0) { + console.error( + `wallet output for transaction ${walletTransaction.transactionHash.toString()} not found` + ) continue } From 41f917a7ccce0b998161b80df5447262426e911b Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 11:08:29 +0200 Subject: [PATCH 190/198] Bump tbtc-v2.ts dependency in system-tests --- system-tests/yarn.lock | 405 ++++++++++++++++++++++++++++++----------- 1 file changed, 303 insertions(+), 102 deletions(-) diff --git a/system-tests/yarn.lock b/system-tests/yarn.lock index e30872622..9d178326c 100644 --- a/system-tests/yarn.lock +++ b/system-tests/yarn.lock @@ -1492,16 +1492,16 @@ resolved "https://registry.yarnpkg.com/@keep-network/bitcoin-spv-sol/-/bitcoin-spv-sol-3.4.0-solc-0.8.tgz#8b44c246ffab8ea993efe196f6bf385b1a3b84dc" integrity sha512-KlpY9BbasyLvYXSS7dsJktgRChu/yjdFLOX8ldGA/pltLicCm/l0F4oqxL8wSws9XD12vq9x0B5qzPygVLB2TQ== -"@keep-network/ecdsa@2.1.0-dev.6": - version "2.1.0-dev.6" - resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.6.tgz#ccc690f784b6e802a5b80b2dfb7127d96e548a25" - integrity sha512-1D74OPVzzxxVcG8za/niuxmwEdDc5R6KNuHsUvsFkcHNJE1UgQNw+QdrI+k3M2so6YrO4L5lP7vTvIvBDbEMNQ== +"@keep-network/ecdsa@2.1.0-dev.15": + version "2.1.0-dev.15" + resolved "https://registry.yarnpkg.com/@keep-network/ecdsa/-/ecdsa-2.1.0-dev.15.tgz#ee631a42e165f30c75aae8c54aace765b77e272a" + integrity sha512-iUE3SwDSNc/k1oui7Z+fDGhhGyOzpe4/f/oKvDUMHqXx0BQG3QCrOz9KqWuPFXTXMav4LxLbt12WyDITAl/hjw== dependencies: - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/random-beacon" "2.1.0-dev.15" "@keep-network/sortition-pools" "^2.0.0-pre.16" "@openzeppelin/contracts" "^4.6.0" "@openzeppelin/contracts-upgradeable" "^4.6.0" - "@threshold-network/solidity-contracts" "1.3.0-dev.3" + "@threshold-network/solidity-contracts" "1.3.0-dev.6" "@keep-network/hardhat-helpers@^0.6.0-pre.7": version "0.6.0-pre.7" @@ -1538,15 +1538,25 @@ version "0.0.1" resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/a1a333e7ac49928a0f6ed39421906dd1e46ab0f3" -"@keep-network/random-beacon@2.1.0-dev.5": - version "2.1.0-dev.5" - resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.5.tgz#5ea1a76f57c8171fe3b12ecf4cfcefee38f954ac" - integrity sha512-v3Mqzwx69WqG5bi8qEO4b72PpDMbwl69f5PYHZ0vO3g2pzU1PpVq2nq/vzgdqW2xgztvnHFwOq+lOyN8hx0K3A== +"@keep-network/random-beacon@2.1.0-dev.15": + version "2.1.0-dev.15" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.15.tgz#541620c469e3bc75a5d1f7649889540b0e032e9e" + integrity sha512-vxBICRtmqSmJtFU5hZMpwB0alhgKchyMbxk4DtLZ7T2zBjd5tjt3CqeKEk+ON09g7yL1mIxY07InP4okviUK4A== dependencies: "@keep-network/sortition-pools" "^2.0.0-pre.16" - "@openzeppelin/contracts" "^4.6.0" + "@openzeppelin/contracts" "4.7.3" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" + +"@keep-network/random-beacon@2.1.0-dev.16": + version "2.1.0-dev.16" + resolved "https://registry.yarnpkg.com/@keep-network/random-beacon/-/random-beacon-2.1.0-dev.16.tgz#9f2b5c19aa79f6ff1a5498ba7b55eb170463161d" + integrity sha512-o+cG/VDkhUc91W+4bMplYCgOu0twSFICqarpv5k2ES8GcaafaeV8stXGhCxjvHYJjU/sfG8mhlQZhWdZixq+JQ== + dependencies: + "@keep-network/sortition-pools" "^2.0.0-pre.16" + "@openzeppelin/contracts" "4.7.3" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" - "@threshold-network/solidity-contracts" "1.3.0-dev.3" + "@threshold-network/solidity-contracts" "1.3.0-dev.6" "@keep-network/sortition-pools@1.2.0-dev.1": version "1.2.0-dev.1" @@ -1564,30 +1574,31 @@ "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc-v2.ts@development": - version "1.1.0-dev.8" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2.ts/-/tbtc-v2.ts-1.1.0-dev.8.tgz#9a3e0cc962681fe14c8b198d2b21e84d27ebdb4b" - integrity sha512-F5PEd+oaZuueQsFVBJ4MJcs8nVBOJJaXqVJJzWnLWw1/lARqT0H5m1dvMofuFTF76y9ShxbHNT1BYQOEX7dlJQ== + version "1.3.0-dev.5" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2.ts/-/tbtc-v2.ts-1.3.0-dev.5.tgz#f01516207ddeb40b33f1c9a64022de9b8a216915" + integrity sha512-UmZg56yflaWJWKk7UdXgndc4duK7crnOyBAfiHBdrMJQiFXb0qpNKkbZAsVbpfxD2P1n0VwWitczXTQAPyKNRQ== dependencies: - "@keep-network/ecdsa" "2.1.0-dev.6" - "@keep-network/tbtc-v2" "1.0.3-dev.0" + "@keep-network/ecdsa" "2.1.0-dev.15" + "@keep-network/tbtc-v2" "1.6.0-dev.0" bcoin "git+https://github.com/keep-network/bcoin.git#5accd32c63e6025a0d35d67739c4a6e84095a1f8" bcrypto "git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0" bufio "^1.0.6" electrum-client-js "git+https://github.com/keep-network/electrum-client-js.git#v0.1.1" ethers "^5.5.2" + p-timeout "^4.1.0" wif "2.0.6" -"@keep-network/tbtc-v2@1.0.3-dev.0": - version "1.0.3-dev.0" - resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.0.3-dev.0.tgz#754eab80269ea5a616c92cb8c1f607ec21343e0b" - integrity sha512-RqIFZvJtbLgmPZvPgamIJoTc5UsosrPE2g3879RqU4XqntezF4gr95FIuUFmicjRy0OPsjCupU2HplxlWfQfdw== +"@keep-network/tbtc-v2@1.6.0-dev.0": + version "1.6.0-dev.0" + resolved "https://registry.yarnpkg.com/@keep-network/tbtc-v2/-/tbtc-v2-1.6.0-dev.0.tgz#ba95805cef3f04bde7379d3c3b14e882a9cfa080" + integrity sha512-5N2dMdFSdS+Ljvqnqoscft5xnbIK/U/z8Dc2hNXWULkPhIy0Mx/E7i7I4CpBTV4LazIo1Hq6W4EJtj+lmrekgg== dependencies: "@keep-network/bitcoin-spv-sol" "3.4.0-solc-0.8" - "@keep-network/ecdsa" "2.1.0-dev.6" - "@keep-network/random-beacon" "2.1.0-dev.5" + "@keep-network/ecdsa" "2.1.0-dev.15" + "@keep-network/random-beacon" "2.1.0-dev.16" "@keep-network/tbtc" "1.1.2-dev.1" - "@openzeppelin/contracts" "^4.6.0" - "@openzeppelin/contracts-upgradeable" "^4.6.0" + "@openzeppelin/contracts" "^4.8.1" + "@openzeppelin/contracts-upgradeable" "^4.8.1" "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" "@keep-network/tbtc@1.1.2-dev.1": @@ -1694,25 +1705,30 @@ "@types/sinon-chai" "^3.2.3" "@types/web3" "1.0.19" -"@openzeppelin/contracts-upgradeable@^4.6.0": - version "4.8.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.1.tgz#363f7dd08f25f8f77e16d374350c3d6b43340a7a" - integrity sha512-1wTv+20lNiC0R07jyIAbHU7TNHKRwGiTGRfiNnA8jOWjKT98g5OgLpYWOi40Vgpk8SPLA9EvfJAbAeIyVn+7Bw== +"@openzeppelin/contracts-upgradeable@^4.6.0", "@openzeppelin/contracts-upgradeable@^4.8.1": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.2.tgz#a817c75688f8daede420052fbcb34e52482e769e" + integrity sha512-siviV3PZV/fHfPaoIC51rf1Jb6iElkYWnNYZ0leO23/ukXuvOyoC/ahy8jqiV7g+++9Nuo3n/rk5ajSN/+d/Sg== "@openzeppelin/contracts-upgradeable@~4.5.2": version "4.5.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.5.2.tgz#90d9e47bacfd8693bfad0ac8a394645575528d05" integrity sha512-xgWZYaPlrEOQo3cBj97Ufiuv79SPd8Brh4GcFYhPgb6WvAq4ppz8dWKL6h+jLAK01rUqMRp/TS9AdXgAeNvCLA== +"@openzeppelin/contracts@4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e" + integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== + "@openzeppelin/contracts@^2.4.0": version "2.5.1" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-2.5.1.tgz#c76e3fc57aa224da3718ec351812a4251289db31" integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== -"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0": - version "4.8.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.1.tgz#709cfc4bbb3ca9f4460d60101f15dac6b7a2d5e4" - integrity sha512-xQ6eUZl+RDyb/FiZe1h+U7qr/f4p/SrTSQcTPH2bjur3C5DbuW/zFgCU/b1P/xcIaEqJep+9ju4xDRi3rmChdQ== +"@openzeppelin/contracts@^4.1.0", "@openzeppelin/contracts@^4.3.2", "@openzeppelin/contracts@^4.6.0", "@openzeppelin/contracts@^4.8.1": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" + integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== "@openzeppelin/contracts@~4.5.0": version "4.5.0" @@ -2001,6 +2017,7 @@ eslint-config-prettier "^8.3.0" eslint-plugin-import "^2.23.4" eslint-plugin-jsx-a11y "^6.4.1" + eslint-plugin-no-only-tests "^2.6.0" eslint-plugin-prettier "^4.0.0" eslint-plugin-react "^7.25.2" eslint-plugin-react-hooks "^4.2.0" @@ -2015,10 +2032,20 @@ dependencies: "@openzeppelin/contracts" "^4.1.0" -"@threshold-network/solidity-contracts@1.3.0-dev.3": - version "1.3.0-dev.3" - resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.3.tgz#aa896b80a083ca8a7cb5219e3c9d1c47e3d86b03" - integrity sha512-BNm5+JKrFvg9hZ02Sp/A+vKs1PQB37rYdcZqLrLhvwDFzHFvL+XA2IXqvN1CznQTeehwnX3DtCcONTVP42i56A== +"@threshold-network/solidity-contracts@1.3.0-dev.5": + version "1.3.0-dev.5" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" + integrity sha512-AInTKQkJ0PKa32q2m8GnZFPYEArsnvOwhIFdBFaHdq9r4EGyqHMf4YY1WjffkheBZ7AQ0DNA8Lst30kBoQd0SA== + dependencies: + "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" + "@openzeppelin/contracts" "~4.5.0" + "@openzeppelin/contracts-upgradeable" "~4.5.2" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + +"@threshold-network/solidity-contracts@1.3.0-dev.6": + version "1.3.0-dev.6" + resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.6.tgz#41e34a84f409f63635e59f9a6ce170df1472b8a1" + integrity sha512-U7nMp+86M5qkjW7YUvT3qWgRiEEUIxqE96vkEiARTOkWX5JdLP2CXehkHCkEzjdgOCczmCp3fFtcgKFnQhhZ8A== dependencies: "@keep-network/keep-core" ">1.8.1-dev <1.8.1-goerli" "@openzeppelin/contracts" "~4.5.0" @@ -2128,9 +2155,9 @@ integrity sha512-lIxCk6G7AwmUagQ4gIQGxUBnvAq664prFD9nSAz6dgd1XmBXBtZABV/op+QsJsIyaP1GZsf/iXhYKHX3azSRCw== "@types/debug@^4.1.5": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82" - integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg== + version "4.1.8" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.8.tgz#cef723a5d0a90990313faec2d1e22aee5eecb317" + integrity sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ== dependencies: "@types/ms" "*" @@ -2191,9 +2218,9 @@ "@types/node" "*" "@types/lodash@^4.14.170": - version "4.14.191" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" - integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== + version "4.14.195" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" + integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== "@types/lru-cache@^5.1.0": version "5.1.1" @@ -2652,6 +2679,14 @@ array-back@^4.0.1, array-back@^4.0.2: resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -2823,8 +2858,8 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== "bcfg@git+https://github.com/bcoin-org/bcfg.git#semver:~0.1.7": - version "0.1.7" - resolved "git+https://github.com/bcoin-org/bcfg.git#05122154b35baa82cd01dc9478ebee7346386ba1" + version "0.1.8" + resolved "git+https://github.com/bcoin-org/bcfg.git#90e1aff3b040160cd73956a500765ffcc823f0c2" dependencies: bsert "~0.0.10" @@ -2869,8 +2904,8 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" "bcrypto@git+https://github.com/bcoin-org/bcrypto.git#semver:~5.5.0": - version "5.5.0" - resolved "git+https://github.com/bcoin-org/bcrypto.git#34738cf15033e3bce91a4f6f41ec1ebee3c2fdc8" + version "5.5.1" + resolved "git+https://github.com/bcoin-org/bcrypto.git#42bcbd52831042f08cdf178d2cf30eacb62a4446" dependencies: bufio "~1.0.7" loady "~0.0.5" @@ -2908,8 +2943,8 @@ bech32@1.1.4: bsert "~0.0.10" "bfile@git+https://github.com/bcoin-org/bfile.git#semver:~0.2.1": - version "0.2.2" - resolved "git+https://github.com/bcoin-org/bfile.git#c3075133a02830dc384f8353d8275d4499b8bff9" + version "0.2.3" + resolved "git+https://github.com/bcoin-org/bfile.git#c13235d04974f0fa5a487fdbaf74611523e2f4e6" "bfilter@git+https://github.com/bcoin-org/bfilter.git#semver:~2.3.0": version "2.3.0" @@ -3093,7 +3128,7 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.1, body-parser@^1.16.0: +body-parser@1.20.1: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== @@ -3111,6 +3146,24 @@ body-parser@1.20.1, body-parser@^1.16.0: type-is "~1.6.18" unpipe "1.0.0" +body-parser@^1.16.0: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -3218,10 +3271,15 @@ bs58check@<3.0.0, bs58check@^2.1.1, bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" -"bsert@git+https://github.com/chjj/bsert.git#semver:~0.0.10", bsert@~0.0.10: +"bsert@git+https://github.com/chjj/bsert.git#semver:~0.0.10": version "0.0.10" resolved "git+https://github.com/chjj/bsert.git#bd09d49eab8644bca08ae8259a3d8756e7d453fc" +bsert@~0.0.10: + version "0.0.12" + resolved "https://registry.yarnpkg.com/bsert/-/bsert-0.0.12.tgz#157c6a6beb1548af3b14d484fcd2a78eb440599d" + integrity sha512-lUB0EMu4KhIf+VQ6RZJ7J3dFdohYSeta+gNgDi00Hi/t3k/W6xZlwm9PSSG0q7hJ2zW9Rsn5yaMPymETxroTRw== + "bsock@git+https://github.com/bcoin-org/bsock.git#semver:~0.1.9", bsock@~0.1.8, bsock@~0.1.9: version "0.1.9" resolved "git+https://github.com/bcoin-org/bsock.git#7cf76b3021ae7929c023d1170f789811e91ae528" @@ -3328,10 +3386,15 @@ bufio@^1.0.6: resolved "https://registry.yarnpkg.com/bufio/-/bufio-1.2.0.tgz#b9ad1c06b0d9010363c387c39d2810a7086d143f" integrity sha512-UlFk8z/PwdhYQTXSQQagwGAdtRI83gib2n4uy4rQnenxUM2yQi8lBDzF230BNk+3wAoZDxYRoBwVVUPgHa9MCA== -"bufio@git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6", bufio@~1.0.7: +"bufio@git+https://github.com/bcoin-org/bufio.git#semver:~1.0.6": version "1.0.7" resolved "git+https://github.com/bcoin-org/bufio.git#91ae6c93899ff9fad7d7cee9afd2a1c4933ca984" +bufio@~1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/bufio/-/bufio-1.0.7.tgz#b7f63a1369a0829ed64cc14edf0573b3e382a33e" + integrity sha512-bd1dDQhiC+bEbEfg56IdBv7faWa6OipMs/AFFFvtFnB3wAYjlwQpQRZ0pm6ZkgtfL0pILRXhKxOiQj6UzoMR7A== + "bupnp@git+https://github.com/bcoin-org/bupnp.git#semver:~0.2.6": version "0.2.6" resolved "git+https://github.com/bcoin-org/bupnp.git#c44fa7356aa297c9de96e8ad094a6816939cd688" @@ -3341,8 +3404,8 @@ bufio@^1.0.6: bsert "~0.0.10" "bval@git+https://github.com/bcoin-org/bval.git#semver:~0.1.6": - version "0.1.7" - resolved "git+https://github.com/bcoin-org/bval.git#5dcc923f24da9fb7eb96269ef8ce01540da983e7" + version "0.1.8" + resolved "git+https://github.com/bcoin-org/bval.git#f9c44d510bbc5bcc13cbd4b67e9704a24cc5ec0e" dependencies: bsert "~0.0.10" @@ -3377,9 +3440,9 @@ cacheable-request@^6.0.0: responselike "^1.0.2" cacheable-request@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" - integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + version "7.0.4" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" + integrity sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg== dependencies: clone-response "^1.0.2" get-stream "^5.1.0" @@ -3696,10 +3759,10 @@ content-hash@^2.5.2: multicodec "^0.5.5" multihashes "^0.4.15" -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.4, content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== cookie-signature@1.0.6: version "1.0.6" @@ -3807,11 +3870,11 @@ cross-fetch@3.0.4: whatwg-fetch "3.0.0" cross-fetch@^3.0.6: - version "3.1.5" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f" - integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw== + version "3.1.8" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" + integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== dependencies: - node-fetch "2.6.7" + node-fetch "^2.6.12" cross-spawn@^7.0.2: version "7.0.3" @@ -3914,7 +3977,7 @@ debug@^3.1.0, debug@^3.2.7: decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== decamelize@^4.0.0: version "4.0.0" @@ -4035,7 +4098,15 @@ deferred-leveldown@~5.3.0: abstract-leveldown "~6.2.1" inherits "^2.0.3" -define-properties@^1.1.2, define-properties@^1.1.3, define-properties@^1.1.4: +define-properties@^1.1.2, define-properties@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +define-properties@^1.1.3, define-properties@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== @@ -4059,9 +4130,9 @@ depd@2.0.0: integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -4314,6 +4385,46 @@ es-abstract@^1.19.1: string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" +es-abstract@^1.21.2: + version "1.21.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.21.2.tgz#a56b9695322c8a185dc25975aa3b8ec31d0e7eff" + integrity sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg== + dependencies: + array-buffer-byte-length "^1.0.0" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.2.0" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.10" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.4.3" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.7" + string.prototype.trimend "^1.0.6" + string.prototype.trimstart "^1.0.6" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.9" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" @@ -4495,7 +4606,7 @@ eslint-plugin-jsx-a11y@^6.4.1: language-tags "^1.0.5" minimatch "^3.0.4" -eslint-plugin-no-only-tests@^2.3.1: +eslint-plugin-no-only-tests@^2.3.1, eslint-plugin-no-only-tests@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.6.0.tgz#19f6c9620bda02b9b9221b436c5f070e42628d76" integrity sha512-T9SmE/g6UV1uZo1oHAqOvL86XWl7Pl2EpRpnLI8g/bkJu+h7XBCB+1LnubRZ2CUQXj805vh4/CYZdnqtVaEo2Q== @@ -4668,7 +4779,7 @@ etag@~1.8.1: eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" - integrity sha1-IprEbsqG1S4MmR58sq74P/D2i88= + integrity sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw== dependencies: idna-uts46-hx "^2.3.1" js-sha3 "^0.5.7" @@ -5383,9 +5494,9 @@ functions-have-names@^1.2.2: integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== futoin-hkdf@^1.0.3: - version "1.5.1" - resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.1.tgz#141f00427bc9950b38a42aa786b99c318b9b688d" - integrity sha512-g5d0Qp7ks55hYmYmfqn4Nz18XH49lcCR+vvIvHT92xXnsJaGZmY1EtWQWilJ6BQp57heCIXM/rRo+AFep8hGgg== + version "1.5.2" + resolved "https://registry.yarnpkg.com/futoin-hkdf/-/futoin-hkdf-1.5.2.tgz#d316623d29f45fe5e6f136f435eccd74096bf676" + integrity sha512-Bnytx8kQJQoEAPGgTZw3kVPy8e/n9CDftPzc0okgaujmbdF1x7w8wg+u2xS0CML233HgruNk6VQW28CzuUFMKw== ganache@7.0.3: version "7.0.3" @@ -5425,6 +5536,16 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3: has "^1.0.3" has-symbols "^1.0.3" +get-intrinsic@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" @@ -5562,9 +5683,9 @@ globby@^11.0.3: slash "^3.0.0" google-libphonenumber@^3.2.15, google-libphonenumber@^3.2.4: - version "3.2.31" - resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.31.tgz#d2c4d4c8d7385be70b515086e4d28dd20da50600" - integrity sha512-l3bzAkfN4ITICKvuqEiY7JN06RxDAviOoKMtD2KfGYjGK3btPO8Xav7k0fgmf1Ud/pEm523yBh1/s/xDtKEvnw== + version "3.2.32" + resolved "https://registry.yarnpkg.com/google-libphonenumber/-/google-libphonenumber-3.2.32.tgz#63c48a9c247b64a3bc2eec21bdf3fcfbf2e148c0" + integrity sha512-mcNgakausov/B/eTgVeX8qc8IwWjRrupk9UzZZ/QDEvdh5fAjE7Aa211bkZpZj42zKkeS6MTT8avHUwjcLxuGQ== gopd@^1.0.1: version "1.0.1" @@ -5627,7 +5748,12 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: +graceful-fs@^4.1.10: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.4: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5826,9 +5952,9 @@ hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== http-errors@2.0.0: version "2.0.0" @@ -5960,6 +6086,15 @@ internal-slot@^1.0.3, internal-slot@^1.0.4: has "^1.0.3" side-channel "^1.0.4" +internal-slot@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.5.tgz#f2a2ee21f668f8627a4667f309dc0f4fb6674986" + integrity sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ== + dependencies: + get-intrinsic "^1.2.0" + has "^1.0.3" + side-channel "^1.0.4" + invariant@2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -6006,6 +6141,15 @@ is-array-buffer@^3.0.1: get-intrinsic "^1.1.3" is-typed-array "^1.1.10" +is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -6217,6 +6361,11 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -6550,10 +6699,15 @@ load-json-file@^1.0.0: pinkie-promise "^2.0.0" strip-bom "^2.0.0" -"loady@git+https://github.com/chjj/loady.git#semver:~0.0.1", loady@~0.0.1, loady@~0.0.5: +"loady@git+https://github.com/chjj/loady.git#semver:~0.0.1": version "0.0.5" resolved "git+https://github.com/chjj/loady.git#b94958b7ee061518f4b85ea6da380e7ee93222d5" +loady@~0.0.1, loady@~0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/loady/-/loady-0.0.5.tgz#b17adb52d2fb7e743f107b0928ba0b591da5d881" + integrity sha512-uxKD2HIj042/HBx77NBcmEPsD+hxCgAtjEWlYNScuUjIsh/62Uyu39GOR68TBR68v+jqDL9zfftCWoUo4y03sQ== + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -6836,7 +6990,12 @@ minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +minimist@^1.2.6: version "1.2.7" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== @@ -6864,9 +7023,9 @@ mkdirp-promise@^5.0.1: mkdirp "*" mkdirp@*: - version "2.1.3" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.3.tgz#b083ff37be046fd3d6552468c1f0ff44c1545d1f" - integrity sha512-sjAkg21peAG9HS+Dkx7hlG9Ztx7HLeKnvB3NQRcu/mltCVmvkF0pisbiTSfDVYTT86XEfZrTUosLdZLStquZUw== + version "3.0.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-3.0.1.tgz#e44e4c5607fb279c168241713cc6e0fea9adcb50" + integrity sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg== mkdirp@0.5.4: version "0.5.4" @@ -7088,7 +7247,14 @@ node-fetch@2.6.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-fetch@2.6.7, node-fetch@^2.6.7: +node-fetch@^2.6.12: + version "2.6.12" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba" + integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g== + dependencies: + whatwg-url "^5.0.0" + +node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -7168,7 +7334,7 @@ object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1 resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-inspect@^1.12.0, object-inspect@^1.12.2, object-inspect@^1.9.0: +object-inspect@^1.12.0, object-inspect@^1.12.2, object-inspect@^1.12.3, object-inspect@^1.9.0: version "1.12.3" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== @@ -7217,14 +7383,15 @@ object.fromentries@^2.0.5: es-abstract "^1.19.1" object.getownpropertydescriptors@^2.0.3: - version "2.1.5" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" - integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== + version "2.1.6" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz#5e5c384dd209fa4efffead39e3a0512770ccc312" + integrity sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ== dependencies: array.prototype.reduce "^1.0.5" call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.21.2" + safe-array-concat "^1.0.0" object.hasown@^1.1.1: version "1.1.1" @@ -7393,6 +7560,11 @@ p-timeout@^1.1.1: dependencies: p-finally "^1.0.0" +p-timeout@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-4.1.0.tgz#788253c0452ab0ffecf18a62dff94ff1bd09ca0a" + integrity sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw== + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -7528,7 +7700,7 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + integrity sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog== pify@^3.0.0: version "3.0.0" @@ -7733,6 +7905,16 @@ raw-body@2.5.1, raw-body@^2.4.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -7756,9 +7938,9 @@ read-pkg@^1.0.0: path-type "^1.0.0" readable-stream@^2.3.0, readable-stream@^2.3.5: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -7980,6 +8162,16 @@ rxjs@6: dependencies: tslib "^1.9.0" +safe-array-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.0.tgz#2064223cba3c08d2ee05148eedbc563cd6d84060" + integrity sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -8403,6 +8595,15 @@ string.prototype.matchall@^4.0.7: regexp.prototype.flags "^1.4.1" side-channel "^1.0.4" +string.prototype.trim@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" + integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.20.4" + string.prototype.trimend@^1.0.5, string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" @@ -9880,9 +10081,9 @@ which-module@^1.0.0: integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + version "2.0.1" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" + integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== which-typed-array@^1.1.2, which-typed-array@^1.1.9: version "1.1.9" @@ -9920,7 +10121,7 @@ wide-align@1.1.3: wif@2.0.6, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" - integrity sha1-CNP1IFbGZnkplyb63g1DKudLRwQ= + integrity sha512-HIanZn1zmduSF+BQhkE+YXIbEiH0xPr1012QbFEGB0xsKqJii0/SqJjyn8dFv6y36kOznMgMB+LGcbZTJ1xACQ== dependencies: bs58check "<3.0.0" From b56d4db24607830485c1f602639c78c9a3979903 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 11:15:02 +0200 Subject: [PATCH 191/198] Fix system tests Request the redemption via the `depositorBridgeHandle.requestRedemption` directly instead of `requestRedemption` function. After refactoring in `#632`, the `requestRedemption` requests redemption via tBTC token contract. In the current deposit scenario, we do not pass the vault address so the `depositor` does not actually have any tBTC tokens so we can't request redemption via `requestRedemption` fn with changes from `#632`. We are going to add a new scenario where we pass the TBTC vault address to the `revealDeposit` function to test the new mechanism of requesting the redemption via tBTC token contract in follow-up work. --- system-tests/test/deposit-redemption.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system-tests/test/deposit-redemption.test.ts b/system-tests/test/deposit-redemption.test.ts index 6a7ebfbb3..f72a13894 100644 --- a/system-tests/test/deposit-redemption.test.ts +++ b/system-tests/test/deposit-redemption.test.ts @@ -262,12 +262,11 @@ describe("System Test - Deposit and redemption", () => { systemTestsContext.depositorBitcoinKeyPair.publicKey.compressed )}` - await TBTC.requestRedemption( + await depositorBridgeHandle.requestRedemption( systemTestsContext.walletBitcoinKeyPair.publicKey.compressed, sweepUtxo, redeemerOutputScript, requestedAmount, - depositorBridgeHandle ) console.log( From 056cac5b657d984d3ddba4605b879a4e540780fe Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 12 Jul 2023 11:18:00 +0200 Subject: [PATCH 192/198] Use `createOutputScriptFromAddress` where applicable --- typescript/src/electrum.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/typescript/src/electrum.ts b/typescript/src/electrum.ts index d467f42f7..022ccce2a 100644 --- a/typescript/src/electrum.ts +++ b/typescript/src/electrum.ts @@ -2,6 +2,7 @@ import bcoin from "bcoin" import pTimeout from "p-timeout" import { Client as BitcoinClient, + createOutputScriptFromAddress, RawTransaction, Transaction, TransactionHash, @@ -232,7 +233,7 @@ export class Client implements BitcoinClient { ): Promise { return this.withElectrum( async (electrum: Electrum) => { - const script = bcoin.Script.fromAddress(address).toRaw().toString("hex") + const script = createOutputScriptFromAddress(address).toString() // eslint-disable-next-line camelcase type UnspentOutput = { tx_pos: number; value: number; tx_hash: string } @@ -262,7 +263,7 @@ export class Client implements BitcoinClient { limit?: number ): Promise { return this.withElectrum(async (electrum: Electrum) => { - const script = bcoin.Script.fromAddress(address).toRaw().toString("hex") + const script = createOutputScriptFromAddress(address).toString() // eslint-disable-next-line camelcase type HistoryItem = { height: number; tx_hash: string } From 7b0b9bdb7fb947614f9ddff195c73f3a001bb7b9 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 12 Jul 2023 11:20:42 +0200 Subject: [PATCH 193/198] Simplify `determineWalletMainUtxo` return statement --- typescript/src/wallet.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/typescript/src/wallet.ts b/typescript/src/wallet.ts index 7f053b79a..5c9a46ae1 100644 --- a/typescript/src/wallet.ts +++ b/typescript/src/wallet.ts @@ -326,11 +326,8 @@ export async function determineWalletMainUtxo( // operations. Try to determine the main UTXO for that address first as the // chance for success is the highest here. const mainUtxo = await determine(true) - if (mainUtxo) { - return mainUtxo - } // In case the main UTXO was not found for witness address, there is still // a chance it exists for the legacy wallet address. - return determine(false) + return mainUtxo ?? (await determine(false)) } From f2e5b9f938a6e455609a7c5bb9933bd5fa046492 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 12 Jul 2023 11:27:48 +0200 Subject: [PATCH 194/198] Improve unit tests of `determineWalletMainUtxo` --- typescript/test/wallet.test.ts | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/typescript/test/wallet.test.ts b/typescript/test/wallet.test.ts index 8042be548..277b07e5a 100644 --- a/typescript/test/wallet.test.ts +++ b/typescript/test/wallet.test.ts @@ -78,8 +78,37 @@ describe("Wallet", () => { ), ] - // Create a fake wallet legacy transaction history that consists of 2 transactions. - const walletLegacyTransactionsHistory: BitcoinTransaction[] = [ + // Create a fake wallet legacy transaction history that consists of 6 transactions. + const walletLegacyTransactionHistory: BitcoinTransaction[] = [ + mockTransaction( + "230a19d8867ff3f5b409e924d9dd6413188e215f9bb52f1c47de6154dac42267", + { + "00140000000000000000000000000000000000000001": 100000, + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 200000, // wallet legacy output + } + ), + mockTransaction( + "b11bfc481b95769b8488bd661d5f61a35f7c3c757160494d63f6e04e532dfcb9", + { + "00140000000000000000000000000000000000000001": 100000, + "00140000000000000000000000000000000000000002": 200000, + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 300000, // wallet legacy output + } + ), + mockTransaction( + "7e91580d989f8541489a37431381ff9babd596111232f1bc7a1a1ba503c27dee", + { + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 100000, // wallet legacy output + "00140000000000000000000000000000000000000001": 200000, + } + ), + mockTransaction( + "5404e339ba82e6e52fcc24cb40029bed8425baa4c7f869626ef9de956186f910", + { + "76a914e6f9d74726b19b75f16fe1e9feaec048aa4fa1d088ac": 100000, // wallet legacy output + "00140000000000000000000000000000000000000001": 200000, + } + ), mockTransaction( "05dabb0291c0a6aa522de5ded5cb6d14ee2159e7ff109d3ef0f21de128b56b94", { @@ -176,6 +205,18 @@ describe("Wallet", () => { }, expectedMainUtxo: undefined, }, + { + testName: "old legacy transaction", + // Set the main UTXO hash based on the oldest transaction from walletLegacyTransactionHistory. + actualMainUtxo: { + transactionHash: Hex.from( + "230a19d8867ff3f5b409e924d9dd6413188e215f9bb52f1c47de6154dac42267" + ), + outputIndex: 1, + value: BigNumber.from(200000), + }, + expectedMainUtxo: undefined, + }, ] tests.forEach(({ testName, actualMainUtxo, expectedMainUtxo }) => { @@ -218,7 +259,7 @@ describe("Wallet", () => { ) transactionHistory.set( walletLegacyAddress, - walletLegacyTransactionsHistory + walletLegacyTransactionHistory ) bitcoinClient.transactionHistory = transactionHistory From c6f94f641dda72a2a8c155d50de2a902daaa24c6 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 12:27:26 +0200 Subject: [PATCH 195/198] Rename fn that converts script to BTC address The `scriptPubKey` is a field specific to transaction outputs but basically, this function converts any script to a Bitcoin address. Here we make this function more generic and rename to `createAddressFromOutputScript`. --- typescript/src/bitcoin.ts | 2 +- typescript/test/bitcoin.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index ceffb0fca..4abc66599 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -633,7 +633,7 @@ export function createOutputScriptFromAddress(address: string): Hex { * @param network Bitcoin network. * @returns The Bitcoin address. */ -export function getAddressFromScriptPubKey( +export function createAddressFromOutputScript( scriptPubKey: string, network: BitcoinNetwork = BitcoinNetwork.Mainnet ): string { diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index b581fb78e..ce525b06d 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -12,7 +12,7 @@ import { bitsToTarget, targetToDifficulty, createOutputScriptFromAddress, - getAddressFromScriptPubKey, + createAddressFromOutputScript, } from "../src/bitcoin" import { calculateDepositRefundLocktime } from "../src/deposit" import { BitcoinNetwork } from "../src/bitcoin-network" @@ -493,7 +493,7 @@ describe("Bitcoin", () => { btcAddresses[bitcoinNetwork as keyof typeof btcAddresses] ).forEach(([addressType, { address, scriptPubKey }]) => { it(`should return correct ${addressType} address`, () => { - const result = getAddressFromScriptPubKey( + const result = createAddressFromOutputScript( scriptPubKey, bitcoinNetwork === "mainnet" ? BitcoinNetwork.Mainnet From 1c9b91b210eb22733a35e5549f4a735f8da2fcf3 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 12:36:12 +0200 Subject: [PATCH 196/198] Update `createAddressFromOutputScript` fn param Rename `scriptPubKey` to `script` and update docs. The `scriptPubKey` is a field specific to transaction outputs but basically, this function converts any script to a Bitcoin address. Here we also update type of this param to `Hex` instead of `string`. --- typescript/src/bitcoin.ts | 10 ++++------ typescript/test/bitcoin.test.ts | 2 +- typescript/test/data/bitcoin.ts | 29 ++++++++++++++++++----------- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/typescript/src/bitcoin.ts b/typescript/src/bitcoin.ts index 4abc66599..3d7c32585 100644 --- a/typescript/src/bitcoin.ts +++ b/typescript/src/bitcoin.ts @@ -626,18 +626,16 @@ export function createOutputScriptFromAddress(address: string): Hex { } /** - * Returns the Bitcoin address based on the script pub key placed on the output - * of a Bitcoin transaction. - * @param scriptPubKey Scirpt pub key placed on the output of a Bitcoin - * transaction. + * Creates the Bitcoin address from the output script. + * @param script The unprefixed and not prepended with length output script. * @param network Bitcoin network. * @returns The Bitcoin address. */ export function createAddressFromOutputScript( - scriptPubKey: string, + script: Hex, network: BitcoinNetwork = BitcoinNetwork.Mainnet ): string { - return Script.fromRaw(scriptPubKey.toString(), "hex") + return Script.fromRaw(script.toString(), "hex") .getAddress() ?.toString(toBcoinNetwork(network)) } diff --git a/typescript/test/bitcoin.test.ts b/typescript/test/bitcoin.test.ts index ce525b06d..27ce2861f 100644 --- a/typescript/test/bitcoin.test.ts +++ b/typescript/test/bitcoin.test.ts @@ -478,7 +478,7 @@ describe("Bitcoin", () => { it(`should create correct output script for ${addressType} address type`, () => { const result = createOutputScriptFromAddress(address) - expect(result.toString()).to.eq(expectedOutputScript) + expect(result.toString()).to.eq(expectedOutputScript.toString()) }) } ) diff --git a/typescript/test/data/bitcoin.ts b/typescript/test/data/bitcoin.ts index bc266e1a0..d44b4b737 100644 --- a/typescript/test/data/bitcoin.ts +++ b/typescript/test/data/bitcoin.ts @@ -1,4 +1,5 @@ import { BitcoinNetwork } from "../../src/bitcoin-network" +import { Hex } from "../../src/hex" export const btcAddresses: Record< Exclude, @@ -6,7 +7,7 @@ export const btcAddresses: Record< [addressType: string]: { address: string redeemerOutputScript: string - scriptPubKey: string + scriptPubKey: Hex } } > = { @@ -15,25 +16,28 @@ export const btcAddresses: Record< address: "mjc2zGWypwpNyDi4ZxGbBNnUA84bfgiwYc", redeemerOutputScript: "0x1976a9142cd680318747b720d67bf4246eb7403b476adb3488ac", - scriptPubKey: "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac", + scriptPubKey: Hex.from( + "76a9142cd680318747b720d67bf4246eb7403b476adb3488ac" + ), }, P2WPKH: { address: "tb1qumuaw3exkxdhtut0u85latkqfz4ylgwstkdzsx", redeemerOutputScript: "0x160014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", - scriptPubKey: "0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0", + scriptPubKey: Hex.from("0014e6f9d74726b19b75f16fe1e9feaec048aa4fa1d0"), }, P2SH: { address: "2MsM67NLa71fHvTUBqNENW15P68nHB2vVXb", redeemerOutputScript: "0x17a914011beb6fb8499e075a57027fb0a58384f2d3f78487", - scriptPubKey: "a914011beb6fb8499e075a57027fb0a58384f2d3f78487", + scriptPubKey: Hex.from("a914011beb6fb8499e075a57027fb0a58384f2d3f78487"), }, P2WSH: { address: "tb1qau95mxzh2249aa3y8exx76ltc2sq0e7kw8hj04936rdcmnynhswqqz02vv", redeemerOutputScript: "0x220020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", - scriptPubKey: - "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c", + scriptPubKey: Hex.from( + "0020ef0b4d985752aa5ef6243e4c6f6bebc2a007e7d671ef27d4b1d0db8dcc93bc1c" + ), }, }, mainnet: { @@ -41,25 +45,28 @@ export const btcAddresses: Record< address: "12higDjoCCNXSA95xZMWUdPvXNmkAduhWv", redeemerOutputScript: "0x1976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", - scriptPubKey: "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac", + scriptPubKey: Hex.from( + "76a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac" + ), }, P2WPKH: { address: "bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c", redeemerOutputScript: "0x1600148d7a0a3461e3891723e5fdf8129caa0075060cff", - scriptPubKey: "00148d7a0a3461e3891723e5fdf8129caa0075060cff", + scriptPubKey: Hex.from("00148d7a0a3461e3891723e5fdf8129caa0075060cff"), }, P2SH: { address: "342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey", redeemerOutputScript: "0x17a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", - scriptPubKey: "a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87", + scriptPubKey: Hex.from("a91419a7d869032368fd1f1e26e5e73a4ad0e474960e87"), }, P2WSH: { address: "bc1qeklep85ntjz4605drds6aww9u0qr46qzrv5xswd35uhjuj8ahfcqgf6hak", redeemerOutputScript: "0x220020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", - scriptPubKey: - "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70", + scriptPubKey: Hex.from( + "0020cdbf909e935c855d3e8d1b61aeb9c5e3c03ae8021b286839b1a72f2e48fdba70" + ), }, }, } From 5b786c204cc5f0551dd89c549db973ea625ce405 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 14:39:07 +0200 Subject: [PATCH 197/198] Improve errors in `findWalletForRedemption` fn Throw error when currently, there are no active wallets in the network and when the user requested redemption for all active wallets in the network using the same Bitcoin address - in that case, a user should use another Bitcoin address. --- typescript/src/redemption.ts | 14 ++++++++ typescript/test/redemption.test.ts | 57 +++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index f8a0665cf..e1a631101 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -441,6 +441,7 @@ export async function findWalletForRedemption( } | undefined = undefined let maxAmount = BigNumber.from(0) + let activeWalletsCounter = 0 for (const wallet of wallets) { const { walletPublicKeyHash } = wallet @@ -456,6 +457,7 @@ export async function findWalletForRedemption( ) continue } + activeWalletsCounter++ // Wallet must have a main UTXO that can be determined. const mainUtxo = await determineWalletMainUtxo( @@ -511,6 +513,18 @@ export async function findWalletForRedemption( ) } + if (activeWalletsCounter === 0) { + throw new Error("Currently, there are no active wallets in the network.") + } + + // Cover a corner case when the user requested redemption for all active + // wallets in the network using the same Bitcoin address. + if (!walletData && activeWalletsCounter > 0 && maxAmount.eq(0)) { + throw new Error( + "All active wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." + ) + } + if (!walletData) throw new Error( `Could not find a wallet with enough funds. Maximum redemption amount is ${maxAmount} Satoshi.` diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index e2efa36d1..21af6263d 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1468,7 +1468,7 @@ describe("Redemption", () => { bitcoinClient ) ).to.be.rejectedWith( - "Could not find a wallet with enough funds. Maximum redemption amount is 0 Satoshi." + "Currently, there are no active wallets in the network." ) }) } @@ -1676,6 +1676,61 @@ describe("Redemption", () => { }) } ) + + context( + "when all active wallets has pending redemption for a given Bitcoin address", + () => { + const amount: BigNumber = BigNumber.from("1000000") // 0.01 BTC + const redeemerOutputScript = + findWalletForRedemptionData.pendingRedemption.redeemerOutputScript + + beforeEach(async () => { + const walletPublicKeyHash = + findWalletForRedemptionData.walletWithPendingRedemption.event + .walletPublicKeyHash + + const pendingRedemptions = new Map< + BigNumberish, + RedemptionRequest + >() + + const pendingRedemption1 = MockBridge.buildRedemptionKey( + walletPublicKeyHash.toString(), + redeemerOutputScript + ) + + const pendingRedemption2 = MockBridge.buildRedemptionKey( + findWalletForRedemptionData.liveWallet.event.walletPublicKeyHash.toString(), + redeemerOutputScript + ) + + pendingRedemptions.set( + pendingRedemption1, + findWalletForRedemptionData.pendingRedemption + ) + + pendingRedemptions.set( + pendingRedemption2, + findWalletForRedemptionData.pendingRedemption + ) + bridge.setPendingRedemptions(pendingRedemptions) + }) + + it("should throw an error", async () => { + await expect( + findWalletForRedemption( + amount, + redeemerOutputScript, + BitcoinNetwork.Testnet, + bridge, + bitcoinClient + ) + ).to.be.rejectedWith( + "All active wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." + ) + }) + } + ) }) }) }) From 19e2dfff19b8bed26b98fe9e94a302ab1f183470 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Wed, 12 Jul 2023 15:08:43 +0200 Subject: [PATCH 198/198] Adjust a nomenclature in `findWalletForRedemption` There is always only one "active" wallet in the system. This is the one that accepts new deposits. What we are talking about here are "live" wallets that are operable from the Bridge's standpoint. Here we rename the `activeWalletsCounter` variable to `liveWalletsCounter` and adjust the nomenclature everywherre accordingly. --- typescript/src/redemption.ts | 25 +++++++++++++------------ typescript/test/redemption.test.ts | 4 ++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/typescript/src/redemption.ts b/typescript/src/redemption.ts index e1a631101..f3b2474a0 100644 --- a/typescript/src/redemption.ts +++ b/typescript/src/redemption.ts @@ -412,11 +412,12 @@ export async function getRedemptionRequest( } /** - * Finds the oldest active wallet that has enough BTC to handle a redemption request. + * Finds the oldest live wallet that has enough BTC to handle a redemption + * request. * @param amount The amount to be redeemed in satoshis. - * @param redeemerOutputScript The redeemer output script the redeemed funds - * are supposed to be locked on. Must be un-prefixed and not prepended - * with length. + * @param redeemerOutputScript The redeemer output script the redeemed funds are + * supposed to be locked on. Must be un-prefixed and not prepended with + * length. * @param bitcoinNetwork Bitcoin network. * @param bridge The handle to the Bridge on-chain contract. * @param bitcoinClient Bitcoin client used to interact with the network. @@ -441,7 +442,7 @@ export async function findWalletForRedemption( } | undefined = undefined let maxAmount = BigNumber.from(0) - let activeWalletsCounter = 0 + let liveWalletsCounter = 0 for (const wallet of wallets) { const { walletPublicKeyHash } = wallet @@ -457,7 +458,7 @@ export async function findWalletForRedemption( ) continue } - activeWalletsCounter++ + liveWalletsCounter++ // Wallet must have a main UTXO that can be determined. const mainUtxo = await determineWalletMainUtxo( @@ -513,15 +514,15 @@ export async function findWalletForRedemption( ) } - if (activeWalletsCounter === 0) { - throw new Error("Currently, there are no active wallets in the network.") + if (liveWalletsCounter === 0) { + throw new Error("Currently, there are no live wallets in the network.") } - // Cover a corner case when the user requested redemption for all active - // wallets in the network using the same Bitcoin address. - if (!walletData && activeWalletsCounter > 0 && maxAmount.eq(0)) { + // Cover a corner case when the user requested redemption for all live wallets + // in the network using the same Bitcoin address. + if (!walletData && liveWalletsCounter > 0 && maxAmount.eq(0)) { throw new Error( - "All active wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." + "All live wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." ) } diff --git a/typescript/test/redemption.test.ts b/typescript/test/redemption.test.ts index 21af6263d..58bac10cc 100644 --- a/typescript/test/redemption.test.ts +++ b/typescript/test/redemption.test.ts @@ -1468,7 +1468,7 @@ describe("Redemption", () => { bitcoinClient ) ).to.be.rejectedWith( - "Currently, there are no active wallets in the network." + "Currently, there are no live wallets in the network." ) }) } @@ -1726,7 +1726,7 @@ describe("Redemption", () => { bitcoinClient ) ).to.be.rejectedWith( - "All active wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." + "All live wallets in the network have the pending redemption for a given Bitcoin address. Please use another Bitcoin address." ) }) }