diff --git a/.gitignore b/.gitignore index 9d5b40eb5..fd475abd6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .vscode .env -cache/ +forge_cache/ out/ artifacts/ @@ -9,7 +9,7 @@ cache/ node_modules/ typechain/ -yarn-error.log/ +yarn-error.log broadcast/ diff --git a/.mainnet.json b/.mainnet.json index 18ca62d05..880ee0cfe 100644 --- a/.mainnet.json +++ b/.mainnet.json @@ -12,6 +12,7 @@ "doge": "0xbA2aE424d960c26247Dd6c32edC70B295c744C43", "dot": "0x7083609fCE4d1d8Dc0C979AAb8c869Ea2C873402", "eth": "0x2170Ed0880ac9A755fd29B2688956BD959F933F8", + "high": "0x5f4Bde007Dc06b867f86EBFE4802e34A1fFEEd63", "matic": "0xCC42724C6683B7E57334c4E856f4c9965ED682bD", "tusd": "0x14016E85a25aeb13065688cAFB43044C2ef86784", "usdt": "0x55d398326f99059fF775485246999027B3197955", @@ -52,6 +53,7 @@ "collateralFacet": "0x8cE125c65605f937AE16645a3642d3A335852936", "diamondCutFacet": "0x2E28CbF8995969d4ea1F03FfB6f25dab8afEE45C", "diamondLoupeFacet": "0xaDB5Be7b114Ca6721e00778F97e615B85D095952", + "flashloanFacet": "", "lendFacet": "0x0d8AE68ee3eE728Ed7AE9E99Edc10f2cfc3959b1", "liquidationFacet": "0xaB530549D03AE12A96292d749c75f7f719EA2f9D", "nonCollatBorrowFacet": "0xF22133299081534780777D1504A6B38955195b03", @@ -194,5 +196,13 @@ } ] }, - "moneyMarketReader": "0x1d3cb2f91207afDA9E9baB89caDE1a4c3222cf6a" -} \ No newline at end of file + "rewarders": [], + "moneyMarketReader": "0x4913DEC75cC0e061Ba78ebbDb2584905760be4C6", + "smartTreasury": { + "implementation": "", + "proxy": "" + }, + "pathReader": { + "v3": "" + } +} diff --git a/deploy/core/facets/diamond-cut/execute-diamond.ts b/deploy/core/facets/diamond-cut/execute-diamond.ts new file mode 100644 index 000000000..9ef3fd7e2 --- /dev/null +++ b/deploy/core/facets/diamond-cut/execute-diamond.ts @@ -0,0 +1,155 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { ethers } from "hardhat"; + +import * as readlineSync from "readline-sync"; +import { ConfigFileHelper } from "../../../file-helper.ts/config-file.helper"; +import { getDeployer } from "../../../utils/deployer-helper"; +import { facetContractNameToAddress, getSelectors } from "../../../utils/diamond"; +import { IMMDiamondCut, MMDiamondCutFacet__factory, MMDiamondLoupeFacet__factory } from "../../../../typechain"; + +enum FacetCutAction { + Add, + Replace, + Remove, +} + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + const FACET = "ViewFacet"; + const INITIALIZER_ADDRESS = ethers.constants.AddressZero; + const OLD_FACET_ADDRESS = "0xA7D618BF3880f146Bbc0F0d18eB6f13F59d3D339"; + + const deployer = await getDeployer(); + + const configFileHelper = new ConfigFileHelper(); + const config = configFileHelper.getConfig(); + + const diamondLoupeFacet = MMDiamondLoupeFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); + + const diamondCutFacet = MMDiamondCutFacet__factory.connect(config.moneyMarket.moneyMarketDiamond, deployer); + + console.log(`> Diamond cutting ${FACET}`); + + // Build the facetCuts array + console.log(`> Build the action selectors array from ${FACET} contract`); + const contractFactory = await ethers.getContractFactory(FACET); + const facetAddress = facetContractNameToAddress(FACET); + const existedFacetCuts = (await diamondLoupeFacet.facets()) + .map((each) => each.functionSelectors) + .reduce((result, array) => result.concat(array), []); + + const previousFacet = (await diamondLoupeFacet.facets()).find((each) => each.facetAddress == OLD_FACET_ADDRESS); + if (!previousFacet) { + console.log("Previous facet not found"); + return; + } + + const facetCuts: Array = []; + const replaceSelectors: Array = []; + const addSelectors: Array = []; + const removeSelectors: Array = []; + const functionSelectors = getSelectors(contractFactory); + // Loop through each selector to find out if it needs to replace or add + for (const selector of functionSelectors) { + if (existedFacetCuts.includes(selector)) { + replaceSelectors.push(selector); + } else { + addSelectors.push(selector); + } + } + // Loop through existed facet cuts to find out selectors to remove + for (const selector of previousFacet.functionSelectors) { + if (!functionSelectors.includes(selector)) { + removeSelectors.push(selector); + } + } + + console.log(`> Build the facetCuts array from ${FACET} contract`); + // Put the replaceSelectors and addSelectors into facetCuts + if (replaceSelectors.length > 0) { + facetCuts.push({ + facetAddress, + action: FacetCutAction.Replace, + functionSelectors: replaceSelectors, + }); + } + if (addSelectors.length > 0) { + facetCuts.push({ + facetAddress, + action: FacetCutAction.Add, + functionSelectors: addSelectors, + }); + } + if (removeSelectors.length > 0) { + // Get the old facet address based on the selector + facetCuts.push({ + facetAddress: ethers.constants.AddressZero, + action: FacetCutAction.Remove, + functionSelectors: removeSelectors, + }); + } + + console.log(`> Found ${replaceSelectors.length} selectors to replace`); + console.log(`> Methods to replace:`); + console.table( + replaceSelectors.map((each) => { + return { + functionName: contractFactory.interface.getFunction(each).name, + selector: each, + }; + }) + ); + console.log(`> Found ${addSelectors.length} selectors to add`); + console.log(`> Methods to add:`); + console.table( + addSelectors.map((each) => { + return { + functionName: contractFactory.interface.getFunction(each).name, + selector: each, + }; + }) + ); + console.log(`> Found ${removeSelectors.length} selectors to remove`); + console.log(`> Methods to remove:`); + console.table( + removeSelectors.map((each) => { + return { + functionName: "unknown (TODO: integrate with 4bytes dictionary)", + selector: each, + }; + }) + ); + + // Ask for confirmation + const confirmExecuteDiamondCut = readlineSync.question("Confirm? (y/n): "); + switch (confirmExecuteDiamondCut.toLowerCase()) { + case "y": + break; + case "n": + console.log("Aborting"); + return; + default: + console.log("Invalid input"); + return; + } + + console.log("> Executing diamond cut"); + const tx = await diamondCutFacet.diamondCut(facetCuts, INITIALIZER_ADDRESS, "0x", { gasLimit: 10000000 }); + console.log(`> Tx is submitted: ${tx.hash}`); + console.log(`> Waiting for tx to be mined`); + await tx.wait(); + console.log(`> Tx is mined`); +}; + +export default func; +func.tags = ["ExecuteDiamondCut"]; diff --git a/type-script/file-helper.ts/config-file.helper.ts b/deploy/file-helper.ts/config-file.helper.ts similarity index 52% rename from type-script/file-helper.ts/config-file.helper.ts rename to deploy/file-helper.ts/config-file.helper.ts index 2f44c7e1a..a5d6ea3d0 100644 --- a/type-script/file-helper.ts/config-file.helper.ts +++ b/deploy/file-helper.ts/config-file.helper.ts @@ -1,4 +1,4 @@ -import { Config, Market, MiniFLPool } from "../interfaces"; +import { Config, Market, MiniFLPool, Rewarder } from "../interfaces"; import MainnetConfig from "../../.mainnet.json"; import * as fs from "fs"; @@ -20,6 +20,25 @@ export class ConfigFileHelper { this._writeConfigFile(this.config); } + public setMiniFLPoolRewarders(pid: number, rewarderAddresses: string[]): void { + const miniFLPool = this.config.miniFL.pools.find((pool) => pool.id === Number(pid))!; + + const rewarders = rewarderAddresses.map( + (rewarder) => this.config.rewarders.find((configRewarder) => configRewarder.address === rewarder)! + ); + miniFLPool.rewarders = rewarders; + this._writeConfigFile(this.config); + } + + public addRewarder(rewarder: Rewarder): void { + this.config.rewarders.push(rewarder); + this._writeConfigFile(this.config); + } + + public getConfig() { + return this.config; + } + private _writeConfigFile(config: Config) { console.log(`>> Writing ${this.filePath}`); fs.writeFileSync(this.filePath, JSON.stringify(config, null, 2)); diff --git a/type-script/interfaces.ts b/deploy/interfaces.ts similarity index 57% rename from type-script/interfaces.ts rename to deploy/interfaces.ts index c804a8f70..24e5b9916 100644 --- a/type-script/interfaces.ts +++ b/deploy/interfaces.ts @@ -1,9 +1,24 @@ export interface Config { moneyMarket: MoneyMarket; miniFL: MiniFL; + rewarders: Rewarder[]; } export interface MoneyMarket { + moneyMarketDiamond: string; + facets: { + adminFacet: string; + borrowFacet: string; + collateralFacet: string; + diamondCutFacet: string; + diamondLoupeFacet: string; + flashloanFacet: string; + lendFacet: string; + liquidationFacet: string; + nonCollatBorrowFacet: string; + ownershipFacet: string; + viewFacet: string; + }; markets: Market[]; } @@ -24,7 +39,13 @@ export interface MiniFLPool { id: number; name: string; stakingToken: string; - rewarders: string[]; + rewarders: Rewarder[]; +} + +export interface Rewarder { + name: string; + address: string; + rewardToken: string; } export type AssetTier = 0 | 1 | 2 | 3; diff --git a/deploy/utils/deployer-helper.ts b/deploy/utils/deployer-helper.ts new file mode 100644 index 000000000..ce73bb72f --- /dev/null +++ b/deploy/utils/deployer-helper.ts @@ -0,0 +1,26 @@ +import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { ethers, network } from "hardhat"; +import { JsonRpcProvider } from "@ethersproject/providers"; +import { HttpNetworkUserConfig } from "hardhat/types"; + +export async function getDeployer(): Promise { + const [defaultDeployer] = await ethers.getSigners(); + + if (isFork()) { + const provider = ethers.getDefaultProvider((network.config as HttpNetworkUserConfig).url) as JsonRpcProvider; + const signer = provider.getSigner("0xC44f82b07Ab3E691F826951a6E335E1bC1bB0B51"); + const mainnetForkDeployer = await SignerWithAddress.create(signer); + + return mainnetForkDeployer; + } + + return defaultDeployer; +} + +export function isFork() { + const networkUrl = (network.config as HttpNetworkUserConfig).url; + if (networkUrl) { + return networkUrl.indexOf("https://rpc.tenderly.co/fork/") !== -1; + } + throw new Error("invalid Network Url"); +} diff --git a/deploy/utils/diamond.ts b/deploy/utils/diamond.ts new file mode 100644 index 000000000..bfa1e7440 --- /dev/null +++ b/deploy/utils/diamond.ts @@ -0,0 +1,23 @@ +import { ContractFactory } from "ethers"; +import _ from "lodash"; +import { ConfigFileHelper } from "../file-helper.ts/config-file.helper"; + +export function getSelectors(contract: ContractFactory): Array { + const signatures = Object.keys(contract.interface.functions); + const selectors = signatures.reduce((acc, val) => { + acc.push(contract.interface.getSighash(val)); + return acc; + }, [] as Array); + return selectors; +} + +export function facetContractNameToAddress(contractName: string): string { + const config = new ConfigFileHelper().getConfig(); + const facetList = config.moneyMarket.facets as any; + contractName = _.camelCase(contractName); + const address = facetList[contractName]; + if (!address) { + throw new Error(`${contractName} not found in config`); + } + return address; +} diff --git a/foundry.toml b/foundry.toml index 17c11736e..71a9a3070 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,6 +3,7 @@ optimizer = true optimizer-runs = 1 src = 'solidity/contracts' out = 'out' +cache_path = './forge_cache' libs = ['node_modules'] test = 'solidity/tests' fs_permissions = [{ access = "read-write", path = "./" }] diff --git a/hardhat.config.ts b/hardhat.config.ts index dcc15241f..d32cac501 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,18 +1,20 @@ import { config as dotEnvConfig } from "dotenv"; +import { HardhatUserConfig } from "hardhat/config"; dotEnvConfig(); import "@openzeppelin/hardhat-upgrades"; import "@nomiclabs/hardhat-ethers"; import "@typechain/hardhat"; +import "hardhat-deploy"; -module.exports = { +const config: HardhatUserConfig = { defaultNetwork: "hardhat", networks: { - // rinkeby: { - // url: process.env.RINKEBY_RPC, - // accounts: - // process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], - // }, + bsc_mainnet: { + chainId: 56, + url: process.env.BSC_RPC_URL, + accounts: process.env.DEPLOYER_PRIVATE_KEY !== undefined ? [process.env.DEPLOYER_PRIVATE_KEY] : [], + }, }, solidity: { version: "0.8.19", @@ -21,7 +23,6 @@ module.exports = { enabled: true, runs: 1, }, - evmVersion: "istanbul", }, }, paths: { @@ -32,9 +33,11 @@ module.exports = { }, typechain: { outDir: "./typechain", - target: process.env.TYPECHAIN_TARGET || "ethers-v5", + target: "ethers-v5", }, mocha: { timeout: 100000, }, }; + +export default config; diff --git a/package.json b/package.json index 538914ae7..ef3903dc9 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "compile": "hardhat compile && yarn build", "build:cjs": "tsc -p tsconfig.cjs.json", "build": "yarn run build:cjs", + "bsc_mainnet": "hardhat console --no-compile --network bsc_mainnet", + "----------Deploy Foundry Script-------------": "----------Deploy Foundry Script-------------", "exec:bsc_mainnet:proxy-admin:deploy": "forge script script/deployments/ProxyAdmin/deploy/ProxyAdmin.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:minifl:deploy": "forge script script/deployments/MiniFL/deploy/MiniFL.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:minifl:upgrade": "forge script script/deployments/MiniFL/upgrade/MiniFL.s.sol --rpc-url bsc_mainnet --broadcast --slow", @@ -15,9 +17,11 @@ "exec:bsc_mainnet:minifl:config:set-alpaca-per-sec": "forge script script/deployments/MiniFL/config/SetAlpacaPerSecond.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:minifl:config:set-whitelist-callers": "forge script script/deployments/MiniFL/config/SetWhitelistedCallers.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:minifl:script:mass-update-pools": "forge script script/deployments/MiniFL/script/MassUpdatePools.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:minifl:config:set-pool-rewarders": "forge script script/deployments/MiniFL/config/SetPoolRewarders.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:ib-token:deploy": "forge script script/deployments/InterestBearingToken/deploy/InterestBearingTokenImplementation.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:debt-token:deploy": "forge script script/deployments/DebtToken/deploy/DebtTokenImplementation.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:deploy": "forge script script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:cut:flash-loan-facet": "forge script script/deployments/MoneyMarket/diamond-cut/FlashloanFacetCut.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:open-market": "forge script script/deployments/MoneyMarket/config/OpenMarket.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:set-interest-model": "forge script script/deployments/MoneyMarket/config/SetInterestModel.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:set-fees": "forge script script/deployments/MoneyMarket/config/SetFees.s.sol --rpc-url bsc_mainnet --broadcast --slow", @@ -33,7 +37,12 @@ "exec:bsc_mainnet:money-market:config:set-account-manager-ok": "forge script script/deployments/MoneyMarket/config/SetAccountManagersOk.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:set-repurchase-reward-model": "forge script script/deployments/MoneyMarket/config/SetRepurchaseRewardModel.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:set-risk-manager-ok": "forge script script/deployments/MoneyMarket/config/SetRiskManagersOkScript.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:config:set-operator-ok": "forge script script/deployments/MoneyMarket/config/SetOperatorsOk.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market:config:withdraw-protocol-reserves": "forge script script/deployments/MoneyMarket/config/WithdrawProtocolReserves.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:config:set-flash-loan-params": "forge script script/deployments/MoneyMarket/config/SetFlashloanParams.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:admin-facet:deploy": "forge script script/deployments/MoneyMarket/deploy/AdminFacet.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:flash-loan-facet:deploy": "forge script script/deployments/MoneyMarket/deploy/FlashloanFacet.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:money-market:view-facet:deploy": "forge script script/deployments/MoneyMarket/deploy/ViewFacet.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:mm-account-manager:deploy": "forge script script/deployments/MoneyMarketAccountManager/deploy/MoneyMarketAccountManager.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:pancake-v2-liquidate-strat:deploy": "forge script script/deployments/PancakeswapV2LiquidationStrategy/deploy/PancakeswapV2LiquidationStrategy.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:pancake-v2-liquidate-ib-strat:deploy": "forge script script/deployments/PancakeswapV2IbTokenLiquidationStrategy/deploy/PancakeswapV2IbTokenLiquidationStrategy.s.sol --rpc-url bsc_mainnet --broadcast --slow", @@ -50,13 +59,29 @@ "exec:bsc_mainnet:wnative-relayer:config:set-caller-ok": "forge script script/deployments/WNativeRelayer/config/setCallerOk.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:money-market-reader:deploy": "forge script script/deployments/MoneyMarketReader/deploy/MoneyMarketReader.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:chainlink-price-oracle:config:set-price-feeds": "forge script script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol --rpc-url bsc_mainnet --broadcast --slow", - "exec:bsc_mainnet:chainlink-price-oracle2:deploy": "forge script script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.s.sol --rpc-url bsc_mainnet --broadcast --slow", - "exec:bsc_mainnet:chainlink-price-oracle2:config:set-price-feeds": "forge script script/deployments/ChainLinkOracle2/config/SetPriceFeeds.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:fix-fee-model-500-bps:deploy": "forge script script/deployments/RepurchaseRewardModel/deploy/FixedFeeModel500Bps.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:triple-slope-model0:deploy": "forge script script/deployments/InterestModels/deploy/TripleSlopeModel0.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:double-slope-model1:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel1.s.sol --rpc-url bsc_mainnet --broadcast --slow", "exec:bsc_mainnet:double-slope-model2:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel2.s.sol --rpc-url bsc_mainnet --broadcast --slow", - "exec:bsc_mainnet:double-slope-model3:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel3.s.sol --rpc-url bsc_mainnet --broadcast --slow" + "exec:bsc_mainnet:double-slope-model3:deploy": "forge script script/deployments/InterestModels/deploy/MMDoubleSlopeModel3.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:rewarder:deploy": "forge script script/deployments/Rewarder/deploy/Rewarder.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:rewarder:config:add-pool": "forge script script/deployments/Rewarder/config/AddPool.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:rewarder:config:set-pool": "forge script script/deployments/Rewarder/config/SetPool.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "exec:bsc_mainnet:rewarder:config:set-reward-per-second": "forge script script/deployments/Rewarder/config/SetRewardPerSecond.s.sol --rpc-url bsc_mainnet --broadcast --slow", + "----------Deploy Hardhat -------------": "----------Deploy Hardhat -------------", + "exec:bsc_mainnet:money-market:diamond-cut": "hardhat --network bsc_mainnet deploy --no-compile --reset --tags ExecuteDiamondCut" + }, + "devDependencies": { + "@typechain/ethers-v5": "^10.0.0", + "@typechain/hardhat": "^5.0.0", + "@types/mocha": "^9.1.0", + "@types/lodash": "^4.14.191", + "@types/readline-sync": "^1.4.4", + "ts-node": "^10.7.0", + "typescript": "^4.6.2", + "typechain": "^8.0.0", + "lodash": "^4.17.21", + "readline-sync": "^1.4.10" }, "dependencies": { "@nomiclabs/hardhat-ethers": "^2.0.5", @@ -68,6 +93,7 @@ "dotenv": "^16.0.0", "ethers": "^5.6.1", "hardhat": "^2.9.1", + "hardhat-deploy": "^0.11.10", "prettier": "^2.6.0", "prettier-plugin-solidity": "^1.0.0-beta.19" }, @@ -75,11 +101,7 @@ "typechain", "artifacts" ], - "devDependencies": { - "@typechain/hardhat": "^5.0.0", - "@types/mocha": "^9.1.0", - "ts-node": "^10.7.0", - "typechain": "^8.0.0", - "typescript": "^4.6.2" + "engines": { + "node": ">=14.15.4" } } diff --git a/script/BaseScript.sol b/script/BaseScript.sol index bd73395a7..e00c14a37 100644 --- a/script/BaseScript.sol +++ b/script/BaseScript.sol @@ -15,6 +15,7 @@ import { IBorrowFacet } from "solidity/contracts/money-market/interfaces/IBorrow import { ILendFacet } from "solidity/contracts/money-market/interfaces/ILendFacet.sol"; import { IMMOwnershipFacet } from "solidity/contracts/money-market/interfaces/IMMOwnershipFacet.sol"; import { IMiniFL } from "solidity/contracts/miniFL/interfaces/IMiniFL.sol"; +import { ISmartTreasury } from "solidity/contracts/interfaces/ISmartTreasury.sol"; import { IMoneyMarketAccountManager } from "solidity/contracts/interfaces/IMoneyMarketAccountManager.sol"; import { IAlpacaV2Oracle } from "solidity/contracts/oracle/interfaces/IAlpacaV2Oracle.sol"; import { IERC20 } from "solidity/contracts/money-market/interfaces/IERC20.sol"; @@ -48,6 +49,7 @@ abstract contract BaseScript is Script { address internal pancakeswapFactoryV3; address internal pancakeswapRouterV2; address internal pancakeswapRouterV3; + ISmartTreasury internal smartTreasury; // shareConfig address internal fixFeeModel500Bps; @@ -55,6 +57,9 @@ abstract contract BaseScript is Script { address internal doubleSlope2; address internal doubleSlope3; + // path reader + address internal pathReaderV3; + // tokens address internal ada; address internal alpaca; @@ -65,6 +70,7 @@ abstract contract BaseScript is Script { address internal doge; address internal dot; address internal eth; + address internal high; address internal matic; address internal tusd; address internal usdt; @@ -79,6 +85,7 @@ abstract contract BaseScript is Script { moneyMarket = abi.decode(configJson.parseRaw(".moneyMarket.moneyMarketDiamond"), (IMoneyMarket)); proxyAdminAddress = abi.decode(configJson.parseRaw(".proxyAdmin"), (address)); miniFL = abi.decode(configJson.parseRaw(".miniFL.proxy"), (IMiniFL)); + smartTreasury = abi.decode(configJson.parseRaw(".smartTreasury.proxy"), (ISmartTreasury)); accountManager = abi.decode(configJson.parseRaw(".moneyMarket.accountManager.proxy"), (IMoneyMarketAccountManager)); nativeRelayer = abi.decode(configJson.parseRaw(".nativeRelayer"), (address)); usdPlaceholder = abi.decode(configJson.parseRaw(".usdPlaceholder"), (address)); @@ -92,6 +99,9 @@ abstract contract BaseScript is Script { doubleSlope2 = abi.decode(configJson.parseRaw(".sharedConfig.doubleSlope2"), (address)); doubleSlope3 = abi.decode(configJson.parseRaw(".sharedConfig.doubleSlope3"), (address)); + // path reader + pathReaderV3 = abi.decode(configJson.parseRaw(".pathReader.v3"), (address)); + ibTokenImplementation = abi.decode( configJson.parseRaw(".moneyMarket.interestBearingTokenImplementation"), (address) @@ -125,6 +135,7 @@ abstract contract BaseScript is Script { doge = abi.decode(configJson.parseRaw(".tokens.doge"), (address)); dot = abi.decode(configJson.parseRaw(".tokens.dot"), (address)); eth = abi.decode(configJson.parseRaw(".tokens.eth"), (address)); + high = abi.decode(configJson.parseRaw(".tokens.high"), (address)); matic = abi.decode(configJson.parseRaw(".tokens.matic"), (address)); tusd = abi.decode(configJson.parseRaw(".tokens.tusd"), (address)); usdt = abi.decode(configJson.parseRaw(".tokens.usdt"), (address)); diff --git a/script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol b/script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol index ad9aaf9b7..247b4149d 100644 --- a/script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol +++ b/script/deployments/AlpacaV2Oracle/config/SetTokenConfig.s.sol @@ -26,40 +26,17 @@ contract SetTokenConfigScript is BaseScript { // set alpaca guard path - // WBNB - alpacaGuardPath.push(wbnb); - alpacaGuardPath.push(usdt); - addSetTokenConfigList( - IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true }) - ); - - // USDC - alpacaGuardPath.push(usdc); - alpacaGuardPath.push(usdt); - addSetTokenConfigList( - IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true }) - ); - - // BUSD + // HIGH + alpacaGuardPath.push(high); alpacaGuardPath.push(busd); alpacaGuardPath.push(usdt); addSetTokenConfigList( - IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true }) - ); - - // BTCB - alpacaGuardPath.push(btcb); - alpacaGuardPath.push(usdt); - addSetTokenConfigList( - IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true }) - ); - - // ETH - alpacaGuardPath.push(eth); - alpacaGuardPath.push(wbnb); - alpacaGuardPath.push(usdt); - addSetTokenConfigList( - IAlpacaV2Oracle.Config({ path: alpacaGuardPath, router: address(0), maxPriceDiffBps: 10500, isUsingV3Pool: true }) + IAlpacaV2Oracle.Config({ + path: alpacaGuardPath, + router: pancakeswapRouterV2, + maxPriceDiffBps: 10500, + isUsingV3Pool: false + }) ); //---- execution ----// diff --git a/script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol b/script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol index d02270de2..e250a2e9b 100644 --- a/script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol +++ b/script/deployments/ChainLinkOracle/config/SetPriceFeeds.s.sol @@ -31,12 +31,12 @@ contract SetPriceFeedsScript is BaseScript { Check all variables below before execute the deployment script */ - // USDC + // HIGH addSetPriceFeeds( SetPriceFeedsInput({ - token0: usdc, + token0: high, token1: usdPlaceholder, - source: IAggregatorV3(0x51597f405303C4377E36123cBc172b13269EA163) + source: IAggregatorV3(0xdF4Dd957a84F798acFADd448badd2D8b9bC99047) }) ); diff --git a/script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.json b/script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.json deleted file mode 100644 index 18adbeade..000000000 --- a/script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.json +++ /dev/null @@ -1,6772 +0,0 @@ -{ - "abi": [ - { - "inputs": [], - "name": "ChainlinkPriceOracle2_InconsistentLength", - "type": "error" - }, - { - "inputs": [], - "name": "ChainlinkPriceOracle2_InvalidPrice", - "type": "error" - }, - { - "inputs": [], - "name": "ChainlinkPriceOracle2_NoSource", - "type": "error" - }, - { - "inputs": [], - "name": "ChainlinkPriceOracle2_SourceExistedPair", - "type": "error" - }, - { - "inputs": [], - "name": "ChainlinkPriceOracle2_SourceOverLimit", - "type": "error" - }, - { - "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": true, - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "token1", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract AggregatorV3Interface[]", - "name": "sources", - "type": "address[]" - } - ], - "name": "SetPriceFeed", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "name": "getPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "priceFeedCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "priceFeeds", - "outputs": [ - { - "internalType": "contract AggregatorV3Interface", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "token0s", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "token1s", - "type": "address[]" - }, - { - "internalType": "contract AggregatorV3Interface[][]", - "name": "allSources", - "type": "address[][]" - } - ], - "name": "setPriceFeeds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": { - "object": "0x608060405234801561001057600080fd5b50611349806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610109578063ac41865a1461011a578063f2fde38b14610142578063fe23ce531461015557600080fd5b80636fee810c1461008d578063715018a6146100a2578063790a33fc146100aa5780638129fc1c14610101575b600080fd5b6100a061009b366004610ee3565b61018e565b005b6100a0610295565b6100e46100b8366004610f99565b60656020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a06102a9565b6033546001600160a01b03166100e4565b61012d610128366004610fd5565b6103bf565b604080519283526020830191909152016100f8565b6100a0610150366004611008565b610bc0565b610180610163366004610fd5565b606660209081526000928352604080842090915290825290205481565b6040519081526020016100f8565b610196610c36565b84831415806101a55750848114155b156101c357604051632b05b2d760e11b815260040160405180910390fd5b60005b8581101561028c5761027a8787838181106101e3576101e361102a565b90506020020160208101906101f89190611008565b86868481811061020a5761020a61102a565b905060200201602081019061021f9190611008565b8585858181106102315761023161102a565b90506020028101906102439190611040565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610c9092505050565b80610284816110a0565b9150506101c6565b50505050505050565b61029d610c36565b6102a76000610df2565b565b600054610100900460ff16158080156102c95750600054600160ff909116105b806102e35750303b1580156102e3575060005460ff166001145b61034b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561036e576000805461ff0019166101001790555b610376610e44565b80156103bc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b038083166000908152606660209081526040808320938516835292905290812054819015801561041957506001600160a01b03808416600090815260666020908152604080832093881683529290522054155b156104375760405163faab535d60e01b815260040160405180910390fd5b6001600160a01b03808516600090815260666020908152604080832093871683529290529081205481908190819081908190819015610829576001600160a01b03808c1660009081526065602090815260408083208e85168452825280832083805290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa1580156104dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050191906110d5565b9091929350909150508097508198505050606560008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020600080815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e09190611125565b60ff1692506105f083600a61122e565b61060288670de0b6b3a764000061123a565b61060c9190611259565b6001600160a01b03808d166000908152606660209081526040808320938f168352929052205490925060021415610819576001600160a01b03808c1660009081526065602090815260408083208e8516845282528083206001845290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa1580156106ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cf91906110d5565b9091929350909150508095508196505050606560008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b0316815260200190815260200160002060006001815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561078b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107af9190611125565b60ff1692506107bf83600a61122e565b6107d186670de0b6b3a764000061123a565b6107db9190611259565b9050806107f083670de0b6b3a764000061123a565b6107fa9190611259565b8685106108075786610809565b845b9850985050505050505050610bb9565b509650929450610bb99350505050565b6001600160a01b03808b1660009081526065602090815260408083208f85168452825280832083805290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa158015610896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ba91906110d5565b9091929350909150508097508198505050606560008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020600080815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109999190611125565b60ff169250866109aa84600a61122e565b6109bc90670de0b6b3a764000061123a565b6109c69190611259565b9150606660008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205460021415610bae576001600160a01b03808b1660009081526065602090815260408083208f8516845282528083206001845290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906110d5565b9091929350909150508095508196505050606560008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060006001815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611125565b60ff16925084610b9c84600a61122e565b6107d190670de0b6b3a764000061123a565b509650929450505050505b9250929050565b610bc8610c36565b6001600160a01b038116610c2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610342565b6103bc81610df2565b6033546001600160a01b031633146102a75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610342565b6001600160a01b0380831660009081526066602090815260408083209387168352929052205415610cd457604051631880fe7960e31b815260040160405180910390fd5b600281511115610cf7576040516342f612cf60e11b815260040160405180910390fd5b80516001600160a01b0380851660009081526066602090815260408083209387168352929052908120919091555b8151811015610da157818181518110610d4057610d4061102a565b6020908102919091018101516001600160a01b038681166000908152606584526040808220888416835285528082208683529094529290922080546001600160a01b0319169290911691909117905580610d99816110a0565b915050610d25565b50816001600160a01b0316836001600160a01b03167f6152108a07e7f45c64d65b611b5e1dfa7475f6d50a37630badf018bfeaea93aa83604051610de5919061127b565b60405180910390a3505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610e6b5760405162461bcd60e51b8152600401610342906112c8565b6102a7600054610100900460ff16610e955760405162461bcd60e51b8152600401610342906112c8565b6102a733610df2565b60008083601f840112610eb057600080fd5b50813567ffffffffffffffff811115610ec857600080fd5b6020830191508360208260051b8501011115610bb957600080fd5b60008060008060008060608789031215610efc57600080fd5b863567ffffffffffffffff80821115610f1457600080fd5b610f208a838b01610e9e565b90985096506020890135915080821115610f3957600080fd5b610f458a838b01610e9e565b90965094506040890135915080821115610f5e57600080fd5b50610f6b89828a01610e9e565b979a9699509497509295939492505050565b80356001600160a01b0381168114610f9457600080fd5b919050565b600080600060608486031215610fae57600080fd5b610fb784610f7d565b9250610fc560208501610f7d565b9150604084013590509250925092565b60008060408385031215610fe857600080fd5b610ff183610f7d565b9150610fff60208401610f7d565b90509250929050565b60006020828403121561101a57600080fd5b61102382610f7d565b9392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261105757600080fd5b83018035915067ffffffffffffffff82111561107257600080fd5b6020019150600581901b3603821315610bb957600080fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156110b4576110b461108a565b5060010190565b805169ffffffffffffffffffff81168114610f9457600080fd5b600080600080600060a086880312156110ed57600080fd5b6110f6866110bb565b9450602086015193506040860151925060608601519150611119608087016110bb565b90509295509295909350565b60006020828403121561113757600080fd5b815160ff8116811461102357600080fd5b600181815b808511156111835781600019048211156111695761116961108a565b8085161561117657918102915b93841c939080029061114d565b509250929050565b60008261119a57506001611228565b816111a757506000611228565b81600181146111bd57600281146111c7576111e3565b6001915050611228565b60ff8411156111d8576111d861108a565b50506001821b611228565b5060208310610133831016604e8410600b8410161715611206575081810a611228565b6112108383611148565b80600019048211156112245761122461108a565b0290505b92915050565b6000611023838361118b565b60008160001904831182151516156112545761125461108a565b500290565b60008261127657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252825182820181905260009190848201906040850190845b818110156112bc5783516001600160a01b031683529284019291840191600101611297565b50909695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220aae21df20f8f61cdda9b8e01c79f4f7fc30c3f9a66d18f57915120429c87c37664736f6c634300080b0033", - "sourceMap": "530:4305:27:-:0;;;;;;;;;;;;;;;;;;;", - "linkReferences": {} - }, - "deployedBytecode": { - "object": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610109578063ac41865a1461011a578063f2fde38b14610142578063fe23ce531461015557600080fd5b80636fee810c1461008d578063715018a6146100a2578063790a33fc146100aa5780638129fc1c14610101575b600080fd5b6100a061009b366004610ee3565b61018e565b005b6100a0610295565b6100e46100b8366004610f99565b60656020908152600093845260408085208252928452828420905282529020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a06102a9565b6033546001600160a01b03166100e4565b61012d610128366004610fd5565b6103bf565b604080519283526020830191909152016100f8565b6100a0610150366004611008565b610bc0565b610180610163366004610fd5565b606660209081526000928352604080842090915290825290205481565b6040519081526020016100f8565b610196610c36565b84831415806101a55750848114155b156101c357604051632b05b2d760e11b815260040160405180910390fd5b60005b8581101561028c5761027a8787838181106101e3576101e361102a565b90506020020160208101906101f89190611008565b86868481811061020a5761020a61102a565b905060200201602081019061021f9190611008565b8585858181106102315761023161102a565b90506020028101906102439190611040565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610c9092505050565b80610284816110a0565b9150506101c6565b50505050505050565b61029d610c36565b6102a76000610df2565b565b600054610100900460ff16158080156102c95750600054600160ff909116105b806102e35750303b1580156102e3575060005460ff166001145b61034b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff19166001179055801561036e576000805461ff0019166101001790555b610376610e44565b80156103bc576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6001600160a01b038083166000908152606660209081526040808320938516835292905290812054819015801561041957506001600160a01b03808416600090815260666020908152604080832093881683529290522054155b156104375760405163faab535d60e01b815260040160405180910390fd5b6001600160a01b03808516600090815260666020908152604080832093871683529290529081205481908190819081908190819015610829576001600160a01b03808c1660009081526065602090815260408083208e85168452825280832083805290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa1580156104dd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050191906110d5565b9091929350909150508097508198505050606560008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b03168152602001908152602001600020600080815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e09190611125565b60ff1692506105f083600a61122e565b61060288670de0b6b3a764000061123a565b61060c9190611259565b6001600160a01b03808d166000908152606660209081526040808320938f168352929052205490925060021415610819576001600160a01b03808c1660009081526065602090815260408083208e8516845282528083206001845290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa1580156106ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106cf91906110d5565b9091929350909150508095508196505050606560008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008b6001600160a01b03166001600160a01b0316815260200190815260200160002060006001815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561078b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107af9190611125565b60ff1692506107bf83600a61122e565b6107d186670de0b6b3a764000061123a565b6107db9190611259565b9050806107f083670de0b6b3a764000061123a565b6107fa9190611259565b8685106108075786610809565b845b9850985050505050505050610bb9565b509650929450610bb99350505050565b6001600160a01b03808b1660009081526065602090815260408083208f85168452825280832083805290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa158015610896573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ba91906110d5565b9091929350909150508097508198505050606560008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b03168152602001908152602001600020600080815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109999190611125565b60ff169250866109aa84600a61122e565b6109bc90670de0b6b3a764000061123a565b6109c69190611259565b9150606660008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b031681526020019081526020016000205460021415610bae576001600160a01b03808b1660009081526065602090815260408083208f8516845282528083206001845290915290819020548151633fabe5a360e21b8152915192169163feaf968c9160048082019260a0929091908290030181865afa158015610a87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aab91906110d5565b9091929350909150508095508196505050606560008b6001600160a01b03166001600160a01b0316815260200190815260200160002060008c6001600160a01b03166001600160a01b0316815260200190815260200160002060006001815260200190815260200160002060009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190611125565b60ff16925084610b9c84600a61122e565b6107d190670de0b6b3a764000061123a565b509650929450505050505b9250929050565b610bc8610c36565b6001600160a01b038116610c2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610342565b6103bc81610df2565b6033546001600160a01b031633146102a75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610342565b6001600160a01b0380831660009081526066602090815260408083209387168352929052205415610cd457604051631880fe7960e31b815260040160405180910390fd5b600281511115610cf7576040516342f612cf60e11b815260040160405180910390fd5b80516001600160a01b0380851660009081526066602090815260408083209387168352929052908120919091555b8151811015610da157818181518110610d4057610d4061102a565b6020908102919091018101516001600160a01b038681166000908152606584526040808220888416835285528082208683529094529290922080546001600160a01b0319169290911691909117905580610d99816110a0565b915050610d25565b50816001600160a01b0316836001600160a01b03167f6152108a07e7f45c64d65b611b5e1dfa7475f6d50a37630badf018bfeaea93aa83604051610de5919061127b565b60405180910390a3505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610e6b5760405162461bcd60e51b8152600401610342906112c8565b6102a7600054610100900460ff16610e955760405162461bcd60e51b8152600401610342906112c8565b6102a733610df2565b60008083601f840112610eb057600080fd5b50813567ffffffffffffffff811115610ec857600080fd5b6020830191508360208260051b8501011115610bb957600080fd5b60008060008060008060608789031215610efc57600080fd5b863567ffffffffffffffff80821115610f1457600080fd5b610f208a838b01610e9e565b90985096506020890135915080821115610f3957600080fd5b610f458a838b01610e9e565b90965094506040890135915080821115610f5e57600080fd5b50610f6b89828a01610e9e565b979a9699509497509295939492505050565b80356001600160a01b0381168114610f9457600080fd5b919050565b600080600060608486031215610fae57600080fd5b610fb784610f7d565b9250610fc560208501610f7d565b9150604084013590509250925092565b60008060408385031215610fe857600080fd5b610ff183610f7d565b9150610fff60208401610f7d565b90509250929050565b60006020828403121561101a57600080fd5b61102382610f7d565b9392505050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261105757600080fd5b83018035915067ffffffffffffffff82111561107257600080fd5b6020019150600581901b3603821315610bb957600080fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156110b4576110b461108a565b5060010190565b805169ffffffffffffffffffff81168114610f9457600080fd5b600080600080600060a086880312156110ed57600080fd5b6110f6866110bb565b9450602086015193506040860151925060608601519150611119608087016110bb565b90509295509295909350565b60006020828403121561113757600080fd5b815160ff8116811461102357600080fd5b600181815b808511156111835781600019048211156111695761116961108a565b8085161561117657918102915b93841c939080029061114d565b509250929050565b60008261119a57506001611228565b816111a757506000611228565b81600181146111bd57600281146111c7576111e3565b6001915050611228565b60ff8411156111d8576111d861108a565b50506001821b611228565b5060208310610133831016604e8410600b8410161715611206575081810a611228565b6112108383611148565b80600019048211156112245761122461108a565b0290505b92915050565b6000611023838361118b565b60008160001904831182151516156112545761125461108a565b500290565b60008261127657634e487b7160e01b600052601260045260246000fd5b500490565b6020808252825182820181905260009190848201906040850190845b818110156112bc5783516001600160a01b031683529284019291840191600101611297565b50909695505050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220aae21df20f8f61cdda9b8e01c79f4f7fc30c3f9a66d18f57915120429c87c37664736f6c634300080b0033", - "sourceMap": "530:4305:27:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1738:447;;;;;;:::i;:::-;;:::i;:::-;;2071:101:1;;;:::i;1166:99:27:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1166:99:27;;;;;;-1:-1:-1;;;;;2237:32:31;;;2219:51;;2207:2;2192:18;1166:99:27;;;;;;;;1447:89;;;:::i;1441:85:1:-;1513:6;;-1:-1:-1;;;;;1513:6:1;1441:85;;3084:1749:27;;;;;;:::i;:::-;;:::i;:::-;;;;2928:25:31;;;2984:2;2969:18;;2962:34;;;;2901:18;3084:1749:27;2754:248:31;2321:198:1;;;;;;:::i;:::-;;:::i;1269:69:27:-;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;3344:25:31;;;3332:2;3317:18;1269:69:27;3198:177:31;1738:447:27;1334:13:1;:11;:13::i;:::-;1922:32:27;;::::1;;::::0;:71:::1;;-1:-1:-1::0;1958:35:27;;::::1;;1922:71;1918:132;;;2008:42;;-1:-1:-1::0;;;2008:42:27::1;;;;;;;;;;;1918:132;2062:11;2057:124;2079:20:::0;;::::1;2057:124;;;2116:58;2130:7;;2138:3;2130:12;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;2144:7;;2152:3;2144:12;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;2158:10;;2169:3;2158:15;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;2116:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;::::0;;;;-1:-1:-1;2116:13:27::1;::::0;-1:-1:-1;;;2116:58:27:i:1;:::-;2101:5:::0;::::1;::::0;::::1;:::i;:::-;;;;2057:124;;;;1738:447:::0;;;;;;:::o;2071:101:1:-;1334:13;:11;:13::i;:::-;2135:30:::1;2162:1;2135:18;:30::i;:::-;2071:101::o:0;1447:89:27:-;3268:19:2;3291:13;;;;;;3290:14;;3336:34;;;;-1:-1:-1;3354:12:2;;3369:1;3354:12;;;;:16;3336:34;3335:108;;;-1:-1:-1;3415:4:2;1476:19:9;:23;;;3376:66:2;;-1:-1:-1;3425:12:2;;;;;:17;3376:66;3314:201;;;;-1:-1:-1;;;3314:201:2;;4564:2:31;3314:201:2;;;4546:21:31;4603:2;4583:18;;;4576:30;4642:34;4622:18;;;4615:62;-1:-1:-1;;;4693:18:31;;;4686:44;4747:19;;3314:201:2;;;;;;;;;3525:12;:16;;-1:-1:-1;;3525:16:2;3540:1;3525:16;;;3551:65;;;;3585:13;:20;;-1:-1:-1;;3585:20:2;;;;;3551:65;1496:35:27::1;:33;:35::i;:::-;3640:14:2::0;3636:99;;;3686:5;3670:21;;-1:-1:-1;;3670:21:2;;;3710:14;;-1:-1:-1;4929:36:31;;3710:14:2;;4917:2:31;4902:18;3710:14:2;;;;;;;3636:99;3258:483;1447:89:27:o;3084:1749::-;-1:-1:-1;;;;;3194:22:27;;;3166:7;3194:22;;;:14;:22;;;;;;;;:30;;;;;;;;;;;;3166:7;;3194:35;:74;;;;-1:-1:-1;;;;;;3233:22:27;;;;;;;:14;:22;;;;;;;;:30;;;;;;;;;;:35;3194:74;3190:125;;;3283:32;;-1:-1:-1;;;3283:32:27;;;;;;;;;;;3190:125;-1:-1:-1;;;;;3514:22:27;;;3322:15;3514:22;;;:14;:22;;;;;;;;:30;;;;;;;;;;;;3322:15;;;;;;;;;;;;3514:35;3510:693;;-1:-1:-1;;;;;3592:18:27;;;;;;;:10;:18;;;;;;;;:26;;;;;;;;;;:29;;;;;;;;;;;:47;;-1:-1:-1;;;3592:47:27;;;;:29;;;:45;;:47;;;;;;;;;;;;;;;:29;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3559:80;;;;;;;;;;;;;;;;;3667:10;:18;3678:6;-1:-1:-1;;;;;3667:18:27;-1:-1:-1;;;;;3667:18:27;;;;;;;;;;;;:26;3686:6;-1:-1:-1;;;;;3667:26:27;-1:-1:-1;;;;;3667:26:27;;;;;;;;;;;;:29;3694:1;3667:29;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3667:29:27;-1:-1:-1;;;;;3667:38:27;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3659:49;;;-1:-1:-1;3756:13:27;3659:49;3756:2;:13;:::i;:::-;3727:24;3735:8;3747:4;3727:24;:::i;:::-;3726:44;;;;:::i;:::-;-1:-1:-1;;;;;3783:22:27;;;;;;;:14;:22;;;;;;;;:30;;;;;;;;;;3716:54;;-1:-1:-1;3817:1:27;3783:35;3779:379;;;-1:-1:-1;;;;;3863:18:27;;;;;;;:10;:18;;;;;;;;:26;;;;;;;;;;3890:1;3863:29;;;;;;;;;;:47;;-1:-1:-1;;;3863:47:27;;;;:29;;;:45;;:47;;;;;;;;;;;;;;;:29;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3830:80;;;;;;;;;;;;;;;;;3940:10;:18;3951:6;-1:-1:-1;;;;;3940:18:27;-1:-1:-1;;;;;3940:18:27;;;;;;;;;;;;:26;3959:6;-1:-1:-1;;;;;3940:26:27;-1:-1:-1;;;;;3940:26:27;;;;;;;;;;;;:29;3967:1;3940:29;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;3940:29:27;-1:-1:-1;;;;;3940:38:27;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3932:49;;;-1:-1:-1;4031:13:27;3932:49;4031:2;:13;:::i;:::-;4002:24;4010:8;4022:4;4002:24;:::i;:::-;4001:44;;;;:::i;:::-;3991:54;-1:-1:-1;3991:54:27;4064:14;:7;4074:4;4064:14;:::i;:::-;4063:26;;;;:::i;:::-;4106:12;4091;:27;:57;;4136:12;4091:57;;;4121:12;4091:57;4055:94;;;;;;;;;;;;;3779:379;-1:-1:-1;4174:7:27;-1:-1:-1;4183:12:27;;-1:-1:-1;4166:30:27;;-1:-1:-1;;;;4166:30:27;3510:693;-1:-1:-1;;;;;4242:18:27;;;;;;;:10;:18;;;;;;;;:26;;;;;;;;;;:29;;;;;;;;;;;:47;;-1:-1:-1;;;4242:47:27;;;;:29;;;:45;;:47;;;;;;;;;;;;;;;:29;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4209:80;;;;;;;;;;;;;;;;;4315:10;:18;4326:6;-1:-1:-1;;;;;4315:18:27;-1:-1:-1;;;;;4315:18:27;;;;;;;;;;;;:26;4334:6;-1:-1:-1;;;;;4315:26:27;-1:-1:-1;;;;;4315:26:27;;;;;;;;;;;;:29;4342:1;4315:29;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4315:29:27;-1:-1:-1;;;;;4315:38:27;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4307:49;;;-1:-1:-1;4407:8:27;4374:13;4307:49;4374:2;:13;:::i;:::-;4373:22;;4391:4;4373:22;:::i;:::-;4372:44;;;;:::i;:::-;4362:54;;4427:14;:22;4442:6;-1:-1:-1;;;;;4427:22:27;-1:-1:-1;;;;;4427:22:27;;;;;;;;;;;;:30;4450:6;-1:-1:-1;;;;;4427:30:27;-1:-1:-1;;;;;4427:30:27;;;;;;;;;;;;;4461:1;4427:35;4423:369;;;-1:-1:-1;;;;;4505:18:27;;;;;;;:10;:18;;;;;;;;:26;;;;;;;;;;4532:1;4505:29;;;;;;;;;;:47;;-1:-1:-1;;;4505:47:27;;;;:29;;;:45;;:47;;;;;;;;;;;;;;;:29;:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4472:80;;;;;;;;;;;;;;;;;4580:10;:18;4591:6;-1:-1:-1;;;;;4580:18:27;-1:-1:-1;;;;;4580:18:27;;;;;;;;;;;;:26;4599:6;-1:-1:-1;;;;;4580:26:27;-1:-1:-1;;;;;4580:26:27;;;;;;;;;;;;:29;4607:1;4580:29;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4580:29:27;-1:-1:-1;;;;;4580:38:27;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;4572:49;;;-1:-1:-1;4674:8:27;4641:13;4572:49;4641:2;:13;:::i;:::-;4640:22;;4658:4;4640:22;:::i;4423:369::-;-1:-1:-1;4806:7:27;-1:-1:-1;4815:12:27;;-1:-1:-1;;;;;3084:1749:27;;;;;;:::o;2321:198:1:-;1334:13;:11;:13::i;:::-;-1:-1:-1;;;;;2409:22:1;::::1;2401:73;;;::::0;-1:-1:-1;;;2401:73:1;;7887:2:31;2401:73:1::1;::::0;::::1;7869:21:31::0;7926:2;7906:18;;;7899:30;7965:34;7945:18;;;7938:62;-1:-1:-1;;;8016:18:31;;;8009:36;8062:19;;2401:73:1::1;7685:402:31::0;2401:73:1::1;2484:28;2503:8;2484:18;:28::i;1599:130::-:0;1513:6;;-1:-1:-1;;;;;1513:6:1;929:10:10;1662:23:1;1654:68;;;;-1:-1:-1;;;1654:68:1;;8294:2:31;1654:68:1;;;8276:21:31;;;8313:18;;;8306:30;8372:34;8352:18;;;8345:62;8424:18;;1654:68:1;8092:356:31;2375:542:27;-1:-1:-1;;;;;2518:22:27;;;2551:1;2518:22;;;:14;:22;;;;;;;;:30;;;;;;;;;;:34;2514:88;;2561:41;;-1:-1:-1;;;2561:41:27;;;;;;;;;;;2514:88;2629:1;2612:7;:14;:18;2608:70;;;2639:39;;-1:-1:-1;;;2639:39:27;;;;;;;;;;;2608:70;2732:14;;-1:-1:-1;;;;;2699:22:27;;;;;;;:14;:22;;;;;;;;:30;;;;;;;;;;;:47;;;;2752:112;2780:7;:14;2774:3;:20;2752:112;;;2845:7;2853:3;2845:12;;;;;;;;:::i;:::-;;;;;;;;;;;;-1:-1:-1;;;;;2811:18:27;;;;;;;:10;:18;;;;;;:26;;;;;;;;;;:31;;;;;;;;;;:46;;-1:-1:-1;;;;;;2811:46:27;;;;;;;;;;;:31;2796:5;2811:31;2796:5;:::i;:::-;;;;2752:112;;;;2896:6;-1:-1:-1;;;;;2875:37:27;2888:6;-1:-1:-1;;;;;2875:37:27;;2904:7;2875:37;;;;;;:::i;:::-;;;;;;;;2375:542;;;:::o;2673:187:1:-;2765:6;;;-1:-1:-1;;;;;2781:17:1;;;-1:-1:-1;;;;;;2781:17:1;;;;;;;2813:40;;2765:6;;;2781:17;2765:6;;2813:40;;2746:16;;2813:40;2736:124;2673:187;:::o;1003:95::-;5363:13:2;;;;;;;5355:69;;;;-1:-1:-1;;;5355:69:2;;;;;;;:::i;:::-;1065:26:1::1;5363:13:2::0;;;;;;;5355:69;;;;-1:-1:-1;;;5355:69:2;;;;;;;:::i;:::-;1176:32:1::1;929:10:10::0;1176:18:1::1;:32::i;14:367:31:-:0;77:8;87:6;141:3;134:4;126:6;122:17;118:27;108:55;;159:1;156;149:12;108:55;-1:-1:-1;182:20:31;;225:18;214:30;;211:50;;;257:1;254;247:12;211:50;294:4;286:6;282:17;270:29;;354:3;347:4;337:6;334:1;330:14;322:6;318:27;314:38;311:47;308:67;;;371:1;368;361:12;386:1143;599:6;607;615;623;631;639;692:2;680:9;671:7;667:23;663:32;660:52;;;708:1;705;698:12;660:52;748:9;735:23;777:18;818:2;810:6;807:14;804:34;;;834:1;831;824:12;804:34;873:70;935:7;926:6;915:9;911:22;873:70;:::i;:::-;962:8;;-1:-1:-1;847:96:31;-1:-1:-1;1050:2:31;1035:18;;1022:32;;-1:-1:-1;1066:16:31;;;1063:36;;;1095:1;1092;1085:12;1063:36;1134:72;1198:7;1187:8;1176:9;1172:24;1134:72;:::i;:::-;1225:8;;-1:-1:-1;1108:98:31;-1:-1:-1;1313:2:31;1298:18;;1285:32;;-1:-1:-1;1329:16:31;;;1326:36;;;1358:1;1355;1348:12;1326:36;;1397:72;1461:7;1450:8;1439:9;1435:24;1397:72;:::i;:::-;386:1143;;;;-1:-1:-1;386:1143:31;;-1:-1:-1;386:1143:31;;1488:8;;386:1143;-1:-1:-1;;;386:1143:31:o;1534:173::-;1602:20;;-1:-1:-1;;;;;1651:31:31;;1641:42;;1631:70;;1697:1;1694;1687:12;1631:70;1534:173;;;:::o;1712:328::-;1789:6;1797;1805;1858:2;1846:9;1837:7;1833:23;1829:32;1826:52;;;1874:1;1871;1864:12;1826:52;1897:29;1916:9;1897:29;:::i;:::-;1887:39;;1945:38;1979:2;1968:9;1964:18;1945:38;:::i;:::-;1935:48;;2030:2;2019:9;2015:18;2002:32;1992:42;;1712:328;;;;;:::o;2489:260::-;2557:6;2565;2618:2;2606:9;2597:7;2593:23;2589:32;2586:52;;;2634:1;2631;2624:12;2586:52;2657:29;2676:9;2657:29;:::i;:::-;2647:39;;2705:38;2739:2;2728:9;2724:18;2705:38;:::i;:::-;2695:48;;2489:260;;;;;:::o;3007:186::-;3066:6;3119:2;3107:9;3098:7;3094:23;3090:32;3087:52;;;3135:1;3132;3125:12;3087:52;3158:29;3177:9;3158:29;:::i;:::-;3148:39;3007:186;-1:-1:-1;;;3007:186:31:o;3380:127::-;3441:10;3436:3;3432:20;3429:1;3422:31;3472:4;3469:1;3462:15;3496:4;3493:1;3486:15;3512:573;3633:4;3639:6;3699:11;3686:25;3793:2;3789:7;3778:8;3762:14;3758:29;3754:43;3734:18;3730:68;3720:96;;3812:1;3809;3802:12;3720:96;3839:33;;3891:20;;;-1:-1:-1;3934:18:31;3923:30;;3920:50;;;3966:1;3963;3956:12;3920:50;3999:4;3987:17;;-1:-1:-1;4050:1:31;4046:14;;;4030;4026:35;4016:46;;4013:66;;;4075:1;4072;4065:12;4090:127;4151:10;4146:3;4142:20;4139:1;4132:31;4182:4;4179:1;4172:15;4206:4;4203:1;4196:15;4222:135;4261:3;-1:-1:-1;;4282:17:31;;4279:43;;;4302:18;;:::i;:::-;-1:-1:-1;4349:1:31;4338:13;;4222:135::o;4976:179::-;5054:13;;5107:22;5096:34;;5086:45;;5076:73;;5145:1;5142;5135:12;5160:473;5263:6;5271;5279;5287;5295;5348:3;5336:9;5327:7;5323:23;5319:33;5316:53;;;5365:1;5362;5355:12;5316:53;5388:39;5417:9;5388:39;:::i;:::-;5378:49;;5467:2;5456:9;5452:18;5446:25;5436:35;;5511:2;5500:9;5496:18;5490:25;5480:35;;5555:2;5544:9;5540:18;5534:25;5524:35;;5578:49;5622:3;5611:9;5607:19;5578:49;:::i;:::-;5568:59;;5160:473;;;;;;;;:::o;5638:273::-;5706:6;5759:2;5747:9;5738:7;5734:23;5730:32;5727:52;;;5775:1;5772;5765:12;5727:52;5807:9;5801:16;5857:4;5850:5;5846:16;5839:5;5836:27;5826:55;;5877:1;5874;5867:12;5916:422;6005:1;6048:5;6005:1;6062:270;6083:7;6073:8;6070:21;6062:270;;;6142:4;6138:1;6134:6;6130:17;6124:4;6121:27;6118:53;;;6151:18;;:::i;:::-;6201:7;6191:8;6187:22;6184:55;;;6221:16;;;;6184:55;6300:22;;;;6260:15;;;;6062:270;;;6066:3;5916:422;;;;;:::o;6343:806::-;6392:5;6422:8;6412:80;;-1:-1:-1;6463:1:31;6477:5;;6412:80;6511:4;6501:76;;-1:-1:-1;6548:1:31;6562:5;;6501:76;6593:4;6611:1;6606:59;;;;6679:1;6674:130;;;;6586:218;;6606:59;6636:1;6627:10;;6650:5;;;6674:130;6711:3;6701:8;6698:17;6695:43;;;6718:18;;:::i;:::-;-1:-1:-1;;6774:1:31;6760:16;;6789:5;;6586:218;;6888:2;6878:8;6875:16;6869:3;6863:4;6860:13;6856:36;6850:2;6840:8;6837:16;6832:2;6826:4;6823:12;6819:35;6816:77;6813:159;;;-1:-1:-1;6925:19:31;;;6957:5;;6813:159;7004:34;7029:8;7023:4;7004:34;:::i;:::-;7074:6;7070:1;7066:6;7062:19;7053:7;7050:32;7047:58;;;7085:18;;:::i;:::-;7123:20;;-1:-1:-1;6343:806:31;;;;;:::o;7154:131::-;7214:5;7243:36;7270:8;7264:4;7243:36;:::i;7290:168::-;7330:7;7396:1;7392;7388:6;7384:14;7381:1;7378:21;7373:1;7366:9;7359:17;7355:45;7352:71;;;7403:18;;:::i;:::-;-1:-1:-1;7443:9:31;;7290:168::o;7463:217::-;7503:1;7529;7519:132;;7573:10;7568:3;7564:20;7561:1;7554:31;7608:4;7605:1;7598:15;7636:4;7633:1;7626:15;7519:132;-1:-1:-1;7665:9:31;;7463:217::o;8453:686::-;8652:2;8704:21;;;8774:13;;8677:18;;;8796:22;;;8623:4;;8652:2;8875:15;;;;8849:2;8834:18;;;8623:4;8918:195;8932:6;8929:1;8926:13;8918:195;;;8997:13;;-1:-1:-1;;;;;8993:39:31;8981:52;;9088:15;;;;9053:12;;;;9029:1;8947:9;8918:195;;;-1:-1:-1;9130:3:31;;8453:686;-1:-1:-1;;;;;;8453:686:31:o;9144:407::-;9346:2;9328:21;;;9385:2;9365:18;;;9358:30;9424:34;9419:2;9404:18;;9397:62;-1:-1:-1;;;9490:2:31;9475:18;;9468:41;9541:3;9526:19;;9144:407::o", - "linkReferences": {} - }, - "methodIdentifiers": { - "getPrice(address,address)": "ac41865a", - "initialize()": "8129fc1c", - "owner()": "8da5cb5b", - "priceFeedCount(address,address)": "fe23ce53", - "priceFeeds(address,address,uint256)": "790a33fc", - "renounceOwnership()": "715018a6", - "setPriceFeeds(address[],address[],address[][])": "6fee810c", - "transferOwnership(address)": "f2fde38b" - }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.11+commit.d7f03943\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ChainlinkPriceOracle2_InconsistentLength\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainlinkPriceOracle2_InvalidPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainlinkPriceOracle2_NoSource\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainlinkPriceOracle2_SourceExistedPair\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainlinkPriceOracle2_SourceOverLimit\",\"type\":\"error\"},{\"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\":true,\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contract AggregatorV3Interface[]\",\"name\":\"sources\",\"type\":\"address[]\"}],\"name\":\"SetPriceFeed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token0\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"token1\",\"type\":\"address\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"priceFeedCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"priceFeeds\",\"outputs\":[{\"internalType\":\"contract AggregatorV3Interface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"token0s\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"token1s\",\"type\":\"address[]\"},{\"internalType\":\"contract AggregatorV3Interface[][]\",\"name\":\"allSources\",\"type\":\"address[][]\"}],\"name\":\"setPriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getPrice(address,address)\":{\"details\":\"Return the price of token0/token1, multiplied by 1e18\",\"params\":{\"token0\":\"Token0 to set oracle sources\",\"token1\":\"Token1 to set oracle sources\"}},\"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.\"},\"setPriceFeeds(address[],address[],address[][])\":{\"details\":\"Set sources for multiple token pairs\",\"params\":{\"allSources\":\"source for the token pair\",\"token0s\":\"Token0 address to set source\",\"token1s\":\"Token1 address to set source\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"priceFeeds\":{\"details\":\"Mapping from token0, token1 to sources\"}},\"version\":1},\"userdoc\":{\"errors\":{\"ChainlinkPriceOracle2_InconsistentLength()\":[{\"notice\":\"--------------------------------------------------- Errors ---------------------------------------------------\"}]},\"kind\":\"user\",\"methods\":{\"priceFeeds(address,address,uint256)\":{\"notice\":\"--------------------------------------------------- Configurable variables ---------------------------------------------------\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/contracts/8.11/protocol/price-oracle/ChainlinkPriceOracle2.sol\":\"ChainlinkPriceOracle2\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@chainlink/=node_modules/@chainlink/\",\":@ensdomains/=node_modules/@ensdomains/\",\":@openzeppelin/=node_modules/@openzeppelin/\",\":@rari-capital/=node_modules/@rari-capital/\",\":@scientix-finance/=node_modules/@scientix-finance/\",\":@solidity-parser/=node_modules/abi-to-sol/node_modules/@solidity-parser/\",\":@uniswap/=node_modules/@uniswap/\",\":hardhat-deploy/=node_modules/hardhat-deploy/\",\":hardhat/=node_modules/hardhat/\",\":prettier-plugin-solidity/=node_modules/abi-to-sol/node_modules/prettier-plugin-solidity/\"]},\"sources\":{\"node_modules/@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol\":{\"keccak256\":\"0x1862840d741dedb36e774534b877a13b5187555e3b78b8d2815f898b0dc02268\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://64a15f4349aea6e60703f581a6280b71d6adb35ee74d2f3c4f130a2adc3efee3\",\"dweb:/ipfs/QmdVoSQvGfJNPnjQsAs7ZN3ueWghzTa72jSqzhGiQNDpkL\"]},\"node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d7fc8396619de513c96b6e00301b88dd790e83542aab918425633a5f7297a15a\",\"dweb:/ipfs/QmXbP4kiZyp7guuS7xe8KaybnwkRPGrBc2Kbi3vhcTfpxb\"]},\"node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8a313cf42389440e2706837c91370323b85971c06afd6d056d21e2bc86459618\",\"dweb:/ipfs/QmT8XUrUvQ9aZaPKrqgRU2JVGWnaxBcUYJA7Q7K5KcLBSZ\"]},\"node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://72460c66cd1c3b1c11b863e0d8df0a1c56f37743019e468dc312c754f43e3b06\",\"dweb:/ipfs/QmPExYKiNb9PUsgktQBupPaM33kzDHxaYoVeJdLhv8s879\"]},\"node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d6520943ea55fdf5f0bafb39ed909f64de17051bc954ff3e88c9e5621412c79c\",\"dweb:/ipfs/QmWZ4rAKTQbNG2HxGs46AcTXShsVytKeLs7CUCdCSv5N7a\"]},\"solidity/contracts/8.11/protocol/interfaces/IPriceOracle.sol\":{\"keccak256\":\"0x9648d5ceddd2b0e7db74a737c0083bda7d4e793c441b4e6ae456fa532e43dec3\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://09b50f688594471886615c7be8a473fa5573caa9a66439d53e6a7567a5d5e936\",\"dweb:/ipfs/QmQQKMeDxfvcLfG94YV4E5HXywpvgjKS71CUabeRtvtWec\"]},\"solidity/contracts/8.11/protocol/price-oracle/ChainlinkPriceOracle2.sol\":{\"keccak256\":\"0x277d548b09095f3481eb6282cd0700828b829aeaae3faac4144af0ead7ca0c2f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://136f8b7cc7b92f5d9db3356aebc4585e86dc9cfc20853b007676a8bdd8c3d045\",\"dweb:/ipfs/QmdH78YGhc26uKgf4t7j3yprEV47333WMrUBNEwpH7SZkT\"]}},\"version\":1}", - "metadata": { - "compiler": { - "version": "0.8.11+commit.d7f03943" - }, - "language": "Solidity", - "output": { - "abi": [ - { - "inputs": [], - "type": "error", - "name": "ChainlinkPriceOracle2_InconsistentLength" - }, - { - "inputs": [], - "type": "error", - "name": "ChainlinkPriceOracle2_InvalidPrice" - }, - { - "inputs": [], - "type": "error", - "name": "ChainlinkPriceOracle2_NoSource" - }, - { - "inputs": [], - "type": "error", - "name": "ChainlinkPriceOracle2_SourceExistedPair" - }, - { - "inputs": [], - "type": "error", - "name": "ChainlinkPriceOracle2_SourceOverLimit" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "version", - "type": "uint8", - "indexed": false - } - ], - "type": "event", - "name": "Initialized", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "name": "previousOwner", - "type": "address", - "indexed": true - }, - { - "internalType": "address", - "name": "newOwner", - "type": "address", - "indexed": true - } - ], - "type": "event", - "name": "OwnershipTransferred", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address", - "indexed": true - }, - { - "internalType": "address", - "name": "token1", - "type": "address", - "indexed": true - }, - { - "internalType": "contract AggregatorV3Interface[]", - "name": "sources", - "type": "address[]", - "indexed": false - } - ], - "type": "event", - "name": "SetPriceFeed", - "anonymous": false - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token0", - "type": "address" - }, - { - "internalType": "address", - "name": "token1", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function", - "name": "getPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ] - }, - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "function", - "name": "initialize" - }, - { - "inputs": [], - "stateMutability": "view", - "type": "function", - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ] - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function", - "name": "priceFeedCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ] - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "name": "priceFeeds", - "outputs": [ - { - "internalType": "contract AggregatorV3Interface", - "name": "", - "type": "address" - } - ] - }, - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "function", - "name": "renounceOwnership" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "token0s", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "token1s", - "type": "address[]" - }, - { - "internalType": "contract AggregatorV3Interface[][]", - "name": "allSources", - "type": "address[][]" - } - ], - "stateMutability": "nonpayable", - "type": "function", - "name": "setPriceFeeds" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function", - "name": "transferOwnership" - } - ], - "devdoc": { - "kind": "dev", - "methods": { - "getPrice(address,address)": { - "details": "Return the price of token0/token1, multiplied by 1e18", - "params": { - "token0": "Token0 to set oracle sources", - "token1": "Token1 to set oracle sources" - } - }, - "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." - }, - "setPriceFeeds(address[],address[],address[][])": { - "details": "Set sources for multiple token pairs", - "params": { - "allSources": "source for the token pair", - "token0s": "Token0 address to set source", - "token1s": "Token1 address to set source" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "priceFeeds(address,address,uint256)": { - "notice": "--------------------------------------------------- Configurable variables ---------------------------------------------------" - } - }, - "version": 1 - } - }, - "settings": { - "remappings": [ - ":@chainlink/=node_modules/@chainlink/", - ":@ensdomains/=node_modules/@ensdomains/", - ":@openzeppelin/=node_modules/@openzeppelin/", - ":@rari-capital/=node_modules/@rari-capital/", - ":@scientix-finance/=node_modules/@scientix-finance/", - ":@solidity-parser/=node_modules/abi-to-sol/node_modules/@solidity-parser/", - ":@uniswap/=node_modules/@uniswap/", - ":hardhat-deploy/=node_modules/hardhat-deploy/", - ":hardhat/=node_modules/hardhat/", - ":prettier-plugin-solidity/=node_modules/abi-to-sol/node_modules/prettier-plugin-solidity/" - ], - "optimizer": { - "enabled": true, - "runs": 200 - }, - "metadata": { - "bytecodeHash": "ipfs" - }, - "compilationTarget": { - "solidity/contracts/8.11/protocol/price-oracle/ChainlinkPriceOracle2.sol": "ChainlinkPriceOracle2" - }, - "libraries": {} - }, - "sources": { - "node_modules/@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol": { - "keccak256": "0x1862840d741dedb36e774534b877a13b5187555e3b78b8d2815f898b0dc02268", - "urls": [ - "bzz-raw://64a15f4349aea6e60703f581a6280b71d6adb35ee74d2f3c4f130a2adc3efee3", - "dweb:/ipfs/QmdVoSQvGfJNPnjQsAs7ZN3ueWghzTa72jSqzhGiQNDpkL" - ], - "license": "MIT" - }, - "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { - "keccak256": "0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888", - "urls": [ - "bzz-raw://d7fc8396619de513c96b6e00301b88dd790e83542aab918425633a5f7297a15a", - "dweb:/ipfs/QmXbP4kiZyp7guuS7xe8KaybnwkRPGrBc2Kbi3vhcTfpxb" - ], - "license": "MIT" - }, - "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { - "keccak256": "0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271", - "urls": [ - "bzz-raw://8a313cf42389440e2706837c91370323b85971c06afd6d056d21e2bc86459618", - "dweb:/ipfs/QmT8XUrUvQ9aZaPKrqgRU2JVGWnaxBcUYJA7Q7K5KcLBSZ" - ], - "license": "MIT" - }, - "node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { - "keccak256": "0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183", - "urls": [ - "bzz-raw://72460c66cd1c3b1c11b863e0d8df0a1c56f37743019e468dc312c754f43e3b06", - "dweb:/ipfs/QmPExYKiNb9PUsgktQBupPaM33kzDHxaYoVeJdLhv8s879" - ], - "license": "MIT" - }, - "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { - "keccak256": "0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149", - "urls": [ - "bzz-raw://d6520943ea55fdf5f0bafb39ed909f64de17051bc954ff3e88c9e5621412c79c", - "dweb:/ipfs/QmWZ4rAKTQbNG2HxGs46AcTXShsVytKeLs7CUCdCSv5N7a" - ], - "license": "MIT" - }, - "solidity/contracts/8.11/protocol/interfaces/IPriceOracle.sol": { - "keccak256": "0x9648d5ceddd2b0e7db74a737c0083bda7d4e793c441b4e6ae456fa532e43dec3", - "urls": [ - "bzz-raw://09b50f688594471886615c7be8a473fa5573caa9a66439d53e6a7567a5d5e936", - "dweb:/ipfs/QmQQKMeDxfvcLfG94YV4E5HXywpvgjKS71CUabeRtvtWec" - ], - "license": "MIT" - }, - "solidity/contracts/8.11/protocol/price-oracle/ChainlinkPriceOracle2.sol": { - "keccak256": "0x277d548b09095f3481eb6282cd0700828b829aeaae3faac4144af0ead7ca0c2f", - "urls": [ - "bzz-raw://136f8b7cc7b92f5d9db3356aebc4585e86dc9cfc20853b007676a8bdd8c3d045", - "dweb:/ipfs/QmdH78YGhc26uKgf4t7j3yprEV47333WMrUBNEwpH7SZkT" - ], - "license": "MIT" - } - }, - "version": 1 - }, - "ast": { - "absolutePath": "solidity/contracts/8.11/protocol/price-oracle/ChainlinkPriceOracle2.sol", - "id": 7827, - "exportedSymbols": { - "AddressUpgradeable": [ - 1735 - ], - "AggregatorV3Interface": [ - 45 - ], - "ChainlinkPriceOracle2": [ - 7826 - ], - "ContextUpgradeable": [ - 1777 - ], - "IPriceOracle": [ - 5854 - ], - "Initializable": [ - 346 - ], - "OwnableUpgradeable": [ - 177 - ] - }, - "nodeType": "SourceUnit", - "src": "232:4604:27", - "nodes": [ - { - "id": 7339, - "nodeType": "PragmaDirective", - "src": "232:23:27", - "nodes": [], - "literals": [ - "solidity", - "0.8", - ".11" - ] - }, - { - "id": 7340, - "nodeType": "ImportDirective", - "src": "257:75:27", - "nodes": [], - "absolutePath": "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", - "file": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol", - "nameLocation": "-1:-1:-1", - "scope": 7827, - "sourceUnit": 347, - "symbolAliases": [], - "unitAlias": "" - }, - { - "id": 7341, - "nodeType": "ImportDirective", - "src": "333:75:27", - "nodes": [], - "absolutePath": "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", - "file": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol", - "nameLocation": "-1:-1:-1", - "scope": 7827, - "sourceUnit": 178, - "symbolAliases": [], - "unitAlias": "" - }, - { - "id": 7342, - "nodeType": "ImportDirective", - "src": "410:76:27", - "nodes": [], - "absolutePath": "node_modules/@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol", - "file": "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol", - "nameLocation": "-1:-1:-1", - "scope": 7827, - "sourceUnit": 46, - "symbolAliases": [], - "unitAlias": "" - }, - { - "id": 7343, - "nodeType": "ImportDirective", - "src": "488:40:27", - "nodes": [], - "absolutePath": "solidity/contracts/8.11/protocol/interfaces/IPriceOracle.sol", - "file": "../interfaces/IPriceOracle.sol", - "nameLocation": "-1:-1:-1", - "scope": 7827, - "sourceUnit": 5855, - "symbolAliases": [], - "unitAlias": "" - }, - { - "id": 7826, - "nodeType": "ContractDefinition", - "src": "530:4305:27", - "nodes": [ - { - "id": 7350, - "nodeType": "ErrorDefinition", - "src": "730:49:27", - "nodes": [], - "documentation": { - "id": 7348, - "nodeType": "StructuredDocumentation", - "src": "601:126:27", - "text": "---------------------------------------------------\n Errors\n ---------------------------------------------------" - }, - "name": "ChainlinkPriceOracle2_InconsistentLength", - "nameLocation": "736:40:27", - "parameters": { - "id": 7349, - "nodeType": "ParameterList", - "parameters": [], - "src": "776:2:27" - } - }, - { - "id": 7352, - "nodeType": "ErrorDefinition", - "src": "782:43:27", - "nodes": [], - "name": "ChainlinkPriceOracle2_InvalidPrice", - "nameLocation": "788:34:27", - "parameters": { - "id": 7351, - "nodeType": "ParameterList", - "parameters": [], - "src": "822:2:27" - } - }, - { - "id": 7354, - "nodeType": "ErrorDefinition", - "src": "828:39:27", - "nodes": [], - "name": "ChainlinkPriceOracle2_NoSource", - "nameLocation": "834:30:27", - "parameters": { - "id": 7353, - "nodeType": "ParameterList", - "parameters": [], - "src": "864:2:27" - } - }, - { - "id": 7356, - "nodeType": "ErrorDefinition", - "src": "870:48:27", - "nodes": [], - "name": "ChainlinkPriceOracle2_SourceExistedPair", - "nameLocation": "876:39:27", - "parameters": { - "id": 7355, - "nodeType": "ParameterList", - "parameters": [], - "src": "915:2:27" - } - }, - { - "id": 7358, - "nodeType": "ErrorDefinition", - "src": "921:46:27", - "nodes": [], - "name": "ChainlinkPriceOracle2_SourceOverLimit", - "nameLocation": "927:37:27", - "parameters": { - "id": 7357, - "nodeType": "ParameterList", - "parameters": [], - "src": "964:2:27" - } - }, - { - "id": 7368, - "nodeType": "VariableDeclaration", - "src": "1166:99:27", - "nodes": [], - "constant": false, - "documentation": { - "id": 7359, - "nodeType": "StructuredDocumentation", - "src": "971:192:27", - "text": "---------------------------------------------------\n Configurable variables\n ---------------------------------------------------\n @dev Mapping from token0, token1 to sources" - }, - "functionSelector": "790a33fc", - "mutability": "mutable", - "name": "priceFeeds", - "nameLocation": "1255:10:27", - "scope": 7826, - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - }, - "typeName": { - "id": 7367, - "keyType": { - "id": 7360, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1174:7:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1166:81:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - }, - "valueType": { - "id": 7366, - "keyType": { - "id": 7361, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1193:7:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1185:61:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - }, - "valueType": { - "id": 7365, - "keyType": { - "id": 7362, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1212:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "1204:41:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - }, - "valueType": { - "id": 7364, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 7363, - "name": "AggregatorV3Interface", - "nodeType": "IdentifierPath", - "referencedDeclaration": 45, - "src": "1223:21:27" - }, - "referencedDeclaration": 45, - "src": "1223:21:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - } - } - } - }, - "visibility": "public" - }, - { - "id": 7374, - "nodeType": "VariableDeclaration", - "src": "1269:69:27", - "nodes": [], - "constant": false, - "functionSelector": "fe23ce53", - "mutability": "mutable", - "name": "priceFeedCount", - "nameLocation": "1324:14:27", - "scope": 7826, - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "typeName": { - "id": 7373, - "keyType": { - "id": 7369, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1277:7:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1269:47:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - }, - "valueType": { - "id": 7372, - "keyType": { - "id": 7370, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1296:7:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1288:27:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - }, - "valueType": { - "id": 7371, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "1307:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - } - }, - "visibility": "public" - }, - { - "id": 7384, - "nodeType": "EventDefinition", - "src": "1343:100:27", - "nodes": [], - "anonymous": false, - "name": "SetPriceFeed", - "nameLocation": "1349:12:27", - "parameters": { - "id": 7383, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7376, - "indexed": true, - "mutability": "mutable", - "name": "token0", - "nameLocation": "1378:6:27", - "nodeType": "VariableDeclaration", - "scope": 7384, - "src": "1362:22:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7375, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1362:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7378, - "indexed": true, - "mutability": "mutable", - "name": "token1", - "nameLocation": "1402:6:27", - "nodeType": "VariableDeclaration", - "scope": 7384, - "src": "1386:22:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7377, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1386:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7382, - "indexed": false, - "mutability": "mutable", - "name": "sources", - "nameLocation": "1434:7:27", - "nodeType": "VariableDeclaration", - "scope": 7384, - "src": "1410:31:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[]" - }, - "typeName": { - "baseType": { - "id": 7380, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 7379, - "name": "AggregatorV3Interface", - "nodeType": "IdentifierPath", - "referencedDeclaration": 45, - "src": "1410:21:27" - }, - "referencedDeclaration": 45, - "src": "1410:21:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7381, - "nodeType": "ArrayTypeName", - "src": "1410:23:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_storage_ptr", - "typeString": "contract AggregatorV3Interface[]" - } - }, - "visibility": "internal" - } - ], - "src": "1361:81:27" - } - }, - { - "id": 7395, - "nodeType": "FunctionDefinition", - "src": "1447:89:27", - "nodes": [], - "body": { - "id": 7394, - "nodeType": "Block", - "src": "1490:46:27", - "nodes": [], - "statements": [ - { - "expression": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "id": 7389, - "name": "OwnableUpgradeable", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 177, - "src": "1496:18:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_OwnableUpgradeable_$177_$", - "typeString": "type(contract OwnableUpgradeable)" - } - }, - "id": 7391, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "__Ownable_init", - "nodeType": "MemberAccess", - "referencedDeclaration": 72, - "src": "1496:33:27", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", - "typeString": "function ()" - } - }, - "id": 7392, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1496:35:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7393, - "nodeType": "ExpressionStatement", - "src": "1496:35:27" - } - ] - }, - "functionSelector": "8129fc1c", - "implemented": true, - "kind": "function", - "modifiers": [ - { - "id": 7387, - "kind": "modifierInvocation", - "modifierName": { - "id": 7386, - "name": "initializer", - "nodeType": "IdentifierPath", - "referencedDeclaration": 248, - "src": "1478:11:27" - }, - "nodeType": "ModifierInvocation", - "src": "1478:11:27" - } - ], - "name": "initialize", - "nameLocation": "1456:10:27", - "parameters": { - "id": 7385, - "nodeType": "ParameterList", - "parameters": [], - "src": "1466:2:27" - }, - "returnParameters": { - "id": 7388, - "nodeType": "ParameterList", - "parameters": [], - "src": "1490:0:27" - }, - "scope": 7826, - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "id": 7453, - "nodeType": "FunctionDefinition", - "src": "1738:447:27", - "nodes": [], - "body": { - "id": 7452, - "nodeType": "Block", - "src": "1899:286:27", - "nodes": [], - "statements": [ - { - "condition": { - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 7422, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7416, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "expression": { - "id": 7412, - "name": "token0s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7399, - "src": "1922:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7413, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "1922:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "expression": { - "id": 7414, - "name": "token1s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7402, - "src": "1940:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7415, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "1940:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1922:32:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7421, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "expression": { - "id": 7417, - "name": "token0s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7399, - "src": "1958:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7418, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "1958:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "expression": { - "id": 7419, - "name": "allSources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7407, - "src": "1976:10:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_calldata_ptr_$dyn_calldata_ptr", - "typeString": "contract AggregatorV3Interface[] calldata[] calldata" - } - }, - "id": 7420, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "1976:17:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "1958:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1922:71:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7426, - "nodeType": "IfStatement", - "src": "1918:132:27", - "trueBody": { - "errorCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 7423, - "name": "ChainlinkPriceOracle2_InconsistentLength", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7350, - "src": "2008:40:27", - "typeDescriptions": { - "typeIdentifier": "t_function_error_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 7424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2008:42:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7425, - "nodeType": "RevertStatement", - "src": "2001:49:27" - } - }, - { - "body": { - "id": 7450, - "nodeType": "Block", - "src": "2108:73:27", - "statements": [ - { - "expression": { - "arguments": [ - { - "baseExpression": { - "id": 7439, - "name": "token0s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7399, - "src": "2130:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7441, - "indexExpression": { - "id": 7440, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7428, - "src": "2138:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2130:12:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "baseExpression": { - "id": 7442, - "name": "token1s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7402, - "src": "2144:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7444, - "indexExpression": { - "id": 7443, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7428, - "src": "2152:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2144:12:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "baseExpression": { - "id": 7445, - "name": "allSources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7407, - "src": "2158:10:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_calldata_ptr_$dyn_calldata_ptr", - "typeString": "contract AggregatorV3Interface[] calldata[] calldata" - } - }, - "id": 7447, - "indexExpression": { - "id": 7446, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7428, - "src": "2169:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2158:15:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_calldata_ptr", - "typeString": "contract AggregatorV3Interface[] calldata" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_calldata_ptr", - "typeString": "contract AggregatorV3Interface[] calldata" - } - ], - "id": 7438, - "name": "_setPriceFeed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7525, - "src": "2116:13:27", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr_$returns$__$", - "typeString": "function (address,address,contract AggregatorV3Interface[] memory)" - } - }, - "id": 7448, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2116:58:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7449, - "nodeType": "ExpressionStatement", - "src": "2116:58:27" - } - ] - }, - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7434, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7431, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7428, - "src": "2079:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "expression": { - "id": 7432, - "name": "token0s", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7399, - "src": "2085:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[] calldata" - } - }, - "id": 7433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "2085:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2079:20:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7451, - "initializationExpression": { - "assignments": [ - 7428 - ], - "declarations": [ - { - "constant": false, - "id": 7428, - "mutability": "mutable", - "name": "idx", - "nameLocation": "2070:3:27", - "nodeType": "VariableDeclaration", - "scope": 7451, - "src": "2062:11:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7427, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2062:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7430, - "initialValue": { - "hexValue": "30", - "id": 7429, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2076:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2062:15:27" - }, - "loopExpression": { - "expression": { - "id": 7436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2101:5:27", - "subExpression": { - "id": 7435, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7428, - "src": "2101:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7437, - "nodeType": "ExpressionStatement", - "src": "2101:5:27" - }, - "nodeType": "ForStatement", - "src": "2057:124:27" - } - ] - }, - "documentation": { - "id": 7396, - "nodeType": "StructuredDocumentation", - "src": "1540:195:27", - "text": "@dev Set sources for multiple token pairs\n @param token0s Token0 address to set source\n @param token1s Token1 address to set source\n @param allSources source for the token pair" - }, - "functionSelector": "6fee810c", - "implemented": true, - "kind": "function", - "modifiers": [ - { - "id": 7410, - "kind": "modifierInvocation", - "modifierName": { - "id": 7409, - "name": "onlyOwner", - "nodeType": "IdentifierPath", - "referencedDeclaration": 91, - "src": "1889:9:27" - }, - "nodeType": "ModifierInvocation", - "src": "1889:9:27" - } - ], - "name": "setPriceFeeds", - "nameLocation": "1747:13:27", - "parameters": { - "id": 7408, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7399, - "mutability": "mutable", - "name": "token0s", - "nameLocation": "1785:7:27", - "nodeType": "VariableDeclaration", - "scope": 7453, - "src": "1766:26:27", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 7397, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1766:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 7398, - "nodeType": "ArrayTypeName", - "src": "1766:9:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7402, - "mutability": "mutable", - "name": "token1s", - "nameLocation": "1817:7:27", - "nodeType": "VariableDeclaration", - "scope": 7453, - "src": "1798:26:27", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_calldata_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 7400, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1798:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 7401, - "nodeType": "ArrayTypeName", - "src": "1798:9:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7407, - "mutability": "mutable", - "name": "allSources", - "nameLocation": "1865:10:27", - "nodeType": "VariableDeclaration", - "scope": 7453, - "src": "1830:45:27", - "stateVariable": false, - "storageLocation": "calldata", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_calldata_ptr_$dyn_calldata_ptr", - "typeString": "contract AggregatorV3Interface[][]" - }, - "typeName": { - "baseType": { - "baseType": { - "id": 7404, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 7403, - "name": "AggregatorV3Interface", - "nodeType": "IdentifierPath", - "referencedDeclaration": 45, - "src": "1830:21:27" - }, - "referencedDeclaration": 45, - "src": "1830:21:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7405, - "nodeType": "ArrayTypeName", - "src": "1830:23:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_storage_ptr", - "typeString": "contract AggregatorV3Interface[]" - } - }, - "id": 7406, - "nodeType": "ArrayTypeName", - "src": "1830:25:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_storage_$dyn_storage_ptr", - "typeString": "contract AggregatorV3Interface[][]" - } - }, - "visibility": "internal" - } - ], - "src": "1760:119:27" - }, - "returnParameters": { - "id": 7411, - "nodeType": "ParameterList", - "parameters": [], - "src": "1899:0:27" - }, - "scope": 7826, - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "external" - }, - { - "id": 7525, - "nodeType": "FunctionDefinition", - "src": "2375:542:27", - "nodes": [], - "body": { - "id": 7524, - "nodeType": "Block", - "src": "2495:422:27", - "nodes": [], - "statements": [ - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7471, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7465, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "2518:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7467, - "indexExpression": { - "id": 7466, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7458, - "src": "2533:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2518:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7469, - "indexExpression": { - "id": 7468, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7456, - "src": "2541:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2518:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "hexValue": "30", - "id": 7470, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2551:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2518:34:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7475, - "nodeType": "IfStatement", - "src": "2514:88:27", - "trueBody": { - "errorCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 7472, - "name": "ChainlinkPriceOracle2_SourceExistedPair", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7356, - "src": "2561:39:27", - "typeDescriptions": { - "typeIdentifier": "t_function_error_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 7473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2561:41:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7474, - "nodeType": "RevertStatement", - "src": "2554:48:27" - } - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7479, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "expression": { - "id": 7476, - "name": "sources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7462, - "src": "2612:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - }, - "id": 7477, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "2612:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "hexValue": "32", - "id": 7478, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2629:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "2612:18:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7483, - "nodeType": "IfStatement", - "src": "2608:70:27", - "trueBody": { - "errorCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 7480, - "name": "ChainlinkPriceOracle2_SourceOverLimit", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7358, - "src": "2639:37:27", - "typeDescriptions": { - "typeIdentifier": "t_function_error_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 7481, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2639:39:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7482, - "nodeType": "RevertStatement", - "src": "2632:46:27" - } - }, - { - "expression": { - "id": 7491, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "baseExpression": { - "baseExpression": { - "id": 7484, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "2699:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7487, - "indexExpression": { - "id": 7485, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7456, - "src": "2714:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2699:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7488, - "indexExpression": { - "id": 7486, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7458, - "src": "2722:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2699:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "expression": { - "id": 7489, - "name": "sources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7462, - "src": "2732:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - }, - "id": 7490, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "2732:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2699:47:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7492, - "nodeType": "ExpressionStatement", - "src": "2699:47:27" - }, - { - "body": { - "id": 7516, - "nodeType": "Block", - "src": "2803:61:27", - "statements": [ - { - "expression": { - "id": 7514, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7504, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "2811:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7508, - "indexExpression": { - "id": 7505, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7456, - "src": "2822:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2811:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7509, - "indexExpression": { - "id": 7506, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7458, - "src": "2830:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2811:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7510, - "indexExpression": { - "id": 7507, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7494, - "src": "2838:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "2811:31:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "baseExpression": { - "id": 7511, - "name": "sources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7462, - "src": "2845:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - }, - "id": 7513, - "indexExpression": { - "id": 7512, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7494, - "src": "2853:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2845:12:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "src": "2811:46:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7515, - "nodeType": "ExpressionStatement", - "src": "2811:46:27" - } - ] - }, - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7500, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7497, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7494, - "src": "2774:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "expression": { - "id": 7498, - "name": "sources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7462, - "src": "2780:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - }, - "id": 7499, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "src": "2780:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2774:20:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7517, - "initializationExpression": { - "assignments": [ - 7494 - ], - "declarations": [ - { - "constant": false, - "id": 7494, - "mutability": "mutable", - "name": "idx", - "nameLocation": "2765:3:27", - "nodeType": "VariableDeclaration", - "scope": 7517, - "src": "2757:11:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7493, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2757:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7496, - "initialValue": { - "hexValue": "30", - "id": 7495, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2771:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2757:15:27" - }, - "loopExpression": { - "expression": { - "id": 7502, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2796:5:27", - "subExpression": { - "id": 7501, - "name": "idx", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7494, - "src": "2796:3:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7503, - "nodeType": "ExpressionStatement", - "src": "2796:5:27" - }, - "nodeType": "ForStatement", - "src": "2752:112:27" - }, - { - "eventCall": { - "arguments": [ - { - "id": 7519, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7456, - "src": "2888:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "id": 7520, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7458, - "src": "2896:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "id": 7521, - "name": "sources", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7462, - "src": "2904:7:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[] memory" - } - ], - "id": 7518, - "name": "SetPriceFeed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7384, - "src": "2875:12:27", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr_$returns$__$", - "typeString": "function (address,address,contract AggregatorV3Interface[] memory)" - } - }, - "id": 7522, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2875:37:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7523, - "nodeType": "EmitStatement", - "src": "2870:42:27" - } - ] - }, - "documentation": { - "id": 7454, - "nodeType": "StructuredDocumentation", - "src": "2189:183:27", - "text": "@dev Set source for the token pair\n @param token0 Token0 address to set source\n @param token1 Token1 address to set source\n @param sources source for the token pair" - }, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "_setPriceFeed", - "nameLocation": "2384:13:27", - "parameters": { - "id": 7463, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7456, - "mutability": "mutable", - "name": "token0", - "nameLocation": "2411:6:27", - "nodeType": "VariableDeclaration", - "scope": 7525, - "src": "2403:14:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7455, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2403:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7458, - "mutability": "mutable", - "name": "token1", - "nameLocation": "2431:6:27", - "nodeType": "VariableDeclaration", - "scope": 7525, - "src": "2423:14:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7457, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "2423:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7462, - "mutability": "mutable", - "name": "sources", - "nameLocation": "2474:7:27", - "nodeType": "VariableDeclaration", - "scope": 7525, - "src": "2443:38:27", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_memory_ptr", - "typeString": "contract AggregatorV3Interface[]" - }, - "typeName": { - "baseType": { - "id": 7460, - "nodeType": "UserDefinedTypeName", - "pathNode": { - "id": 7459, - "name": "AggregatorV3Interface", - "nodeType": "IdentifierPath", - "referencedDeclaration": 45, - "src": "2443:21:27" - }, - "referencedDeclaration": 45, - "src": "2443:21:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7461, - "nodeType": "ArrayTypeName", - "src": "2443:23:27", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_contract$_AggregatorV3Interface_$45_$dyn_storage_ptr", - "typeString": "contract AggregatorV3Interface[]" - } - }, - "visibility": "internal" - } - ], - "src": "2397:88:27" - }, - "returnParameters": { - "id": 7464, - "nodeType": "ParameterList", - "parameters": [], - "src": "2495:0:27" - }, - "scope": 7826, - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "internal" - }, - { - "id": 7825, - "nodeType": "FunctionDefinition", - "src": "3084:1749:27", - "nodes": [], - "body": { - "id": 7824, - "nodeType": "Block", - "src": "3184:1649:27", - "nodes": [], - "statements": [ - { - "condition": { - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 7552, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7544, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7538, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "3194:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7540, - "indexExpression": { - "id": 7539, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3209:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3194:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7542, - "indexExpression": { - "id": 7541, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3217:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3194:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "hexValue": "30", - "id": 7543, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3228:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3194:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7551, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7545, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "3233:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7547, - "indexExpression": { - "id": 7546, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3248:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3233:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7549, - "indexExpression": { - "id": 7548, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3256:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3233:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "hexValue": "30", - "id": 7550, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3267:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3233:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3194:74:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7556, - "nodeType": "IfStatement", - "src": "3190:125:27", - "trueBody": { - "errorCall": { - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 7553, - "name": "ChainlinkPriceOracle2_NoSource", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7354, - "src": "3283:30:27", - "typeDescriptions": { - "typeIdentifier": "t_function_error_pure$__$returns$__$", - "typeString": "function () pure" - } - }, - "id": 7554, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3283:32:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7555, - "nodeType": "RevertStatement", - "src": "3276:39:27" - } - }, - { - "assignments": [ - 7558 - ], - "declarations": [ - { - "constant": false, - "id": 7558, - "mutability": "mutable", - "name": "_answer1", - "nameLocation": "3329:8:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3322:15:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 7557, - "name": "int256", - "nodeType": "ElementaryTypeName", - "src": "3322:6:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "visibility": "internal" - } - ], - "id": 7560, - "initialValue": { - "hexValue": "30", - "id": 7559, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3340:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3322:19:27" - }, - { - "assignments": [ - 7562 - ], - "declarations": [ - { - "constant": false, - "id": 7562, - "mutability": "mutable", - "name": "_lastUpdate1", - "nameLocation": "3355:12:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3347:20:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7561, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3347:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7564, - "initialValue": { - "hexValue": "30", - "id": 7563, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3370:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3347:24:27" - }, - { - "assignments": [ - 7566 - ], - "declarations": [ - { - "constant": false, - "id": 7566, - "mutability": "mutable", - "name": "_answer2", - "nameLocation": "3384:8:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3377:15:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 7565, - "name": "int256", - "nodeType": "ElementaryTypeName", - "src": "3377:6:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "visibility": "internal" - } - ], - "id": 7568, - "initialValue": { - "hexValue": "30", - "id": 7567, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3395:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3377:19:27" - }, - { - "assignments": [ - 7570 - ], - "declarations": [ - { - "constant": false, - "id": 7570, - "mutability": "mutable", - "name": "_lastUpdate2", - "nameLocation": "3410:12:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3402:20:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7569, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3402:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7572, - "initialValue": { - "hexValue": "30", - "id": 7571, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3425:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3402:24:27" - }, - { - "assignments": [ - 7574 - ], - "declarations": [ - { - "constant": false, - "id": 7574, - "mutability": "mutable", - "name": "_decimals", - "nameLocation": "3440:9:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3432:17:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7573, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3432:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7576, - "initialValue": { - "hexValue": "30", - "id": 7575, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3452:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3432:21:27" - }, - { - "assignments": [ - 7578 - ], - "declarations": [ - { - "constant": false, - "id": 7578, - "mutability": "mutable", - "name": "_price1", - "nameLocation": "3467:7:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3459:15:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7577, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3459:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7580, - "initialValue": { - "hexValue": "30", - "id": 7579, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3477:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3459:19:27" - }, - { - "assignments": [ - 7582 - ], - "declarations": [ - { - "constant": false, - "id": 7582, - "mutability": "mutable", - "name": "_price2", - "nameLocation": "3492:7:27", - "nodeType": "VariableDeclaration", - "scope": 7824, - "src": "3484:15:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7581, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3484:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 7584, - "initialValue": { - "hexValue": "30", - "id": 7583, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3502:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "3484:19:27" - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7591, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7585, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "3514:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7587, - "indexExpression": { - "id": 7586, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3529:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3514:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7589, - "indexExpression": { - "id": 7588, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3537:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3514:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "hexValue": "30", - "id": 7590, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3548:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3514:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7708, - "nodeType": "IfStatement", - "src": "3510:693:27", - "trueBody": { - "id": 7707, - "nodeType": "Block", - "src": "3551:652:27", - "statements": [ - { - "expression": { - "id": 7604, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "components": [ - null, - { - "id": 7592, - "name": "_answer1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7558, - "src": "3562:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - null, - { - "id": 7593, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "3574:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - null - ], - "id": 7594, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "3559:30:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$_t_int256_$__$_t_uint256_$__$", - "typeString": "tuple(,int256,,uint256,)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7595, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "3592:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7597, - "indexExpression": { - "id": 7596, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3603:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3592:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7599, - "indexExpression": { - "id": 7598, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3611:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3592:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7601, - "indexExpression": { - "hexValue": "30", - "id": 7600, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3619:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3592:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7602, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "latestRoundData", - "nodeType": "MemberAccess", - "referencedDeclaration": 44, - "src": "3592:45:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "function () view external returns (uint80,int256,uint256,uint256,uint80)" - } - }, - "id": 7603, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3592:47:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "tuple(uint80,int256,uint256,uint256,uint80)" - } - }, - "src": "3559:80:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7605, - "nodeType": "ExpressionStatement", - "src": "3559:80:27" - }, - { - "expression": { - "id": 7619, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7606, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "3647:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [ - { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7609, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "3667:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7611, - "indexExpression": { - "id": 7610, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3678:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3667:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7613, - "indexExpression": { - "id": 7612, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3686:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3667:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7615, - "indexExpression": { - "hexValue": "30", - "id": 7614, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3694:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3667:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7616, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "decimals", - "nodeType": "MemberAccess", - "referencedDeclaration": 6, - "src": "3667:38:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$", - "typeString": "function () view external returns (uint8)" - } - }, - "id": 7617, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3667:40:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 7608, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3659:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7607, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3659:7:27", - "typeDescriptions": {} - } - }, - "id": 7618, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3659:49:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3647:61:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7620, - "nodeType": "ExpressionStatement", - "src": "3647:61:27" - }, - { - "expression": { - "id": 7634, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7621, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "3716:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7633, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7627, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "arguments": [ - { - "id": 7624, - "name": "_answer1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7558, - "src": "3735:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 7623, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3727:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7622, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3727:7:27", - "typeDescriptions": {} - } - }, - "id": 7625, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3727:17:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7626, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3747:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "3727:24:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7628, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "3726:26:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "hexValue": "3130", - "id": 7629, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3756:2:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "id": 7630, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "3760:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3756:13:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7632, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "3755:15:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3726:44:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3716:54:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7635, - "nodeType": "ExpressionStatement", - "src": "3716:54:27" - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7642, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7636, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "3783:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7638, - "indexExpression": { - "id": 7637, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3798:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3783:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7640, - "indexExpression": { - "id": 7639, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3806:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3783:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "hexValue": "32", - "id": 7641, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3817:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "3783:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7702, - "nodeType": "IfStatement", - "src": "3779:379:27", - "trueBody": { - "id": 7701, - "nodeType": "Block", - "src": "3820:338:27", - "statements": [ - { - "expression": { - "id": 7655, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "components": [ - null, - { - "id": 7643, - "name": "_answer2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7566, - "src": "3833:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - null, - { - "id": 7644, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "3845:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - null - ], - "id": 7645, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "3830:30:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$_t_int256_$__$_t_uint256_$__$", - "typeString": "tuple(,int256,,uint256,)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7646, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "3863:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7648, - "indexExpression": { - "id": 7647, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3874:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3863:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7650, - "indexExpression": { - "id": 7649, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3882:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3863:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7652, - "indexExpression": { - "hexValue": "31", - "id": 7651, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3890:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3863:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7653, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "latestRoundData", - "nodeType": "MemberAccess", - "referencedDeclaration": 44, - "src": "3863:45:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "function () view external returns (uint80,int256,uint256,uint256,uint80)" - } - }, - "id": 7654, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3863:47:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "tuple(uint80,int256,uint256,uint256,uint80)" - } - }, - "src": "3830:80:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7656, - "nodeType": "ExpressionStatement", - "src": "3830:80:27" - }, - { - "expression": { - "id": 7670, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7657, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "3920:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [ - { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7660, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "3940:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7662, - "indexExpression": { - "id": 7661, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "3951:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3940:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7664, - "indexExpression": { - "id": 7663, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "3959:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3940:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7666, - "indexExpression": { - "hexValue": "31", - "id": 7665, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3967:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "3940:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "decimals", - "nodeType": "MemberAccess", - "referencedDeclaration": 6, - "src": "3940:38:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$", - "typeString": "function () view external returns (uint8)" - } - }, - "id": 7668, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3940:40:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 7659, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "3932:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7658, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3932:7:27", - "typeDescriptions": {} - } - }, - "id": 7669, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3932:49:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3920:61:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7671, - "nodeType": "ExpressionStatement", - "src": "3920:61:27" - }, - { - "expression": { - "id": 7685, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7672, - "name": "_price2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7582, - "src": "3991:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7684, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7678, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "arguments": [ - { - "id": 7675, - "name": "_answer2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7566, - "src": "4010:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 7674, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4002:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7673, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4002:7:27", - "typeDescriptions": {} - } - }, - "id": 7676, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4002:17:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7677, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4022:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "4002:24:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7679, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4001:26:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7682, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "hexValue": "3130", - "id": 7680, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4031:2:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "id": 7681, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "4035:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4031:13:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7683, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4030:15:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4001:44:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3991:54:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7686, - "nodeType": "ExpressionStatement", - "src": "3991:54:27" - }, - { - "expression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7692, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7689, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7687, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "4064:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7688, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4074:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "4064:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7690, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4063:16:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "id": 7691, - "name": "_price2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7582, - "src": "4082:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4063:26:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7695, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7693, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "4091:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "id": 7694, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4106:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4091:27:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseExpression": { - "id": 7697, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4136:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7698, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "Conditional", - "src": "4091:57:27", - "trueExpression": { - "id": 7696, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "4121:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7699, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4062:87:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "functionReturnParameters": 7537, - "id": 7700, - "nodeType": "Return", - "src": "4055:94:27" - } - ] - } - }, - { - "expression": { - "components": [ - { - "id": 7703, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "4174:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 7704, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4183:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7705, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4173:23:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "functionReturnParameters": 7537, - "id": 7706, - "nodeType": "Return", - "src": "4166:30:27" - } - ] - } - }, - { - "expression": { - "id": 7721, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "components": [ - null, - { - "id": 7709, - "name": "_answer1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7558, - "src": "4212:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - null, - { - "id": 7710, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4224:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - null - ], - "id": 7711, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "4209:30:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$_t_int256_$__$_t_uint256_$__$", - "typeString": "tuple(,int256,,uint256,)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7712, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "4242:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7714, - "indexExpression": { - "id": 7713, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "4253:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4242:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7716, - "indexExpression": { - "id": 7715, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "4261:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4242:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7718, - "indexExpression": { - "hexValue": "30", - "id": 7717, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4269:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4242:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7719, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "latestRoundData", - "nodeType": "MemberAccess", - "referencedDeclaration": 44, - "src": "4242:45:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "function () view external returns (uint80,int256,uint256,uint256,uint80)" - } - }, - "id": 7720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4242:47:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "tuple(uint80,int256,uint256,uint256,uint80)" - } - }, - "src": "4209:80:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7722, - "nodeType": "ExpressionStatement", - "src": "4209:80:27" - }, - { - "expression": { - "id": 7736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7723, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "4295:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [ - { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7726, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "4315:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7728, - "indexExpression": { - "id": 7727, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "4326:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4315:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7730, - "indexExpression": { - "id": 7729, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "4334:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4315:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7732, - "indexExpression": { - "hexValue": "30", - "id": 7731, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4342:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4315:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7733, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "decimals", - "nodeType": "MemberAccess", - "referencedDeclaration": 6, - "src": "4315:38:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$", - "typeString": "function () view external returns (uint8)" - } - }, - "id": 7734, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4315:40:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 7725, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4307:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7724, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4307:7:27", - "typeDescriptions": {} - } - }, - "id": 7735, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4307:49:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4295:61:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7737, - "nodeType": "ExpressionStatement", - "src": "4295:61:27" - }, - { - "expression": { - "id": 7751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7738, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "4362:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7750, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7744, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7741, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "hexValue": "3130", - "id": 7739, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4374:2:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "id": 7740, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "4378:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4374:13:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7742, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4373:15:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7743, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4391:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "4373:22:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7745, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4372:24:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "arguments": [ - { - "id": 7748, - "name": "_answer1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7558, - "src": "4407:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 7747, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4399:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7746, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4399:7:27", - "typeDescriptions": {} - } - }, - "id": 7749, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4399:17:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4372:44:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4362:54:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7752, - "nodeType": "ExpressionStatement", - "src": "4362:54:27" - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7759, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "baseExpression": { - "baseExpression": { - "id": 7753, - "name": "priceFeedCount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7374, - "src": "4427:14:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$", - "typeString": "mapping(address => mapping(address => uint256))" - } - }, - "id": 7755, - "indexExpression": { - "id": 7754, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "4442:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4427:22:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", - "typeString": "mapping(address => uint256)" - } - }, - "id": 7757, - "indexExpression": { - "id": 7756, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "4450:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4427:30:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "hexValue": "32", - "id": 7758, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4461:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - }, - "src": "4427:35:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 7819, - "nodeType": "IfStatement", - "src": "4423:369:27", - "trueBody": { - "id": 7818, - "nodeType": "Block", - "src": "4464:328:27", - "statements": [ - { - "expression": { - "id": 7772, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "components": [ - null, - { - "id": 7760, - "name": "_answer2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7566, - "src": "4475:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - null, - { - "id": 7761, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "4487:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - null - ], - "id": 7762, - "isConstant": false, - "isInlineArray": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "TupleExpression", - "src": "4472:30:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$_t_int256_$__$_t_uint256_$__$", - "typeString": "tuple(,int256,,uint256,)" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7763, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "4505:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7765, - "indexExpression": { - "id": 7764, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "4516:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4505:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7767, - "indexExpression": { - "id": 7766, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "4524:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4505:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7769, - "indexExpression": { - "hexValue": "31", - "id": 7768, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4532:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4505:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7770, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "latestRoundData", - "nodeType": "MemberAccess", - "referencedDeclaration": 44, - "src": "4505:45:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "function () view external returns (uint80,int256,uint256,uint256,uint80)" - } - }, - "id": 7771, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4505:47:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint80_$_t_int256_$_t_uint256_$_t_uint256_$_t_uint80_$", - "typeString": "tuple(uint80,int256,uint256,uint256,uint80)" - } - }, - "src": "4472:80:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 7773, - "nodeType": "ExpressionStatement", - "src": "4472:80:27" - }, - { - "expression": { - "id": 7787, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7774, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "4560:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "arguments": [ - { - "arguments": [], - "expression": { - "argumentTypes": [], - "expression": { - "baseExpression": { - "baseExpression": { - "baseExpression": { - "id": 7777, - "name": "priceFeeds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7368, - "src": "4580:10:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$_$", - "typeString": "mapping(address => mapping(address => mapping(uint256 => contract AggregatorV3Interface)))" - } - }, - "id": 7779, - "indexExpression": { - "id": 7778, - "name": "token1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7530, - "src": "4591:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4580:18:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$_$", - "typeString": "mapping(address => mapping(uint256 => contract AggregatorV3Interface))" - } - }, - "id": 7781, - "indexExpression": { - "id": 7780, - "name": "token0", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7528, - "src": "4599:6:27", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4580:26:27", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_contract$_AggregatorV3Interface_$45_$", - "typeString": "mapping(uint256 => contract AggregatorV3Interface)" - } - }, - "id": 7783, - "indexExpression": { - "hexValue": "31", - "id": 7782, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4607:1:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4580:29:27", - "typeDescriptions": { - "typeIdentifier": "t_contract$_AggregatorV3Interface_$45", - "typeString": "contract AggregatorV3Interface" - } - }, - "id": 7784, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "decimals", - "nodeType": "MemberAccess", - "referencedDeclaration": 6, - "src": "4580:38:27", - "typeDescriptions": { - "typeIdentifier": "t_function_external_view$__$returns$_t_uint8_$", - "typeString": "function () view external returns (uint8)" - } - }, - "id": 7785, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4580:40:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint8", - "typeString": "uint8" - } - ], - "id": 7776, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4572:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7775, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4572:7:27", - "typeDescriptions": {} - } - }, - "id": 7786, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4572:49:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4560:61:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7788, - "nodeType": "ExpressionStatement", - "src": "4560:61:27" - }, - { - "expression": { - "id": 7802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "id": 7789, - "name": "_price2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7582, - "src": "4629:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7801, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7795, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7792, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "hexValue": "3130", - "id": 7790, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4641:2:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "nodeType": "BinaryOperation", - "operator": "**", - "rightExpression": { - "id": 7791, - "name": "_decimals", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7574, - "src": "4645:9:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4641:13:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7793, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4640:15:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7794, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4658:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "4640:22:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7796, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4639:24:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "arguments": [ - { - "id": 7799, - "name": "_answer2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7566, - "src": "4674:8:27", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 7798, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "4666:7:27", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": { - "id": 7797, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "4666:7:27", - "typeDescriptions": {} - } - }, - "id": 7800, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4666:17:27", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4639:44:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4629:54:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7803, - "nodeType": "ExpressionStatement", - "src": "4629:54:27" - }, - { - "expression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7809, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "components": [ - { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7806, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7804, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "4700:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "*", - "rightExpression": { - "hexValue": "31653138", - "id": 7805, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4710:4:27", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1e18" - }, - "src": "4700:14:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7807, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4699:16:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "/", - "rightExpression": { - "id": 7808, - "name": "_price2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7582, - "src": "4718:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4699:26:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 7812, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 7810, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "4727:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "id": 7811, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4742:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4727:27:27", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseExpression": { - "id": 7814, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4772:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 7815, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "Conditional", - "src": "4727:57:27", - "trueExpression": { - "id": 7813, - "name": "_lastUpdate2", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7570, - "src": "4757:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7816, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4698:87:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "functionReturnParameters": 7537, - "id": 7817, - "nodeType": "Return", - "src": "4691:94:27" - } - ] - } - }, - { - "expression": { - "components": [ - { - "id": 7820, - "name": "_price1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7578, - "src": "4806:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "id": 7821, - "name": "_lastUpdate1", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7562, - "src": "4815:12:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "id": 7822, - "isConstant": false, - "isInlineArray": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "TupleExpression", - "src": "4805:23:27", - "typeDescriptions": { - "typeIdentifier": "t_tuple$_t_uint256_$_t_uint256_$", - "typeString": "tuple(uint256,uint256)" - } - }, - "functionReturnParameters": 7537, - "id": 7823, - "nodeType": "Return", - "src": "4798:30:27" - } - ] - }, - "baseFunctions": [ - 5853 - ], - "documentation": { - "id": 7526, - "nodeType": "StructuredDocumentation", - "src": "2921:160:27", - "text": "@dev Return the price of token0/token1, multiplied by 1e18\n @param token0 Token0 to set oracle sources\n @param token1 Token1 to set oracle sources" - }, - "functionSelector": "ac41865a", - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getPrice", - "nameLocation": "3093:8:27", - "overrides": { - "id": 7532, - "nodeType": "OverrideSpecifier", - "overrides": [], - "src": "3148:8:27" - }, - "parameters": { - "id": 7531, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7528, - "mutability": "mutable", - "name": "token0", - "nameLocation": "3110:6:27", - "nodeType": "VariableDeclaration", - "scope": 7825, - "src": "3102:14:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7527, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3102:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7530, - "mutability": "mutable", - "name": "token1", - "nameLocation": "3126:6:27", - "nodeType": "VariableDeclaration", - "scope": 7825, - "src": "3118:14:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 7529, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "3118:7:27", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "visibility": "internal" - } - ], - "src": "3101:32:27" - }, - "returnParameters": { - "id": 7537, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7534, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 7825, - "src": "3166:7:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7533, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3166:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - }, - { - "constant": false, - "id": 7536, - "mutability": "mutable", - "name": "", - "nameLocation": "-1:-1:-1", - "nodeType": "VariableDeclaration", - "scope": 7825, - "src": "3175:7:27", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 7535, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "3175:7:27", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "src": "3165:18:27" - }, - "scope": 7826, - "stateMutability": "view", - "virtual": false, - "visibility": "external" - } - ], - "abstract": false, - "baseContracts": [ - { - "baseName": { - "id": 7344, - "name": "OwnableUpgradeable", - "nodeType": "IdentifierPath", - "referencedDeclaration": 177, - "src": "564:18:27" - }, - "id": 7345, - "nodeType": "InheritanceSpecifier", - "src": "564:18:27" - }, - { - "baseName": { - "id": 7346, - "name": "IPriceOracle", - "nodeType": "IdentifierPath", - "referencedDeclaration": 5854, - "src": "584:12:27" - }, - "id": 7347, - "nodeType": "InheritanceSpecifier", - "src": "584:12:27" - } - ], - "canonicalName": "ChainlinkPriceOracle2", - "contractDependencies": [], - "contractKind": "contract", - "fullyImplemented": true, - "linearizedBaseContracts": [ - 7826, - 5854, - 177, - 1777, - 346 - ], - "name": "ChainlinkPriceOracle2", - "nameLocation": "539:21:27", - "scope": 7827, - "usedErrors": [ - 7350, - 7352, - 7354, - 7356, - 7358 - ] - } - ], - "license": "MIT" - }, - "id": 27 -} \ No newline at end of file diff --git a/script/deployments/MiniFL/config/SetPool.s.sol b/script/deployments/MiniFL/config/SetPool.s.sol index 9bb5a5da0..a5bceb50f 100644 --- a/script/deployments/MiniFL/config/SetPool.s.sol +++ b/script/deployments/MiniFL/config/SetPool.s.sol @@ -51,16 +51,16 @@ contract SetPoolScript is BaseScript { _stopBroadcast(); } - function setIbAllocPoint(address _token, uint256 _allocaPoint) internal { + function setIbAllocPoint(address _token, uint256 _allocPoint) internal { address _ibToken = moneyMarket.getIbTokenFromToken(_token); uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_ibToken); - setPoolAllocPoint(_pid, _allocaPoint); + setPoolAllocPoint(_pid, _allocPoint); } - function setDebtAllocPoint(address _token, uint256 _allocaPoint) internal { + function setDebtAllocPoint(address _token, uint256 _allocPoint) internal { address _debtToken = moneyMarket.getDebtTokenFromToken(_token); uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_debtToken); - setPoolAllocPoint(_pid, _allocaPoint); + setPoolAllocPoint(_pid, _allocPoint); } function setPoolAllocPoint(uint256 _pid, uint256 _allocPoint) internal { diff --git a/script/deployments/MiniFL/config/SetPoolRewarders.s.sol b/script/deployments/MiniFL/config/SetPoolRewarders.s.sol new file mode 100644 index 000000000..0d41493dc --- /dev/null +++ b/script/deployments/MiniFL/config/SetPoolRewarders.s.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +contract SetPoolRewardersScript is BaseScript { + struct SetPoolRewarderInput { + uint256 pId; + address[] rewarders; + } + + SetPoolRewarderInput[] setPoolRewarderInputs; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + address[] memory rewarders = new address[](1); + rewarders[0] = 0x7180f062aa725057EB110224a262f64978e89b24; + + setIbPoolRewarders(high, rewarders); + setDebtPoolRewarders(high, rewarders); + + //---- execution ----// + _startDeployerBroadcast(); + + for (uint256 i; i < setPoolRewarderInputs.length; i++) { + miniFL.setPoolRewarders(setPoolRewarderInputs[i].pId, setPoolRewarderInputs[i].rewarders); + + writeRewarderToMiniFLPool(setPoolRewarderInputs[i].pId, setPoolRewarderInputs[i].rewarders); + } + + _stopBroadcast(); + } + + function setIbPoolRewarders(address _token, address[] memory _rewarders) internal { + address _ibToken = moneyMarket.getIbTokenFromToken(_token); + uint256 _pId = moneyMarket.getMiniFLPoolIdOfToken(_ibToken); + setPoolRewarders(_pId, _rewarders); + } + + function setDebtPoolRewarders(address _token, address[] memory _rewarders) internal { + address _debtToken = moneyMarket.getDebtTokenFromToken(_token); + uint256 _pId = moneyMarket.getMiniFLPoolIdOfToken(_debtToken); + setPoolRewarders(_pId, _rewarders); + } + + function setPoolRewarders(uint256 _pId, address[] memory _rewarders) internal { + setPoolRewarderInputs.push(SetPoolRewarderInput({ pId: _pId, rewarders: _rewarders })); + } + + function writeRewarderToMiniFLPool(uint256 _pId, address[] memory _rewarders) internal { + uint256 rewardersLength = _rewarders.length; + string[] memory cmds = new string[](6 + rewardersLength); + cmds[0] = "npx"; + cmds[1] = "ts-node"; + cmds[2] = "./type-script/scripts/set-mini-fl-pool-rewarders.ts"; + cmds[3] = "--pid"; + cmds[4] = vm.toString(_pId); + cmds[5] = "--rewarderAddress"; + + for (uint256 i; i < rewardersLength; i++) { + cmds[6 + i] = vm.toString(_rewarders[i]); + } + + vm.ffi(cmds); + } +} diff --git a/script/deployments/MoneyMarket/config/OpenMarket.s.sol b/script/deployments/MoneyMarket/config/OpenMarket.s.sol index abed4c176..13a2e8b48 100644 --- a/script/deployments/MoneyMarket/config/OpenMarket.s.sol +++ b/script/deployments/MoneyMarket/config/OpenMarket.s.sol @@ -31,81 +31,16 @@ contract OpenMarketScript is BaseScript { */ _startDeployerBroadcast(); - // WBNB + // HIGH executeOpenMarket( OpenMarketInput({ - token: wbnb, + token: high, interestModel: doubleSlope1, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 8000, - borrowingFactor: 8500, - maxCollateral: 250_000 ether, - maxBorrow: 200_000 ether - }) - ); - - // USDC - executeOpenMarket( - OpenMarketInput({ - token: usdc, - interestModel: doubleSlope3, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 9000, - borrowingFactor: 9400, - maxCollateral: 75_000_000 ether, - maxBorrow: 50_000_000 ether - }) - ); - - // USDT - executeOpenMarket( - OpenMarketInput({ - token: usdt, - interestModel: doubleSlope3, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 9000, - borrowingFactor: 9400, - maxCollateral: 75_000_000 ether, - maxBorrow: 50_000_000 ether - }) - ); - - // BUSD - executeOpenMarket( - OpenMarketInput({ - token: busd, - interestModel: doubleSlope3, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 9000, - borrowingFactor: 9400, - maxCollateral: 75_000_000 ether, - maxBorrow: 50_000_000 ether - }) - ); - - // BTCB - executeOpenMarket( - OpenMarketInput({ - token: btcb, - interestModel: doubleSlope2, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 8800, - borrowingFactor: 9100, - maxCollateral: 5_000 ether, - maxBorrow: 4_500 ether - }) - ); - - // ETH - executeOpenMarket( - OpenMarketInput({ - token: eth, - interestModel: doubleSlope2, - tier: LibConstant.AssetTier.COLLATERAL, - collateralFactor: 8800, - borrowingFactor: 9100, - maxCollateral: 50_000 ether, - maxBorrow: 45_000 ether + tier: LibConstant.AssetTier.CROSS, + collateralFactor: 0, + borrowingFactor: 5000, + maxCollateral: 0 ether, + maxBorrow: 500_000 ether }) ); diff --git a/script/deployments/MoneyMarket/config/SetFlashloanParams.s.sol b/script/deployments/MoneyMarket/config/SetFlashloanParams.s.sol new file mode 100644 index 000000000..b094208e5 --- /dev/null +++ b/script/deployments/MoneyMarket/config/SetFlashloanParams.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +contract SetFlashloanParamsScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + uint16 flashloanFeeBps = 19; + uint16 lenderFlashloanBps = 7000; + address flashloanTreasury = 0xFeCfcd99B496e044166086dd2F29E2FC2bb6Dd64; + + //---- execution ----// + _startDeployerBroadcast(); + + moneyMarket.setFlashloanParams(flashloanFeeBps, lenderFlashloanBps, flashloanTreasury); + + _stopBroadcast(); + } +} diff --git a/script/deployments/MoneyMarket/config/SetOperatorsOk.s.sol b/script/deployments/MoneyMarket/config/SetOperatorsOk.s.sol new file mode 100644 index 000000000..e0ff8823a --- /dev/null +++ b/script/deployments/MoneyMarket/config/SetOperatorsOk.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +contract SetOperatorsOkScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + bool isOk = true; + address[] memory operators = new address[](1); + operators[0] = 0xC44f82b07Ab3E691F826951a6E335E1bC1bB0B51; + + //---- execution ----// + _startDeployerBroadcast(); + + moneyMarket.setOperatorsOk(operators, isOk); + + _stopBroadcast(); + } +} diff --git a/script/deployments/MoneyMarket/deploy/AdminFacet.s.sol b/script/deployments/MoneyMarket/deploy/AdminFacet.s.sol new file mode 100644 index 000000000..8aa20c5a0 --- /dev/null +++ b/script/deployments/MoneyMarket/deploy/AdminFacet.s.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { AdminFacet } from "solidity/contracts/money-market/facets/AdminFacet.sol"; + +contract DeployAdminFacetScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + _startDeployerBroadcast(); + + address adminFacet = address(new AdminFacet()); + + _stopBroadcast(); + + _writeJson(vm.toString(adminFacet), ".moneyMarket.facets.adminFacet"); + } +} diff --git a/script/deployments/MoneyMarket/deploy/FlashloanFacet.s.sol b/script/deployments/MoneyMarket/deploy/FlashloanFacet.s.sol new file mode 100644 index 000000000..8ef105e9f --- /dev/null +++ b/script/deployments/MoneyMarket/deploy/FlashloanFacet.s.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { FlashloanFacet } from "solidity/contracts/money-market/facets/FlashloanFacet.sol"; + +contract DeployFlashloanFacetScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + _startDeployerBroadcast(); + + address flashloanFacet = address(new FlashloanFacet()); + + _stopBroadcast(); + + _writeJson(vm.toString(flashloanFacet), ".moneyMarket.facets.flashloanFacet"); + } +} diff --git a/script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol b/script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol index b14c65a00..b6d5ed6c8 100644 --- a/script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol +++ b/script/deployments/MoneyMarket/deploy/MoneyMarket.s.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: BUSL +// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import "solidity/tests/utils/StdJson.sol"; diff --git a/script/deployments/MoneyMarket/deploy/ViewFacet.s.sol b/script/deployments/MoneyMarket/deploy/ViewFacet.s.sol new file mode 100644 index 000000000..19a9f6c7b --- /dev/null +++ b/script/deployments/MoneyMarket/deploy/ViewFacet.s.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { ViewFacet } from "solidity/contracts/money-market/facets/ViewFacet.sol"; + +contract DeployViewFacetScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + _startDeployerBroadcast(); + + address viewFacet = address(new ViewFacet()); + + _stopBroadcast(); + + _writeJson(vm.toString(viewFacet), ".moneyMarket.facets.viewFacet"); + } +} diff --git a/script/deployments/ChainLinkOracle2/config/SetPriceFeeds.s.sol b/script/deployments/MoneyMarket/diamond-cut/FlashloanFacetCut.s.sol similarity index 57% rename from script/deployments/ChainLinkOracle2/config/SetPriceFeeds.s.sol rename to script/deployments/MoneyMarket/diamond-cut/FlashloanFacetCut.s.sol index eac2e326b..fa641cc90 100644 --- a/script/deployments/ChainLinkOracle2/config/SetPriceFeeds.s.sol +++ b/script/deployments/MoneyMarket/diamond-cut/FlashloanFacetCut.s.sol @@ -3,10 +3,10 @@ pragma solidity 0.8.19; import "../../../BaseScript.sol"; -import { IChainLinkPriceOracle2 } from "solidity/contracts/oracle/interfaces/IChainLinkPriceOracle2.sol"; -import { IAggregatorV3 } from "solidity/contracts/oracle/interfaces/IAggregatorV3.sol"; +import { IMMDiamondCut } from "solidity/contracts/money-market/interfaces/IMMDiamondCut.sol"; +import { IFlashloanFacet } from "solidity/contracts/money-market/interfaces/IFlashloanFacet.sol"; -contract SetPriceFeedsScript is BaseScript { +contract DiamondCutFlashloanFacetScript is BaseScript { using stdJson for string; function run() public { @@ -20,33 +20,25 @@ contract SetPriceFeedsScript is BaseScript { Check all variables below before execute the deployment script */ - address _chainLinkPriceOracle2 = 0xEe13333120968d13811Eb2FF7f434ae138578B3e; - address[] memory token0s = new address[](2); - address[] memory token1s = new address[](2); - IAggregatorV3[][] memory allSources = new IAggregatorV3[][](2); + address flashloanFacet = 0x767adcb3650BAB4FEA44469fCe3FA66D767Bc22c; - IAggregatorV3[] memory sources; + IMMDiamondCut.FacetCut[] memory facetCuts = new IMMDiamondCut.FacetCut[](1); - // CAKE - sources = new IAggregatorV3[](1); - sources[0] = IAggregatorV3(0xB6064eD41d4f67e353768aA239cA86f4F73665a1); - - token0s[0] = cake; - token1s[0] = usdPlaceholder; - allSources[0] = sources; - - // DOT - sources = new IAggregatorV3[](1); - sources[0] = IAggregatorV3(0xC333eb0086309a16aa7c8308DfD32c8BBA0a2592); - - token0s[1] = dot; - token1s[1] = usdPlaceholder; - allSources[1] = sources; + facetCuts[0] = IMMDiamondCut.FacetCut({ + action: IMMDiamondCut.FacetCutAction.Add, + facetAddress: flashloanFacet, + functionSelectors: getFlashloanFacetSelectors() + }); _startDeployerBroadcast(); - IChainLinkPriceOracle2(_chainLinkPriceOracle2).setPriceFeeds(token0s, token1s, allSources); + IMMDiamondCut(address(moneyMarket)).diamondCut(facetCuts, address(0), ""); _stopBroadcast(); } + + function getFlashloanFacetSelectors() internal pure returns (bytes4[] memory _selectors) { + _selectors = new bytes4[](1); + _selectors[0] = IFlashloanFacet.flashloan.selector; + } } diff --git a/script/deployments/OracleMedianizer/config/SetMultiPrimarySources.s.sol b/script/deployments/OracleMedianizer/config/SetMultiPrimarySources.s.sol index c0a9c2512..6edf20307 100644 --- a/script/deployments/OracleMedianizer/config/SetMultiPrimarySources.s.sol +++ b/script/deployments/OracleMedianizer/config/SetMultiPrimarySources.s.sol @@ -40,43 +40,10 @@ contract SetMultiPrimarySourcesScript is BaseScript { Check all variables below before execute the deployment script */ - // USDC + // HIGH addSetMultiPrimarySources( SetMultiPrimarySourcesInput({ - token0: usdc, - token1: usdPlaceholder, - maxPriceDeviation: 1e18, - maxPriceStale: 1 days, - priceSources: chainlinkPriceSource - }) - ); - - // BTCB - addSetMultiPrimarySources( - SetMultiPrimarySourcesInput({ - token0: btcb, - token1: usdPlaceholder, - maxPriceDeviation: 1e18, - maxPriceStale: 1 days, - priceSources: chainlinkPriceSource - }) - ); - - // ETH - addSetMultiPrimarySources( - SetMultiPrimarySourcesInput({ - token0: eth, - token1: usdPlaceholder, - maxPriceDeviation: 1e18, - maxPriceStale: 1 days, - priceSources: chainlinkPriceSource - }) - ); - - // BUSD - addSetMultiPrimarySources( - SetMultiPrimarySourcesInput({ - token0: busd, + token0: high, token1: usdPlaceholder, maxPriceDeviation: 1e18, maxPriceStale: 1 days, diff --git a/script/deployments/PancakeswapV2LiquidationStrategy/config/SetPaths.s.sol b/script/deployments/PancakeswapV2LiquidationStrategy/config/SetPaths.s.sol index fd277b9b5..958b87116 100644 --- a/script/deployments/PancakeswapV2LiquidationStrategy/config/SetPaths.s.sol +++ b/script/deployments/PancakeswapV2LiquidationStrategy/config/SetPaths.s.sol @@ -8,6 +8,8 @@ import { PancakeswapV2LiquidationStrategy } from "solidity/contracts/money-marke contract SetPathsScript is BaseScript { using stdJson for string; + PancakeswapV2LiquidationStrategy.SetPathParams[] liquidationPaths; + function run() public { /* ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ @@ -19,25 +21,82 @@ contract SetPathsScript is BaseScript { Check all variables below before execute the deployment script */ - address[] memory _strats = new address[](2); - _strats[0] = address(pancakeswapV2LiquidateStrat); - _strats[1] = address(pancakeswapV2IbLiquidateStrat); + address[] memory _strats = new address[](1); + _strats[0] = address(pancakeswapV2IbLiquidateStrat); + + // ********* WBNB ********* // + // WBNB -> HIGH: + setLiquidationPath(wbnb, busd, high); + + // ********* USDC ********* // + // USDC -> HIGH: + setLiquidationPath(usdc, busd, high); + + // ********* USDT ********* // + // USDT -> HIGH: + setLiquidationPath(usdt, busd, high); - address[] memory _wbnbLiquidationPath = new address[](2); - _wbnbLiquidationPath[0] = wbnb; - _wbnbLiquidationPath[1] = busd; + // ********* BUSD ********* // + // BUSD -> HIGH: + setLiquidationPath(busd, high); - PancakeswapV2LiquidationStrategy.SetPathParams[] - memory _inputs = new PancakeswapV2LiquidationStrategy.SetPathParams[](1); + // ********* BTCB ********* // + // BTCB -> HIGH: + setLiquidationPath(btcb, busd, high); - _inputs[0].path = _wbnbLiquidationPath; + // ********* ETH ********* // + // ETH -> HIGH: + setLiquidationPath(eth, busd, high); + + // ********* HIGH ********* // + // HIGH -> WBNB: + setLiquidationPath(high, busd, wbnb); + // HIGH -> USDC: + setLiquidationPath(high, busd, usdc); + // HIGH -> USDT: + setLiquidationPath(high, busd, usdt); + // HIGH -> BUSD: + setLiquidationPath(high, busd); + // HIGH -> BTCB: + setLiquidationPath(high, busd, btcb); + // HIGH -> ETH: + setLiquidationPath(high, busd, eth); _startDeployerBroadcast(); for (uint8 i; i < _strats.length; i++) { - PancakeswapV2LiquidationStrategy(_strats[i]).setPaths(_inputs); + PancakeswapV2LiquidationStrategy(_strats[i]).setPaths(liquidationPaths); } _stopBroadcast(); } + + function setLiquidationPath(address _token1, address _token2) internal { + address[] memory path = new address[](2); + path[0] = _token1; + path[1] = _token2; + + PancakeswapV2LiquidationStrategy.SetPathParams memory _input = PancakeswapV2LiquidationStrategy.SetPathParams({ + path: path + }); + + liquidationPaths.push(_input); + } + + function setLiquidationPath( + address _token1, + address _token2, + address _token3 + ) internal { + address[] memory path = new address[](3); + path[0] = _token1; + path[1] = _token2; + path[2] = _token3; + + PancakeswapV2LiquidationStrategy.SetPathParams memory _input = PancakeswapV2LiquidationStrategy.SetPathParams({ + path: path + }); + + liquidationPaths.push(_input); + } } diff --git a/script/deployments/Rewarder/config/AddPool.s.sol b/script/deployments/Rewarder/config/AddPool.s.sol new file mode 100644 index 000000000..e28019c23 --- /dev/null +++ b/script/deployments/Rewarder/config/AddPool.s.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { IRewarder } from "solidity/contracts/miniFL/interfaces/IRewarder.sol"; + +contract SetPoolScript is BaseScript { + struct AddPoolInput { + uint256 pid; + uint256 allocPoint; + } + + AddPoolInput[] addPoolInputs; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + IRewarder rewarder = IRewarder(address(0)); + + // HIGH + addIbPool(high, 40); + addDebtPool(high, 60); + + //---- execution ----// + _startDeployerBroadcast(); + + for (uint256 i; i < addPoolInputs.length; i++) { + rewarder.addPool(addPoolInputs[i].pid, addPoolInputs[i].allocPoint, true); + } + + _stopBroadcast(); + } + + function addIbPool(address _token, uint256 _allocPoint) internal { + address _ibToken = moneyMarket.getIbTokenFromToken(_token); + uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_ibToken); + addRewarderPool(_pid, _allocPoint); + } + + function addDebtPool(address _token, uint256 _allocPoint) internal { + address _debtToken = moneyMarket.getDebtTokenFromToken(_token); + uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_debtToken); + addRewarderPool(_pid, _allocPoint); + } + + function addRewarderPool(uint256 _pid, uint256 _allocPoint) internal { + addPoolInputs.push(AddPoolInput({ pid: _pid, allocPoint: _allocPoint })); + } +} diff --git a/script/deployments/Rewarder/config/SetPool.s.sol b/script/deployments/Rewarder/config/SetPool.s.sol new file mode 100644 index 000000000..d6866943e --- /dev/null +++ b/script/deployments/Rewarder/config/SetPool.s.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { IRewarder } from "solidity/contracts/miniFL/interfaces/IRewarder.sol"; + +contract SetPoolScript is BaseScript { + struct SetPoolInput { + uint256 pid; + uint256 allocPoint; + } + + SetPoolInput[] setPoolInputs; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + IRewarder rewarder = IRewarder(0x767adcb3650BAB4FEA44469fCe3FA66D767Bc22c); + + setIbAllocPoint(wbnb, 75); // WBNB + setDebtAllocPoint(wbnb, 100); + // BTCB + // setIbAllocPoint(btcb, 100); + // setDebtAllocPoint(btcb, 125); + // // USDT + // setIbAllocPoint(usdt, 100); + // setDebtAllocPoint(usdt, 175); + // // ETH + // setIbAllocPoint(eth, 75); + // setDebtAllocPoint(eth, 100); + // // USDC + // setIbAllocPoint(usdc, 50); + // setDebtAllocPoint(usdc, 75); + // // BUSD + // setIbAllocPoint(busd, 50); + // setDebtAllocPoint(busd, 75); + + //---- execution ----// + _startDeployerBroadcast(); + + for (uint256 i; i < setPoolInputs.length; i++) { + rewarder.setPool(setPoolInputs[i].pid, setPoolInputs[i].allocPoint, true); + } + + _stopBroadcast(); + } + + function setIbAllocPoint(address _token, uint256 _allocPoint) internal { + address _ibToken = moneyMarket.getIbTokenFromToken(_token); + uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_ibToken); + setPoolAllocPoint(_pid, _allocPoint); + } + + function setDebtAllocPoint(address _token, uint256 _allocPoint) internal { + address _debtToken = moneyMarket.getDebtTokenFromToken(_token); + uint256 _pid = moneyMarket.getMiniFLPoolIdOfToken(_debtToken); + setPoolAllocPoint(_pid, _allocPoint); + } + + function setPoolAllocPoint(uint256 _pid, uint256 _allocPoint) internal { + setPoolInputs.push(SetPoolInput({ pid: _pid, allocPoint: _allocPoint })); + } +} diff --git a/script/deployments/Rewarder/config/SetRewardPerSecond.s.sol b/script/deployments/Rewarder/config/SetRewardPerSecond.s.sol new file mode 100644 index 000000000..48826d577 --- /dev/null +++ b/script/deployments/Rewarder/config/SetRewardPerSecond.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { IRewarder } from "solidity/contracts/miniFL/interfaces/IRewarder.sol"; + +contract SetRewardPerSecondScript is BaseScript { + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + IRewarder rewarder = IRewarder(address(0)); + uint256 _newRewardPerSecond = 6717096560846561; + bool _withUpdate = true; + + //---- execution ----// + _startDeployerBroadcast(); + + rewarder.setRewardPerSecond(_newRewardPerSecond, _withUpdate); + + _stopBroadcast(); + } +} diff --git a/script/deployments/Rewarder/deploy/Rewarder.s.sol b/script/deployments/Rewarder/deploy/Rewarder.s.sol new file mode 100644 index 000000000..c33b95961 --- /dev/null +++ b/script/deployments/Rewarder/deploy/Rewarder.s.sol @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { Rewarder } from "solidity/contracts/miniFL/Rewarder.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +contract DeployRewarderScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + string memory name = "high"; + address miniFL = address(miniFL); + address rewardToken = high; + uint256 maxRewardPerSecond = 1 ether; + + bytes memory data = abi.encodeWithSelector( + bytes4(keccak256("initialize(string,address,address,uint256)")), + name, + miniFL, + rewardToken, + maxRewardPerSecond + ); + + _startDeployerBroadcast(); + // deploy implementation + address rewarderImplementation = address(new Rewarder()); + // deploy proxy + address proxy = address(new TransparentUpgradeableProxy(rewarderImplementation, proxyAdminAddress, data)); + + writeRewarderToJson(proxy); + + _stopBroadcast(); + } + + function writeRewarderToJson(address _rewarder) internal { + string[] memory cmds = new string[](9); + cmds[0] = "npx"; + cmds[1] = "ts-node"; + cmds[2] = "./type-script/scripts/write-rewarder.ts"; + cmds[3] = "--name"; + cmds[4] = Rewarder(_rewarder).name(); + cmds[5] = "--address"; + cmds[6] = vm.toString(_rewarder); + cmds[7] = "--rewardToken"; + cmds[8] = vm.toString(Rewarder(_rewarder).rewardToken()); + + vm.ffi(cmds); + } +} diff --git a/script/deployments/SmartTreasury/config/SetAllocPointScript.s.sol b/script/deployments/SmartTreasury/config/SetAllocPointScript.s.sol new file mode 100644 index 000000000..311629f52 --- /dev/null +++ b/script/deployments/SmartTreasury/config/SetAllocPointScript.s.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; +import { ISmartTreasury } from "solidity/contracts/interfaces/ISmartTreasury.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +contract SetAllocPointScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + uint16 _revenueAllocPoint = 0; + uint16 _devAllocPoint = 0; + uint16 _burnAllocPoint = 0; + + _startDeployerBroadcast(); + + smartTreasury.setAllocPoints(_revenueAllocPoint, _devAllocPoint, _burnAllocPoint); + + _stopBroadcast(); + } +} diff --git a/script/deployments/SmartTreasury/config/SetRevenueTokenScript.s.sol b/script/deployments/SmartTreasury/config/SetRevenueTokenScript.s.sol new file mode 100644 index 000000000..ea229d9f0 --- /dev/null +++ b/script/deployments/SmartTreasury/config/SetRevenueTokenScript.s.sol @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +contract SetRevenueTokenScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + address _revenueToken = address(0); + + _startDeployerBroadcast(); + + smartTreasury.setRevenueToken(_revenueToken); + + _stopBroadcast(); + } +} diff --git a/script/deployments/SmartTreasury/config/SetTreasuryAddressScript.s.sol b/script/deployments/SmartTreasury/config/SetTreasuryAddressScript.s.sol new file mode 100644 index 000000000..aa08aae0d --- /dev/null +++ b/script/deployments/SmartTreasury/config/SetTreasuryAddressScript.s.sol @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +contract SetTreasuryAddressScript is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + address _revenueTreasury = address(0); + address _devTreasury = address(0); + address _burnTreasury = address(0); + + _startDeployerBroadcast(); + + smartTreasury.setTreasuryAddresses(_revenueTreasury, _devTreasury, _burnTreasury); + + _stopBroadcast(); + } +} diff --git a/script/deployments/SmartTreasury/config/SetWhitelistesCallers.s.sol b/script/deployments/SmartTreasury/config/SetWhitelistesCallers.s.sol new file mode 100644 index 000000000..0bf199e44 --- /dev/null +++ b/script/deployments/SmartTreasury/config/SetWhitelistesCallers.s.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import "../../../BaseScript.sol"; + +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; +import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; + +contract SetWhitelistesCallers is BaseScript { + using stdJson for string; + + function run() public { + /* + ░██╗░░░░░░░██╗░█████╗░██████╗░███╗░░██╗██╗███╗░░██╗░██████╗░ + ░██║░░██╗░░██║██╔══██╗██╔══██╗████╗░██║██║████╗░██║██╔════╝░ + ░╚██╗████╗██╔╝███████║██████╔╝██╔██╗██║██║██╔██╗██║██║░░██╗░ + ░░████╔═████║░██╔══██║██╔══██╗██║╚████║██║██║╚████║██║░░╚██╗ + ░░╚██╔╝░╚██╔╝░██║░░██║██║░░██║██║░╚███║██║██║░╚███║╚██████╔╝ + ░░░╚═╝░░░╚═╝░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚══╝╚═╝╚═╝░░╚══╝░╚═════╝░ + Check all variables below before execute the deployment script + */ + + address[] memory _callers = new address[](1); + _callers[0] = deployerAddress; + + _startDeployerBroadcast(); + + smartTreasury.setWhitelistedCallers(_callers, true); + + _stopBroadcast(); + } +} diff --git a/script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.s.sol b/script/deployments/SmartTreasury/deploy/SmartTreasury.s.sol similarity index 65% rename from script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.s.sol rename to script/deployments/SmartTreasury/deploy/SmartTreasury.s.sol index 3476f88a2..a32155dca 100644 --- a/script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.s.sol +++ b/script/deployments/SmartTreasury/deploy/SmartTreasury.s.sol @@ -3,9 +3,11 @@ pragma solidity 0.8.19; import "../../../BaseScript.sol"; +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; +import { SmartTreasury } from "solidity/contracts/smart-treasury/SmartTreasury.sol"; import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; -contract DeployChainlinkPriceOracle2Script is BaseScript { +contract DeploySmartTreasuryScript is BaseScript { using stdJson for string; function run() public { @@ -19,30 +21,23 @@ contract DeployChainlinkPriceOracle2Script is BaseScript { Check all variables below before execute the deployment script */ - bytes memory _logicBytecode = abi.encodePacked( - vm.getCode("./script/deployments/ChainLinkOracle2/deploy/ChainlinkPriceOracle2.json") - ); - - bytes memory data = abi.encodeWithSelector(bytes4(keccak256("initialize()"))); - - address _chainLinkPriceOracle2Implementation; _startDeployerBroadcast(); - // deploy implementation - assembly { - _chainLinkPriceOracle2Implementation := create(0, add(_logicBytecode, 0x20), mload(_logicBytecode)) - if iszero(extcodesize(_chainLinkPriceOracle2Implementation)) { - revert(0, 0) - } - } + address smartTreasuryImplementation = address(new SmartTreasury()); // deploy proxy - address proxy = address( - new TransparentUpgradeableProxy(_chainLinkPriceOracle2Implementation, proxyAdminAddress, data) + bytes memory data = abi.encodeWithSelector( + bytes4(keccak256("initialize(address,address)")), + address(pancakeswapRouterV3), + address(pathReaderV3) + ); + address smartTreasuryProxy = address( + new TransparentUpgradeableProxy(smartTreasuryImplementation, proxyAdminAddress, data) ); + _stopBroadcast(); - console.log("_chainLinkPriceOracle2Implementation", _chainLinkPriceOracle2Implementation); - console.log("_chainLinkPriceOracle2Proxy", proxy); + _writeJson(vm.toString(smartTreasuryImplementation), ".smartTreasury.implementation"); + _writeJson(vm.toString(smartTreasuryProxy), ".smartTreasury.proxy"); } } diff --git a/script/deployments/libraries/LibMoneyMarketDeployment.sol b/script/deployments/libraries/LibMoneyMarketDeployment.sol index f7db21e48..a4ffb14ef 100644 --- a/script/deployments/libraries/LibMoneyMarketDeployment.sol +++ b/script/deployments/libraries/LibMoneyMarketDeployment.sol @@ -15,6 +15,7 @@ import { INonCollatBorrowFacet } from "solidity/contracts/money-market/interface import { IAdminFacet } from "solidity/contracts/money-market/interfaces/IAdminFacet.sol"; import { ILiquidationFacet } from "solidity/contracts/money-market/interfaces/ILiquidationFacet.sol"; import { IMMOwnershipFacet } from "solidity/contracts/money-market/interfaces/IMMOwnershipFacet.sol"; +import { IFlashloanFacet } from "solidity/contracts/money-market/interfaces/IFlashloanFacet.sol"; library LibMoneyMarketDeployment { VM internal constant vm = VM(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); @@ -29,6 +30,7 @@ library LibMoneyMarketDeployment { address adminFacet; address liquidationFacet; address ownershipFacet; + address flashloanFacet; } function deployMoneyMarketDiamond(address _miniFL) @@ -70,6 +72,7 @@ library LibMoneyMarketDeployment { _facetAddresses.adminFacet = deployContract("./out/AdminFacet.sol/AdminFacet.json"); _facetAddresses.liquidationFacet = deployContract("./out/LiquidationFacet.sol/LiquidationFacet.json"); _facetAddresses.ownershipFacet = deployContract("./out/MMOwnershipFacet.sol/MMOwnershipFacet.json"); + _facetAddresses.flashloanFacet = deployContract("./out/FlashloanFacet.sol/FlashloanFacet.json"); } function deployContract(string memory _path) internal returns (address _deployedAddress) { @@ -94,9 +97,10 @@ library LibMoneyMarketDeployment { bytes4[] memory _adminFacetSelectors = getAdminFacetSelectors(); bytes4[] memory _liquidationFacetSelectors = getLiquidationFacetSelectors(); bytes4[] memory _ownershipFacetSelectors = getOwnershipFacetSelectors(); + bytes4[] memory _flashloanFacetSelectors = getFlashloanFacetSelectors(); // prepare FacetCuts - IMMDiamondCut.FacetCut[] memory _facetCuts = new IMMDiamondCut.FacetCut[](9); + IMMDiamondCut.FacetCut[] memory _facetCuts = new IMMDiamondCut.FacetCut[](10); _facetCuts[0] = IMMDiamondCut.FacetCut({ action: IMMDiamondCut.FacetCutAction.Add, facetAddress: _facetAddresses.diamondLoupeFacet, @@ -142,6 +146,11 @@ library LibMoneyMarketDeployment { facetAddress: _facetAddresses.ownershipFacet, functionSelectors: _ownershipFacetSelectors }); + _facetCuts[9] = IMMDiamondCut.FacetCut({ + action: IMMDiamondCut.FacetCutAction.Add, + facetAddress: _facetAddresses.flashloanFacet, + functionSelectors: _flashloanFacetSelectors + }); // perform diamond cut on deployed MoneyMarketDiamond // address(0) and empty string means no initialization / cleanup after diamond cut @@ -157,7 +166,7 @@ library LibMoneyMarketDeployment { } function getViewFacetSelectors() internal pure returns (bytes4[] memory _selectors) { - _selectors = new bytes4[](42); + _selectors = new bytes4[](48); _selectors[0] = IViewFacet.getProtocolReserve.selector; _selectors[1] = IViewFacet.getTokenConfig.selector; _selectors[2] = IViewFacet.getOverCollatDebtSharesOf.selector; @@ -200,6 +209,12 @@ library LibMoneyMarketDeployment { _selectors[39] = IViewFacet.getOverCollatPendingInterest.selector; _selectors[40] = IViewFacet.getOverCollatInterestModel.selector; _selectors[41] = IViewFacet.getOverCollatInterestRate.selector; + _selectors[42] = IViewFacet.getFlashloanParams.selector; + _selectors[43] = IViewFacet.isLiquidationStratOk.selector; + _selectors[44] = IViewFacet.isLiquidatorOk.selector; + _selectors[45] = IViewFacet.isAccountManagersOk.selector; + _selectors[46] = IViewFacet.isRiskManagersOk.selector; + _selectors[47] = IViewFacet.isOperatorsOk.selector; } function getLendFacetSelectors() internal pure returns (bytes4[] memory _selectors) { @@ -230,7 +245,7 @@ library LibMoneyMarketDeployment { } function getAdminFacetSelectors() internal pure returns (bytes4[] memory _selectors) { - _selectors = new bytes4[](23); + _selectors = new bytes4[](25); _selectors[0] = IAdminFacet.openMarket.selector; _selectors[1] = IAdminFacet.setTokenConfigs.selector; _selectors[2] = IAdminFacet.setNonCollatBorrowerOk.selector; @@ -254,6 +269,8 @@ library LibMoneyMarketDeployment { _selectors[20] = IAdminFacet.setAccountManagersOk.selector; _selectors[21] = IAdminFacet.setTokenMaximumCapacities.selector; _selectors[22] = IAdminFacet.setRiskManagersOk.selector; + _selectors[23] = IAdminFacet.setFlashloanParams.selector; + _selectors[24] = IAdminFacet.setOperatorsOk.selector; } function getLiquidationFacetSelectors() internal pure returns (bytes4[] memory _selectors) { @@ -269,4 +286,9 @@ library LibMoneyMarketDeployment { _selectors[2] = IMMOwnershipFacet.owner.selector; _selectors[3] = IMMOwnershipFacet.pendingOwner.selector; } + + function getFlashloanFacetSelectors() internal pure returns (bytes4[] memory _selectors) { + _selectors = new bytes4[](1); + _selectors[0] = IFlashloanFacet.flashloan.selector; + } } diff --git a/solidity/contracts/account-manager/MoneyMarketAccountManager.sol b/solidity/contracts/account-manager/MoneyMarketAccountManager.sol index 2dd9eb4b4..2b1d55f87 100644 --- a/solidity/contracts/account-manager/MoneyMarketAccountManager.sol +++ b/solidity/contracts/account-manager/MoneyMarketAccountManager.sol @@ -287,6 +287,45 @@ contract MoneyMarketAccountManager is IMoneyMarketAccountManager, OwnableUpgrade miniFL.deposit(msg.sender, moneyMarket.getMiniFLPoolIdOfToken(_ibToken), _amountReceived); } + /// @notice Deposit native token to Money Market and stake the ibToken to miniFL + function depositETHAndStake() external payable { + // revert if trying to deposit 0 + if (msg.value == 0) { + revert MoneyMarketAccountManager_InvalidAmount(); + } + // Wrap the native token as MoneyMarket only accepts ERC20 + IWNative(wNativeToken).deposit{ value: msg.value }(); + + // deposit wrapped native token to MoneyMarket + (address _ibToken, uint256 _amountReceived) = _deposit(wNativeToken, msg.value); + + // Use the received ibToken and stake it at miniFL on bahalf of the caller + IERC20(_ibToken).safeApprove(address(miniFL), _amountReceived); + + miniFL.deposit(msg.sender, moneyMarket.getMiniFLPoolIdOfToken(_ibToken), _amountReceived); + } + + /// @notice Unstake ibToken from miniFL and withdraw as native token from MoneyMarket + /// @param _ibTokenAmount The amount to withdraw + function unstakeAndWithdrawETH(uint256 _ibTokenAmount) external { + // revert if trying to remove 0 + + if (_ibTokenAmount == 0) { + revert MoneyMarketAccountManager_InvalidAmount(); + } + // unstake from miniFL with given amount + // If the transaction went through, the amount received will always equals to the _amount + miniFL.withdraw(msg.sender, moneyMarket.getMiniFLPoolIdOfToken(ibWNativeToken), _ibTokenAmount); + + // withdraw all of the ibToken received from unstaking from miniFL + (, uint256 _underlyingAmountReceived) = _withdraw(ibWNativeToken, _ibTokenAmount); + + // The _underlyingAmountReceived is expected to be greater than 0 + // making the ERC20.transfer impossible to revert on transfer 0 amount + // unwrap the wNativeToken and send back to the msg.sender + _safeUnwrap(msg.sender, _underlyingAmountReceived); + } + /// @notice Unstake ibToken from miniFL and withdraw from MoneyMarket /// @param _ibToken The ibToken token to withdraw /// @param _ibTokenAmount The amount to withdraw diff --git a/solidity/contracts/interfaces/IMoneyMarketAccountManager.sol b/solidity/contracts/interfaces/IMoneyMarketAccountManager.sol index e6720babb..516563459 100644 --- a/solidity/contracts/interfaces/IMoneyMarketAccountManager.sol +++ b/solidity/contracts/interfaces/IMoneyMarketAccountManager.sol @@ -51,6 +51,10 @@ interface IMoneyMarketAccountManager { function depositAndStake(address _token, uint256 _amount) external; + function depositETHAndStake() external payable; + + function unstakeAndWithdrawETH(uint256 _amount) external; + function unstakeAndWithdraw(address _ibToken, uint256 _amount) external; function borrow( diff --git a/solidity/contracts/interfaces/IMoneyMarketReader.sol b/solidity/contracts/interfaces/IMoneyMarketReader.sol index 2277a83bf..34909484b 100644 --- a/solidity/contracts/interfaces/IMoneyMarketReader.sol +++ b/solidity/contracts/interfaces/IMoneyMarketReader.sol @@ -44,13 +44,16 @@ interface IMoneyMarketReader { } struct RewardSummary { - uint256 ibPoolId; - uint256 debtPoolId; - uint256 lendingPendingReward; - uint256 borrowingPendingReward; + address rewardToken; + uint256 pId; + uint256 pendingReward; } - function getRewardSummary(address _underlyingToken, address _account) external view returns (RewardSummary memory); + function getRewardSummary( + uint256 _pId, + address _account, + address[] calldata _rewarders + ) external view returns (RewardSummary[] memory); function getSubAccountSummary(address _account, uint256 _subAccountId) external @@ -91,7 +94,7 @@ interface IMoneyMarketReader { uint256 globalDebtValue; uint256 reserve; uint256 totalToken; - uint256 pendingIntetest; + uint256 pendingInterest; uint256 interestRate; uint256 lastAccruedAt; uint256 blockTimestamp; @@ -100,15 +103,24 @@ interface IMoneyMarketReader { function getMarketStats(address _underlyingToken) external view returns (MarketStats memory); struct MarketRewardInfo { - uint256 debtTokenAllocPoint; - uint256 ibTokenAllocPoint; - uint256 totalAllocPoint; - uint256 rewardPerSec; uint256 totalDebtTokenInPool; uint256 totalUnderlyingTokenInPool; + RewarderInfo[] ibRewarderInfos; + RewarderInfo[] debtRewarderInfos; + } + + struct RewarderInfo { + address rewardToken; + uint256 pId; + uint256 rewardPerSec; + uint256 totalAllocPoint; + uint256 allocPoint; } - function getMarketRewardInfo(address _underlyingToken) external view returns (MarketRewardInfo memory); + function getMarketRewardInfo(address _underlyingToken, address[] calldata _rewarders) + external + view + returns (MarketRewardInfo memory); struct MarketPriceInfo { uint256 underlyingTokenPrice; diff --git a/solidity/contracts/interfaces/ISmartTreasury.sol b/solidity/contracts/interfaces/ISmartTreasury.sol new file mode 100644 index 000000000..1831d4214 --- /dev/null +++ b/solidity/contracts/interfaces/ISmartTreasury.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +interface ISmartTreasury { + error SmartTreasury_InvalidAddress(); + error SmartTreasury_InvalidAllocPoint(); + error SmartTreasury_SlippageTolerance(); + error SmartTreasury_PathConfigNotFound(); + error SmartTreasury_Unauthorized(); + + function distribute(address[] calldata _tokens) external; + + function setAllocPoints( + uint16 _revenueAllocPoint, + uint16 _devAllocPoint, + uint16 _burnAllocPoint + ) external; + + function setRevenueToken(address _revenueToken) external; + + function setSlippageToleranceBps(uint16 _slippageToleranceBps) external; + + function setTreasuryAddresses( + address _revenueTreasury, + address _devTreasury, + address _burnTreasury + ) external; + + function setWhitelistedCallers(address[] calldata _callers, bool _allow) external; + + function withdraw(address[] calldata _tokens, address _to) external; +} diff --git a/solidity/contracts/miniFL/Rewarder.sol b/solidity/contracts/miniFL/Rewarder.sol index 35d4b04d4..8e0e871fb 100644 --- a/solidity/contracts/miniFL/Rewarder.sol +++ b/solidity/contracts/miniFL/Rewarder.sol @@ -197,12 +197,12 @@ contract Rewarder is IRewarder, OwnableUpgradeable, ReentrancyGuardUpgradeable { } /// @notice Add a new pool. Can only be called by the owner. - /// @param _allocPoint The new allocation point /// @param _pid The Pool ID on MiniFL + /// @param _allocPoint The new allocation point /// @param _withUpdate If true, do mass update pools function addPool( - uint256 _allocPoint, uint256 _pid, + uint256 _allocPoint, bool _withUpdate ) external onlyOwner { if (poolInfo[_pid].lastRewardTime != 0) revert Rewarder1_PoolExisted(); @@ -251,7 +251,9 @@ contract Rewarder is IRewarder, OwnableUpgradeable, ReentrancyGuardUpgradeable { unchecked { _timePast = block.timestamp - _poolInfo.lastRewardTime; } - uint256 _rewards = (_timePast * rewardPerSecond * _poolInfo.allocPoint) / totalAllocPoint; + uint256 _rewards = totalAllocPoint != 0 + ? (_timePast * rewardPerSecond * _poolInfo.allocPoint) / totalAllocPoint + : 0; _accRewardPerShare = _accRewardPerShare + ((_rewards * ACC_REWARD_PRECISION) / _stakedBalance); } return @@ -352,4 +354,10 @@ contract Rewarder is IRewarder, OwnableUpgradeable, ReentrancyGuardUpgradeable { function lastRewardTime(uint256 _pid) external view returns (uint256) { return poolInfo[_pid].lastRewardTime; } + + /// @notice Returns the allocation point of a pool. + /// @param _pid The index of the pool. See `poolInfo`. + function getPoolAllocPoint(uint256 _pid) external view returns (uint256 _allocPoint) { + _allocPoint = poolInfo[_pid].allocPoint; + } } diff --git a/solidity/contracts/miniFL/interfaces/IMiniFL.sol b/solidity/contracts/miniFL/interfaces/IMiniFL.sol index 85504832d..fc59d8f1b 100644 --- a/solidity/contracts/miniFL/interfaces/IMiniFL.sol +++ b/solidity/contracts/miniFL/interfaces/IMiniFL.sol @@ -43,4 +43,6 @@ interface IMiniFL { function harvestMany(uint256[] calldata _pids) external; function massUpdatePools() external; + + function setPoolRewarders(uint256 _pid, address[] calldata _newRewarders) external; } diff --git a/solidity/contracts/miniFL/interfaces/IRewarder.sol b/solidity/contracts/miniFL/interfaces/IRewarder.sol index 0eebd04c2..0f45c5279 100644 --- a/solidity/contracts/miniFL/interfaces/IRewarder.sol +++ b/solidity/contracts/miniFL/interfaces/IRewarder.sol @@ -28,4 +28,26 @@ interface IRewarder { function pendingToken(uint256 pid, address user) external view returns (uint256); function lastRewardTime(uint256 _pid) external view returns (uint256); + + function addPool( + uint256 _pid, + uint256 _allocPoint, + bool _withUpdate + ) external; + + function setPool( + uint256 _pid, + uint256 _newAllocPoint, + bool _withUpdate + ) external; + + function setRewardPerSecond(uint256 _newRewardPerSecond, bool _withUpdate) external; + + function rewardToken() external view returns (address); + + function rewardPerSecond() external view returns (uint256); + + function totalAllocPoint() external view returns (uint256); + + function getPoolAllocPoint(uint256 _pid) external view returns (uint256 _allocPoint); } diff --git a/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol b/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol index 10cadc2ff..efc50bafb 100644 --- a/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol +++ b/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol @@ -6,7 +6,7 @@ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; // ---- Libraries ---- // import { LibSafeToken } from "./libraries/LibSafeToken.sol"; -import { LibPath } from "./libraries/LibPath.sol"; +import { LibPath } from "../reader/libraries/LibPath.sol"; // ---- Interfaces ---- // import { ILiquidationStrategy } from "./interfaces/ILiquidationStrategy.sol"; @@ -110,10 +110,8 @@ contract PancakeswapV3IbTokenLiquidationStrategy is ILiquidationStrategy, Ownabl while (true) { bool hasMultiplePools = LibPath.hasMultiplePools(_path); - // get first hop (token0, fee, token1) - bytes memory _hop = _path.getFirstPool(); // extract the token from encoded hop - (address _token0, address _token1, uint24 _fee) = _hop.decodeFirstPool(); + (address _token0, address _token1, uint24 _fee) = _path.decodeFirstPool(); // compute pool address from token0, token1 and fee address _pool = _computeAddressV3(_token0, _token1, _fee); diff --git a/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.sol b/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.sol new file mode 100644 index 000000000..43d9f5371 --- /dev/null +++ b/solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.sol @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +// ---- External Libraries ---- // +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; + +// ---- Libraries ---- // +import { LibSafeToken } from "./libraries/LibSafeToken.sol"; + +// ---- Interfaces ---- // +import { ILiquidationStrategy } from "./interfaces/ILiquidationStrategy.sol"; +import { IPancakeSwapRouterV3 } from "./interfaces/IPancakeSwapRouterV3.sol"; +import { IERC20 } from "./interfaces/IERC20.sol"; +import { IMoneyMarket } from "./interfaces/IMoneyMarket.sol"; +import { IUniSwapV3PathReader } from "../reader/interfaces/IUniSwapV3PathReader.sol"; + +contract PancakeswapV3IbTokenLiquidationStrategy_WithPathReader is ILiquidationStrategy, Ownable { + using LibSafeToken for IERC20; + + event LogSetCaller(address _caller, bool _isOk); + + error PancakeswapV3IbTokenLiquidationStrategy_Unauthorized(); + error PancakeswapV3IbTokenLiquidationStrategy_RepayTokenIsSameWithUnderlyingToken(); + error PancakeswapV3IbTokenLiquidationStrategy_PathConfigNotFound(address tokenIn, address tokenOut); + + IPancakeSwapRouterV3 internal immutable router; + IMoneyMarket internal immutable moneyMarket; + IUniSwapV3PathReader internal immutable pathReader; + + mapping(address => bool) public callersOk; + + struct WithdrawParam { + address to; + address token; + uint256 amount; + } + + /// @notice allow only whitelisted callers + modifier onlyWhitelistedCallers() { + if (!callersOk[msg.sender]) { + revert PancakeswapV3IbTokenLiquidationStrategy_Unauthorized(); + } + _; + } + + constructor( + address _router, + address _moneyMarket, + address _pathReader + ) { + router = IPancakeSwapRouterV3(_router); + moneyMarket = IMoneyMarket(_moneyMarket); + pathReader = IUniSwapV3PathReader(_pathReader); + } + + /// @notice Execute liquidate from collatToken to repayToken + /// @param _ibToken The source token + /// @param _repayToken The destination token + /// @param _ibTokenAmountIn Available amount of source token to trade + /// @param _minReceive Min token receive after swap + function executeLiquidation( + address _ibToken, + address _repayToken, + uint256 _ibTokenAmountIn, + uint256, /*_repayAmount*/ + uint256 _minReceive + ) external onlyWhitelistedCallers { + // get underlying tokenAddress from MoneyMarket + address _underlyingToken = moneyMarket.getTokenFromIbToken(_ibToken); + + // Revert if _underlyingToken and _repayToken are the same address + if (_underlyingToken == _repayToken) { + revert PancakeswapV3IbTokenLiquidationStrategy_RepayTokenIsSameWithUnderlyingToken(); + } + + bytes memory _path = pathReader.paths(_underlyingToken, _repayToken); + // Revert if no swapPath config for _underlyingToken and _repayToken pair + if (_path.length == 0) { + revert PancakeswapV3IbTokenLiquidationStrategy_PathConfigNotFound(_underlyingToken, _repayToken); + } + + // withdraw ibToken from Moneymarket for underlyingToken + uint256 _withdrawnUnderlyingAmount = moneyMarket.withdraw(msg.sender, _ibToken, _ibTokenAmountIn); + + // setup params from swap + IPancakeSwapRouterV3.ExactInputParams memory params = IPancakeSwapRouterV3.ExactInputParams({ + path: _path, + recipient: msg.sender, + deadline: block.timestamp, + amountIn: _withdrawnUnderlyingAmount, + amountOutMinimum: _minReceive + }); + + // approve router for swapping + IERC20(_underlyingToken).safeApprove(address(router), _withdrawnUnderlyingAmount); + // swap all ib's underlyingToken to repayToken + router.exactInput(params); + } + + /// @notice Set callers ok + /// @param _callers A list of caller addresses + /// @param _isOk An ok flag + function setCallersOk(address[] calldata _callers, bool _isOk) external onlyOwner { + uint256 _length = _callers.length; + for (uint256 _i; _i < _length; ) { + callersOk[_callers[_i]] = _isOk; + emit LogSetCaller(_callers[_i], _isOk); + unchecked { + ++_i; + } + } + } + + /// @notice Withdraw ERC20 from this contract + /// @param _withdrawParams an array of Withdrawal parameters (to, token, amount) + function withdraw(WithdrawParam[] calldata _withdrawParams) external onlyOwner { + uint256 _length = _withdrawParams.length; + for (uint256 _i; _i < _length; ) { + IERC20(_withdrawParams[_i].token).safeTransfer(_withdrawParams[_i].to, _withdrawParams[_i].amount); + + unchecked { + ++_i; + } + } + } +} diff --git a/solidity/contracts/money-market/PancakeswapV3TokenLiquidationStrategy.sol b/solidity/contracts/money-market/PancakeswapV3TokenLiquidationStrategy.sol new file mode 100644 index 000000000..c57790d23 --- /dev/null +++ b/solidity/contracts/money-market/PancakeswapV3TokenLiquidationStrategy.sol @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +// ---- External Libraries ---- // +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; + +// ---- Libraries ---- // +import { LibSafeToken } from "./libraries/LibSafeToken.sol"; +import { LibPath } from "../reader/libraries/LibPath.sol"; + +// ---- Interfaces ---- // +import { ILiquidationStrategy } from "./interfaces/ILiquidationStrategy.sol"; +import { IPancakeSwapRouterV3 } from "./interfaces/IPancakeSwapRouterV3.sol"; +import { IERC20 } from "./interfaces/IERC20.sol"; +import { IPancakeV3Pool } from "./interfaces/IPancakeV3Pool.sol"; +import { IUniSwapV3PathReader } from "../reader/interfaces/IUniSwapV3PathReader.sol"; + +contract PancakeswapV3TokenLiquidationStrategy is ILiquidationStrategy, Ownable { + using LibSafeToken for IERC20; + using LibPath for bytes; + + event LogSetCaller(address _caller, bool _isOk); + event LogSetPath(address _token0, address _token1, bytes _path); + + error PancakeswapV3TokenLiquidationStrategy_Unauthorized(); + error PancakeswapV3TokenLiquidationStrategy_RepayTokenIsSameWithCollatToken(); + error PancakeswapV3TokenLiquidationStrategy_PathConfigNotFound(address tokenIn, address tokenOut); + error PancakeswapV3TokenLiquidationStrategy_NoLiquidity(address tokenA, address tokenB, uint24 fee); + + IPancakeSwapRouterV3 internal immutable router; + IUniSwapV3PathReader internal immutable pathReader; + + address internal constant PANCAKE_V3_POOL_DEPLOYER = 0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9; + bytes32 internal constant POOL_INIT_CODE_HASH = 0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2; + + mapping(address => bool) public callersOk; + // tokenIn => tokenOut => path + mapping(address => mapping(address => bytes)) public paths; + + struct WithdrawParam { + address to; + address token; + uint256 amount; + } + + /// @notice allow only whitelisted callers + modifier onlyWhitelistedCallers() { + if (!callersOk[msg.sender]) { + revert PancakeswapV3TokenLiquidationStrategy_Unauthorized(); + } + _; + } + + constructor(address _router, address _pathReader) { + router = IPancakeSwapRouterV3(_router); + pathReader = IUniSwapV3PathReader(_pathReader); + } + + /// @notice Execute liquidate from collatToken to repayToken + /// @param _collatToken The source token + /// @param _repayToken The destination token + /// @param _collatAmountIn Available amount of source token to trade + /// @param _minReceive Min token receive after swap + function executeLiquidation( + address _collatToken, + address _repayToken, + uint256 _collatAmountIn, + uint256, /* _repayAmount */ + uint256 _minReceive + ) external onlyWhitelistedCallers { + // Revert if _underlyingToken and _repayToken are the same address + if (_collatToken == _repayToken) { + revert PancakeswapV3TokenLiquidationStrategy_RepayTokenIsSameWithCollatToken(); + } + + bytes memory _path = pathReader.paths(_collatToken, _repayToken); + // Revert if no swapPath config for _collatToken and _repayToken pair + if (_path.length == 0) { + revert PancakeswapV3TokenLiquidationStrategy_PathConfigNotFound(_collatToken, _repayToken); + } + + // setup params from swap + IPancakeSwapRouterV3.ExactInputParams memory params = IPancakeSwapRouterV3.ExactInputParams({ + path: _path, + recipient: msg.sender, + deadline: block.timestamp, + amountIn: _collatAmountIn, + amountOutMinimum: _minReceive + }); + + // approve router for swapping + IERC20(_collatToken).safeApprove(address(router), _collatAmountIn); + // swap all collatToken to repayToken + router.exactInput(params); + } + + /// @notice Set callers ok + /// @param _callers A list of caller addresses + /// @param _isOk An ok flag + function setCallersOk(address[] calldata _callers, bool _isOk) external onlyOwner { + uint256 _length = _callers.length; + for (uint256 _i; _i < _length; ) { + callersOk[_callers[_i]] = _isOk; + emit LogSetCaller(_callers[_i], _isOk); + unchecked { + ++_i; + } + } + } + + /// @notice Withdraw ERC20 from this contract + /// @param _withdrawParams an array of Withdrawal parameters (to, token, amount) + function withdraw(WithdrawParam[] calldata _withdrawParams) external onlyOwner { + uint256 _length = _withdrawParams.length; + for (uint256 _i; _i < _length; ) { + IERC20(_withdrawParams[_i].token).safeTransfer(_withdrawParams[_i].to, _withdrawParams[_i].amount); + + unchecked { + ++_i; + } + } + } +} diff --git a/solidity/contracts/money-market/facets/AdminFacet.sol b/solidity/contracts/money-market/facets/AdminFacet.sol index 4ea62c252..1fcf97eb0 100644 --- a/solidity/contracts/money-market/facets/AdminFacet.sol +++ b/solidity/contracts/money-market/facets/AdminFacet.sol @@ -42,6 +42,7 @@ contract AdminFacet is IAdminFacet { event LogSetAccountManagerOk(address indexed _manager, bool isOk); event LogSetLiquidationTreasury(address indexed _treasury); event LogSetFees(uint256 _lendingFeeBps, uint256 _repurchaseFeeBps, uint256 _liquidationFeeBps); + event LogSetFlashloanParams(uint256 _flashloanFeeBps, uint256 _lenderFlashloanBps, address _flashloanTreasury); event LogSetRepurchaseRewardModel(IFeeModel indexed _repurchaseRewardModel); event LogSetIbTokenImplementation(address indexed _newImplementation); event LogSetDebtTokenImplementation(address indexed _newImplementation); @@ -53,6 +54,7 @@ contract AdminFacet is IAdminFacet { event LogTopUpTokenReserve(address indexed _token, uint256 _amount); event LogSetMinDebtSize(uint256 _newValue); event LogSetEmergencyPaused(address indexed _caller, bool _isPasued); + event LogSetOperatorsOk(address indexed _caller, bool _allow); modifier onlyOwner() { LibDiamond.enforceIsContractOwner(); @@ -346,6 +348,21 @@ contract AdminFacet is IAdminFacet { } } + /// @notice Set operators + /// @param _operators The addresses of the operator that are going to be whitelisted. + /// @param _isOk Whether to allow or disallow callers. + function setOperatorsOk(address[] calldata _operators, bool _isOk) external onlyOwner { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + uint256 _length = _operators.length; + for (uint256 _i; _i < _length; ) { + moneyMarketDs.operatorsOk[_operators[_i]] = _isOk; + emit LogSetOperatorsOk(_operators[_i], _isOk); + unchecked { + ++_i; + } + } + } + /// @notice Set the treasury address /// @param _treasury The new treasury address function setLiquidationTreasury(address _treasury) external onlyOwner { @@ -385,6 +402,27 @@ contract AdminFacet is IAdminFacet { emit LogSetFees(_newLendingFeeBps, _newRepurchaseFeeBps, _newLiquidationFeeBps); } + /// @notice Set parameters for flashloan + /// @param _flashloanFeeBps the flashloan fee collected by protocol + /// @param _lenderFlashloanBps the portion that lenders will receive from _flashloanFeeBps + /// @param _flashloanTreasury the address that hold excess flashloan fee + function setFlashloanParams( + uint16 _flashloanFeeBps, + uint16 _lenderFlashloanBps, + address _flashloanTreasury + ) external onlyOwner { + if (_flashloanFeeBps > LibConstant.MAX_BPS || _lenderFlashloanBps > LibConstant.MAX_BPS) { + revert AdminFacet_InvalidArguments(); + } + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + // Replace existing params + moneyMarketDs.flashloanFeeBps = _flashloanFeeBps; + moneyMarketDs.lenderFlashloanBps = _lenderFlashloanBps; + moneyMarketDs.flashloanTreasury = _flashloanTreasury; + + emit LogSetFlashloanParams(_flashloanFeeBps, _lenderFlashloanBps, _flashloanTreasury); + } + /// @notice Set the repurchase reward model for a token specifically to over collateralized borrowing /// @param _newRepurchaseRewardModel The contract address of the repurchase reward model function setRepurchaseRewardModel(IFeeModel _newRepurchaseRewardModel) external onlyOwner { @@ -531,10 +569,11 @@ contract AdminFacet is IAdminFacet { /// @notice Withdraw the protocol reserves /// @param _withdrawProtocolReserveParam An array of protocol's reserve to withdraw - function withdrawProtocolReserves(WithdrawProtocolReserveParam[] calldata _withdrawProtocolReserveParam) - external - onlyOwner - { + function withdrawProtocolReserves(WithdrawProtocolReserveParam[] calldata _withdrawProtocolReserveParam) external { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + + if (!moneyMarketDs.operatorsOk[msg.sender]) revert AdminFacet_Unauthorized(); + uint256 _length = _withdrawProtocolReserveParam.length; for (uint256 _i; _i < _length; ) { _withdrawProtocolReserve( diff --git a/solidity/contracts/money-market/facets/FlashloanFacet.sol b/solidity/contracts/money-market/facets/FlashloanFacet.sol new file mode 100644 index 000000000..44fad56d5 --- /dev/null +++ b/solidity/contracts/money-market/facets/FlashloanFacet.sol @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +// libraries +import { LibMoneyMarket01 } from "../libraries/LibMoneyMarket01.sol"; +import { LibSafeToken } from "../libraries/LibSafeToken.sol"; +import { LibConstant } from "../libraries/LibConstant.sol"; +import { LibReentrancyGuard } from "../libraries/LibReentrancyGuard.sol"; + +// interfaces +import { IFlashloanFacet } from "../interfaces/IFlashloanFacet.sol"; +import { IAlpacaFlashloanCallback } from "../interfaces/IAlpacaFlashloanCallback.sol"; +import { IERC20 } from "../interfaces/IERC20.sol"; + +contract FlashloanFacet is IFlashloanFacet { + using LibSafeToken for IERC20; + + modifier nonReentrant() { + LibReentrancyGuard.lock(); + _; + LibReentrancyGuard.unlock(); + } + + // Event + event LogFlashloan( + address _token, + uint256 _amount, + uint256 _feeToLenders, + uint256 _feeToProtocol, + uint256 _excessFee + ); + + /// @notice Loan token and pay it back, plus fee, in the callback + /// @dev The caller of this method receives a callback in the form of IAlpacaFlashloanCallback#alpacaFlashloanCallback + /// @param _token The address of loan token + /// @param _amount The amount of the loan token + /// @param _data Any data to be passed through to the callback + function flashloan( + address _token, + uint256 _amount, + bytes calldata _data + ) external nonReentrant { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + + // only allow flashloan on opened market + if (moneyMarketDs.tokenToIbTokens[_token] == address(0)) { + revert FlashloanFacet_InvalidToken(); + } + + // expected fee = (_amount * flashloan fee (bps)) / max bps + uint256 _expectedFee = (_amount * moneyMarketDs.flashloanFeeBps) / LibConstant.MAX_BPS; + + if (_expectedFee == 0) { + revert FlashloanFacet_NoFee(); + } + + // cache balance before sending token to flashloaner + uint256 _balanceBefore = IERC20(_token).balanceOf(address(this)); + IERC20(_token).safeTransfer(msg.sender, _amount); + + // initiate callback at sender's contract + IAlpacaFlashloanCallback(msg.sender).alpacaFlashloanCallback(_token, _amount + _expectedFee, _data); + + // revert if the returned amount did not cover fee + uint256 _actualTotalFee = IERC20(_token).balanceOf(address(this)) - _balanceBefore; + if (_actualTotalFee < _expectedFee) { + revert FlashloanFacet_NotEnoughRepay(); + } + + // transfer excess fee to treasury + // in case flashloaner inject a lot of fee, the ib token price should not be inflated + // this is to prevent unforeseeable impact from inflating the ib token price + uint256 _excessFee; + if (_actualTotalFee > _expectedFee) { + unchecked { + _excessFee = _actualTotalFee - _expectedFee; + } + + IERC20(_token).safeTransfer(moneyMarketDs.flashloanTreasury, _excessFee); + } + + // calculate the actual lender fee by taking x% of expected fee + uint256 _feeToLenders = (_expectedFee * moneyMarketDs.lenderFlashloanBps) / LibConstant.MAX_BPS; + + // expected fee will be added to reserve + moneyMarketDs.reserves[_token] += _expectedFee; + // protocol portion will be booked to protocol reserve + uint256 _feeToProtocol; + unchecked { + _feeToProtocol = _expectedFee - _feeToLenders; + } + moneyMarketDs.protocolReserves[_token] += _feeToProtocol; + + emit LogFlashloan(_token, _amount, _feeToLenders, _feeToProtocol, _excessFee); + } +} diff --git a/solidity/contracts/money-market/facets/ViewFacet.sol b/solidity/contracts/money-market/facets/ViewFacet.sol index 329da8798..cc3064a04 100644 --- a/solidity/contracts/money-market/facets/ViewFacet.sol +++ b/solidity/contracts/money-market/facets/ViewFacet.sol @@ -416,6 +416,25 @@ contract ViewFacet is IViewFacet { _liquidationFeeBps = moneyMarketDs.liquidationFeeBps; } + /// @notice Get flashloan fees + /// @return _flashloanFeeBps the flashloan fee collected by protocol + /// @return _lenderFlashloanBps the portion that lenders will receive from _flashloanFeeBps + /// @return _flashloanTreasury Flashloan treasury address + function getFlashloanParams() + external + view + returns ( + uint16 _flashloanFeeBps, + uint16 _lenderFlashloanBps, + address _flashloanTreasury + ) + { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + _flashloanFeeBps = moneyMarketDs.flashloanFeeBps; + _lenderFlashloanBps = moneyMarketDs.lenderFlashloanBps; + _flashloanTreasury = moneyMarketDs.flashloanTreasury; + } + /// @notice Get the address of repurchase reward model /// @return address of repurchase reward model contract function getRepurchaseRewardModel() external view returns (address) { @@ -456,4 +475,44 @@ contract ViewFacet is IViewFacet { function getMiniFL() external view returns (address) { return address(LibMoneyMarket01.moneyMarketDiamondStorage().miniFL); } + + /// @notice Check given address is in liquidationStrat whitelist + /// @param _strat Strat address + /// @return Bool True if address is in liquidationStrat whitelist + function isLiquidationStratOk(address _strat) external view returns (bool) { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + return moneyMarketDs.liquidationStratOk[_strat]; + } + + /// @notice Check given address is in liquidator whitelist + /// @param _liquidator Liquidator address + /// @return Bool True if address is in liquidator whitelist + function isLiquidatorOk(address _liquidator) external view returns (bool) { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + return moneyMarketDs.liquidatorsOk[_liquidator]; + } + + /// @notice Check given address is in account manager whitelist + /// @param _accountManger account manager address + /// @return Bool True if address is in account manager whitelist + function isAccountManagersOk(address _accountManger) external view returns (bool) { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + return moneyMarketDs.accountManagersOk[_accountManger]; + } + + /// @notice Check given address is in risk manager whitelist + /// @param _riskManager risk manager address + /// @return Bool True if address is in risk manager whitelist + function isRiskManagersOk(address _riskManager) external view returns (bool) { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + return moneyMarketDs.riskManagersOk[_riskManager]; + } + + /// @notice Check given address is in operator whitelist + /// @param _operator operator address + /// @return Bool True if address is in operator whitelist + function isOperatorsOk(address _operator) external view returns (bool) { + LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs = LibMoneyMarket01.moneyMarketDiamondStorage(); + return moneyMarketDs.operatorsOk[_operator]; + } } diff --git a/solidity/contracts/money-market/interfaces/IAdminFacet.sol b/solidity/contracts/money-market/interfaces/IAdminFacet.sol index 0a7d15c85..09b2aa688 100644 --- a/solidity/contracts/money-market/interfaces/IAdminFacet.sol +++ b/solidity/contracts/money-market/interfaces/IAdminFacet.sol @@ -85,6 +85,12 @@ interface IAdminFacet { uint16 _newLiquidationFeeBps ) external; + function setFlashloanParams( + uint16 _flashloanFeeBps, + uint16 _lenderFlashloanBps, + address _flashloanTreasury + ) external; + function setRepurchaseRewardModel(IFeeModel _newRepurchaseRewardModel) external; function setIbTokenImplementation(address _newImplementation) external; @@ -113,5 +119,7 @@ interface IAdminFacet { uint256 _newMaxBorrow ) external; + function setOperatorsOk(address[] calldata _operators, bool _isOk) external; + function withdrawProtocolReserves(WithdrawProtocolReserveParam[] calldata _withdrawProtocolReserveParam) external; } diff --git a/solidity/contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol b/solidity/contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol new file mode 100644 index 000000000..fab7b1a96 --- /dev/null +++ b/solidity/contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +interface IAlpacaFlashloanCallback { + /// @notice Called to `msg.sender` after executing a flashloan via IFlashloanFacet#flashloan. + /// @param _token The address of loan token + /// @param _repay The atleast amount that msg.sender required for pay back + /// @param _data Any data to be passed through to the callback + function alpacaFlashloanCallback( + address _token, + uint256 _repay, + bytes calldata _data + ) external; +} diff --git a/solidity/contracts/money-market/interfaces/IFlashloanFacet.sol b/solidity/contracts/money-market/interfaces/IFlashloanFacet.sol new file mode 100644 index 000000000..672e72f5d --- /dev/null +++ b/solidity/contracts/money-market/interfaces/IFlashloanFacet.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +interface IFlashloanFacet { + // Errors + error FlashloanFacet_InvalidToken(); + error FlashloanFacet_NotEnoughToken(uint256 _amount); + error FlashloanFacet_NotEnoughRepay(); + error FlashloanFacet_NoFee(); + + /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback + /// @dev The caller of this method receives a callback in the form of IAlpacaFlashloanCallback#alpacaFlashloanCallback + /// @param _token The address of loan token + /// @param _amount The amount of the loan token + /// @param _data Any data to be passed through to the callback + function flashloan( + address _token, + uint256 _amount, + bytes calldata _data + ) external; +} diff --git a/solidity/contracts/money-market/interfaces/IMiniFL.sol b/solidity/contracts/money-market/interfaces/IMiniFL.sol index eb09bbc1a..38c0a0569 100644 --- a/solidity/contracts/money-market/interfaces/IMiniFL.sol +++ b/solidity/contracts/money-market/interfaces/IMiniFL.sol @@ -43,4 +43,6 @@ interface IMiniFL { function harvest(uint256 _pid) external; function harvestMany(uint256[] calldata _pids) external; + + function ALPACA() external view returns (address); } diff --git a/solidity/contracts/money-market/interfaces/IViewFacet.sol b/solidity/contracts/money-market/interfaces/IViewFacet.sol index af6924ade..38d87a8af 100644 --- a/solidity/contracts/money-market/interfaces/IViewFacet.sol +++ b/solidity/contracts/money-market/interfaces/IViewFacet.sol @@ -115,6 +115,15 @@ interface IViewFacet { uint16 _liquidationFeeBps ); + function getFlashloanParams() + external + view + returns ( + uint16 _flashloanFeeBps, + uint16 _lenderFlashloanBps, + address _flashloanTreasury + ); + function getRepurchaseRewardModel() external view returns (address); function getIbTokenImplementation() external view returns (address); @@ -128,4 +137,14 @@ interface IViewFacet { function getOracle() external view returns (address); function getMiniFL() external view returns (address); + + function isLiquidationStratOk(address _strat) external view returns (bool); + + function isLiquidatorOk(address _liquidator) external view returns (bool); + + function isAccountManagersOk(address _accountManger) external view returns (bool); + + function isRiskManagersOk(address _riskManager) external view returns (bool); + + function isOperatorsOk(address _operator) external view returns (bool); } diff --git a/solidity/contracts/money-market/libraries/BytesLib.sol b/solidity/contracts/money-market/libraries/LibBytes.sol similarity index 99% rename from solidity/contracts/money-market/libraries/BytesLib.sol rename to solidity/contracts/money-market/libraries/LibBytes.sol index ce97c47b5..ab5ce5987 100644 --- a/solidity/contracts/money-market/libraries/BytesLib.sol +++ b/solidity/contracts/money-market/libraries/LibBytes.sol @@ -8,7 +8,7 @@ */ pragma solidity 0.8.19; -library BytesLib { +library LibBytes { function slice( bytes memory _bytes, uint256 _start, diff --git a/solidity/contracts/money-market/libraries/LibMoneyMarket01.sol b/solidity/contracts/money-market/libraries/LibMoneyMarket01.sol index 3bb8a1b1a..a8a5490b7 100644 --- a/solidity/contracts/money-market/libraries/LibMoneyMarket01.sol +++ b/solidity/contracts/money-market/libraries/LibMoneyMarket01.sol @@ -150,6 +150,11 @@ library LibMoneyMarket01 { uint16 lendingFeeBps; // fee that is charged from lending interest by protocol, goes to protocolReserve uint16 repurchaseFeeBps; // fee that is charged during repurchase by protocol, goes to liquidationTreasury uint16 liquidationFeeBps; // fee that is charged during liquidation by protocol, goes to liquidationTreasury + uint16 flashloanFeeBps; // fee that is charged when providing the flashloan + uint16 lenderFlashloanBps; // portion of flashloan fee that will go to lenders + // Additional state + address flashloanTreasury; // a treasury to hold excess flashloan fee + mapping(address => bool) operatorsOk; // allowed to withdraw the protocol reserve } /// @dev Get money market storage diff --git a/solidity/contracts/oracle/ChainLinkPriceOracle2.sol b/solidity/contracts/oracle/ChainLinkPriceOracle2.sol deleted file mode 100644 index 1c0b8a932..000000000 --- a/solidity/contracts/oracle/ChainLinkPriceOracle2.sol +++ /dev/null @@ -1,142 +0,0 @@ -// SPDX-License-Identifier: BUSL -/** - ∩~~~~∩ - ξ ・×・ ξ - ξ ~ ξ - ξ   ξ - ξ   “~~~~〇 - ξ       ξ - ξ ξ ξ~~~ξ ξ ξ -  ξ_ξξ_ξ ξ_ξξ_ξ -Alpaca Fin Corporation -*/ -pragma solidity 0.8.19; - -import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; - -import { IChainLinkPriceOracle2 } from "./interfaces/IChainLinkPriceOracle2.sol"; -import { IAggregatorV3 } from "./interfaces/IAggregatorV3.sol"; - -contract ChainLinkPriceOracle2 is OwnableUpgradeable, IChainLinkPriceOracle2 { - /// --------------------------------------------------- - /// Errors - /// --------------------------------------------------- - error ChainlinkPriceOracle_InconsistentLength(); - error ChainlinkPriceOracle_InvalidPrice(); - error ChainlinkPriceOracle_NoSource(); - error ChainlinkPriceOracle_SourceExistedPair(); - error ChainlinkPriceOracle_SourceOverLimit(); - - /// --------------------------------------------------- - /// State - /// --------------------------------------------------- - /// @dev Mapping from token0, token1 to sources - mapping(address => mapping(address => mapping(uint256 => IAggregatorV3))) public priceFeeds; - mapping(address => mapping(address => uint256)) public priceFeedCount; - - /// --------------------------------------------------- - /// Event - /// --------------------------------------------------- - event LogSetPriceFeed(address indexed token0, address indexed token1, IAggregatorV3[] sources); - - constructor() { - _disableInitializers(); - } - - function initialize() external initializer { - OwnableUpgradeable.__Ownable_init(); - } - - /// @dev Set sources for multiple token pairs - /// @param token0s Token0 address to set source - /// @param token1s Token1 address to set source - /// @param allSources source for the token pair - function setPriceFeeds( - address[] calldata token0s, - address[] calldata token1s, - IAggregatorV3[][] calldata allSources - ) external onlyOwner { - // Check - if (token0s.length != token1s.length || token0s.length != allSources.length) - revert ChainlinkPriceOracle_InconsistentLength(); - - for (uint256 _i; _i < token0s.length; ) { - _setPriceFeed(token0s[_i], token1s[_i], allSources[_i]); - unchecked { - ++_i; - } - } - } - - /// @dev Set source for the token pair - /// @param token0 Token0 address to set source - /// @param token1 Token1 address to set source - /// @param sources source for the token pair - function _setPriceFeed( - address token0, - address token1, - IAggregatorV3[] memory sources - ) internal { - // Check - if (priceFeedCount[token1][token0] > 0) revert ChainlinkPriceOracle_SourceExistedPair(); - if (sources.length > 2) revert ChainlinkPriceOracle_SourceOverLimit(); - - // Effect - priceFeedCount[token0][token1] = sources.length; - for (uint256 _i; _i < sources.length; ) { - priceFeeds[token0][token1][_i] = sources[_i]; - unchecked { - ++_i; - } - } - - emit LogSetPriceFeed(token0, token1, sources); - } - - /// @dev Return the price of token0/token1, multiplied by 1e18 - /// @param token0 Token0 to set oracle sources - /// @param token1 Token1 to set oracle sources - function getPrice(address token0, address token1) public view override returns (uint256, uint256) { - if (uint256(priceFeedCount[token0][token1]) == 0 && uint256(priceFeedCount[token1][token0]) == 0) - revert ChainlinkPriceOracle_NoSource(); - - uint256 _price1 = 0; - uint256 _price2 = 0; - uint256 _lastUpdate1 = 0; - uint256 _lastUpdate2 = 0; - - if (priceFeedCount[token0][token1] != 0) { - (_price1, _lastUpdate1) = _extractPriceFeeds(token0, token1, 0, false); - if (priceFeedCount[token0][token1] == 2) { - (_price2, _lastUpdate2) = _extractPriceFeeds(token0, token1, 1, false); - return ((_price1 * 1e18) / _price2, _lastUpdate2 < _lastUpdate1 ? _lastUpdate2 : _lastUpdate1); - } - return (_price1, _lastUpdate1); - } - - (_price1, _lastUpdate1) = _extractPriceFeeds(token1, token0, 0, true); - if (priceFeedCount[token1][token0] == 2) { - (_price2, _lastUpdate2) = _extractPriceFeeds(token1, token0, 1, true); - return ((_price1 * 1e18) / _price2, _lastUpdate2 < _lastUpdate1 ? _lastUpdate2 : _lastUpdate1); - } - - return (_price1, _lastUpdate1); - } - - function _extractPriceFeeds( - address token0, - address token1, - uint8 index, - bool reversedPair - ) internal view returns (uint256, uint256) { - IAggregatorV3 priceFeed = priceFeeds[token0][token1][index]; - (, int256 answer, , uint256 lastUpdate, ) = priceFeed.latestRoundData(); - uint256 decimals = uint256(priceFeed.decimals()); - - uint256 price = reversedPair - ? ((10**decimals) * 1e18) / uint256(answer) - : ((uint256(answer) * 1e18) / (10**decimals)); - - return (price, lastUpdate); - } -} diff --git a/solidity/contracts/oracle/interfaces/IChainLinkPriceOracle.sol b/solidity/contracts/oracle/interfaces/IChainLinkPriceOracle.sol index 092adca3a..973250020 100644 --- a/solidity/contracts/oracle/interfaces/IChainLinkPriceOracle.sol +++ b/solidity/contracts/oracle/interfaces/IChainLinkPriceOracle.sol @@ -10,5 +10,5 @@ interface IChainLinkPriceOracle { IAggregatorV3[] calldata allSources ) external; - function getPrice(address token0, address token1) external returns (uint256, uint256); + function getPrice(address token0, address token1) external view returns (uint256, uint256); } diff --git a/solidity/contracts/reader/MoneyMarketReader.sol b/solidity/contracts/reader/MoneyMarketReader.sol index 1e1f3f53b..2c74511be 100644 --- a/solidity/contracts/reader/MoneyMarketReader.sol +++ b/solidity/contracts/reader/MoneyMarketReader.sol @@ -14,6 +14,7 @@ import { IOracleMedianizer } from "../oracle/interfaces/IOracleMedianizer.sol"; import { IAlpacaV2Oracle } from "../oracle/interfaces/IAlpacaV2Oracle.sol"; import { IMiniFL } from "../money-market/interfaces/IMiniFL.sol"; import { IInterestRateModel } from "../money-market/interfaces/IInterestRateModel.sol"; +import { IRewarder } from "../miniFL/interfaces/IRewarder.sol"; contract MoneyMarketReader is IMoneyMarketReader { IMoneyMarket private immutable _moneyMarket; @@ -28,22 +29,36 @@ contract MoneyMarketReader is IMoneyMarketReader { } /// @dev Get the reward summary - /// @param _underlyingToken The underlying token address + /// @param _pId Pool id of miniFL /// @param _account The account address - function getRewardSummary(address _underlyingToken, address _account) external view returns (RewardSummary memory) { - address _ibAddress = _moneyMarket.getIbTokenFromToken(_underlyingToken); - address _debtAddress = _moneyMarket.getDebtTokenFromToken(_underlyingToken); + /// @param _rewarders List of rewarder addresses associate with miniFL pId + function getRewardSummary( + uint256 _pId, + address _account, + address[] calldata _rewarders + ) external view returns (RewardSummary[] memory _rewardSummary) { + // include miniFL reward + uint256 _rewardLength = _rewarders.length + 1; + _rewardSummary = new RewardSummary[](_rewardLength); + + _rewardSummary[0] = RewardSummary({ + rewardToken: _miniFL.ALPACA(), + pId: _pId, + pendingReward: _miniFL.pendingAlpaca(_pId, _account) + }); - uint256 _ibPoolId = _moneyMarket.getMiniFLPoolIdOfToken(_ibAddress); - uint256 _debtPoolId = _moneyMarket.getMiniFLPoolIdOfToken(_debtAddress); + for (uint256 i; i < _rewarders.length; ) { + IRewarder _rewarder = IRewarder(_rewarders[i]); - return - RewardSummary({ - ibPoolId: _ibPoolId, - debtPoolId: _debtPoolId, - lendingPendingReward: _miniFL.pendingAlpaca(_ibPoolId, _account), - borrowingPendingReward: _miniFL.pendingAlpaca(_debtPoolId, _account) + _rewardSummary[i + 1] = RewardSummary({ + rewardToken: _rewarder.rewardToken(), + pId: _pId, + pendingReward: _rewarder.pendingToken(_pId, _account) }); + unchecked { + ++i; + } + } } /// @dev Get subaccount summary of collaterals and debts @@ -317,7 +332,7 @@ contract MoneyMarketReader is IMoneyMarketReader { marketStats.globalDebtValue = _moneyMarket.getGlobalDebtValue(_underlyingToken); marketStats.reserve = _moneyMarket.getFloatingBalance(_underlyingToken); marketStats.totalToken = _moneyMarket.getTotalToken(_underlyingToken); - marketStats.pendingIntetest = _moneyMarket.getGlobalPendingInterest(_underlyingToken); + marketStats.pendingInterest = _moneyMarket.getGlobalPendingInterest(_underlyingToken); marketStats.interestRate = _moneyMarket.getOverCollatInterestRate(_underlyingToken); marketStats.lastAccruedAt = _moneyMarket.getDebtLastAccruedAt(_underlyingToken); marketStats.blockTimestamp = block.timestamp; @@ -325,7 +340,11 @@ contract MoneyMarketReader is IMoneyMarketReader { return marketStats; } - function getMarketRewardInfo(address _underlyingToken) external view returns (MarketRewardInfo memory) { + function getMarketRewardInfo(address _underlyingToken, address[] calldata _rewarders) + external + view + returns (MarketRewardInfo memory) + { address _ibAddress = _moneyMarket.getIbTokenFromToken(_underlyingToken); address _debtAddress = _moneyMarket.getDebtTokenFromToken(_underlyingToken); @@ -340,15 +359,46 @@ contract MoneyMarketReader is IMoneyMarketReader { return MarketRewardInfo({ - debtTokenAllocPoint: _miniFL.getPoolAllocPoint(_debtPoolId), - ibTokenAllocPoint: _miniFL.getPoolAllocPoint(_ibPoolId), - totalAllocPoint: _miniFL.totalAllocPoint(), - rewardPerSec: _miniFL.alpacaPerSecond(), totalUnderlyingTokenInPool: IInterestBearingToken(_ibAddress).convertToAssets(_ibReserveAmount), - totalDebtTokenInPool: _totalDebtToken + totalDebtTokenInPool: _totalDebtToken, + ibRewarderInfos: _getRewardersInfo(_ibPoolId, _rewarders), + debtRewarderInfos: _getRewardersInfo(_debtPoolId, _rewarders) }); } + function _getRewardersInfo(uint256 _pId, address[] calldata _rewarders) + internal + view + returns (RewarderInfo[] memory _rewarderInfos) + { + uint256 rewarderLength = _rewarders.length + 1; + _rewarderInfos = new RewarderInfo[](rewarderLength); + + _rewarderInfos[0] = RewarderInfo({ + rewardToken: _miniFL.ALPACA(), + pId: _pId, + rewardPerSec: _miniFL.alpacaPerSecond(), + allocPoint: _miniFL.getPoolAllocPoint(_pId), + totalAllocPoint: _miniFL.totalAllocPoint() + }); + + for (uint256 i; i < _rewarders.length; ) { + IRewarder _rewarder = IRewarder(_rewarders[i]); + + _rewarderInfos[i + 1] = RewarderInfo({ + rewardToken: _rewarder.rewardToken(), + pId: _pId, + rewardPerSec: _rewarder.rewardPerSecond(), + allocPoint: _rewarder.getPoolAllocPoint(_pId), + totalAllocPoint: _rewarder.totalAllocPoint() + }); + + unchecked { + ++i; + } + } + } + function getMarketPriceInfo(address _underlyingToken) external view returns (MarketPriceInfo memory) { MarketPriceInfo memory marketPriceInfo; diff --git a/solidity/contracts/reader/PCSV3PathReader.sol b/solidity/contracts/reader/PCSV3PathReader.sol new file mode 100644 index 000000000..2a60bf491 --- /dev/null +++ b/solidity/contracts/reader/PCSV3PathReader.sol @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { LibPath } from "./libraries/LibPath.sol"; +import { IPancakeV3Pool } from "../money-market/interfaces/IPancakeV3Pool.sol"; +import { IUniSwapV3PathReader } from "./interfaces/IUniSwapV3PathReader.sol"; + +contract PCSV3PathReader is IUniSwapV3PathReader, Ownable { + using LibPath for bytes; + + address internal constant PANCAKE_V3_POOL_DEPLOYER = 0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9; + bytes32 internal constant POOL_INIT_CODE_HASH = 0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2; + + // tokenIn => tokenOut => path + mapping(address => mapping(address => bytes)) public override paths; + + // Errors + error PCSV3PathReader_NoLiquidity(address tokenA, address tokenB, uint24 fee); + + // Events + event LogSetPath(address _token0, address _token1, bytes _path); + + function setPaths(bytes[] calldata _paths) external onlyOwner { + uint256 _len = _paths.length; + for (uint256 _i; _i < _len; ) { + bytes memory _path = _paths[_i]; + + while (true) { + bool hasMultiplePools = LibPath.hasMultiplePools(_path); + + // extract the token from first encoded hop + (address _token0, address _token1, uint24 _fee) = _path.decodeFirstPool(); + + // compute pool address from token0, token1 and fee + address _pool = _computeAddressV3(_token0, _token1, _fee); + + // revert EVM error if pool is not existing (cannot call liquidity) + if (IPancakeV3Pool(_pool).liquidity() == 0) { + // revert no liquidity if there's no liquidity + revert PCSV3PathReader_NoLiquidity(_token0, _token1, _fee); + } + + // if true, go to the next hop + if (hasMultiplePools) { + _path = _path.skipToken(); + } else { + // if it's last hop + // Get source token address from first hop + (address _source, , ) = _paths[_i].decodeFirstPool(); + // Get destination token from last hop + (, address _destination, ) = _path.decodeFirstPool(); + // Assign to global paths + paths[_source][_destination] = _paths[_i]; + emit LogSetPath(_source, _destination, _paths[_i]); + break; + } + } + + unchecked { + ++_i; + } + } + } + + function _computeAddressV3( + address _tokenA, + address _tokenB, + uint24 _fee + ) internal pure returns (address pool) { + if (_tokenA > _tokenB) (_tokenA, _tokenB) = (_tokenB, _tokenA); + pool = address( + uint160( + uint256( + keccak256( + abi.encodePacked( + hex"ff", + PANCAKE_V3_POOL_DEPLOYER, + keccak256(abi.encode(_tokenA, _tokenB, _fee)), + POOL_INIT_CODE_HASH + ) + ) + ) + ) + ); + } +} diff --git a/solidity/contracts/reader/interfaces/IUniSwapV3PathReader.sol b/solidity/contracts/reader/interfaces/IUniSwapV3PathReader.sol new file mode 100644 index 000000000..12a8d164c --- /dev/null +++ b/solidity/contracts/reader/interfaces/IUniSwapV3PathReader.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +interface IUniSwapV3PathReader { + function setPaths(bytes[] calldata _paths) external; + + function paths(address _source, address _destination) external returns (bytes memory); +} diff --git a/solidity/contracts/reader/libraries/LibBytes.sol b/solidity/contracts/reader/libraries/LibBytes.sol new file mode 100644 index 000000000..ab5ce5987 --- /dev/null +++ b/solidity/contracts/reader/libraries/LibBytes.sol @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * @title Solidity Bytes Arrays Utils + * @author Gonçalo Sá + * + * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity. + * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage. + */ +pragma solidity 0.8.19; + +library LibBytes { + function slice( + bytes memory _bytes, + uint256 _start, + uint256 _length + ) internal pure returns (bytes memory) { + require(_length + 31 >= _length, "slice_overflow"); + require(_start + _length >= _start, "slice_overflow"); + require(_bytes.length >= _start + _length, "slice_outOfBounds"); + + bytes memory tempBytes; + + assembly { + switch iszero(_length) + case 0 { + // Get a location of some free memory and store it in tempBytes as + // Solidity does for memory variables. + tempBytes := mload(0x40) + + // The first word of the slice result is potentially a partial + // word read from the original array. To read it, we calculate + // the length of that partial word and start copying that many + // bytes into the array. The first word we copy will start with + // data we don't care about, but the last `lengthmod` bytes will + // land at the beginning of the contents of the new array. When + // we're done copying, we overwrite the full first word with + // the actual length of the slice. + let lengthmod := and(_length, 31) + + // The multiplication in the next line is necessary + // because when slicing multiples of 32 bytes (lengthmod == 0) + // the following copy loop was copying the origin's length + // and then ending prematurely not copying everything it should. + let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod))) + let end := add(mc, _length) + + for { + // The multiplication in the next line has the same exact purpose + // as the one above. + let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start) + } lt(mc, end) { + mc := add(mc, 0x20) + cc := add(cc, 0x20) + } { + mstore(mc, mload(cc)) + } + + mstore(tempBytes, _length) + + //update free-memory pointer + //allocating the array padded to 32 bytes like the compiler does now + mstore(0x40, and(add(mc, 31), not(31))) + } + //if we want a zero-length slice let's just return a zero-length array + default { + tempBytes := mload(0x40) + //zero out the 32 bytes slice we are about to return + //we need to do it because Solidity does not garbage collect + mstore(tempBytes, 0) + + mstore(0x40, add(tempBytes, 0x20)) + } + } + + return tempBytes; + } + + function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) { + require(_start + 20 >= _start, "toAddress_overflow"); + require(_bytes.length >= _start + 20, "toAddress_outOfBounds"); + address tempAddress; + + assembly { + tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000) + } + + return tempAddress; + } + + function toUint24(bytes memory _bytes, uint256 _start) internal pure returns (uint24) { + require(_start + 3 >= _start, "toUint24_overflow"); + require(_bytes.length >= _start + 3, "toUint24_outOfBounds"); + uint24 tempUint; + + assembly { + tempUint := mload(add(add(_bytes, 0x3), _start)) + } + + return tempUint; + } +} diff --git a/solidity/contracts/money-market/libraries/LibPath.sol b/solidity/contracts/reader/libraries/LibPath.sol similarity index 98% rename from solidity/contracts/money-market/libraries/LibPath.sol rename to solidity/contracts/reader/libraries/LibPath.sol index 1f4379709..218a179c7 100644 --- a/solidity/contracts/money-market/libraries/LibPath.sol +++ b/solidity/contracts/reader/libraries/LibPath.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.0; -import "./BytesLib.sol"; +import "./LibBytes.sol"; /// original is Path.sol from https://github.com/Uniswap/v3-periphery/blob/main/contracts/libraries/Path.sol /// @title Functions for manipulating path data for multihop swaps library LibPath { - using BytesLib for bytes; + using LibBytes for bytes; /// @dev The length of the bytes encoded address uint256 private constant ADDR_SIZE = 20; diff --git a/solidity/contracts/smart-treasury/SmartTreasury.sol b/solidity/contracts/smart-treasury/SmartTreasury.sol new file mode 100644 index 000000000..b41bd5d9d --- /dev/null +++ b/solidity/contracts/smart-treasury/SmartTreasury.sol @@ -0,0 +1,255 @@ +// SPDX-License-Identifier: BUSL +pragma solidity 0.8.19; + +// ---- External Libraries ---- // +import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; + +// ---- Libraries ---- // +import { LibSafeToken } from "../money-market/libraries/LibSafeToken.sol"; +import { LibConstant } from "solidity/contracts/money-market/libraries/LibConstant.sol"; + +// ---- Interfaces ---- // +import { IUniSwapV3PathReader } from "solidity/contracts/reader/interfaces/IUniSwapV3PathReader.sol"; +import { IPancakeSwapRouterV3 } from "../money-market/interfaces/IPancakeSwapRouterV3.sol"; +import { IERC20 } from "../money-market/interfaces/IERC20.sol"; +import { ISmartTreasury } from "../interfaces/ISmartTreasury.sol"; +import { IOracleMedianizer } from "solidity/contracts/oracle/interfaces/IOracleMedianizer.sol"; + +contract SmartTreasury is OwnableUpgradeable, ISmartTreasury { + using LibSafeToken for IERC20; + + event LogDistribute(address _token, uint256 _revenueAmount, uint256 _devAmount, uint256 _burnAmount); + event LogSetAllocPoints(uint256 _revenueAllocPoint, uint256 _devAllocPoint, uint256 _burnAllocPoint); + event LogSetRevenueToken(address _revenueToken); + event LogSetWhitelistedCaller(address indexed _caller, bool _allow); + event LogFailedDistribution(address _token, bytes _reason); + event LogSetSlippageToleranceBps(uint256 _slippageToleranceBps); + event LogSetTreasuryAddresses(address _revenueTreasury, address _devTreasury, address _burnTreasury); + event LogWithdraw(address _to, address _token, uint256 _amount); + + address public constant USD = 0x115dffFFfffffffffFFFffffFFffFfFfFFFFfFff; + + address public revenueTreasury; + uint16 public revenueAllocPoint; + + address public devTreasury; + uint16 public devAllocPoint; + + address public burnTreasury; + uint16 public burnAllocPoint; + + address public revenueToken; + + IPancakeSwapRouterV3 public router; + IUniSwapV3PathReader public pathReader; + IOracleMedianizer public oracleMedianizer; + + mapping(address => bool) public whitelistedCallers; + uint16 public slippageToleranceBps; + + modifier onlyWhitelisted() { + if (!whitelistedCallers[msg.sender]) { + revert SmartTreasury_Unauthorized(); + } + _; + } + + constructor() { + _disableInitializers(); + } + + function initialize( + address _router, + address _pathReader, + address _oracleMedianizer + ) external initializer { + OwnableUpgradeable.__Ownable_init(); + router = IPancakeSwapRouterV3(_router); + pathReader = IUniSwapV3PathReader(_pathReader); + oracleMedianizer = IOracleMedianizer(_oracleMedianizer); + } + + /// @notice Distribute the balance in this contract to each treasury + /// @dev This function will be called by external. + /// @param _tokens An array of tokens that want to distribute. + function distribute(address[] calldata _tokens) external onlyWhitelisted { + uint256 _length = _tokens.length; + for (uint256 _i; _i < _length; ) { + _distribute(_tokens[_i]); + unchecked { + ++_i; + } + } + } + + /// @notice Set allocation points + /// @param _revenueAllocPoint revenue treasury allocation point + /// @param _devAllocPoint dev treasury allocation point + /// @param _burnAllocPoint burn treasury allocation point + function setAllocPoints( + uint16 _revenueAllocPoint, + uint16 _devAllocPoint, + uint16 _burnAllocPoint + ) external onlyWhitelisted { + if ( + _revenueAllocPoint > LibConstant.MAX_BPS || + _devAllocPoint > LibConstant.MAX_BPS || + _burnAllocPoint > LibConstant.MAX_BPS + ) { + revert SmartTreasury_InvalidAllocPoint(); + } + + revenueAllocPoint = _revenueAllocPoint; + devAllocPoint = _devAllocPoint; + burnAllocPoint = _burnAllocPoint; + + emit LogSetAllocPoints(_revenueAllocPoint, _devAllocPoint, _burnAllocPoint); + } + + /// @notice Set revenue token + /// @dev Revenue token used for swapping before transfer to revenue treasury. + /// @param _revenueToken An address of destination token. + function setRevenueToken(address _revenueToken) external onlyWhitelisted { + // Sanity check + IERC20(_revenueToken).decimals(); + + revenueToken = _revenueToken; + emit LogSetRevenueToken(_revenueToken); + } + + /// @notice Set Slippage tolerance (bps) + /// @param _slippageToleranceBps Amount of Slippage Tolerance (bps) + function setSlippageToleranceBps(uint16 _slippageToleranceBps) external onlyWhitelisted { + if (_slippageToleranceBps > LibConstant.MAX_BPS) { + revert SmartTreasury_SlippageTolerance(); + } + slippageToleranceBps = _slippageToleranceBps; + emit LogSetSlippageToleranceBps(_slippageToleranceBps); + } + + /// @notice Set treasury addresses + /// @dev The destination addresses for distribution + /// @param _revenueTreasury An address of revenue treasury + /// @param _devTreasury An address of dev treasury + /// @param _burnTreasury An address of burn treasury + function setTreasuryAddresses( + address _revenueTreasury, + address _devTreasury, + address _burnTreasury + ) external onlyWhitelisted { + if (_revenueTreasury == address(0) || _devTreasury == address(0) || _burnTreasury == address(0)) { + revert SmartTreasury_InvalidAddress(); + } + + revenueTreasury = _revenueTreasury; + devTreasury = _devTreasury; + burnTreasury = _burnTreasury; + + emit LogSetTreasuryAddresses(_revenueTreasury, _devTreasury, _burnTreasury); + } + + /// @notice Set whitelisted callers + /// @param _callers The addresses of the callers that are going to be whitelisted. + /// @param _allow Whether to allow or disallow callers. + function setWhitelistedCallers(address[] calldata _callers, bool _allow) external onlyOwner { + uint256 _length = _callers.length; + for (uint256 _i; _i < _length; ) { + whitelistedCallers[_callers[_i]] = _allow; + emit LogSetWhitelistedCaller(_callers[_i], _allow); + + unchecked { + ++_i; + } + } + } + + function _getMinAmountOut( + address _tokenIn, + address _tokenOut, + uint256 _amountIn + ) internal view returns (uint256 _minAmountOut) { + (uint256 _tokenInPrice, ) = oracleMedianizer.getPrice(_tokenIn, USD); + + uint256 _minAmountOutUSD = (_amountIn * _tokenInPrice * (LibConstant.MAX_BPS - slippageToleranceBps)) / + (10**IERC20(_tokenIn).decimals() * LibConstant.MAX_BPS); + + (uint256 _tokenOutPrice, ) = oracleMedianizer.getPrice(_tokenOut, USD); + _minAmountOut = ((_minAmountOutUSD * (10**IERC20(_tokenOut).decimals())) / _tokenOutPrice); + } + + function _distribute(address _token) internal { + uint256 _amount = IERC20(_token).balanceOf(address(this)); + (uint256 _revenueAmount, uint256 _devAmount, uint256 _burnAmount) = _allocate(_amount); + + if (_revenueAmount != 0) { + if (_token == revenueToken) { + IERC20(_token).safeTransfer(revenueTreasury, _revenueAmount); + } else { + bytes memory _path = pathReader.paths(_token, revenueToken); + if (_path.length == 0) { + revert SmartTreasury_PathConfigNotFound(); + } + + IPancakeSwapRouterV3.ExactInputParams memory params = IPancakeSwapRouterV3.ExactInputParams({ + path: _path, + recipient: revenueTreasury, + deadline: block.timestamp, + amountIn: _revenueAmount, + amountOutMinimum: _getMinAmountOut(_token, revenueToken, _revenueAmount) + }); + + // Swap and send to revenue treasury + IERC20(_token).safeApprove(address(router), _revenueAmount); + try router.exactInput(params) {} catch (bytes memory _reason) { + emit LogFailedDistribution(_token, _reason); + return; + } + } + } + + if (_devAmount != 0) { + IERC20(_token).safeTransfer(devTreasury, _devAmount); + } + + if (_burnAmount != 0) { + IERC20(_token).safeTransfer(burnTreasury, _burnAmount); + } + + emit LogDistribute(_token, _revenueAmount, _devAmount, _burnAmount); + } + + function _allocate(uint256 _amount) + internal + view + returns ( + uint256 _revenueAmount, + uint256 _devAmount, + uint256 _burnAmount + ) + { + if (_amount != 0) { + uint256 _totalAllocPoint = revenueAllocPoint + devAllocPoint + burnAllocPoint; + _devAmount = (_amount * devAllocPoint) / _totalAllocPoint; + _burnAmount = (_amount * burnAllocPoint) / _totalAllocPoint; + unchecked { + _revenueAmount = _amount - _devAmount - _burnAmount; + } + } + } + + function withdraw(address[] calldata _tokens, address _to) external onlyOwner { + uint256 _length = _tokens.length; + for (uint256 _i; _i < _length; ) { + _withdraw(_tokens[_i], _to); + unchecked { + ++_i; + } + } + } + + function _withdraw(address _token, address _to) internal { + uint256 _amount = IERC20(_token).balanceOf(address(this)); + IERC20(_token).transfer(_to, _amount); + emit LogWithdraw(_to, _token, _amount); + } +} diff --git a/solidity/tests/base/BaseTest.sol b/solidity/tests/base/BaseTest.sol index 89fd206e4..743aa8045 100644 --- a/solidity/tests/base/BaseTest.sol +++ b/solidity/tests/base/BaseTest.sol @@ -20,7 +20,6 @@ import { InterestBearingToken } from "../../contracts/money-market/InterestBeari // oracle import { SimplePriceOracle } from "../../contracts/oracle/SimplePriceOracle.sol"; -import { ChainLinkPriceOracle2 } from "../../contracts/oracle/ChainLinkPriceOracle2.sol"; import { AlpacaV2Oracle, IAlpacaV2Oracle } from "../../contracts/oracle/AlpacaV2Oracle.sol"; import { OracleMedianizer } from "../../contracts/oracle/OracleMedianizer.sol"; @@ -138,7 +137,7 @@ contract BaseTest is DSTest, StdUtils, StdAssertions, StdCheats { // miniFL - _setupProxyAdmin(); + proxyAdmin = _setupProxyAdmin(); vm.label(DEPLOYER, "DEPLOYER"); vm.label(ALICE, "ALICE"); @@ -241,7 +240,7 @@ contract BaseTest is DSTest, StdUtils, StdAssertions, StdCheats { function _setupUpgradeable(bytes memory _logicBytecode, bytes memory _initializer) internal returns (address) { bytes memory _proxyBytecode = abi.encodePacked( - vm.getCode("./out/AdminUpgradeabilityProxy.sol/AdminUpgradeabilityProxy.json") + vm.getCode("./out/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json") ); address _logic; diff --git a/solidity/contracts/money-market/libraries/LibPCSV3PoolAddress.sol b/solidity/tests/libs/LibPCSV3PoolAddress.sol similarity index 100% rename from solidity/contracts/money-market/libraries/LibPCSV3PoolAddress.sol rename to solidity/tests/libs/LibPCSV3PoolAddress.sol diff --git a/solidity/tests/miniFL/MiniFL_BaseTest.t.sol b/solidity/tests/miniFL/MiniFL_BaseTest.t.sol index 8dac5b938..449d37a66 100644 --- a/solidity/tests/miniFL/MiniFL_BaseTest.t.sol +++ b/solidity/tests/miniFL/MiniFL_BaseTest.t.sol @@ -73,10 +73,10 @@ contract MiniFL_BaseTest is BaseTest { // | Pool | AllocPoint | // | DToken | 100 | function setupRewarder() internal { - rewarder1.addPool(90, wethPoolID, false); - rewarder1.addPool(10, dtokenPoolID, false); + rewarder1.addPool(wethPoolID, 90, false); + rewarder1.addPool(dtokenPoolID, 10, false); - rewarder2.addPool(100, wethPoolID, false); + rewarder2.addPool(wethPoolID, 100, false); address[] memory _poolWethRewarders = new address[](2); _poolWethRewarders[0] = address(rewarder1); diff --git a/solidity/tests/miniFL/MiniFL_SetPoolRewarders.t.sol b/solidity/tests/miniFL/MiniFL_SetPoolRewarders.t.sol index ecf6a419f..a826ce6ff 100644 --- a/solidity/tests/miniFL/MiniFL_SetPoolRewarders.t.sol +++ b/solidity/tests/miniFL/MiniFL_SetPoolRewarders.t.sol @@ -17,10 +17,10 @@ contract MiniFL_SetPoolRewardersTest is MiniFL_BaseTest { } function testCorrectness_WhenSetPoolRewarders() external { - rewarder1.addPool(90, wethPoolID, false); - rewarder1.addPool(10, dtokenPoolID, false); + rewarder1.addPool(wethPoolID, 90, false); + rewarder1.addPool(dtokenPoolID, 10, false); - rewarder2.addPool(100, wethPoolID, false); + rewarder2.addPool(wethPoolID, 100, false); address[] memory _poolWethRewarders = new address[](2); _poolWethRewarders[0] = address(rewarder1); diff --git a/solidity/tests/mocks/MockFlashloan.sol b/solidity/tests/mocks/MockFlashloan.sol new file mode 100644 index 000000000..ece9cd385 --- /dev/null +++ b/solidity/tests/mocks/MockFlashloan.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { IAlpacaFlashloanCallback } from "../../contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol"; +import { IFlashloanFacet } from "../../contracts/money-market/interfaces/IFlashloanFacet.sol"; +import { IERC20 } from "../../contracts/money-market/interfaces/IERC20.sol"; + +contract MockFlashloan is IAlpacaFlashloanCallback { + IFlashloanFacet internal immutable flashloanRouter; + + constructor(address _flashloanRouter) { + flashloanRouter = IFlashloanFacet(_flashloanRouter); + } + + function flash( + address _token, + uint256 _amount, + bytes calldata _data + ) external { + flashloanRouter.flashloan(_token, _amount, _data); + } + + function alpacaFlashloanCallback( + address _token, + uint256 _repay, + bytes calldata _data + ) external { + // if no data, just repay + if (_data.length == 0) { + IERC20(_token).transfer(msg.sender, _repay); + } else { + // if data exist, repay +- (fee) + int256 _fee = abi.decode(_data, (int256)); + + uint256 _actualRepay = uint256(int256(_repay) + _fee); + + IERC20(_token).transfer(msg.sender, _actualRepay); + } + } +} diff --git a/solidity/tests/mocks/MockFlashloan_Redeposit.sol b/solidity/tests/mocks/MockFlashloan_Redeposit.sol new file mode 100644 index 000000000..5acc64a49 --- /dev/null +++ b/solidity/tests/mocks/MockFlashloan_Redeposit.sol @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { IAlpacaFlashloanCallback } from "../../contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol"; +import { IFlashloanFacet } from "../../contracts/money-market/interfaces/IFlashloanFacet.sol"; +import { IERC20 } from "../../contracts/money-market/interfaces/IERC20.sol"; +import { IMoneyMarketAccountManager } from "../../contracts/interfaces/IMoneyMarketAccountManager.sol"; +import { ILendFacet } from "../../contracts/money-market/interfaces/ILendFacet.sol"; + +contract MockFlashloan_Redeposit is IAlpacaFlashloanCallback { + IFlashloanFacet internal immutable flashloanRouter; + + constructor(address _flashloanRouter) { + flashloanRouter = IFlashloanFacet(_flashloanRouter); + } + + function flash( + address _token, + uint256 _amount, + bytes calldata _data + ) external { + flashloanRouter.flashloan(_token, _amount, _data); + } + + function alpacaFlashloanCallback( + address _token, + uint256 _repay, + bytes calldata _data + ) external { + // data will be included: + ///@param _accountManager address of account manager + ///@param _amount: the borrow amount (not including fee yet) + // if data exists, call deposit via the account manager + if (_data.length > 0) { + (address _accountManager, uint256 _amount) = abi.decode(_data, (address, uint256)); + IERC20(_token).approve(_accountManager, type(uint256).max); + IMoneyMarketAccountManager(_accountManager).deposit(_token, _amount); + IERC20(_token).transfer(msg.sender, _repay); + } else { + // if data not exists, call deposit directly to moneymarket diamond + IERC20(_token).approve(msg.sender, type(uint256).max); + ILendFacet(msg.sender).deposit(address(this), _token, _repay); + IERC20(_token).transfer(msg.sender, _repay); + } + } +} diff --git a/solidity/tests/mocks/MockFlashloan_Repurchase.sol b/solidity/tests/mocks/MockFlashloan_Repurchase.sol new file mode 100644 index 000000000..98a5fb596 --- /dev/null +++ b/solidity/tests/mocks/MockFlashloan_Repurchase.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { IAlpacaFlashloanCallback } from "../../contracts/money-market/interfaces/IAlpacaFlashloanCallback.sol"; +import { IFlashloanFacet } from "../../contracts/money-market/interfaces/IFlashloanFacet.sol"; +import { IERC20 } from "../../contracts/money-market/interfaces/IERC20.sol"; + +// repurchase +import { ILiquidationFacet } from "../../contracts/money-market/interfaces/ILiquidationFacet.sol"; + +contract MockFlashloan_Repurchase is IAlpacaFlashloanCallback { + IFlashloanFacet internal immutable flashloanRouter; + + struct RepurchaseParam { + address _account; + uint256 _subAccountId; + address _repayToken; + address _collatToken; + uint256 _desiredRepayAmount; + } + + constructor(address _flashloanRouter) { + flashloanRouter = IFlashloanFacet(_flashloanRouter); + } + + function flash( + address _token, + uint256 _amount, + bytes calldata _data + ) external { + flashloanRouter.flashloan(_token, _amount, _data); + } + + function alpacaFlashloanCallback( + address _token, + uint256 _repay, + bytes calldata _data + ) external { + // repurchaser call repurchase via liquidation + RepurchaseParam memory _param = abi.decode(_data, (RepurchaseParam)); + ILiquidationFacet(msg.sender).repurchase( + _param._account, + _param._subAccountId, + _param._repayToken, + _param._collatToken, + _param._desiredRepayAmount + ); + IERC20(_token).transfer(msg.sender, _repay); + } +} diff --git a/solidity/tests/money-market/MoneyMarket_BaseTest.t.sol b/solidity/tests/money-market/MoneyMarket_BaseTest.t.sol index 062166bc2..eee4f475f 100644 --- a/solidity/tests/money-market/MoneyMarket_BaseTest.t.sol +++ b/solidity/tests/money-market/MoneyMarket_BaseTest.t.sol @@ -17,6 +17,7 @@ import { INonCollatBorrowFacet } from "../../contracts/money-market/interfaces/I import { ILiquidationFacet } from "../../contracts/money-market/interfaces/ILiquidationFacet.sol"; import { IMMOwnershipFacet } from "../../contracts/money-market/interfaces/IMMOwnershipFacet.sol"; import { IMoneyMarketAccountManager } from "../../contracts/interfaces/IMoneyMarketAccountManager.sol"; +import { IFlashloanFacet } from "../../contracts/money-market/interfaces/IFlashloanFacet.sol"; import { IERC20 } from "../../contracts/money-market/interfaces/IERC20.sol"; // mocks @@ -44,6 +45,7 @@ abstract contract MoneyMarket_BaseTest is BaseTest { INonCollatBorrowFacet internal nonCollatBorrowFacet; ILiquidationFacet internal liquidationFacet; IMMOwnershipFacet internal MMOwnershipFacet; + IFlashloanFacet internal flashloanFacet; MockAlpacaV2Oracle internal mockOracle; @@ -60,6 +62,7 @@ abstract contract MoneyMarket_BaseTest is BaseTest { nonCollatBorrowFacet = INonCollatBorrowFacet(moneyMarketDiamond); liquidationFacet = ILiquidationFacet(moneyMarketDiamond); MMOwnershipFacet = IMMOwnershipFacet(moneyMarketDiamond); + flashloanFacet = IFlashloanFacet(moneyMarketDiamond); address[] memory _whitelistedCallers = new address[](1); _whitelistedCallers[0] = moneyMarketDiamond; @@ -223,7 +226,6 @@ abstract contract MoneyMarket_BaseTest is BaseTest { adminFacet.setLiquidationTreasury(liquidationTreasury); // adminFacet.setFees(_newLendingFeeBps, _newRepurchaseFeeBps, _newLiquidationFeeBps); - adminFacet.setFees(0, 100, 100); // set liquidation params: maxLiquidate 50%, liquidationThreshold 111.11% diff --git a/solidity/tests/money-market/account-manager/MoneyMarket_AccountManager.t.sol b/solidity/tests/money-market/account-manager/MoneyMarket_AccountManager.t.sol index 536bd6f11..8ecb0565c 100644 --- a/solidity/tests/money-market/account-manager/MoneyMarket_AccountManager.t.sol +++ b/solidity/tests/money-market/account-manager/MoneyMarket_AccountManager.t.sol @@ -51,4 +51,14 @@ contract MoneyMarket_AccountManagerTest is MoneyMarket_BaseTest { assertEq(weth.balanceOf(ALICE), _wethBalanceBefore); } + + function testCorrectness_UnstakeAndWithdrawETH_ShouldWork() external { + uint256 _nativeTokenBalance = ALICE.balance; + vm.startPrank(ALICE); + accountManager.depositETHAndStake{ value: 10 ether }(); + accountManager.unstakeAndWithdrawETH(10 ether); + vm.stopPrank(); + + assertEq(weth.balanceOf(ALICE), _nativeTokenBalance); + } } diff --git a/solidity/tests/money-market/accrue-interest/MoneyMarket_AccrueInterest_Borrow.t.sol b/solidity/tests/money-market/accrue-interest/MoneyMarket_AccrueInterest_Borrow.t.sol index e061b5850..005eecf4a 100644 --- a/solidity/tests/money-market/accrue-interest/MoneyMarket_AccrueInterest_Borrow.t.sol +++ b/solidity/tests/money-market/accrue-interest/MoneyMarket_AccrueInterest_Borrow.t.sol @@ -17,6 +17,10 @@ contract MoneyMarket_AccrueInterest_Borrow is MoneyMarket_BaseTest { function setUp() public override { super.setUp(); + // set whitelist + address[] memory _operators = new address[](1); + _operators[0] = ALICE; + adminFacet.setOperatorsOk(_operators, true); mockToken = deployMockErc20("Mock token", "MOCK", 18); mockToken.mint(ALICE, 1000 ether); @@ -430,18 +434,27 @@ contract MoneyMarket_AccrueInterest_Borrow is MoneyMarket_BaseTest { _withdrawInput[0] = IAdminFacet.WithdrawProtocolReserveParam(address(weth), address(this), 5e16); // test withdrawing reserve + vm.startPrank(ALICE); vm.expectRevert(IAdminFacet.AdminFacet_ReserveTooLow.selector); adminFacet.withdrawProtocolReserves(_withdrawInput); + vm.stopPrank(); _withdrawInput[0] = IAdminFacet.WithdrawProtocolReserveParam(address(weth), address(this), 4e16); - vm.prank(ALICE); - vm.expectRevert("LibDiamond: Must be contract owner"); + // call withdraw by deployer, should revert unauthorized + vm.expectRevert(abi.encodeWithSelector(IAdminFacet.AdminFacet_Unauthorized.selector)); + adminFacet.withdrawProtocolReserves(_withdrawInput); + + // call withdraw by unauthorized person, should revert unauthorized + vm.prank(BOB); + vm.expectRevert(abi.encodeWithSelector(IAdminFacet.AdminFacet_Unauthorized.selector)); adminFacet.withdrawProtocolReserves(_withdrawInput); + vm.startPrank(ALICE); adminFacet.withdrawProtocolReserves(_withdrawInput); assertEq(viewFacet.getProtocolReserve(address(weth)), 0); assertEq(viewFacet.getTotalToken(address(weth)), 5396e16); + vm.stopPrank(); } function testCorrectness_WhenUsersBorrowSameTokenButDifferentInterestModel_ShouldaccrueInterestCorrectly() external { diff --git a/solidity/tests/money-market/flashloan/MoneyMarket_Flashloan.t.sol b/solidity/tests/money-market/flashloan/MoneyMarket_Flashloan.t.sol new file mode 100644 index 000000000..93fe5dd2d --- /dev/null +++ b/solidity/tests/money-market/flashloan/MoneyMarket_Flashloan.t.sol @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { MoneyMarket_BaseTest, console } from "../MoneyMarket_BaseTest.t.sol"; + +// libs +import { LibMoneyMarket01 } from "../../../contracts/money-market/libraries/LibMoneyMarket01.sol"; +import { LibConstant } from "../../../contracts/money-market/libraries/LibConstant.sol"; +import { LibReentrancyGuard } from "../../../contracts/money-market/libraries/LibReentrancyGuard.sol"; + +// interfaces +import { IFlashloanFacet } from "../../../contracts/money-market/interfaces/IFlashloanFacet.sol"; +import { IERC20 } from "../../../contracts/money-market/interfaces/IERC20.sol"; + +// mock +import { MockFlashloan } from "../../mocks/MockFlashloan.sol"; +import { MockFlashloan_Redeposit } from "../../mocks/MockFlashloan_Redeposit.sol"; +import { MockFlashloan_Repurchase } from "../../mocks/MockFlashloan_Repurchase.sol"; + +contract MoneyMarket_Flashloan is MoneyMarket_BaseTest { + MockFlashloan internal mockFlashloan; + address internal flashloanTreasury; + + struct RepurchaseParam { + address _account; + uint256 _subAccountId; + address _repayToken; + address _collatToken; + uint256 _desiredRepayAmount; + } + + function setUp() public override { + super.setUp(); + flashloanTreasury = address(111); + adminFacet.setFlashloanParams(500, 5000, flashloanTreasury); + + mockFlashloan = new MockFlashloan(moneyMarketDiamond); + // add 5 usdc to mock flashloan contract + usdc.mint(address(mockFlashloan), normalizeEther(5 ether, usdcDecimal)); + + // add 10 USDC to moneymarket's reserve + vm.prank(ALICE); + uint256 _depositAmount = normalizeEther(10 ether, usdcDecimal); + accountManager.deposit(address(usdc), _depositAmount); + } + + // NOTE: if token is not available/existing in pool. + // It will revert same as "no liquidity" or "ERC20: transfer amount exceeds balance" + + function testCorrectness_WhenUserCallFlashloan_ShouldWork() external { + // flashloan 1 usdc + uint256 _flashloanAmount = normalizeEther(1 ether, usdcDecimal); + + // Fee calculation: + // ============================= + // fee = 5% of amount + // flashloan amount: 1 USDC + // fee = 1 USDC * 5% = 0.05 USDC + // Contract: 5 USDC + // After call flashloan = balance - fee from flashloan + // = 5 - (1 * 5%) = 4.95 USDC + + // Reserve calculation: + // ============================= + // Market reserve: 10 USDC + // After call flashloan, reserve = current reserve + (50% of fee from flashloan's amount) + // fee = 0.05 USDC + // reserve = 10 + 0.05 = 10.05 USDC + // protocol reserve = 0.025 USDC + // total token = 10.05 - 0.025 = 10.025 USDC + + // call flashloan with 1 usdc + mockFlashloan.flash(address(usdc), _flashloanAmount, ""); + + // mock flashloan contract should have 5 - (1 * fee) = 4.95 usdc + uint256 _mockFlashloanBalanceAfter = usdc.balanceOf(address(mockFlashloan)); + + // - user balance is deducted correctly + assertEq(_mockFlashloanBalanceAfter, normalizeEther(4.95 ether, usdcDecimal), "mockFlashloan USDC balance"); + + // - reserve increase correctly + uint256 _reserve = viewFacet.getFloatingBalance(address(usdc)); + assertEq(_reserve, normalizeEther(10.05 ether, usdcDecimal), "Reserve"); + + // - protocol reserve increase correctly + // 0 -> 0.025 + uint256 _protocolReserve = viewFacet.getProtocolReserve(address(usdc)); + assertEq(_protocolReserve, normalizeEther(0.025 ether, usdcDecimal), "Protocol reserve"); + } + + // test if repay excess the expected fee (should work) + function testCorrectness_WhenContractRepayGreaterThanExpectedFee_ShouldWork() external { + // define flashloan amount + uint256 _flashloanAmount = normalizeEther(1 ether, usdcDecimal); + + // define data for use as extra fee + bytes memory _data = abi.encode(normalizeEther(1 ether, usdcDecimal)); + + // call flashloan with 1 usdc with extra fee (1 usdc) + mockFlashloan.flash(address(usdc), _flashloanAmount, _data); + + // check contract + uint256 _mockFlashloanBalanceAfter = usdc.balanceOf(address(mockFlashloan)); + + // Contract should have 5 - (1 * fee) - 1 (extra fee) = 3.95 usdc + assertEq(_mockFlashloanBalanceAfter, normalizeEther(3.95 ether, usdcDecimal)); + + // check reserve + // Reserve = 10 USDC + // fee = 0.05 USDC + // After flash, reserve = current + fee + extra + // 10 + 0.05 + 1 = 11.05 USDC # + // Extra 1 USDC should go to flashloan treasury + // protocol reserve = current + fee = 0 + 0.025 = 0.025 USDC # + uint256 _reserve = viewFacet.getFloatingBalance(address(usdc)); + assertEq(_reserve, normalizeEther(10.05 ether, usdcDecimal), "Reserve"); + + uint256 _protocolReserve = viewFacet.getProtocolReserve(address(usdc)); + assertEq(_protocolReserve, normalizeEther(0.025 ether, usdcDecimal), "Protocol reserve"); + + assertEq(usdc.balanceOf(flashloanTreasury), normalizeEther(1 ether, usdcDecimal), "Flashloan Treasury"); + } + + // test if repay less than the expected fee (should revert) + function testRevert_WhenContractRepayLessThanExpectedFee_ShouldRevert() external { + uint256 _flashloanAmount = normalizeEther(1 ether, usdcDecimal); + bytes memory _data = abi.encode(-int256(normalizeEther(0.01 ether, usdcDecimal))); + + // call flashloan with 1 USDC with -0.01 USDC fee + vm.expectRevert(abi.encodeWithSelector(IFlashloanFacet.FlashloanFacet_NotEnoughRepay.selector)); + mockFlashloan.flash(address(usdc), _flashloanAmount, _data); + } + + // test if loan amount is bigger than reserve + function testRevert_WhenLoanAmountIsBiggerThanReserve_ShouldRevert() external { + // reserve = 10 USDC + // loan = 11 USDC + uint256 _flashloanAmount = normalizeEther(11 ether, usdcDecimal); + + // call flashloan with 11 usdc + // in detail, should revert "ERC20: transfer amount exceeds balance". But we use safeTransfer Lib + vm.expectRevert("!safeTransfer"); + mockFlashloan.flash(address(usdc), _flashloanAmount, ""); + } + + // Flash and deposit back to mm, should revert with Reentrant error + function testRevert_WhenContractCallFlashloanAndDepositBacktoMM_ShouldRevert() external { + // mock flashloan have: 5 USDC + // reserve and balanceOf(mm): 10 USDC + + // flashloan all balance + uint256 _flashloanAmount = usdc.balanceOf(moneyMarketDiamond); + + // mock new flashloan that implements redeposit + MockFlashloan_Redeposit _mockRedepositFlashloan = new MockFlashloan_Redeposit(moneyMarketDiamond); + usdc.mint(address(_mockRedepositFlashloan), normalizeEther(5 ether, usdcDecimal)); + + // deposit back to mm + // - direct, should revert LibReentrancyGuard_ReentrantCall before LibMoneyMarket01_UnAuthorized + { + vm.expectRevert(LibReentrancyGuard.LibReentrancyGuard_ReentrantCall.selector); + _mockRedepositFlashloan.flash(address(usdc), _flashloanAmount, ""); + } + // - via account manager, should revert LibReentrancyGuard_ReentrantCall + { + bytes memory _data = abi.encode(address(accountManager), _flashloanAmount); + vm.expectRevert(LibReentrancyGuard.LibReentrancyGuard_ReentrantCall.selector); + _mockRedepositFlashloan.flash(address(usdc), _flashloanAmount, _data); + } + } + + // Flash and repurchase, should revert with Reentrant error + function testRevert_WhenContractCallFlashloanAndRepurchase_ShouldRevert() external { + // mock flashloan have: 5 USDC + // reserve and balanceOf(mm): 10 USDC + + // flashloan all balance + uint256 _flashloanAmount = usdc.balanceOf(moneyMarketDiamond); + + // mock new flashloan that implements redeposit + MockFlashloan_Repurchase _mockRepurchaseFlashloan = new MockFlashloan_Repurchase(moneyMarketDiamond); + usdc.mint(address(_mockRepurchaseFlashloan), normalizeEther(5 ether, usdcDecimal)); + + // repurchase param (Don't need to consider the param, it should revert reentrancy first) + RepurchaseParam memory _param = RepurchaseParam(ALICE, 0, address(cake), address(usdc), 1 ether); + + // repurchase + { + bytes memory _data = abi.encode(_param); + vm.expectRevert(LibReentrancyGuard.LibReentrancyGuard_ReentrantCall.selector); + _mockRepurchaseFlashloan.flash(address(usdc), _flashloanAmount, _data); + } + } + + function testRevert_IfExpectedFeeIsZero_ShouldRevert() external { + // this should cause precision loss on expected fee + vm.expectRevert(IFlashloanFacet.FlashloanFacet_NoFee.selector); + mockFlashloan.flash(address(usdc), 10, ""); + } + + function testRevert_WhenTryToFlashloanNonExistingMarket_ShouldRevert() external { + vm.expectRevert(IFlashloanFacet.FlashloanFacet_InvalidToken.selector); + mockFlashloan.flash(address(888), 10, ""); + } +} diff --git a/solidity/tests/money-market/liquidation-strategiesV3/BasePCSV3LiquidationForkTest.sol b/solidity/tests/money-market/liquidation-strategiesV3/BasePCSV3LiquidationForkTest.sol index 61f670c73..4467377b5 100644 --- a/solidity/tests/money-market/liquidation-strategiesV3/BasePCSV3LiquidationForkTest.sol +++ b/solidity/tests/money-market/liquidation-strategiesV3/BasePCSV3LiquidationForkTest.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import { DSTest } from "solidity/tests/base/DSTest.sol"; import "../../utils/Components.sol"; -import { PancakeswapV3IbTokenLiquidationStrategy } from "solidity/contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol"; +import { PCSV3PathReader } from "solidity/contracts/reader/PCSV3PathReader.sol"; // interfaces import { IPancakeSwapRouterV3 } from "solidity/contracts/money-market/interfaces/IPancakeSwapRouterV3.sol"; @@ -47,7 +47,7 @@ contract BasePCSV3LiquidationForkTest is DSTest, StdUtils, StdAssertions, StdChe IPancakeSwapRouterV3 internal router = IPancakeSwapRouterV3(0x1b81D678ffb9C0263b24A97847620C99d213eB14); IQuoterV2 internal quoterV2 = IQuoterV2(0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997); MockMoneyMarket internal moneyMarket; - PancakeswapV3IbTokenLiquidationStrategy internal liquidationStrat; + PCSV3PathReader internal pathReader; function setUp() public virtual { vm.selectFork(vm.createFork(BSC_URL_RPC)); @@ -62,8 +62,7 @@ contract BasePCSV3LiquidationForkTest is DSTest, StdUtils, StdAssertions, StdChe ibETHDecimal = ibETH.decimals(); moneyMarket = new MockMoneyMarket(); - liquidationStrat = new PancakeswapV3IbTokenLiquidationStrategy(address(router), address(moneyMarket)); - + pathReader = new PCSV3PathReader(); vm.label(ALICE, "ALICE"); vm.label(BOB, "BOB"); } diff --git a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol index 0e0a4f673..395aaae3f 100644 --- a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol +++ b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol @@ -9,10 +9,13 @@ import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; contract PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation is BasePCSV3LiquidationForkTest { bytes[] internal paths = new bytes[](1); + PancakeswapV3IbTokenLiquidationStrategy internal liquidationStrat; function setUp() public override { super.setUp(); + liquidationStrat = new PancakeswapV3IbTokenLiquidationStrategy(address(router), address(moneyMarket)); + // mint ibETH to alice ibETH.mint(ALICE, normalizeEther(1 ether, ibETHDecimal)); @@ -70,7 +73,6 @@ contract PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation is BasePCSV3 vm.stopPrank(); } - // expect ibWeth => ETH => btcb function testCorrectness_WhenExecuteIbTokenLiquiationStratV3_ShouldWork() external { // prepare criteria address _ibToken = address(ibETH); diff --git a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol index 08793a3dd..c3092bb3a 100644 --- a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol +++ b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol @@ -5,7 +5,7 @@ import { BasePCSV3LiquidationForkTest } from "./BasePCSV3LiquidationForkTest.sol import { PancakeswapV3IbTokenLiquidationStrategy } from "../../../contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy.sol"; // libs -import { LibPCSV3PoolAddress } from "../../../contracts/money-market/libraries/LibPCSV3PoolAddress.sol"; +import { LibPCSV3PoolAddress } from "../../libs/LibPCSV3PoolAddress.sol"; // interfaces import { IPancakeV3PoolState } from "../../../contracts/money-market/interfaces/IPancakeV3Pool.sol"; @@ -14,8 +14,11 @@ import { IPancakeV3PoolState } from "../../../contracts/money-market/interfaces/ import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; contract PancakeswapV3IbTokenLiquidationStrategy_SetConfigs is BasePCSV3LiquidationForkTest { + PancakeswapV3IbTokenLiquidationStrategy internal liquidationStrat; + function setUp() public override { super.setUp(); + liquidationStrat = new PancakeswapV3IbTokenLiquidationStrategy(address(router), address(moneyMarket)); } function testCorrectness_WhenOwnerSetCallersOk_ShouldWork() external { @@ -68,7 +71,7 @@ contract PancakeswapV3IbTokenLiquidationStrategy_SetConfigs is BasePCSV3Liquidat // expect pool address address _poolAddress = LibPCSV3PoolAddress.computeAddress( PANCAKE_V3_POOL_DEPLOYER, - LibPCSV3PoolAddress.PoolKey(address(_randomToken0), address(_randomToken1), poolFee) + LibPCSV3PoolAddress.getPoolKey(address(_randomToken0), address(_randomToken1), poolFee) ); // when mock liquidity => 0, should revert PancakeswapV3IbTokenLiquidationStrategy_NoLiquidity correctly diff --git a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_ExecuteLiquidation.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_ExecuteLiquidation.t.sol new file mode 100644 index 000000000..a8b20bff4 --- /dev/null +++ b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_ExecuteLiquidation.t.sol @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BasePCSV3LiquidationForkTest } from "./BasePCSV3LiquidationForkTest.sol"; +import { PancakeswapV3TokenLiquidationStrategy } from "../../../contracts/money-market/PancakeswapV3TokenLiquidationStrategy.sol"; + +// mocks +import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; + +contract PancakeswapV3TokenLiquidationStrategy_ExecuteLiquidation is BasePCSV3LiquidationForkTest { + bytes[] internal paths = new bytes[](1); + PancakeswapV3TokenLiquidationStrategy internal liquidationStrat; + + function setUp() public override { + super.setUp(); + liquidationStrat = new PancakeswapV3TokenLiquidationStrategy(address(router), address(pathReader)); + + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + liquidationStrat.setCallersOk(_callers, true); + + // Set path + paths[0] = abi.encodePacked(address(ETH), uint24(2500), address(btcb)); + pathReader.setPaths(paths); + + // mint ETH to ALICE + vm.startPrank(BSC_TOKEN_OWNER); + ETH.mint(normalizeEther(10 ether, ETHDecimal)); // mint to mm + ETH.transfer(address(ALICE), normalizeEther(10 ether, ETHDecimal)); + vm.stopPrank(); + } + + function testCorrectness_LiquidationStratV3_WhenExecuteLiquidation_ShouldWork() external { + address _collatToken = address(ETH); + address _debtToken = address(btcb); + uint256 _collatAmountIn = normalizeEther(1 ether, ETHDecimal); + + // state before execution + uint256 _aliceBTCBBalanceBefore = btcb.balanceOf(ALICE); + + // expected repay amount out after swap + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput(paths[0], _collatAmountIn); + + vm.startPrank(ALICE); + MockERC20(_collatToken).transfer(address(liquidationStrat), _collatAmountIn); + liquidationStrat.executeLiquidation(_collatToken, _debtToken, _collatAmountIn, 0, 0); + vm.stopPrank(); + + uint256 _aliceBTCBBalanceAfter = btcb.balanceOf(ALICE); + + // nothing left in strat + assertEq(ETH.balanceOf(address(liquidationStrat)), 0, "ETH balance of strat"); + assertEq(btcb.balanceOf(address(liquidationStrat)), 0, "BTCB balance of strat"); + + // caller (ALICE) must get repay token amount + assertEq(_aliceBTCBBalanceAfter, _aliceBTCBBalanceBefore + _expectedAmountOut, "BTCB balance of money market"); + } + + function testCorrectness_WhenInjectCollatToStrat_ExecuteLiquidationV3_ShouldTransferCollatAmountBackCorrectly() + external + { + address _collatToken = address(ETH); + address _debtToken = address(btcb); + + uint256 _collatAmount = normalizeEther(1 ether, ETHDecimal); + // expected repay amount + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput(paths[0], _collatAmount); + + uint256 _injectAmount = normalizeEther(1 ether, ETHDecimal); + vm.startPrank(BSC_TOKEN_OWNER); + ETH.mint(_collatAmount + _injectAmount); + ETH.transfer(address(liquidationStrat), _collatAmount + _injectAmount); + vm.stopPrank(); + + vm.prank(ALICE); + liquidationStrat.executeLiquidation(_collatToken, _debtToken, _collatAmount, 0, 0); + + // injected collat left in strat + assertEq(ETH.balanceOf(address(liquidationStrat)), _injectAmount, "ETH balance of strat"); + assertEq(btcb.balanceOf(address(liquidationStrat)), 0, "btcb balance of strat"); + + assertEq(btcb.balanceOf(address(ALICE)), _expectedAmountOut, "btcb balance of callers"); + } + + function testRevert_WhenNonCallersCallExecuteLiquidation_ShouldRevert() external { + address _collatToken = address(ETH); + address _debtToken = address(btcb); + + vm.prank(BOB); + vm.expectRevert( + abi.encodeWithSelector( + PancakeswapV3TokenLiquidationStrategy.PancakeswapV3TokenLiquidationStrategy_Unauthorized.selector + ) + ); + liquidationStrat.executeLiquidation( + _collatToken, + _debtToken, + normalizeEther(1 ether, ETHDecimal), + normalizeEther(1 ether, btcbDecimal), + 0 + ); + } + + function testRevert_WhenExecuteLiquidationOnNonExistingPath() external { + address _collatToken = address(btcb); + address _debtToken = address(cake); + + vm.prank(ALICE); + vm.expectRevert(); + liquidationStrat.executeLiquidation( + _collatToken, + _debtToken, + normalizeEther(1 ether, btcbDecimal), + normalizeEther(1 ether, cakeDecimal), + 0 + ); + } + + function testCorrectness_WhenLiquidationOnMultiHop_ShouldWork() external { + address _collatToken = address(ETH); + address _debtToken = address(usdt); + uint256 _collatTokenAmountIn = normalizeEther(1 ether, ETHDecimal); + uint256 _minReceive = 0; + + // set withdrawal amount + uint256 _expectedWithdrawalAmount = normalizeEther(1 ether, ETHDecimal); + moneyMarket.setWithdrawalAmount(_expectedWithdrawalAmount); + + // state before execution + uint256 _aliceETHBalanceBefore = ETH.balanceOf(ALICE); + uint256 _aliceBTCBBalanceBefore = btcb.balanceOf(ALICE); + uint256 _aliceUSDTBalanceBefore = usdt.balanceOf(ALICE); + + // set multi-hop path ETH => btcb => usdt + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(ETH), uint24(2500), address(btcb), uint24(500), address(usdt)); + pathReader.setPaths(_paths); + + // transfer collat to to strat + vm.startPrank(ALICE); + ETH.transfer(address(liquidationStrat), _collatTokenAmountIn); + // expect amount out 2 hop expect btcb, expect usdt + bytes memory _ETHToBtcbPath = abi.encodePacked(address(ETH), uint24(2500), address(btcb)); + (uint256 _expectedBTCBOut, , , ) = quoterV2.quoteExactInput(_ETHToBtcbPath, _collatTokenAmountIn); + + bytes memory _BtcbToUsdtPath = abi.encodePacked(address(btcb), uint24(500), address(usdt)); + (uint256 _expectedUSDTOut, , , ) = quoterV2.quoteExactInput(_BtcbToUsdtPath, _expectedBTCBOut); + + liquidationStrat.executeLiquidation(_collatToken, _debtToken, _collatTokenAmountIn, 0, _minReceive); + + uint256 _aliceETHBalanceAfter = ETH.balanceOf(ALICE); + uint256 _aliceBTCBBalanceAfter = btcb.balanceOf(ALICE); + uint256 _aliceUSDTBalanceAfter = usdt.balanceOf(ALICE); + + // nothing left in strat + assertEq(ETH.balanceOf(address(liquidationStrat)), 0, "ETH balance of strat"); + assertEq(btcb.balanceOf(address(liquidationStrat)), 0, "btcb balance of strat"); + assertEq(usdt.balanceOf(address(liquidationStrat)), 0, "usdt balance of strat"); + + // eth of alice must not effect + assertEq(_aliceETHBalanceAfter, _aliceETHBalanceBefore - _collatTokenAmountIn, "ETH balance of ALICE"); + + // btcb of alice (middle hop) must not left + assertEq(_aliceBTCBBalanceAfter, _aliceBTCBBalanceBefore, "BTCB balance of ALICE"); + + // huge amount of collat token will cause the revert, since the tick would be changed + // repay token (usdt) of alice must increase + assertEq(_aliceUSDTBalanceAfter, _aliceUSDTBalanceBefore + _expectedUSDTOut, "USDT balance of ALICE"); + } + + function testCorrect_WhenCallerWithdraw_ShouldWork() external { + // mint erc20 to strat (token0, token1) + MockERC20 _token0 = new MockERC20("token0", "TK0", 18); + MockERC20 _token1 = new MockERC20("token1", "TK1", 18); + uint256 _token0Decimal = _token0.decimals(); + uint256 _token1Decimal = _token1.decimals(); + + uint256 _withdrawToken0Amount = normalizeEther(10, _token0Decimal); + uint256 _withdrawToken1Amount = normalizeEther(10, _token1Decimal); + _token0.mint(address(liquidationStrat), _withdrawToken0Amount); + _token1.mint(address(liquidationStrat), _withdrawToken1Amount); + + // balance before + uint256 _stratToken0BalanceBefore = _token0.balanceOf(address(liquidationStrat)); + uint256 _stratToken1BalanceBefore = _token1.balanceOf(address(liquidationStrat)); + uint256 _aliceToken0BalanceBefore = _token0.balanceOf(address(ALICE)); + uint256 _aliceToken1BalanceBefore = _token1.balanceOf(address(ALICE)); + + // use owner to withdraw + PancakeswapV3TokenLiquidationStrategy.WithdrawParam[] + memory _withdrawParams = new PancakeswapV3TokenLiquidationStrategy.WithdrawParam[](2); + _withdrawParams[0] = PancakeswapV3TokenLiquidationStrategy.WithdrawParam( + ALICE, + address(_token0), + _withdrawToken0Amount + ); + _withdrawParams[1] = PancakeswapV3TokenLiquidationStrategy.WithdrawParam( + ALICE, + address(_token1), + _withdrawToken1Amount + ); + + liquidationStrat.withdraw(_withdrawParams); + + // balance after + uint256 _stratToken0BalanceAfter = _token0.balanceOf(address(liquidationStrat)); + uint256 _stratToken1BalanceAfter = _token1.balanceOf(address(liquidationStrat)); + uint256 _aliceToken0BalanceAfter = _token0.balanceOf(address(ALICE)); + uint256 _aliceToken1BalanceAfter = _token1.balanceOf(address(ALICE)); + + // assert + // strat: after = before - withdraw + assertEq(_stratToken0BalanceAfter, _stratToken0BalanceBefore - _withdrawToken0Amount); + assertEq(_stratToken1BalanceAfter, _stratToken1BalanceBefore - _withdrawToken1Amount); + // ALICE: after = before + withdraw + assertEq(_aliceToken0BalanceAfter, _aliceToken0BalanceBefore + _withdrawToken0Amount); + assertEq(_aliceToken1BalanceAfter, _aliceToken1BalanceBefore + _withdrawToken1Amount); + } + + function testRevert_WhenNonCallerWithdraw_ShouldRevert() external { + // mint erc20 to strat + MockERC20 _token = new MockERC20("token0", "TK0", 18); + uint256 _tokenDecimal = _token.decimals(); + + uint256 _withdrawAmount = normalizeEther(10, _tokenDecimal); + _token.mint(address(liquidationStrat), _withdrawAmount); + + PancakeswapV3TokenLiquidationStrategy.WithdrawParam[] + memory _withdrawParams = new PancakeswapV3TokenLiquidationStrategy.WithdrawParam[](1); + _withdrawParams[0] = PancakeswapV3TokenLiquidationStrategy.WithdrawParam(ALICE, address(_token), _withdrawAmount); + + // prank to BOB and call withdraw + vm.startPrank(BOB); + vm.expectRevert("Ownable: caller is not the owner"); + liquidationStrat.withdraw(_withdrawParams); + } +} diff --git a/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_SetConfigs.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_SetConfigs.t.sol new file mode 100644 index 000000000..e7a64b341 --- /dev/null +++ b/solidity/tests/money-market/liquidation-strategiesV3/PancakeswapV3TokenLiquidationStrategy_SetConfigs.t.sol @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BasePCSV3LiquidationForkTest } from "./BasePCSV3LiquidationForkTest.sol"; +import { PancakeswapV3TokenLiquidationStrategy } from "../../../contracts/money-market/PancakeswapV3TokenLiquidationStrategy.sol"; + +// libs +import { LibPCSV3PoolAddress } from "../../libs/LibPCSV3PoolAddress.sol"; + +// mocks +import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; + +contract PancakeswapV3TokenLiquidationStrategy_SetConfigs is BasePCSV3LiquidationForkTest { + PancakeswapV3TokenLiquidationStrategy internal liquidationStrat; + + function setUp() public override { + super.setUp(); + liquidationStrat = new PancakeswapV3TokenLiquidationStrategy(address(router), address(pathReader)); + } + + function testCorrectness_WhenOwnerSetCallersOk_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = BOB; + + liquidationStrat.setCallersOk(_callers, true); + + assertTrue(liquidationStrat.callersOk(BOB)); + } + + function testRevert_WhenNonOwnerSetCallersOk_ShouldRevert() external { + address[] memory _callers = new address[](1); + _callers[0] = BOB; + + vm.prank(BOB); + vm.expectRevert("Ownable: caller is not the owner"); + liquidationStrat.setCallersOk(_callers, true); + } + + function testCorrectness_WhenOwnerSetPathSingleHop_ShouldWork() external { + // bytes[] paths + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(cake), poolFee, address(wbnb)); + + pathReader.setPaths(_paths); + assertEq(pathReader.paths(address(cake), address(wbnb)), _paths[0]); + } + + function testCorrectness_WhenOwnerSetPathMultiHop_ShouldWork() external { + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(cake), poolFee, address(usdt), poolFee, address(wbnb)); + pathReader.setPaths(_paths); + + assertEq(pathReader.paths(address(cake), address(wbnb)), _paths[0]); + } + + function testRevert_WhenOwnerSetNonExistingPath_ShouldRevert() external { + // random token + MockERC20 _randomToken0 = new MockERC20("Random0", "RD0", 18); + MockERC20 _randomToken1 = new MockERC20("Random1", "RD1", 18); + + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(_randomToken0), poolFee, address(_randomToken1)); + + vm.expectRevert(); + pathReader.setPaths(_paths); + } + + function testRevert_WhenNotOwnerSetPaths_ShouldRevert() external { + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(wbnb), poolFee, address(cake)); + + vm.prank(ALICE); + vm.expectRevert("Ownable: caller is not the owner"); + pathReader.setPaths(_paths); + } +} diff --git a/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol new file mode 100644 index 000000000..8f504fd85 --- /dev/null +++ b/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation.t.sol @@ -0,0 +1,285 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BasePCSV3LiquidationForkTest } from "./BasePCSV3LiquidationForkTest.sol"; +import { PancakeswapV3IbTokenLiquidationStrategy_WithPathReader } from "../../../contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.sol"; + +// mocks +import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; + +contract WithReader_PancakeswapV3IbTokenLiquidationStrategy_ExecuteLiquidation is BasePCSV3LiquidationForkTest { + bytes[] internal paths = new bytes[](1); + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader internal liquidationStrat; + + function setUp() public override { + super.setUp(); + + liquidationStrat = new PancakeswapV3IbTokenLiquidationStrategy_WithPathReader( + address(router), + address(moneyMarket), + address(pathReader) + ); + + // mint ibETH to alice + ibETH.mint(ALICE, normalizeEther(1 ether, ibETHDecimal)); + + moneyMarket.setIbToken(address(ibETH), address(ETH)); + + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + liquidationStrat.setCallersOk(_callers, true); + + // Set path + paths[0] = abi.encodePacked(address(ETH), uint24(2500), address(btcb)); + pathReader.setPaths(paths); + + vm.startPrank(BSC_TOKEN_OWNER); + ETH.mint(normalizeEther(10 ether, ETHDecimal)); // mint to mm + ETH.transfer(address(moneyMarket), normalizeEther(10 ether, ETHDecimal)); + btcb.mint(normalizeEther(10 ether, btcbDecimal)); // mint to mm + btcb.transfer(address(moneyMarket), normalizeEther(10 ether, btcbDecimal)); + vm.stopPrank(); + } + + function testRevert_WhenThereIsNoConfiguredPath_ShouldRevert() external { + vm.prank(address(ALICE)); + vm.expectRevert( + abi.encodeWithSelector( + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader + .PancakeswapV3IbTokenLiquidationStrategy_PathConfigNotFound + .selector, + [address(ETH), address(usdt)] + ) + ); + liquidationStrat.executeLiquidation( + address(ibETH), + address(usdt), + normalizeEther(1 ether, ibETHDecimal), + normalizeEther(1 ether, usdtDecimal), + 0 + ); + } + + function testRevert_WhenNonOwnerExecuteLiquidationV3_ShouldRevert() external { + // prepare criteria + address _ibToken = address(ibETH); + address _debtToken = address(btcb); + uint256 _ibTokenIn = normalizeEther(1 ether, ibETHDecimal); + uint256 _minReceive = 0; + + ibETH.mint(BOB, normalizeEther(1 ether, ibETHDecimal)); + vm.startPrank(BOB); + ibETH.transfer(address(liquidationStrat), _ibTokenIn); + vm.expectRevert( + abi.encodeWithSelector( + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader + .PancakeswapV3IbTokenLiquidationStrategy_Unauthorized + .selector + ) + ); + liquidationStrat.executeLiquidation(_ibToken, _debtToken, _ibTokenIn, 0, _minReceive); + vm.stopPrank(); + } + + function testCorrectness_WhenExecuteIbTokenLiquiationStratV3_ShouldWork() external { + // prepare criteria + address _ibToken = address(ibETH); + address _debtToken = address(btcb); + uint256 _ibTokenIn = normalizeEther(1 ether, ibETHDecimal); + uint256 _minReceive = 0; + + // state before execution + uint256 _aliceIbTokenBalanceBefore = ibETH.balanceOf(ALICE); + uint256 _aliceETHBalanceBefore = ETH.balanceOf(ALICE); + uint256 _aliceBTCBBalanceBefore = btcb.balanceOf(ALICE); + + // all ib token will be swapped (no ib left in liquidationStrat) + + // mock withdrawal amount + uint256 _expectedIbTokenAmountToWithdraw = normalizeEther(1 ether, ibETHDecimal); + uint256 _expectedWithdrawalAmount = normalizeEther(1 ether, ETHDecimal); + moneyMarket.setWithdrawalAmount(_expectedWithdrawalAmount); + + // expect amount out + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput(paths[0], _ibTokenIn); + + vm.startPrank(ALICE); + // transfer ib token to strat + ibETH.transfer(address(liquidationStrat), _ibTokenIn); + assertEq(ibETH.balanceOf(address(liquidationStrat)), _ibTokenIn, "ibETH balance of liquidationStrat"); + liquidationStrat.executeLiquidation(_ibToken, _debtToken, _ibTokenIn, 0, _minReceive); + vm.stopPrank(); + + // ALICE's balance after execution + uint256 _aliceBTCBBalanceAfter = btcb.balanceOf(ALICE); + + // nothing left in strat + // to check underlyingToken should swap all + assertEq(ETH.balanceOf(address(liquidationStrat)), 0, "ETH balance of liquidationStrat"); + + // to check swapped token should be here + assertEq(btcb.balanceOf(address(liquidationStrat)), 0, "btcb balance of liquidationStrat"); + + // to check swap work correctly + assertEq(_aliceBTCBBalanceAfter, _aliceBTCBBalanceBefore + _expectedAmountOut, "btcb balance of ALICE"); + + // to check final ibToken should be corrected + assertEq( + ibETH.balanceOf(ALICE), + _aliceIbTokenBalanceBefore - _expectedIbTokenAmountToWithdraw, + "ibETH balance of ALICE" + ); + + // to check final underlying should be not affected + assertEq(ETH.balanceOf(ALICE), _aliceETHBalanceBefore, "ETH balance of ALICE"); + } + + function testRevert_WhenExecuteIbTokenLiquiationStratV3AndUnderlyingTokenAndRepayTokenAreSame() external { + // prepare criteria + address _ibToken = address(ibETH); + address _debtToken = address(ETH); + uint256 _ibTokenIn = normalizeEther(1 ether, ibETHDecimal); + uint256 _minReceive = 0 ether; + + // _ibTokenTotalSupply = 100 ether + // _totalTokenWithInterest = 100 ether + // _requireAmountToWithdraw = repay amount = 1 ether + // to withdraw, amount to withdraw = Min(_requireAmountToWithdraw, _ibTokenIn) = 1 ether + + vm.startPrank(ALICE); + // transfer ib token to strat + ibETH.transfer(address(liquidationStrat), _ibTokenIn); + vm.expectRevert( + abi.encodeWithSelector( + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader + .PancakeswapV3IbTokenLiquidationStrategy_RepayTokenIsSameWithUnderlyingToken + .selector + ) + ); + liquidationStrat.executeLiquidation(_ibToken, _debtToken, _ibTokenIn, 0, _minReceive); + vm.stopPrank(); + } + + function testCorrectness_WhenLiduidateMultiHopIbToken_ShouldWork() external { + address _ibToken = address(ibETH); + address _debtToken = address(usdt); + uint256 _ibTokenAmountIn = normalizeEther(1 ether, ibETHDecimal); + uint256 _minReceive = 0; + + // set withdrawal amount + uint256 _expectedWithdrawalAmount = normalizeEther(1 ether, ETHDecimal); + moneyMarket.setWithdrawalAmount(_expectedWithdrawalAmount); + + // state before execution + uint256 _aliceETHBalanceBefore = ETH.balanceOf(ALICE); + uint256 _aliceBTCBBalanceBefore = btcb.balanceOf(ALICE); + uint256 _aliceUSDTBalanceBefore = usdt.balanceOf(ALICE); + + // set multi-hop path ETH => btcb => usdt + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(ETH), uint24(2500), address(btcb), uint24(500), address(usdt)); + pathReader.setPaths(_paths); + + // transfer ib to strat + vm.startPrank(ALICE); + ibETH.transfer(address(liquidationStrat), _ibTokenAmountIn); + // expect amount out 2 hop expect btcb, expect usdt + bytes memory _ETHToBtcbPath = abi.encodePacked(address(ETH), uint24(2500), address(btcb)); + (uint256 _expectedBTCBOut, , , ) = quoterV2.quoteExactInput(_ETHToBtcbPath, _ibTokenAmountIn); + + bytes memory _BtcbToUsdtPath = abi.encodePacked(address(btcb), uint24(500), address(usdt)); + (uint256 _expectedUSDTOut, , , ) = quoterV2.quoteExactInput(_BtcbToUsdtPath, _expectedBTCBOut); + + liquidationStrat.executeLiquidation(_ibToken, _debtToken, _ibTokenAmountIn, 0, _minReceive); + + uint256 _aliceETHBalanceAfter = ETH.balanceOf(ALICE); + uint256 _aliceBTCBBalanceAfter = btcb.balanceOf(ALICE); + uint256 _aliceUSDTBalanceAfter = usdt.balanceOf(ALICE); + + // nothing left in strat + assertEq(ETH.balanceOf(address(liquidationStrat)), 0, "ETH balance of strat"); + assertEq(btcb.balanceOf(address(liquidationStrat)), 0, "btcb balance of strat"); + assertEq(usdt.balanceOf(address(liquidationStrat)), 0, "usdt balance of strat"); + + // eth of alice must not effect + assertEq(_aliceETHBalanceAfter, _aliceETHBalanceBefore, "ETH balance of ALICE"); + + // btcb of alice (middle hop) must not left + assertEq(_aliceBTCBBalanceAfter, _aliceBTCBBalanceBefore, "BTCB balance of ALICE"); + + // huge amount of collat token will cause the revert, since the tick would be changed + // repay token (usdt) of alice must increase + assertEq(_aliceUSDTBalanceAfter, _aliceUSDTBalanceBefore + _expectedUSDTOut, "USDT balance of ALICE"); + } + + function testCorrect_WhenCallerWithdraw_ShouldWork() external { + // mint erc20 to strat (token0, token1) + MockERC20 _token0 = new MockERC20("token0", "TK0", 18); + MockERC20 _token1 = new MockERC20("token1", "TK1", 18); + uint256 _token0Decimal = _token0.decimals(); + uint256 _token1Decimal = _token1.decimals(); + + uint256 _withdrawToken0Amount = normalizeEther(10, _token0Decimal); + uint256 _withdrawToken1Amount = normalizeEther(10, _token1Decimal); + _token0.mint(address(liquidationStrat), _withdrawToken0Amount); + _token1.mint(address(liquidationStrat), _withdrawToken1Amount); + + // balance before + uint256 _stratToken0BalanceBefore = _token0.balanceOf(address(liquidationStrat)); + uint256 _stratToken1BalanceBefore = _token1.balanceOf(address(liquidationStrat)); + uint256 _aliceToken0BalanceBefore = _token0.balanceOf(address(ALICE)); + uint256 _aliceToken1BalanceBefore = _token1.balanceOf(address(ALICE)); + + // use owner to withdraw + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam[] + memory _withdrawParams = new PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam[](2); + _withdrawParams[0] = PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam( + ALICE, + address(_token0), + _withdrawToken0Amount + ); + _withdrawParams[1] = PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam( + ALICE, + address(_token1), + _withdrawToken1Amount + ); + + liquidationStrat.withdraw(_withdrawParams); + + // balance after + uint256 _stratToken0BalanceAfter = _token0.balanceOf(address(liquidationStrat)); + uint256 _stratToken1BalanceAfter = _token1.balanceOf(address(liquidationStrat)); + uint256 _aliceToken0BalanceAfter = _token0.balanceOf(address(ALICE)); + uint256 _aliceToken1BalanceAfter = _token1.balanceOf(address(ALICE)); + + // assert + // strat: after = before - withdraw + assertEq(_stratToken0BalanceAfter, _stratToken0BalanceBefore - _withdrawToken0Amount); + assertEq(_stratToken1BalanceAfter, _stratToken1BalanceBefore - _withdrawToken1Amount); + // ALICE: after = before + withdraw + assertEq(_aliceToken0BalanceAfter, _aliceToken0BalanceBefore + _withdrawToken0Amount); + assertEq(_aliceToken1BalanceAfter, _aliceToken1BalanceBefore + _withdrawToken1Amount); + } + + function testRevert_WhenNonCallerWithdraw_ShouldRevert() external { + // mint erc20 to strat + MockERC20 _token = new MockERC20("token0", "TK0", 18); + uint256 _tokenDecimal = _token.decimals(); + + uint256 _withdrawAmount = normalizeEther(10, _tokenDecimal); + _token.mint(address(liquidationStrat), _withdrawAmount); + + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam[] + memory _withdrawParams = new PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam[](1); + _withdrawParams[0] = PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.WithdrawParam( + ALICE, + address(_token), + _withdrawAmount + ); + + // prank to BOB and call withdraw + vm.startPrank(BOB); + vm.expectRevert("Ownable: caller is not the owner"); + liquidationStrat.withdraw(_withdrawParams); + } +} diff --git a/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol b/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol new file mode 100644 index 000000000..1ab9ad236 --- /dev/null +++ b/solidity/tests/money-market/liquidation-strategiesV3/WithReader_PancakeswapV3IbTokenLiquidationStrategy_SetConfigs.t.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BasePCSV3LiquidationForkTest } from "./BasePCSV3LiquidationForkTest.sol"; +import { PancakeswapV3IbTokenLiquidationStrategy_WithPathReader } from "../../../contracts/money-market/PancakeswapV3IbTokenLiquidationStrategy_WithPathReader.sol"; +import { PCSV3PathReader } from "solidity/contracts/reader/PCSV3PathReader.sol"; + +// libs +import { LibPCSV3PoolAddress } from "../../libs/LibPCSV3PoolAddress.sol"; + +// interfaces +import { IPancakeV3PoolState } from "../../../contracts/money-market/interfaces/IPancakeV3Pool.sol"; +import { IUniSwapV3PathReader } from "solidity/contracts/reader/interfaces/IUniSwapV3PathReader.sol"; + +// mocks +import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; + +contract WithReader_PancakeswapV3IbTokenLiquidationStrategy_SetConfigs is BasePCSV3LiquidationForkTest { + PancakeswapV3IbTokenLiquidationStrategy_WithPathReader internal liquidationStrat; + + function setUp() public override { + super.setUp(); + liquidationStrat = new PancakeswapV3IbTokenLiquidationStrategy_WithPathReader( + address(router), + address(moneyMarket), + address(pathReader) + ); + } + + function testCorrectness_WhenOwnerSetCallersOk_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = BOB; + + liquidationStrat.setCallersOk(_callers, true); + + assertTrue(liquidationStrat.callersOk(BOB)); + } + + function testRevert_WhenNonOwnerSetCallersOk_ShouldRevert() external { + address[] memory _callers = new address[](1); + _callers[0] = BOB; + + vm.prank(BOB); + vm.expectRevert("Ownable: caller is not the owner"); + liquidationStrat.setCallersOk(_callers, true); + } + + function testCorrectness_WhenOwnerSetPathSingleHop_ShouldWork() external { + // bytes[] paths + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(cake), poolFee, address(wbnb)); + + pathReader.setPaths(_paths); + assertEq(pathReader.paths(address(cake), address(wbnb)), _paths[0]); + } + + function testCorrectness_WhenOwnerSetPathMultiHop_ShouldWork() external { + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(cake), poolFee, address(usdt), poolFee, address(wbnb)); + pathReader.setPaths(_paths); + + assertEq(pathReader.paths(address(cake), address(wbnb)), _paths[0]); + } + + function testRevert_WhenOwnerSetNonExistingPath_ShouldRevert() external { + // random token + MockERC20 _randomToken0 = new MockERC20("Random0", "RD0", 18); + MockERC20 _randomToken1 = new MockERC20("Random1", "RD1", 18); + + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(_randomToken0), poolFee, address(_randomToken1)); + + // Expect EVM Error. Since we call pool.liquidity() where pool is not existing + vm.expectRevert(); + pathReader.setPaths(_paths); + + // expect pool address + address _poolAddress = LibPCSV3PoolAddress.computeAddress( + PANCAKE_V3_POOL_DEPLOYER, + LibPCSV3PoolAddress.getPoolKey(address(_randomToken0), address(_randomToken1), poolFee) + ); + + // when mock liquidity => 0, should revert PCSV3PathReader_NoLiquidity correctly + vm.mockCall(address(_poolAddress), abi.encodeWithSelector(IPancakeV3PoolState.liquidity.selector), abi.encode(0)); + vm.expectRevert( + abi.encodeWithSelector( + PCSV3PathReader.PCSV3PathReader_NoLiquidity.selector, + [address(_randomToken0), address(_randomToken1), address(uint160(poolFee))] + ) + ); + pathReader.setPaths(_paths); + } + + function testRevert_WhenCallerIsNotOwner_ShouldRevert() external { + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(wbnb), poolFee, address(cake)); + + vm.prank(ALICE); + vm.expectRevert("Ownable: caller is not the owner"); + pathReader.setPaths(_paths); + } +} diff --git a/solidity/tests/oracle/Oracle_ChainLink2Test.t.sol b/solidity/tests/oracle/Oracle_ChainLink2Test.t.sol deleted file mode 100644 index ea54cac6e..000000000 --- a/solidity/tests/oracle/Oracle_ChainLink2Test.t.sol +++ /dev/null @@ -1,122 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.19; - -import { BaseTest, console, MockERC20 } from "../base/BaseTest.sol"; - -import { ChainLinkPriceOracle2 } from "../../contracts/oracle/ChainLinkPriceOracle2.sol"; -import { IAggregatorV3 } from "../../contracts/oracle/interfaces/IAggregatorV3.sol"; -import { IPriceOracle } from "../../contracts/oracle/interfaces/IPriceOracle.sol"; -import { MockChainLinkAggregator } from "../mocks/MockChainLinkAggregator.sol"; - -contract Oracle_ChainLinkPriceOracleTest is BaseTest { - IAggregatorV3[] _fakeAggregatorWETHUSD; - IAggregatorV3[] _fakeAggregatorUSDCUSD; - IAggregatorV3[] _fakeAggregatorWETHUSDC; - - function setUp() public virtual { - _fakeAggregatorWETHUSD = new IAggregatorV3[](1); - _fakeAggregatorWETHUSD[0] = new MockChainLinkAggregator(1500e18, 18); - - _fakeAggregatorUSDCUSD = new IAggregatorV3[](1); - _fakeAggregatorUSDCUSD[0] = new MockChainLinkAggregator(1e18, 18); - - _fakeAggregatorWETHUSDC = new IAggregatorV3[](2); - _fakeAggregatorWETHUSDC[0] = new MockChainLinkAggregator(1500e18, 18); - _fakeAggregatorWETHUSDC[1] = new MockChainLinkAggregator(1e18, 18); - - ChainLinkPriceOracle2 chainLinkPriceOracle = new ChainLinkPriceOracle2(); - address oldOwner = chainLinkPriceOracle.owner(); - vm.prank(oldOwner); - chainLinkPriceOracle.transferOwnership(DEPLOYER); - - oracle = IPriceOracle(address(chainLinkPriceOracle)); - } - - function testCorrectness_NotOwner_setPriceFeed_shouldRevertCallerIsNotOwner() external { - address[] memory t0 = new address[](1); - t0[0] = address(weth); - - address[] memory t1 = new address[](1); - t1[0] = address(usd); - - IAggregatorV3[][] memory sources = new IAggregatorV3[][](1); - sources[0] = _fakeAggregatorWETHUSD; - - vm.startPrank(ALICE); - try ChainLinkPriceOracle2(address(oracle)).setPriceFeeds(t0, t1, sources) { - fail(); - } catch Error(string memory reason) { - assertEq(reason, "Ownable: caller is not the owner", "upgrade not owner"); - } - vm.stopPrank(); - } - - function testCorrectness_setPriceFeed_shouldPass() external { - address[] memory t0 = new address[](2); - t0[0] = address(weth); - t0[1] = address(usdc); - - address[] memory t1 = new address[](2); - t1[0] = address(usd); - t1[1] = address(usd); - - IAggregatorV3[][] memory sources = new IAggregatorV3[][](2); - - sources[0] = _fakeAggregatorWETHUSD; - sources[1] = _fakeAggregatorUSDCUSD; - - vm.prank(DEPLOYER); - ChainLinkPriceOracle2(address(oracle)).setPriceFeeds(t0, t1, sources); - - uint256 wethCount = ChainLinkPriceOracle2(address(oracle)).priceFeedCount(address(weth), address(usd)); - uint256 usdcCount = ChainLinkPriceOracle2(address(oracle)).priceFeedCount(address(usdc), address(usd)); - assertEq(wethCount, 1); - assertEq(usdcCount, 1); - } - - function testCorrectness_getPriceBeforeSet_shouldRevertNoSource() external { - address[] memory t0 = new address[](1); - t0[0] = address(weth); - - address[] memory t1 = new address[](1); - t1[0] = address(usdc); - - IAggregatorV3[][] memory sources = new IAggregatorV3[][](1); - sources[0] = _fakeAggregatorWETHUSD; - - vm.prank(DEPLOYER); - ChainLinkPriceOracle2(address(oracle)).setPriceFeeds(t0, t1, sources); - - vm.expectRevert(ChainLinkPriceOracle2.ChainlinkPriceOracle_NoSource.selector); - ChainLinkPriceOracle2(address(oracle)).getPrice(address(weth), address(usd)); - } - - function testCorrectness_getPrice_shouldPass() external { - address[] memory t0 = new address[](3); - t0[0] = address(weth); - t0[1] = address(usdc); - t0[2] = address(weth); - - address[] memory t1 = new address[](3); - t1[0] = address(usd); - t1[1] = address(usd); - t1[2] = address(usdc); - - IAggregatorV3[][] memory sources = new IAggregatorV3[][](3); - sources[0] = _fakeAggregatorWETHUSD; - sources[1] = _fakeAggregatorUSDCUSD; - sources[2] = _fakeAggregatorWETHUSDC; - - vm.prank(DEPLOYER); - ChainLinkPriceOracle2(address(oracle)).setPriceFeeds(t0, t1, sources); - - (uint256 wethPrice, ) = oracle.getPrice(address(weth), address(usd)); - assertEq(wethPrice, 1500 ether); - - (uint256 usdcPrice, ) = oracle.getPrice(address(usdc), address(usd)); - assertEq(usdcPrice, 1 ether); - - (uint256 wethUsdcPrice, ) = oracle.getPrice(address(weth), address(usdc)); - assertEq(wethUsdcPrice, 1500 ether); - } -} diff --git a/solidity/tests/smart-treasury/BaseFork.sol b/solidity/tests/smart-treasury/BaseFork.sol new file mode 100644 index 000000000..4228bc5b0 --- /dev/null +++ b/solidity/tests/smart-treasury/BaseFork.sol @@ -0,0 +1,145 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { DSTest } from "solidity/tests/base/DSTest.sol"; +import "../utils/Components.sol"; +import { ProxyAdminLike } from "../interfaces/ProxyAdminLike.sol"; + +// implementation +import { PCSV3PathReader } from "solidity/contracts/reader/PCSV3PathReader.sol"; +import { SmartTreasury } from "solidity/contracts/smart-treasury/SmartTreasury.sol"; + +// interfaces +import { IERC20 } from "solidity/contracts/money-market/interfaces/IERC20.sol"; +import { IPancakeSwapRouterV3 } from "solidity/contracts/money-market/interfaces/IPancakeSwapRouterV3.sol"; +import { IQuoterV2 } from "solidity/tests/interfaces/IQuoterV2.sol"; +import { IOracleMedianizer } from "solidity/contracts/oracle/interfaces/IOracleMedianizer.sol"; + +contract BaseFork is DSTest, StdUtils, StdAssertions, StdCheats { + using stdStorage for StdStorage; + + VM internal constant vm = VM(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D); + + ProxyAdminLike internal proxyAdmin; + + // Users + address constant DEPLOYER = 0xC44f82b07Ab3E691F826951a6E335E1bC1bB0B51; + address ALICE = makeAddr("ALICE"); + address BOB = makeAddr("BOB"); + address CHARLIE = makeAddr("CHARLIE"); + address EVE = makeAddr("EVE"); + + address internal constant PANCAKE_V3_POOL_DEPLOYER = 0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9; + + // Treasury + address REVENUE_TREASURY = makeAddr("REVENUE_TREASURY"); + address DEV_TREASURY = makeAddr("DEV_TREASURY"); + address BURN_TREASURY = makeAddr("BURN_TREASURY"); + + // Token + + IERC20 public constant btcb = IERC20(0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c); + IERC20 public constant eth = IERC20(0x2170Ed0880ac9A755fd29B2688956BD959F933F8); + IERC20 public constant wbnb = IERC20(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c); + IERC20 public constant usdt = IERC20(0x55d398326f99059fF775485246999027B3197955); + IERC20 public constant usdc = IERC20(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d); + IERC20 public constant cake = IERC20(0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82); + IERC20 public constant doge = IERC20(0xbA2aE424d960c26247Dd6c32edC70B295c744C43); + + address internal usd = 0x115dffFFfffffffffFFFffffFFffFfFfFFFFfFff; + + IPancakeSwapRouterV3 internal router = IPancakeSwapRouterV3(0x1b81D678ffb9C0263b24A97847620C99d213eB14); + PCSV3PathReader internal pathReader; + SmartTreasury internal smartTreasury; + IQuoterV2 internal quoterV2 = IQuoterV2(0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997); + IOracleMedianizer internal oracleMedianizer = IOracleMedianizer(0x553b8adc2Ac16491Ec57239BeA7191719a2B880c); + + function setUp() public virtual { + vm.createSelectFork("bsc_mainnet", 28_113_725); + + pathReader = new PCSV3PathReader(); + // set path for + bytes[] memory _paths = new bytes[](2); + _paths[0] = abi.encodePacked(address(wbnb), uint24(500), address(usdt)); + _paths[1] = abi.encodePacked(address(eth), uint24(500), address(usdc), uint24(100), address(usdt)); + + pathReader.setPaths(_paths); + + vm.startPrank(DEPLOYER); + proxyAdmin = _setupProxyAdmin(); + smartTreasury = deploySmartTreasury(address(router), address(pathReader), address(oracleMedianizer)); + vm.stopPrank(); + + vm.label(address(eth), "ETH"); + vm.label(address(wbnb), "WBNB"); + vm.label(address(usdt), "USDT"); + vm.label(address(usdc), "USDC"); + vm.label(address(cake), "CAKE"); + vm.label(address(doge), "DOGE"); + + vm.label(ALICE, "ALICE"); + vm.label(BOB, "BOB"); + vm.label(CHARLIE, "CHARLIE"); + vm.label(EVE, "EVE"); + + vm.label(REVENUE_TREASURY, "REVENUE_TREASURY"); + vm.label(DEV_TREASURY, "DEV_TREASURY"); + vm.label(BURN_TREASURY, "BURN_TREASURY"); + + vm.label(address(router), "PancakeSwapRouterV3"); + vm.label(address(smartTreasury), "SmartTreasury"); + vm.label(address(oracleMedianizer), "OracleMedianizer"); + } + + function deploySmartTreasury( + address _router, + address _pathReader, + address _oracle + ) internal returns (SmartTreasury) { + bytes memory _logicBytecode = abi.encodePacked(vm.getCode("./out/SmartTreasury.sol/SmartTreasury.json")); + bytes memory _initializer = abi.encodeWithSelector( + bytes4(keccak256("initialize(address,address,address)")), + _router, + _pathReader, + _oracle + ); + address _proxy = _setupUpgradeable(_logicBytecode, _initializer); + return SmartTreasury(_proxy); + } + + function _setupUpgradeable(bytes memory _logicBytecode, bytes memory _initializer) internal returns (address) { + bytes memory _proxyBytecode = abi.encodePacked( + vm.getCode("./out/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json") + ); + + address _logic; + assembly { + _logic := create(0, add(_logicBytecode, 0x20), mload(_logicBytecode)) + } + + _proxyBytecode = abi.encodePacked(_proxyBytecode, abi.encode(_logic, address(proxyAdmin), _initializer)); + + address _proxy; + assembly { + _proxy := create(0, add(_proxyBytecode, 0x20), mload(_proxyBytecode)) + if iszero(extcodesize(_proxy)) { + revert(0, 0) + } + } + + return _proxy; + } + + function _setupProxyAdmin() internal returns (ProxyAdminLike) { + bytes memory _bytecode = abi.encodePacked(vm.getCode("./out/ProxyAdmin.sol/ProxyAdmin.json")); + address _address; + assembly { + _address := create(0, add(_bytecode, 0x20), mload(_bytecode)) + } + return ProxyAdminLike(address(_address)); + } + + function normalizeEther(uint256 _ether, uint256 _decimal) internal pure returns (uint256 _normalizedEther) { + _normalizedEther = _ether / 10**(18 - _decimal); + } +} diff --git a/solidity/tests/smart-treasury/SmartTreasury_Distribute.t.sol b/solidity/tests/smart-treasury/SmartTreasury_Distribute.t.sol new file mode 100644 index 000000000..143ae0bbb --- /dev/null +++ b/solidity/tests/smart-treasury/SmartTreasury_Distribute.t.sol @@ -0,0 +1,348 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BaseFork, console } from "./BaseFork.sol"; + +// implementation +import { MockERC20 } from "solidity/tests/mocks/MockERC20.sol"; +import { OracleMedianizer } from "solidity/contracts/oracle/OracleMedianizer.sol"; + +// libraries +import { LibPCSV3PoolAddress } from "../libs/LibPCSV3PoolAddress.sol"; + +// interfaces +import { ISmartTreasury } from "solidity/contracts/interfaces/ISmartTreasury.sol"; +import { IPancakeSwapRouterV3 } from "solidity/contracts/money-market/interfaces/IPancakeSwapRouterV3.sol"; +import { IERC20 } from "solidity/contracts/money-market/interfaces/IERC20.sol"; +import { IOracleMedianizer } from "solidity/contracts/oracle/interfaces/IOracleMedianizer.sol"; +import { IPriceOracle } from "solidity/contracts/oracle/interfaces/IPriceOracle.sol"; +import { IUniswapV3Pool } from "solidity/contracts/oracle/interfaces/IUniswapV3Pool.sol"; +import { IPancakeV3PoolState } from "../../contracts/money-market/interfaces/IPancakeV3Pool.sol"; + +contract SmartTreasury_Distribute is BaseFork { + struct CacheState { + uint256 _rev; + uint256 _dev; + uint256 _burn; + } + + function setUp() public override { + super.setUp(); + + // setup whitelisted caller + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(ALICE); + // setup revenue token, alloc points and treasury address + smartTreasury.setRevenueToken(address(usdt)); + smartTreasury.setAllocPoints(100, 100, 100); + smartTreasury.setTreasuryAddresses(REVENUE_TREASURY, DEV_TREASURY, BURN_TREASURY); + smartTreasury.setSlippageToleranceBps(100); + vm.stopPrank(); + } + + function testCorrectness_CallDistribute_ShouldWork() external { + // state before distribution + uint256 _USDTrevenueBalanceBefore = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _WBNBdevBalanceBefore = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _WBNBburnBalanceBefore = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // top up wbnb to smart treasury + deal(address(wbnb), address(smartTreasury), 30 ether); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + // expect amount in usdt + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput( + abi.encodePacked(address(wbnb), uint24(500), address(usdt)), + 10 ether + ); + + // state after distribute + uint256 _USDTrevenueBalanceAfter = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _WBNBdevBalanceAfter = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _WBNBburnBalanceAfter = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // rev treasury (USDT) + assertCloseBps(_USDTrevenueBalanceAfter, _USDTrevenueBalanceBefore + _expectedAmountOut, 100); + // dev treasury (WBNB) + assertEq(_WBNBdevBalanceAfter, _WBNBdevBalanceBefore + 10 ether, "Dev Treasury Balance (WBNB)"); + // burn treasury (WBNB) + assertEq(_WBNBburnBalanceAfter, _WBNBburnBalanceBefore + 10 ether, "Burn Treasury Balance (WBNB)"); + + // Smart treasury must have nothing + uint256 _WBNBSmartTreasuryBalanceAfter = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + assertEq(_WBNBSmartTreasuryBalanceAfter, 0, "Smart treasury balance (WBNB)"); + } + + function testRevert_UnauthorizedCallDistribute_ShouldRevert() external { + // top up wbnb to smart treasury + deal(address(wbnb), address(smartTreasury), 30 ether); + uint256 _WBNBTreasuryBalanceBefore = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + + vm.prank(BOB); + vm.expectRevert(ISmartTreasury.SmartTreasury_Unauthorized.selector); + smartTreasury.distribute(_tokens); + + // Smart treasury after distributed must equal to before + uint256 _WBNBTreasuryBalanceAfter = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + assertEq(_WBNBTreasuryBalanceAfter, _WBNBTreasuryBalanceBefore, "Smart treasury balance (WBNB)"); + } + + function testRevert_DistributeWithNonExistingRevenueToken_ShouldRevert() external { + deal(address(cake), address(smartTreasury), 30 ether); + uint256 _cakeTreasuryBalanceBefore = IERC20(address(cake)).balanceOf(address(smartTreasury)); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(cake); + + vm.prank(ALICE); + vm.expectRevert(ISmartTreasury.SmartTreasury_PathConfigNotFound.selector); + smartTreasury.distribute(_tokens); + + // Smart treasury after distributed must equal to before + uint256 _cakeTreasuryBalanceAfter = IERC20(address(cake)).balanceOf(address(smartTreasury)); + assertEq(_cakeTreasuryBalanceAfter, _cakeTreasuryBalanceBefore, "Smart treasury balance (Cake)"); + } + + function testCorrectness_DistributeFailedFromSwap_ShouldNotDistribute() external { + // top up wbnb to smart treasury + deal(address(wbnb), address(smartTreasury), 30 ether); + uint256 _WBNBTreasuryBalanceBefore = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + + // state before distribute + uint256 _USDTrevenueBalanceBefore = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _WBNBdevBalanceBefore = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _WBNBburnBalanceBefore = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // mock swap failed + vm.mockCallRevert( + address(router), + abi.encodeWithSelector(IPancakeSwapRouterV3.exactInput.selector), + abi.encode("Failed swap") + ); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + // state after distribute + uint256 _revenueBalanceAfter = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _devBalanceAfter = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _burnBalanceAfter = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // after should be equal to before + assertEq(_revenueBalanceAfter, _USDTrevenueBalanceBefore, "Revenue Treasury Balance (USDT)"); + assertEq(_devBalanceAfter, _WBNBdevBalanceBefore, "Dev Treasury Balance (WBNB)"); + assertEq(_burnBalanceAfter, _WBNBburnBalanceBefore, "Burn Treasury Balance (WBNB)"); + + // Smart treasury after must equal to before + uint256 _WBNBTreasuryBalanceAfter = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + assertEq(_WBNBTreasuryBalanceAfter, _WBNBTreasuryBalanceBefore, "Smart treasury balance (WBNB)"); + } + + function testCorrectness_WhenSwapFailedOtherDistribution_ShoulWork() external { + // top up 2 tokens ot treasury + // wbnb (failed) + // eth (passed) + deal(address(wbnb), address(smartTreasury), normalizeEther(3 ether, wbnb.decimals())); + deal(address(eth), address(smartTreasury), normalizeEther(3 ether, eth.decimals())); + + uint256 _wbnbTreasuryBefore = IERC20(wbnb).balanceOf(address(smartTreasury)); + + // mock fail for wbnb by slippage + vm.mockCall( + address(oracleMedianizer), + abi.encodeWithSelector(IPriceOracle.getPrice.selector, address(wbnb), usd), + abi.encode(normalizeEther(500 ether, wbnb.decimals()), 0) + ); + + address[] memory _tokens = new address[](2); + _tokens[0] = address(wbnb); + _tokens[1] = address(eth); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + uint256 _wbnbTreasuryAfter = IERC20(wbnb).balanceOf(address(smartTreasury)); + uint256 _ethTreasuryAfter = IERC20(eth).balanceOf(address(smartTreasury)); + + // smart treasury (wbnb) before must equal to after + assertEq(_wbnbTreasuryAfter, _wbnbTreasuryBefore, "WBNB smart treasury"); + // smart treasury (eth) must have nothing + assertEq(_ethTreasuryAfter, 0, "ETH smart treasury"); + } + + function testRevert_WhenOracleGetPriceFailed_ShouldRevert() external { + // set path for cake to usdt + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(cake), uint24(2500), address(usdt)); + pathReader.setPaths(_paths); + + deal(address(cake), address(smartTreasury), 30 ether); + + // call distribute + address[] memory _tokens = new address[](1); + _tokens[0] = address(cake); + vm.prank(ALICE); + vm.expectRevert("OracleMedianizer::getPrice:: no primary source"); + smartTreasury.distribute(_tokens); + } + + // TODO: incorrect logic, should not work + function testCorrectness_DecimalDiff_ShouldWork() external { + // tokenIn: doge (8 decimals) + // tokenOut (revenue token): wbnb (18 decimals) + + // set revenue token + vm.prank(ALICE); + smartTreasury.setRevenueToken(address(wbnb)); + + uint256 _distributeAmount = normalizeEther(3 ether, doge.decimals()); + + bytes[] memory _paths = new bytes[](1); + _paths[0] = abi.encodePacked(address(doge), uint24(2500), address(wbnb)); + pathReader.setPaths(_paths); + + // mock price doge on oracle doge = 0.0715291 * 1e18 + vm.mockCall( + address(oracleMedianizer), + abi.encodeWithSelector(IPriceOracle.getPrice.selector, address(doge), usd), + abi.encode(0.0715291 ether, 0) + ); + + // expect amount out + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput( + abi.encodePacked(address(doge), uint24(2500), address(wbnb)), + normalizeEther(1 ether, doge.decimals()) + ); + + // top up doge to smart treasury + deal(address(doge), address(smartTreasury), _distributeAmount); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(doge); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + uint256 _WBNBrevenueTreasury = IERC20(address(wbnb)).balanceOf(REVENUE_TREASURY); + assertCloseBps(_WBNBrevenueTreasury, _expectedAmountOut, 100); + + // expect distributed amount = 1 doge on dev treasury + uint256 _DogeDevTreasuryBalance = IERC20(address(doge)).balanceOf(DEV_TREASURY); + assertEq(_DogeDevTreasuryBalance, normalizeEther(1 ether, doge.decimals()), "DOGE Dev treasury"); + + // expect distributed amount = 1 doge on burn treasury + uint256 _burnDogeTreasury = IERC20(address(doge)).balanceOf(BURN_TREASURY); + assertEq(_burnDogeTreasury, normalizeEther(1 ether, doge.decimals()), "DOGE Burn treasury"); + } + + function testCorrectness_DistributeTokenIsRevenueToken_ShouldWork() external { + // state before distribute + uint256 _revenueBalanceBefore = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _devBalanceBefore = IERC20(address(usdt)).balanceOf(DEV_TREASURY); + uint256 _burnBalanceBefore = IERC20(address(usdt)).balanceOf(BURN_TREASURY); + + // top up usdt to balance smart treasury + deal(address(usdt), address(smartTreasury), normalizeEther(30 ether, usdt.decimals())); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(usdt); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + // state after distribute + uint256 _revenueBalanceAfter = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _devBalanceAfter = IERC20(address(usdt)).balanceOf(DEV_TREASURY); + uint256 _burnBalanceAfter = IERC20(address(usdt)).balanceOf(BURN_TREASURY); + + uint256 _expectAmount = normalizeEther(10 ether, usdt.decimals()); + + // rev treasury (get usdt) + assertEq(_revenueBalanceAfter, _revenueBalanceBefore + _expectAmount, "Revenue Treasury Balance (USDT)"); + // dev treasury (get usdt) + assertEq(_devBalanceAfter, _devBalanceBefore + _expectAmount, "Dev Treasury Balance (USDT)"); + // burn treasury (get usdt) + assertEq(_burnBalanceAfter, _burnBalanceBefore + _expectAmount, "Burn Treasury Balance (USDT)"); + + // Smart treasury after distribute must have nothing + uint256 _USDTTreasuryBalanceAfter = IERC20(address(usdt)).balanceOf(address(smartTreasury)); + assertEq(_USDTTreasuryBalanceAfter, 0, "Smart treasury balance (USDT)"); + } + + function testCorrectness_TooSmallSlippage_ShouldWork() external { + // state before distribute + uint256 _revenueBalanceBefore = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _devBalanceBefore = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _burnBalanceBefore = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // top up bnb to smart treasury + deal(address(wbnb), address(smartTreasury), 30 ether); + + // mock oracle under rate + vm.mockCall( + address(oracleMedianizer), + abi.encodeWithSelector(IPriceOracle.getPrice.selector, address(wbnb), usd), + abi.encode(normalizeEther(100 ether, wbnb.decimals()), 0) + ); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + // expect amount + (uint256 _expectedAmountOut, , , ) = quoterV2.quoteExactInput( + abi.encodePacked(address(wbnb), uint24(500), address(usdt)), + 10 ether + ); + + // state after distribute + uint256 _revenueBalanceAfter = IERC20(address(usdt)).balanceOf(REVENUE_TREASURY); + uint256 _devBalanceAfter = IERC20(address(wbnb)).balanceOf(DEV_TREASURY); + uint256 _burnBalanceAfter = IERC20(address(wbnb)).balanceOf(BURN_TREASURY); + + // rev treasury (get usdt) + assertCloseBps(_revenueBalanceAfter, _revenueBalanceBefore + _expectedAmountOut, 100); + // dev treasury (get wbnb) + assertEq(_devBalanceAfter, _devBalanceBefore + 10 ether, "Dev Treasury Balance (WBNB)"); + + // burn treasury (get wbnb) + assertEq(_burnBalanceAfter, _burnBalanceBefore + 10 ether, "Burn Treasury Balance (WBNB)"); + + // Smart treasury after must equal to before + uint256 _WBNBTreasuryBalanceAfter = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + assertEq(_WBNBTreasuryBalanceAfter, 0, "Smart treasury balance (WBNB)"); + } + + function testCorrectness_TooMuchSlippage_ShouldSkip() external { + // top up bnb to smart treasury + deal(address(wbnb), address(smartTreasury), 30 ether); + uint256 _WBNBTreasuryBalanceBefore = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + + // mock oracle under rate + vm.mockCall( + address(oracleMedianizer), + abi.encodeWithSelector(IPriceOracle.getPrice.selector, address(wbnb), usd), + abi.encode(normalizeEther(500 ether, wbnb.decimals()), 0) + ); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + vm.prank(ALICE); + smartTreasury.distribute(_tokens); + + // Smart treasury after must equal to before + uint256 _WBNBTreasuryBalanceAfter = IERC20(address(wbnb)).balanceOf(address(smartTreasury)); + assertEq(_WBNBTreasuryBalanceAfter, _WBNBTreasuryBalanceBefore, "Smart treasury balance (WBNB)"); + } +} diff --git a/solidity/tests/smart-treasury/SmartTreasury_SetConfigs.t.sol b/solidity/tests/smart-treasury/SmartTreasury_SetConfigs.t.sol new file mode 100644 index 000000000..00504fe67 --- /dev/null +++ b/solidity/tests/smart-treasury/SmartTreasury_SetConfigs.t.sol @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BaseFork } from "./BaseFork.sol"; +import { ISmartTreasury } from "solidity/contracts/interfaces/ISmartTreasury.sol"; + +contract SmartTreasury_SetConfigs is BaseFork { + function setUp() public override { + super.setUp(); + } + + function testCorrectness_SetWhitelist_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + assertEq(smartTreasury.whitelistedCallers(ALICE), true, "Set Whitelist"); + } + + function testCorrectness_SetRevenueToken_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(ALICE); + smartTreasury.setRevenueToken(address(wbnb)); + assertEq(smartTreasury.revenueToken(), address(wbnb), "Set Revenue Token"); + + // evm revert, since it will try to call address.decimals() which not existing + vm.expectRevert(); + smartTreasury.setRevenueToken(address(199)); + + vm.stopPrank(); + } + + function testCorrectness_SetAlloc_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(ALICE); + smartTreasury.setAllocPoints(100, 100, 100); + assertEq(smartTreasury.revenueAllocPoint(), 100, "Set Revenue Allocation"); + assertEq(smartTreasury.devAllocPoint(), 100, "Set Dev Allocation"); + assertEq(smartTreasury.burnAllocPoint(), 100, "Set Burn Allocation"); + + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAllocPoint.selector); + smartTreasury.setAllocPoints(10001, 100, 100); + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAllocPoint.selector); + smartTreasury.setAllocPoints(100, 10001, 100); + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAllocPoint.selector); + smartTreasury.setAllocPoints(100, 100, 10001); + + vm.stopPrank(); + } + + function testCorrectness_SetTreasuryAddresses_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(ALICE); + smartTreasury.setTreasuryAddresses(REVENUE_TREASURY, DEV_TREASURY, BURN_TREASURY); + assertEq(smartTreasury.revenueTreasury(), REVENUE_TREASURY, "Set Revenue treasury address"); + assertEq(smartTreasury.devTreasury(), DEV_TREASURY, "Set Dev treasury address"); + assertEq(smartTreasury.burnTreasury(), BURN_TREASURY, "Set Burn treasury address"); + + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAddress.selector); + smartTreasury.setTreasuryAddresses(address(0), DEV_TREASURY, BURN_TREASURY); + + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAddress.selector); + smartTreasury.setTreasuryAddresses(REVENUE_TREASURY, address(0), BURN_TREASURY); + + vm.expectRevert(ISmartTreasury.SmartTreasury_InvalidAddress.selector); + smartTreasury.setTreasuryAddresses(REVENUE_TREASURY, DEV_TREASURY, address(0)); + + vm.stopPrank(); + } + + function testCorrectness_SetSlippageTolerances_ShouldWork() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(ALICE); + smartTreasury.setSlippageToleranceBps(100); + assertEq(smartTreasury.slippageToleranceBps(), 100, "Slippage tolerance"); + + vm.expectRevert(ISmartTreasury.SmartTreasury_SlippageTolerance.selector); + smartTreasury.setSlippageToleranceBps(10001); + + vm.stopPrank(); + } + + function testRevert_UnauthorizedCallerCallSetter() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.prank(DEPLOYER); + smartTreasury.setWhitelistedCallers(_callers, true); + + vm.startPrank(BOB); + vm.expectRevert(ISmartTreasury.SmartTreasury_Unauthorized.selector); + smartTreasury.setRevenueToken(address(wbnb)); + + vm.expectRevert(ISmartTreasury.SmartTreasury_Unauthorized.selector); + smartTreasury.setAllocPoints(100, 100, 100); + + vm.expectRevert(ISmartTreasury.SmartTreasury_Unauthorized.selector); + smartTreasury.setTreasuryAddresses(REVENUE_TREASURY, DEV_TREASURY, BURN_TREASURY); + + vm.expectRevert(ISmartTreasury.SmartTreasury_Unauthorized.selector); + smartTreasury.setSlippageToleranceBps(100); + + vm.stopPrank(); + } + + function testRevert_NonOwnerSetWhitelist_ShouldRevert() external { + address[] memory _callers = new address[](1); + _callers[0] = ALICE; + vm.expectRevert("Ownable: caller is not the owner"); + smartTreasury.setWhitelistedCallers(_callers, true); + } +} diff --git a/solidity/tests/smart-treasury/SmartTreasury_Withdraw.t.sol b/solidity/tests/smart-treasury/SmartTreasury_Withdraw.t.sol new file mode 100644 index 000000000..cd094a2b7 --- /dev/null +++ b/solidity/tests/smart-treasury/SmartTreasury_Withdraw.t.sol @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; + +import { BaseFork } from "./BaseFork.sol"; +import { ISmartTreasury } from "solidity/contracts/interfaces/ISmartTreasury.sol"; + +contract SmartTreasury_Withdraw is BaseFork { + function setUp() public override { + super.setUp(); + } + + function testCorrectness_Withdraw_ShouldWork() external { + // top up + uint256 _topUpAmount = normalizeEther(10 ether, wbnb.decimals()); + deal(address(wbnb), address(smartTreasury), _topUpAmount); + uint256 _deployerBalance = wbnb.balanceOf(DEPLOYER); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + + vm.prank(DEPLOYER); + smartTreasury.withdraw(_tokens, DEPLOYER); + + uint256 _deployerAfter = wbnb.balanceOf(DEPLOYER); + assertEq(_deployerAfter, _deployerBalance + _topUpAmount, "DEPLOYER BALANCE"); + } + + function testRevert_UnauthorizedWithdraw_ShouldRevert() external { + // top up + uint256 _topUpAmount = normalizeEther(10 ether, wbnb.decimals()); + deal(address(wbnb), address(smartTreasury), _topUpAmount); + + address[] memory _tokens = new address[](1); + _tokens[0] = address(wbnb); + + vm.prank(BOB); + vm.expectRevert("Ownable: caller is not the owner"); + smartTreasury.withdraw(_tokens, DEPLOYER); + } +} diff --git a/solidity/tests/utils/VM.sol b/solidity/tests/utils/VM.sol index cf8d26717..45ec8f64d 100644 --- a/solidity/tests/utils/VM.sol +++ b/solidity/tests/utils/VM.sol @@ -434,6 +434,20 @@ interface VM is VmSafe { bytes calldata ) external; + function mockCallRevert( + address callee, + bytes calldata data, + bytes calldata revertData + ) external; + + // Reverts a call to an address with a specific msg.value, with specified revert data. + function mockCallRevert( + address callee, + uint256 msgValue, + bytes calldata data, + bytes calldata revertData + ) external; + // Clears all mocked calls function clearMockedCalls() external; diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index d41c06b22..54b9d4e9f 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -10,14 +10,28 @@ "esModuleInterop": true, "resolveJsonModule": true, "moduleResolution": "node", - "lib": ["es6", "es2017", "dom"], - "types": ["@types/node"], - "typeRoots": ["./node_modules/@types", "./types"], + "lib": [ + "es6", + "es2017", + "dom" + ], + "types": [ + "@types/node" + ], + "typeRoots": [ + "./node_modules/@types", + "./types" + ], "outDir": "typechain", "declaration": true }, "include": [ "./typechain/**/*.ts" ], - "exclude": ["node_modules", "build", "cache", "artifacts"] + "exclude": [ + "node_modules", + "build", + "cache", + "artifacts" + ] } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index a0ab81b7e..a56843d7d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,16 +8,30 @@ "esModuleInterop": true, "resolveJsonModule": true, "module": "commonjs", - "lib": ["es6", "es2017", "dom"], + "lib": [ + "es6", + "es2017", + "dom" + ], "target": "es5", - "types": ["@types/node"], - "typeRoots": ["./node_modules/@types", "./types"], + "types": [ + "@types/node" + ], + "typeRoots": [ + "./node_modules/@types", + "./types" + ], }, "include": [ "**/*.ts" ], - "exclude": ["node_modules", "build", "cache", "artifacts"], + "exclude": [ + "node_modules", + "build", + "cache", + "artifacts" + ], "files": [ - "typechain/index.d.ts" + "typechain/index.ts" ] } \ No newline at end of file diff --git a/type-script/scripts/set-mini-fl-pool-rewarders.ts b/type-script/scripts/set-mini-fl-pool-rewarders.ts new file mode 100644 index 000000000..a02e9fac4 --- /dev/null +++ b/type-script/scripts/set-mini-fl-pool-rewarders.ts @@ -0,0 +1,24 @@ +import { Command } from "commander"; +import { ConfigFileHelper } from "../../deploy/file-helper.ts/config-file.helper"; + +async function main(miniFLpId: number, rewarderAddress: string[]) { + const configFileHelper = new ConfigFileHelper(); + + configFileHelper.setMiniFLPoolRewarders(miniFLpId, rewarderAddress); + console.log("✅ Done"); +} + +const program = new Command(); +program.requiredOption("-p, --pid "); +program.requiredOption("-r, --rewarderAddress "); + +program.parse(process.argv); + +const options = program.opts(); + +main(options.pid, options.rewarderAddress) + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/type-script/scripts/write-mini-fl-pool.ts b/type-script/scripts/write-mini-fl-pool.ts index 58babc945..165efe28c 100644 --- a/type-script/scripts/write-mini-fl-pool.ts +++ b/type-script/scripts/write-mini-fl-pool.ts @@ -1,6 +1,6 @@ import { Command } from "commander"; -import { ConfigFileHelper } from "../file-helper.ts/config-file.helper"; -import { MiniFLPool } from "../interfaces"; +import { ConfigFileHelper } from "../../deploy/file-helper.ts/config-file.helper"; +import { MiniFLPool } from "../../deploy/interfaces"; async function main(id: string, name: string, stakingToken: string) { const configFileHelper = new ConfigFileHelper(); diff --git a/type-script/scripts/write-new-market.ts b/type-script/scripts/write-new-market.ts index 447934978..5d428ca3a 100644 --- a/type-script/scripts/write-new-market.ts +++ b/type-script/scripts/write-new-market.ts @@ -1,6 +1,6 @@ import { Command } from "commander"; -import { ConfigFileHelper } from "../file-helper.ts/config-file.helper"; -import { AssetTier, Market, reverseAssetTier } from "../interfaces"; +import { ConfigFileHelper } from "../../deploy/file-helper.ts/config-file.helper"; +import { AssetTier, Market, reverseAssetTier } from "../../deploy/interfaces"; async function main( name: string, diff --git a/type-script/scripts/write-rewarder.ts b/type-script/scripts/write-rewarder.ts new file mode 100644 index 000000000..6519e6009 --- /dev/null +++ b/type-script/scripts/write-rewarder.ts @@ -0,0 +1,32 @@ +import { Command } from "commander"; +import { ConfigFileHelper } from "../../deploy/file-helper.ts/config-file.helper"; +import { Rewarder } from "../../deploy/interfaces"; + +async function main(name: string, address: string, rewardToken: string) { + const configFileHelper = new ConfigFileHelper(); + + const rewarder: Rewarder = { + name, + address, + rewardToken, + }; + + configFileHelper.addRewarder(rewarder); + console.log("✅ Done"); +} + +const program = new Command(); +program.requiredOption("-n, --name "); +program.requiredOption("-a, --address
"); +program.requiredOption("-r, --rewardToken "); + +program.parse(process.argv); + +const options = program.opts(); + +main(options.name, options.address, options.rewardToken) + .then(() => process.exit(0)) + .catch((error) => { + console.error(error); + process.exit(1); + }); diff --git a/yarn.lock b/yarn.lock index a2c242be8..5cb4fa19e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,431 +2,445 @@ # yarn lockfile v1 -"@cspotcode/source-map-consumer@0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b" - integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg== - -"@cspotcode/source-map-support@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5" - integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA== +"@aws-crypto/sha256-js@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-1.2.2.tgz#02acd1a1fda92896fc5a28ec7c6e164644ea32fc" + integrity sha512-Nr1QJIbW/afYYGzYvrF70LtaHrIRtd4TNAglX8BvlfxJLZ45SAmueIKYl5tWoNBPzp65ymXGFK0Bb1vZUpuc9g== dependencies: - "@cspotcode/source-map-consumer" "0.8.0" + "@aws-crypto/util" "^1.2.2" + "@aws-sdk/types" "^3.1.0" + tslib "^1.11.1" -"@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.0", "@ethereumjs/block@^3.6.2": - version "3.6.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/block/-/block-3.6.2.tgz#63d1e26d0b7a7a3684fce920de6ebabec1e5b674" - integrity sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw== - dependencies: - "@ethereumjs/common" "^2.6.3" - "@ethereumjs/tx" "^3.5.1" - ethereumjs-util "^7.1.4" - merkle-patricia-tree "^4.2.4" - -"@ethereumjs/blockchain@^5.5.0", "@ethereumjs/blockchain@^5.5.2": - version "5.5.2" - resolved "https://registry.yarnpkg.com/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz#1848abd9dc1ee56acf8cec4c84304d7f4667d027" - integrity sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig== - dependencies: - "@ethereumjs/block" "^3.6.2" - "@ethereumjs/common" "^2.6.3" - "@ethereumjs/ethash" "^1.1.0" - debug "^4.3.3" - ethereumjs-util "^7.1.4" - level-mem "^5.0.1" - lru-cache "^5.1.1" - semaphore-async-await "^1.5.1" +"@aws-crypto/util@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@aws-crypto/util/-/util-1.2.2.tgz#b28f7897730eb6538b21c18bd4de22d0ea09003c" + integrity sha512-H8PjG5WJ4wz0UXAFXeJjWCW1vkvIJ3qUUD+rGRwJ2/hj+xT58Qle2MTql/2MGzkU+1JLAFuR6aJpLAjHwhmwwg== + dependencies: + "@aws-sdk/types" "^3.1.0" + "@aws-sdk/util-utf8-browser" "^3.0.0" + tslib "^1.11.1" -"@ethereumjs/common@^2.6.0", "@ethereumjs/common@^2.6.3": - version "2.6.3" - resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-2.6.3.tgz#39ddece7300b336276bad6c02f6a9f1a082caa05" - integrity sha512-mQwPucDL7FDYIg9XQ8DL31CnIYZwGhU5hyOO5E+BMmT71G0+RHvIT5rIkLBirJEKxV6+Rcf9aEIY0kXInxUWpQ== +"@aws-sdk/types@^3.1.0": + version "3.329.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.329.0.tgz#bc20659abfcd666954196c3a24ad47785db80dd3" + integrity sha512-wFBW4yciDfzQBSFmWNaEvHShnSGLMxSu9Lls6EUf6xDMavxSB36bsrVRX6CyAo/W0NeIIyEOW1LclGPgJV1okg== dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.4" + tslib "^2.5.0" -"@ethereumjs/ethash@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" - integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== - dependencies: - "@ethereumjs/block" "^3.5.0" - "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.1.1" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@^3.4.0", "@ethereumjs/tx@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.5.1.tgz#8d941b83a602b4a89949c879615f7ea9a90e6671" - integrity sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA== - dependencies: - "@ethereumjs/common" "^2.6.3" - ethereumjs-util "^7.1.4" - -"@ethereumjs/vm@^5.6.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.8.0.tgz#c9055f96afc13dd7b72893b57fa20027effea6fe" - integrity sha512-mn2G2SX79QY4ckVvZUfxlNUpzwT2AEIkvgJI8aHoQaNYEHhH8rmdVDIaVVgz6//PjK52BZsK23afz+WvSR0Qqw== - dependencies: - "@ethereumjs/block" "^3.6.2" - "@ethereumjs/blockchain" "^5.5.2" - "@ethereumjs/common" "^2.6.3" - "@ethereumjs/tx" "^3.5.1" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^4.3.3" - ethereumjs-util "^7.1.4" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.2.4" - rustbn.js "~0.2.0" +"@aws-sdk/util-utf8-browser@^3.0.0": + version "3.259.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz#3275a6f5eb334f96ca76635b961d3c50259fd9ff" + integrity sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw== + dependencies: + tslib "^2.3.1" -"@ethersproject/abi@5.6.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.6.0.tgz#ea07cbc1eec2374d32485679c12408005895e9f3" - integrity sha512-AhVByTwdXCc2YQ20v300w6KVHle9g2OFc28ZAFCPnJyEpkv1xKXjZcSTgWOlv1i+0dqlgF8RCF2Rn2KC1t+1Vg== - 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.6.0", "@ethersproject/abstract-provider@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.6.0.tgz#0c4ac7054650dbd9c476cf5907f588bbb6ef3061" - integrity sha512-oPMFlKLN+g+y7a79cLK3WiLcjWFnZQtXWgnLAbHZcN3s7L4v90UHpTOrLk+m3yr0gt+/h9STTM6zrr7PM8uoRw== - dependencies: - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/networks" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" - "@ethersproject/web" "^5.6.0" - -"@ethersproject/abstract-signer@5.6.0", "@ethersproject/abstract-signer@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.6.0.tgz#9cd7ae9211c2b123a3b29bf47aab17d4d016e3e7" - integrity sha512-WOqnG0NJKtI8n0wWZPReHtaLkDByPL67tn4nBaDAhmVq8sjHTPbCdz4DRhVu/cfTOvfy9w3iq5QZ7BX7zw56BQ== - 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.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== - dependencies: - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/rlp" "^5.6.0" - -"@ethersproject/base64@5.6.0", "@ethersproject/base64@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.6.0.tgz#a12c4da2a6fb86d88563216b0282308fc15907c9" - integrity sha512-2Neq8wxJ9xHxCF9TUgmKeSh9BXJ6OAxWfeGWvbauPh8FuHEjamgHilllx8KkSd5ErxyHIX7Xv3Fkcud2kY9ezw== - dependencies: - "@ethersproject/bytes" "^5.6.0" - -"@ethersproject/basex@5.6.0", "@ethersproject/basex@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.6.0.tgz#9ea7209bf0a1c3ddc2a90f180c3a7f0d7d2e8a69" - integrity sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - -"@ethersproject/bignumber@5.6.0", "@ethersproject/bignumber@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.6.0.tgz#116c81b075c57fa765a8f3822648cf718a8a0e26" - integrity sha512-VziMaXIUHQlHJmkv1dlcd6GY2PmT0khtAqaMctCIDogxkrarMzA9L94KN1NeXqqOfFD6r0sJT3vCTOFSmZ07DA== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - bn.js "^4.11.9" +"@chainsafe/as-sha256@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" + integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== -"@ethersproject/bytes@5.6.0", "@ethersproject/bytes@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.0.tgz#81652f2a0e04533575befadce555213c11d8aa20" - integrity sha512-3hJPlYemb9V4VLfJF5BfN0+55vltPZSHU3QKUyP9M3Y2TcajbiRrz65UG+xVHOzBereB1b9mn7r12o177xgN7w== - dependencies: - "@ethersproject/logger" "^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/contracts@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.0.tgz#60f2cfc7addd99a865c6c8cfbbcec76297386067" - integrity sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw== - 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/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== - dependencies: - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - -"@ethersproject/hdnode@5.6.0", "@ethersproject/hdnode@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.6.0.tgz#9dcbe8d629bbbcf144f2cae476337fe92d320998" - integrity sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw== - 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.6.0", "@ethersproject/json-wallets@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz#4c2fc27f17e36c583e7a252fb938bc46f98891e5" - integrity sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ== - dependencies: - "@ethersproject/abstract-signer" "^5.6.0" - "@ethersproject/address" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/hdnode" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/pbkdf2" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/random" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - "@ethersproject/transactions" "^5.6.0" +"@chainsafe/persistent-merkle-tree@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" + integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/persistent-merkle-tree@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" + integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/ssz@^0.10.0": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" + integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.5.0" + +"@chainsafe/ssz@^0.9.2": + version "0.9.4" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" + integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.4.2" + case "^1.6.3" + +"@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" + +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.6.3", "@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.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.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.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.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", "@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.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.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== +"@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== dependencies: - "@ethersproject/bytes" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.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/networks@5.6.0", "@ethersproject/networks@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.0.tgz#486d03fff29b4b6b5414d47a232ded09fe10de5e" - integrity sha512-DaVzgyThzHgSDLuURhvkp4oviGoGe9iTZW4jMEORHDRCgSZ9K9THGFKqL+qGXqPAYLEgZTf5z2w56mRrPR1MjQ== - dependencies: - "@ethersproject/logger" "^5.6.0" - -"@ethersproject/pbkdf2@5.6.0", "@ethersproject/pbkdf2@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz#04fcc2d7c6bff88393f5b4237d906a192426685a" - integrity sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/sha2" "^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/providers@5.6.1": - version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.6.1.tgz#9a05f00ecbac59565bf6907c8d2af8ac33303b48" - integrity sha512-w8Wx15nH+aVDvnoKCyI1f3x0B5idmk/bDJXMEUqCfdO8Eadd0QpDx9lDMTMmenhOmf9vufLJXjpSm24D3ZnVpg== - 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" +"@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== + +"@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.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", "@ethersproject/providers@^5.7.1", "@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.6.0", "@ethersproject/random@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.6.0.tgz#1505d1ab6a250e0ee92f436850fa3314b2cb5ae6" - integrity sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw== +"@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.6.0" - "@ethersproject/logger" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@5.6.0", "@ethersproject/rlp@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.6.0.tgz#55a7be01c6f5e64d6e6e7edb6061aa120962a717" - integrity sha512-dz9WR1xpcTL+9DtOT/aDO+YyxSSdO8YIS0jyZwHHSlAmnxA6cKU3TrTd4Xc/bHayctxTgGLYNuVVoiXE4tTq1g== +"@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.6.0" - "@ethersproject/logger" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" -"@ethersproject/sha2@5.6.0", "@ethersproject/sha2@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.6.0.tgz#364c4c11cc753bda36f31f001628706ebadb64d9" - integrity sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA== +"@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.6.0" - "@ethersproject/logger" "^5.6.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.6.0", "@ethersproject/signing-key@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.6.0.tgz#4f02e3fb09e22b71e2e1d6dc4bcb5dafa69ce042" - integrity sha512-S+njkhowmLeUu/r7ir8n78OUKx63kBdMCPssePS89So1TH4hZqnWFsThEd/GiXYp9qMxVrydf7KdM9MTGPFukA== +"@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.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - bn.js "^4.11.9" + "@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.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.6.0.tgz#64657362a596bf7f5630bdc921c07dd78df06dc3" - integrity sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww== - dependencies: - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/sha2" "^5.6.0" - "@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== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/logger" "^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== - dependencies: - "@ethersproject/address" "^5.6.0" - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/keccak256" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/rlp" "^5.6.0" - "@ethersproject/signing-key" "^5.6.0" - -"@ethersproject/units@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.6.0.tgz#e5cbb1906988f5740254a21b9ded6bd51e826d9c" - integrity sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw== - dependencies: - "@ethersproject/bignumber" "^5.6.0" - "@ethersproject/constants" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - -"@ethersproject/wallet@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.0.tgz#33d11a806d783864208f348709a5a3badac8e22a" - integrity sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg== - 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/web@5.6.0", "@ethersproject/web@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.6.0.tgz#4bf8b3cbc17055027e1a5dd3c357e37474eaaeb8" - integrity sha512-G/XHj0hV1FxI2teHRfCGvfBUHFmU+YOSbCxlAMqJklxSa7QMiHFQfAxvwY2PFqgvdkxEKwRNr/eCjfAPEm2Ctg== - dependencies: - "@ethersproject/base64" "^5.6.0" - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.0" - -"@ethersproject/wordlists@5.6.0", "@ethersproject/wordlists@^5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.6.0.tgz#79e62c5276e091d8575f6930ba01a29218ded032" - integrity sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q== - dependencies: - "@ethersproject/bytes" "^5.6.0" - "@ethersproject/hash" "^5.6.0" - "@ethersproject/logger" "^5.6.0" - "@ethersproject/properties" "^5.6.0" - "@ethersproject/strings" "^5.6.0" +"@ethersproject/solidity@5.7.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.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== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^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== + 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", "@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" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@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" "@metamask/eth-sig-util@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.0.tgz#11553ba06de0d1352332c1bde28c8edd00e0dcf6" - integrity sha512-LczOjjxY4A7XYloxzyxJIHONELmUxVZncpOLoClpEcTiebiVdM46KRPYXGuULro9oNNR2xdVx3yoKiQjdfWmoA== + 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" @@ -434,44 +448,286 @@ 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== + +"@nomicfoundation/ethereumjs-block@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.1.tgz#6f89664f55febbd723195b6d0974773d29ee133d" + integrity sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + +"@nomicfoundation/ethereumjs-blockchain@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.1.tgz#80e0bd3535bfeb9baa29836b6f25123dab06a726" + integrity sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-ethash" "3.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + abstract-level "^1.0.3" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + level "^8.0.0" + lru-cache "^5.1.1" + memory-level "^1.0.0" + +"@nomicfoundation/ethereumjs-common@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.1.tgz#4702d82df35b07b5407583b54a45bf728e46a2f0" + integrity sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.1" + crc-32 "^1.2.0" + +"@nomicfoundation/ethereumjs-ethash@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.1.tgz#65ca494d53e71e8415c9a49ef48bc921c538fc41" + integrity sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + abstract-level "^1.0.3" + bigint-crypto-utils "^3.0.23" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-evm@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.1.tgz#f35681e203363f69ce2b3d3bf9f44d4e883ca1f1" + integrity sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ== + dependencies: + "@ethersproject/providers" "^5.7.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + mcl-wasm "^0.7.1" + rustbn.js "~0.2.0" + +"@nomicfoundation/ethereumjs-rlp@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.1.tgz#0b30c1cf77d125d390408e391c4bb5291ef43c28" + integrity sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ== + +"@nomicfoundation/ethereumjs-statemanager@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.1.tgz#8824a97938db4471911e2d2f140f79195def5935" + integrity sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + ethers "^5.7.1" + js-sdsl "^4.1.4" + +"@nomicfoundation/ethereumjs-trie@6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.1.tgz#662c55f6b50659fd4b22ea9f806a7401cafb7717" + integrity sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + "@types/readable-stream" "^2.3.13" + ethereum-cryptography "0.1.3" + readable-stream "^3.6.0" + +"@nomicfoundation/ethereumjs-tx@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.1.tgz#7629dc2036b4a33c34e9f0a592b43227ef4f0c7d" + integrity sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w== + dependencies: + "@chainsafe/ssz" "^0.9.2" + "@ethersproject/providers" "^5.7.2" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.1": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.1.tgz#530cda8bae33f8b5020a8f199ed1d0a2ce48ec89" + integrity sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA== + dependencies: + "@chainsafe/ssz" "^0.10.0" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-vm@7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.1.tgz#7d035e0993bcad10716c8b36e61dfb87fa3ca05f" + integrity sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-blockchain" "7.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-evm" "2.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-statemanager" "2.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + debug "^4.3.3" + ethereum-cryptography "0.1.3" + 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.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.5.tgz#131b0da1b71680d5a01569f916ae878229d326d3" - integrity sha512-A2gZAGB6kUvLx+kzM92HKuUF33F1FSe90L0TmkXkT2Hh0OKRpvWZURUSU2nghD2yC4DzfEZ3DftfeHGvZ2JTUw== + version "2.2.3" + resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" + integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== "@openzeppelin/contracts-upgradeable@^4.7.3": - version "4.7.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.7.3.tgz#f1d606e2827d409053f3e908ba4eb8adb1dd6995" - integrity sha512-+wuegAMaLcZnLCJIvrVUDzA9z/Wp93f0Dla/4jJvIhijRrPabjQbZe6fWiECLaJyfn5ci9fqf9vTw3xpQOad2A== + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f" + integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg== "@openzeppelin/contracts@^4.7.1": - version "4.7.3" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.3.tgz#939534757a81f8d69cc854c7692805684ff3111e" - integrity sha512-dGRS0agJzu8ybo44pCIf3xBaPQN/65AIXNgK8+4gzKd5kbvlqyxryUYVLJv7fK98Seyd2hDZzVEHSWAh0Bt1Yw== + version "4.8.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a" + integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg== "@openzeppelin/hardhat-upgrades@^1.16.1": - version "1.16.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.16.1.tgz#f2c1cdeadb3461712e593945e0fce52f362c91fe" - integrity sha512-vSlOCi3n9MGex3F+Qs+0WZJx2d2sg1rhWQ6FbHAybfQH7wngQn4INv1m3JZZpmerkOAoHi1Cdv4GOGLmxFnWYQ== + version "1.26.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.26.0.tgz#a1c667c6fd59fa90d026bab461486ea2bffb948f" + integrity sha512-ggCvdIf7A9QcMedCaswecgt3N7hacx3qYOn+4bNPqMAwslo/SJ9vN4AhV0VWkDcY4CqFFou3RFQmDWNeLMBX9A== dependencies: - "@openzeppelin/upgrades-core" "^1.13.1" + "@openzeppelin/upgrades-core" "^1.26.2" chalk "^4.1.0" + debug "^4.1.1" + defender-base-client "^1.44.0" + platform-deploy-client "^0.6.0" proper-lockfile "^4.1.1" -"@openzeppelin/upgrades-core@^1.13.1": - version "1.14.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.14.1.tgz#a0e1c83f9811186ac49d286e6b43ae129097422b" - integrity sha512-iKlh1mbUxyfdjdEiUFyhMkqirfas+DMUu7ED53nZbHEyhcYsm+5Fl/g0Bv6bZA+a7k8kO8+22DNEKsqaDUBc2Q== +"@openzeppelin/upgrades-core@^1.26.2": + version "1.26.2" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.26.2.tgz#6ac3d16dca21d9bd76bd55a8a34121b4a78dd2c2" + integrity sha512-TJORrgyun5qflPos/47P3j61gDw+7W+tEirSBOYRxfVL1WGjX1n8iaLrijPIqzyeS1MKguN1nckAMspQ4SKrxw== dependencies: - bn.js "^5.1.2" cbor "^8.0.0" chalk "^4.1.0" - compare-versions "^4.0.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" +"@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" @@ -540,37 +796,37 @@ "@sentry/types" "5.30.0" tslib "^1.9.3" -"@solidity-parser/parser@^0.14.0", "@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== +"@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" "@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + 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.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + 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.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + 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.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== "@typechain/ethers-v5@^10.2.0": - version "10.2.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.0.tgz#68f5963efb5214cb2d881477228e4b5b315473e1" - integrity sha512-ikaq0N/w9fABM+G01OFmU3U3dNnyRwEahkdvi9mqy1a3XwKiPZaF/lu54OcNaEWnpvEYyhhS0N7buCtLQqC92w== + version "10.2.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz#50241e6957683281ecfa03fb5a6724d8a3ce2391" + integrity sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A== dependencies: lodash "^4.17.15" ts-essentials "^7.0.1" @@ -582,11 +838,6 @@ dependencies: fs-extra "^9.1.0" -"@types/abstract-leveldown@*": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz#f055979a99f7654e84d6b8e6267419e9c4cfff87" - integrity sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ== - "@types/bn.js@^4.11.3": version "4.11.6" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" @@ -595,25 +846,16 @@ "@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== + 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/level-errors@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/level-errors/-/level-errors-3.0.0.tgz#15c1f4915a5ef763b51651b15e90f6dc081b96a8" - integrity sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ== - -"@types/levelup@^4.3.0": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@types/levelup/-/levelup-4.3.3.tgz#4dc2b77db079b1cf855562ad52321aa4241b8ef4" - integrity sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA== - dependencies: - "@types/abstract-leveldown" "*" - "@types/level-errors" "*" - "@types/node" "*" +"@types/lodash@^4.14.191": + version "4.14.194" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.194.tgz#b71eb6f7a0ff11bff59fc987134a093029258a76" + integrity sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g== "@types/lru-cache@^5.1.0": version "5.1.1" @@ -621,14 +863,14 @@ integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== "@types/mocha@^9.1.0": - version "9.1.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.0.tgz#baf17ab2cca3fcce2d322ebc30454bff487efad5" - integrity sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg== + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/node@*": - version "17.0.23" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.23.tgz#3b41a6e643589ac6442bdbd7a4a3ded62f33f7da" - integrity sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw== + version "20.2.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.0.tgz#e33da33171ac4eba79b9cfe30b68a4f1561e74ec" + integrity sha512-3iD2jaCCziTx04uudpJKwe39QxXgSUnpxXSvRQjRvHPxFQfmfP4NXIm/NURVeNlTCc+ru4WqjYGTmpXrW9uMlw== "@types/pbkdf2@^3.0.0": version "3.1.0" @@ -638,9 +880,27 @@ "@types/node" "*" "@types/prettier@^2.1.1": - version "2.7.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" - integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== + version "2.7.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" + integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + +"@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/readable-stream@^2.3.13": + version "2.3.15" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" + integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== + dependencies: + "@types/node" "*" + safe-buffer "~5.1.1" + +"@types/readline-sync@^1.4.4": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@types/readline-sync/-/readline-sync-1.4.4.tgz#8568292efe4ddd94d0ccee958b29cc3f4e0ea140" + integrity sha512-cFjVIoiamX7U6zkO2VPvXyTxbFDdiRo902IarJuPVxBhpDnXhwSaVE86ip+SCuyWBbEioKCkT4C88RNTxBM1Dw== "@types/secp256k1@^4.0.1": version "4.0.3" @@ -649,11 +909,6 @@ dependencies: "@types/node" "*" -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - abort-controller@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" @@ -661,27 +916,18 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -abstract-leveldown@^6.2.1: - version "6.3.0" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz#d25221d1e6612f820c35963ba4bd739928f6026a" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz#036543d87e3710f2528e47040bc3261b77a9a8eb" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.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" acorn-walk@^8.1.1: version "8.2.0" @@ -689,9 +935,9 @@ acorn-walk@^8.1.1: integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.4.1: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== + 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" @@ -701,7 +947,7 @@ adm-zip@^0.4.16: aes-js@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" - integrity sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0= + integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== agent-base@6: version "6.0.2" @@ -718,11 +964,27 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ansi-colors@4.1.1, ansi-colors@^4.1.1: +amazon-cognito-identity-js@^6.0.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.2.0.tgz#99e96666944429cb8f67b62e4cf7ad77fbe71ad0" + integrity sha512-9Fxrp9+MtLdsJvqOwSaE3ll+pneICeuE3pwj2yDkiyGNWuHx97b8bVLR2bOgfDmDJnY0Hq8QoeXtwdM4aaXJjg== + dependencies: + "@aws-crypto/sha256-js" "1.2.2" + buffer "4.9.2" + fast-base64-decode "^1.0.0" + isomorphic-unfetch "^3.0.0" + js-cookie "^2.2.1" + +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@^4.3.0: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -755,9 +1017,9 @@ antlr4ts@^0.5.0-alpha.4: integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + 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" @@ -782,25 +1044,30 @@ 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== -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== +async-retry@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" + integrity sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw== dependencies: - async "^2.4.0" + retry "0.13.1" -async@^2.4.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - 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== +axios@^0.21.1, axios@^0.21.2: + 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" @@ -813,7 +1080,7 @@ base-x@^3.0.2: dependencies: safe-buffer "^5.0.1" -base64-js@^1.3.1: +base64-js@^1.0.2, 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== @@ -823,6 +1090,11 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== +bigint-crypto-utils@^3.0.23: + version "3.2.2" + resolved "https://registry.yarnpkg.com/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz#e30a49ec38357c6981cd3da5aaa6480b1f752ee4" + integrity sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" @@ -833,15 +1105,15 @@ blakejs@^1.1.0: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== -bn.js@^4.0.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: 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.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.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== brace-expansion@^1.1.7: version "1.1.11" @@ -851,6 +1123,13 @@ brace-expansion@^1.1.7: 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@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -858,10 +1137,20 @@ braces@~3.0.2: dependencies: fill-range "^7.0.1" -brorand@^1.0.1, brorand@^1.1.0: +brorand@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + 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" @@ -883,7 +1172,7 @@ browserify-aes@^1.2.0: bs58@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== dependencies: base-x "^3.0.2" @@ -904,22 +1193,31 @@ buffer-from@^1.0.0: buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + 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== +buffer@4.9.2: + version "4.9.2" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" + integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== dependencies: - safe-buffer "^5.1.1" + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" -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== +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.1.13" + ieee754 "^1.2.1" + +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" @@ -939,6 +1237,16 @@ camelcase@^6.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== +case@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" + integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== + +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@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" @@ -955,7 +1263,7 @@ chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.1.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== @@ -963,7 +1271,7 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chokidar@3.5.3, chokidar@^3.4.0: +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== @@ -991,6 +1299,17 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" +classic-level@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/classic-level/-/classic-level-1.3.0.tgz#5e36680e01dc6b271775c093f2150844c5edd5c8" + integrity sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg== + dependencies: + abstract-level "^1.0.2" + catering "^2.1.0" + module-error "^1.0.1" + napi-macros "^2.2.2" + 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" @@ -1022,13 +1341,20 @@ color-convert@^2.0.1: color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + 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== +combined-stream@^1.0.8: + 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" @@ -1064,33 +1390,25 @@ commander@^9.2.0: resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30" integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== -compare-versions@^4.0.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-4.1.3.tgz#8f7b8966aef7dc4282b45dfa6be98434fc18a1a4" - integrity sha512-WQfnbDcrYnGr55UwbxKiQKASnTtNnaAWVi8jZyy8NTpVAXWACSne8lMD1iaIo9AiU6mnuLvSVshCzewVuWxHUg== +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== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== 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== -core-js-pure@^3.0.1: - version "3.21.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" - integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== - crc-32@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.1.tgz#436d2bcaad27bcb6bd073a2587139d3024a16460" - integrity sha512-Dn/xm/1vFFgs3nfrpEVScHoIslO9NZRITWGz/1E/St6u4xw99vfZzVkW0OSnzx2h9egej9xwMCEut6sqwokM/w== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.3.1" + version "1.2.2" + resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" + integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" @@ -1120,20 +1438,13 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -debug@4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3: +debug@4, debug@4.3.4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3: 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@4.3.3: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - decamelize@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" @@ -1144,13 +1455,21 @@ deep-extend@~0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz#27a997ad95408b61161aa69bd489b86c71b78058" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== +defender-base-client@^1.44.0: + version "1.44.0" + resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.44.0.tgz#afe724447c0f9177b999b70b9f14dd70d61d5a7a" + integrity sha512-8ZgGA93+FlxNwG9LN1nu/Au5AyCKwAWJGNf0VLiPmh4GX/Nali/7kv72K+OtZgGxTLtKDKfgN4cnhEZwfrc8dg== dependencies: - abstract-leveldown "~6.2.1" - inherits "^2.0.3" + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^0.21.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + +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== depd@2.0.0: version "2.0.0" @@ -1168,9 +1487,9 @@ diff@^4.0.1: integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== dotenv@^16.0.0: - version "16.0.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411" - integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q== + version "16.0.3" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" + integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" @@ -1185,27 +1504,17 @@ elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -emoji-regex@^10.0.0: - version "10.0.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.0.1.tgz#77180edb279b99510a21b79b19e1dc283d8f3991" - integrity sha512-cLuZzriSWVE+rllzeq4zpUEoCPfYEbQ6ZVhIq+ed6ynWST7Bw9XnOr+bKWgCup4paq72DI21gw9M3aaFkm4HAw== - 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== -encoding-down@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/encoding-down/-/encoding-down-6.3.0.tgz#b1c4eb0e1728c146ecaef8e32963c549e76d082b" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" +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== -enquirer@^2.3.0: +enquirer@^2.3.0, 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== @@ -1217,19 +1526,12 @@ env-paths@^2.2.0: 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" - 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-string-regexp@4.0.0, 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== @@ -1237,9 +1539,9 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: 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 sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== -ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: +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== @@ -1260,6 +1562,16 @@ ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: 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" + ethereumjs-abi@^0.6.8: version "0.6.8" resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" @@ -1281,10 +1593,10 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.4: - version "7.1.4" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz#a6885bcdd92045b06f596c7626c3e89ab3312458" - integrity sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A== +ethereumjs-util@^7.0.3: + 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" @@ -1292,41 +1604,41 @@ ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^5.6.1: - version "5.6.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.1.tgz#a56cd67f1595b745dc3dde0ccf2b5de53a41a6d0" - integrity sha512-qtl/2W+dwmUa5Z3JqwsbV3JEBZZHNARe5K/A2ePcNAuhJYnEKIgGOT/O9ouPwBijSqVoQnmQMzi5D48LFNOY2A== - dependencies: - "@ethersproject/abi" "5.6.0" - "@ethersproject/abstract-provider" "5.6.0" - "@ethersproject/abstract-signer" "5.6.0" - "@ethersproject/address" "5.6.0" - "@ethersproject/base64" "5.6.0" - "@ethersproject/basex" "5.6.0" - "@ethersproject/bignumber" "5.6.0" - "@ethersproject/bytes" "5.6.0" - "@ethersproject/constants" "5.6.0" - "@ethersproject/contracts" "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/networks" "5.6.0" - "@ethersproject/pbkdf2" "5.6.0" - "@ethersproject/properties" "5.6.0" - "@ethersproject/providers" "5.6.1" - "@ethersproject/random" "5.6.0" - "@ethersproject/rlp" "5.6.0" - "@ethersproject/sha2" "5.6.0" - "@ethersproject/signing-key" "5.6.0" - "@ethersproject/solidity" "5.6.0" - "@ethersproject/strings" "5.6.0" - "@ethersproject/transactions" "5.6.0" - "@ethersproject/units" "5.6.0" - "@ethersproject/wallet" "5.6.0" - "@ethersproject/web" "5.6.0" - "@ethersproject/wordlists" "5.6.0" +ethers@^5.5.3, ethers@^5.6.1, ethers@^5.7.1: + 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-util@0.1.6, ethjs-util@^0.1.6: version "0.1.6" @@ -1349,10 +1661,10 @@ evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== +fast-base64-decode@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" + integrity sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q== fill-range@^7.0.1: version "7.0.1" @@ -1379,7 +1691,7 @@ find-up@5.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" @@ -1388,10 +1700,26 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -follow-redirects@^1.12.1: - version "1.14.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" - integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +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.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== + +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" fp-ts@1.19.3: version "1.19.3" @@ -1406,7 +1734,7 @@ fp-ts@^1.0.0: fs-extra@^0.30.0: version "0.30.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= + integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== dependencies: graceful-fs "^4.1.2" jsonfile "^2.1.0" @@ -1414,6 +1742,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@^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" @@ -1436,7 +1773,7 @@ fs-extra@^9.1.0: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: version "2.3.2" @@ -1448,10 +1785,10 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -functional-red-black-tree@^1.0.1, 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 sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== get-caller-file@^2.0.5: version "2.0.5" @@ -1459,13 +1796,14 @@ get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-intrinsic@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== + 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" glob-parent@~5.1.2: version "5.1.2" @@ -1486,7 +1824,7 @@ glob@7.1.7: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.2.0, glob@^7.1.3: +glob@7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -1498,30 +1836,72 @@ glob@7.2.0, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -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.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== +glob@^7.1.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" -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== +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== + +hardhat-deploy@^0.11.10: + version "0.11.29" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.29.tgz#e6d76e37fa2ed74d76d15b01f3849da3bda49a81" + integrity sha512-9F+MRFkEocelzB8d+SDDCcTL7edBYAj2S63ldknvfIIBSajeB6q1/jm+dlK1GjcWzAzw7EVoxtjJXzxAxZfZcg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/providers" "^5.7.2" + "@ethersproject/solidity" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/wallet" "^5.7.0" + "@types/qs" "^6.9.7" + axios "^0.21.1" + chalk "^4.1.2" + chokidar "^3.5.2" + debug "^4.3.2" + enquirer "^2.3.6" + ethers "^5.5.3" + form-data "^4.0.0" + fs-extra "^10.0.0" + match-all "^1.2.6" + murmur-128 "^0.2.1" + qs "^6.9.4" + zksync-web3 "^0.14.3" hardhat@^2.9.1: - version "2.9.2" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.9.2.tgz#123f3fed6810ef8637b127b73ca44bb9c9efc249" - integrity sha512-elTcUK1EdFverWinybQ+DoJzsM6sgiHUYs0ZYNNXMfESty6ESHiFSwkfJsC88/q09vmIz6YVaMh73BYnYd+feQ== - dependencies: - "@ethereumjs/block" "^3.6.0" - "@ethereumjs/blockchain" "^5.5.0" - "@ethereumjs/common" "^2.6.0" - "@ethereumjs/tx" "^3.4.0" - "@ethereumjs/vm" "^5.6.0" + version "2.14.0" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.14.0.tgz#b60c74861494aeb1b50803cf04cc47865a42b87a" + integrity sha512-73jsInY4zZahMSVFurSK+5TNCJTXMv+vemvGia0Ac34Mm19fYp6vEPVGF3sucbumszsYxiTT2TbS8Ii2dsDSoQ== + dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/ethereumjs-block" "5.0.1" + "@nomicfoundation/ethereumjs-blockchain" "7.0.1" + "@nomicfoundation/ethereumjs-common" "4.0.1" + "@nomicfoundation/ethereumjs-evm" "2.0.1" + "@nomicfoundation/ethereumjs-rlp" "5.0.1" + "@nomicfoundation/ethereumjs-statemanager" "2.0.1" + "@nomicfoundation/ethereumjs-trie" "6.0.1" + "@nomicfoundation/ethereumjs-tx" "5.0.1" + "@nomicfoundation/ethereumjs-util" "9.0.1" + "@nomicfoundation/ethereumjs-vm" "7.0.1" + "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.14.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" abort-controller "^3.0.0" @@ -1534,45 +1914,47 @@ hardhat@^2.9.1: debug "^4.1.1" enquirer "^2.3.0" env-paths "^2.2.0" - ethereum-cryptography "^0.1.2" + ethereum-cryptography "^1.0.3" ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.1.3" find-up "^2.1.0" fp-ts "1.19.3" fs-extra "^7.0.1" - glob "^7.1.3" + glob "7.2.0" immutable "^4.0.0-rc.12" io-ts "1.10.4" + keccak "^3.0.2" lodash "^4.17.11" - merkle-patricia-tree "^4.2.2" mnemonist "^0.38.0" - mocha "^9.2.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" - slash "^3.0.0" solc "0.7.3" source-map-support "^0.5.13" stacktrace-parser "^0.1.10" - "true-case-path" "^2.2.1" tsort "0.0.1" - undici "^4.14.1" + undici "^5.14.0" uuid "^8.3.2" ws "^7.4.6" has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + 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-symbols@^1.0.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-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== @@ -1609,7 +1991,7 @@ he@1.2.0: hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" @@ -1627,9 +2009,9 @@ http-errors@2.0.0: toidentifier "1.0.1" https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + 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" @@ -1641,25 +2023,20 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -ieee754@^1.1.13: +ieee754@^1.1.4, 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== -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 sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= - immutable@^4.0.0-rc.12: - version "4.0.0" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0.tgz#b86f78de6adef3608395efb269a91462797e2c23" - integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw== + version "4.3.0" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be" + integrity sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg== + +imul@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/imul/-/imul-1.0.1.tgz#9d5867161e8b3de96c2c38d5dc7cb102f35e2ac9" + integrity sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA== indent-string@^4.0.0: version "4.0.0" @@ -1669,12 +2046,12 @@ indent-string@^4.0.0: inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + 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, 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== @@ -1693,10 +2070,15 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" +is-buffer@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" + integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -1713,7 +2095,7 @@ is-glob@^4.0.1, is-glob@~4.0.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 sha1-fY035q135dEnFIkTxXPggtd39VQ= + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== is-number@^7.0.0: version "7.0.0" @@ -1730,10 +2112,28 @@ is-unicode-supported@^0.1.0: resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= +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== + +isomorphic-unfetch@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz#87341d5f4f7b63843d468438128cb087b7c3e98f" + integrity sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q== + dependencies: + node-fetch "^2.6.1" + unfetch "^4.2.0" + +js-cookie@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + +js-sdsl@^4.1.4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430" + integrity sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg== js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" @@ -1750,14 +2150,14 @@ js-yaml@4.1.0: jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= + 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 sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== optionalDependencies: graceful-fs "^4.1.6" @@ -1770,10 +2170,10 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -keccak@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.2.tgz#4c2c6e8c54e04f2670ee49fa734eb9da152206e0" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== +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" @@ -1782,85 +2182,35 @@ keccak@^3.0.0: klaw@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= + integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== optionalDependencies: graceful-fs "^4.1.9" -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-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz#1d1009cf108340252cb38c51f9727311193e6263" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== - -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-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz#7ceba69b713b0d7e22fcc0d1f128ccdc8a24f79c" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== - dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - -level-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/level-mem/-/level-mem-5.0.1.tgz#c345126b74f5b8aa376dc77d36813a177ef8251d" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== - dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.yarnpkg.com/level-packager/-/level-packager-5.1.1.tgz#323ec842d6babe7336f70299c14df2e329c18939" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== - dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" +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-supports@~1.0.0: +level-transcoder@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/level-supports/-/level-supports-1.0.1.tgz#2f530a596834c7301622521988e2c36bb77d122d" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== - dependencies: - xtend "^4.0.2" - -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/level-ws/-/level-ws-2.0.0.tgz#207a07bcd0164a0ec5d62c304b4615c54436d339" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== + resolved "https://registry.yarnpkg.com/level-transcoder/-/level-transcoder-1.0.1.tgz#f8cef5990c4f1283d4c86d949e73631b0bc8ba9c" + integrity sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w== dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - xtend "^4.0.1" + buffer "^6.0.3" + module-error "^1.0.1" -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.yarnpkg.com/levelup/-/levelup-4.4.0.tgz#f89da3a228c38deb49c48f88a70fb71f01cafed6" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== +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: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" + browser-level "^1.0.1" + classic-level "^1.2.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" @@ -1877,7 +2227,7 @@ lodash.camelcase@^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@^4.17.11, lodash@^4.17.14, lodash@^4.17.15: +lodash@^4.17.11, lodash@^4.17.15, lodash@^4.17.16, lodash@^4.17.19, lodash@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -1907,18 +2257,18 @@ lru-cache@^6.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 sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - -ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== 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== +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" @@ -1933,42 +2283,31 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -memdown@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/memdown/-/memdown-5.1.0.tgz#608e91a9f10f37f5b5fe767667a8674129a833cb" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== +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-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" + 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 sha1-htcJCzDORV1j+64S3aUaR93K+bI= + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== -merkle-patricia-tree@^4.2.2, merkle-patricia-tree@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz#ff988d045e2bf3dfa2239f7fabe2d59618d57413" - integrity sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w== - dependencies: - "@types/levelup" "^4.3.0" - ethereumjs-util "^7.1.4" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - semaphore-async-await "^1.5.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== -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== +mime-types@^2.1.12: + 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: - bn.js "^4.0.0" - brorand "^1.0.1" + mime-db "1.52.0" minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" @@ -1978,16 +2317,16 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: 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 sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-4.2.1.tgz#40d9d511a46bdc4e563c22c3080cde9c0d8299b4" - integrity sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g== +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 "^1.1.7" + brace-expansion "^2.0.1" -minimatch@^3.0.4: +minimatch@^3.0.4, minimatch@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2006,36 +2345,38 @@ mnemonist@^0.38.0: dependencies: obliterator "^2.0.0" -mocha@^9.2.0: - version "9.2.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.2.tgz#d70db46bdb93ca57402c809333e5a84977a88fb9" - integrity sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g== +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: - "@ungap/promise-all-settled" "1.1.2" ansi-colors "4.1.1" browser-stdout "1.3.1" chokidar "3.5.3" - debug "4.3.3" + debug "4.3.4" diff "5.0.0" escape-string-regexp "4.0.0" find-up "5.0.0" glob "7.2.0" - growl "1.10.5" he "1.2.0" js-yaml "4.1.0" log-symbols "4.1.0" - minimatch "4.2.1" + minimatch "5.0.1" ms "2.1.3" - nanoid "3.3.1" + nanoid "3.3.3" serialize-javascript "6.0.0" strip-json-comments "3.1.1" supports-color "8.1.1" - which "2.0.2" - workerpool "6.2.0" + workerpool "6.2.1" yargs "16.2.0" yargs-parser "20.2.4" yargs-unparser "2.0.0" +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.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2046,20 +2387,41 @@ ms@2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== +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" + +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== + +napi-macros@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/napi-macros/-/napi-macros-2.2.2.tgz#817fef20c3e0e40a963fbf7b37d1600bd0201044" + integrity sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g== 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-gyp-build@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== +node-fetch@^2.6.0, node-fetch@^2.6.1: + 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-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@^3.1.0: version "3.1.0" @@ -2072,26 +2434,26 @@ normalize-path@^3.0.0, normalize-path@~3.0.0: integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 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== + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== obliterator@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.2.tgz#25f50dc92e1181371b9d8209d11890f1a3c2fc21" - integrity sha512-g0TrA7SbUggROhDPK8cEu/qpItwH2LSKcNl4tlfBNT54XY+nOsqrs0Q68h1V9b3HOSpIWv15jb1lax2hAggdIg== + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "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 sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== p-limit@^1.1.0: version "1.3.0" @@ -2110,7 +2472,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" @@ -2131,12 +2493,12 @@ p-map@^4.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 sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== 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" @@ -2146,7 +2508,7 @@ path-exists@^4.0.0: path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-parse@^1.0.6: version "1.0.7" @@ -2169,32 +2531,30 @@ picomatch@^2.0.4, picomatch@^2.2.1: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +platform-deploy-client@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/platform-deploy-client/-/platform-deploy-client-0.6.0.tgz#1f7a59d0cbae2e78f65ad253d7cc1aff67e3de0e" + integrity sha512-mBfnOvF2gb9acGJjlXBQ6VOAkKFRdljsNKHUVY5xKqzKP2PNh/RqCIvi5AR5NqLMrQ3XaMIwRvmwAjtGw7JhYg== + dependencies: + "@ethersproject/abi" "^5.6.3" + axios "^0.21.2" + defender-base-client "^1.44.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + prettier-plugin-solidity@^1.0.0-beta.19: - version "1.0.0-beta.19" - resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.19.tgz#7c3607fc4028f5e6a425259ff03e45eedf733df3" - integrity sha512-xxRQ5ZiiZyUoMFLE9h7HnUDXI/daf1tnmL1msEdcKmyh7ZGQ4YklkYLC71bfBpYU2WruTb5/SFLUaEb3RApg5g== - dependencies: - "@solidity-parser/parser" "^0.14.0" - emoji-regex "^10.0.0" - escape-string-regexp "^4.0.0" - semver "^7.3.5" + 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" - string-width "^4.2.3" -prettier@^2.3.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== - -prettier@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.0.tgz#12f8f504c4d8ddb76475f441337542fa799207d4" - integrity sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A== - -printj@~1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.3.1.tgz#9af6b1d55647a1587ac44f4c1654a4b95b8e12cb" - integrity sha512-GA3TdL8szPK4AQ2YnOe/b+Y1jUFwmmGMMK/qbY7VcE3Z7FU8JstbKiKRzO6CIiAKPhTO8m01NoQ0V5f3jc4OGg== +prettier@^2.3.1, prettier@^2.6.0: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== proper-lockfile@^4.1.1: version "4.1.2" @@ -2205,18 +2565,18 @@ proper-lockfile@^4.1.1: retry "^0.12.0" signal-exit "^3.0.2" -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -qs@^6.7.0: - version "6.10.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" - integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== +qs@^6.7.0, qs@^6.9.4: + version "6.11.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" + integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== dependencies: side-channel "^1.0.4" +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== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -2225,19 +2585,19 @@ randombytes@^2.1.0: safe-buffer "^5.1.0" raw-body@^2.4.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== + 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" -readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== +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" @@ -2250,6 +2610,11 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +readline-sync@^1.4.10: + version "1.4.10" + resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" + integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== + reduce-flatten@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" @@ -2258,7 +2623,7 @@ reduce-flatten@^2.0.0: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.0: version "2.0.2" @@ -2272,10 +2637,15 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" +retry@0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + retry@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" - integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== rimraf@^2.2.8: version "2.7.1" @@ -2299,6 +2669,13 @@ rlp@^2.2.3, rlp@^2.2.4: dependencies: bn.js "^5.2.0" +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" + rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" @@ -2309,6 +2686,11 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +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== + "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -2328,11 +2710,6 @@ secp256k1@^4.0.1: node-addon-api "^2.0.0" node-gyp-build "^4.2.0" -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz#857bef5e3644601ca4b9570b87e9df5ca12974fa" - integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= - semver@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -2343,10 +2720,10 @@ semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.5: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== +semver@^7.3.8: + version "7.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec" + integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw== dependencies: lru-cache "^6.0.0" @@ -2360,7 +2737,7 @@ serialize-javascript@6.0.0: setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== setprototypeof@1.2.0: version "1.2.0" @@ -2389,11 +2766,6 @@ signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - solc@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" @@ -2410,9 +2782,9 @@ solc@0.7.3: tmp "0.0.33" solidity-ast@^0.4.15: - version "0.4.31" - resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.31.tgz#c63e42f894cd047826a05dbb8d1e1dfc17282d39" - integrity sha512-kX6o4XE4ihaqENuRRTMJfwQNHoqWusPENZUlX4oVb19gQdfi7IswFWnThONHSW/61umgfWdKtCBgW45iuOTryQ== + version "0.4.49" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.49.tgz#ecba89d10c0067845b7848c3a3e8cc61a4fc5b82" + integrity sha512-Pr5sCAj1SFqzwFZw1HPKSq0PehlQNdM8GwKyAVYh2DOn7/cCK8LUKD1HeHnKtTgBW7hi9h4nnnan7hpAg5RhWQ== solidity-comments-extractor@^0.0.7: version "0.0.7" @@ -2444,12 +2816,17 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== +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== + 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@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0: 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== @@ -2475,7 +2852,7 @@ strip-ansi@^6.0.0, strip-ansi@^6.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 sha1-DF8VX+8RUTczd96du1iNoFUA428= + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== dependencies: is-hex-prefixed "1.0.0" @@ -2534,16 +2911,17 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -"true-case-path@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-2.2.1.tgz#c5bf04a5bbec3fd118be4084461b3a27c4d796bf" - integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-command-line-args@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.3.1.tgz#b6188e42efc6cf7a8898e438a873fbb15505ddd6" - integrity sha512-FR3y7pLl/fuUNSmnPhfLArGqRrpojQgIEEOVzYx9DhTmfIN7C9RWSfpkJEF4J+Gk7aVx5pak8I7vWZsaN4N84g== + version "2.5.0" + resolved "https://registry.yarnpkg.com/ts-command-line-args/-/ts-command-line-args-2.5.0.tgz#7eeed3a6937b2612ea08a0794cf9d43fbbea89c4" + integrity sha512-Ff7Xt04WWCjj/cmPO9eWTJX3qpBZWuPWyQYG1vnxJao+alWWYjwJBc5aYz3h5p5dE08A6AnpkgiCtP/0KXXBYw== 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" @@ -2555,11 +2933,11 @@ ts-essentials@^7.0.1: integrity sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ== ts-node@^10.7.0: - version "10.7.0" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" - integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== + 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.7.0" + "@cspotcode/source-map-support" "^0.8.0" "@tsconfig/node10" "^1.0.7" "@tsconfig/node12" "^1.0.7" "@tsconfig/node14" "^1.0.0" @@ -2570,18 +2948,23 @@ ts-node@^10.7.0: create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" - v8-compile-cache-lib "^3.0.0" + v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tslib@^1.9.3: +tslib@^1.11.1, 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== +tslib@^2.3.1, tslib@^2.5.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.1.tgz#f2ad78c367857d54e49a0ef9def68737e1a67b21" + integrity sha512-KaI6gPil5m9vF7DKaoXxx1ia9fxS4qG5YveErRRVknPDXXriu5M8h48YRjB6h5ZUOKuAKlSJYb0GaDe8I39fRw== + 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== tweetnacl-util@^0.15.1: version "0.15.1" @@ -2604,9 +2987,9 @@ type-fest@^0.7.1: integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== typechain@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.0.tgz#fc4902ce596519cb2ccfd012e4ddf92a9945b569" - integrity sha512-5jToLgKTjHdI1VKqs/K8BLYy42Sr3o8bV5ojh4MnR9ExHO83cyyUdw+7+vMJCpKXUiVUvARM4qmHTFuyaCMAZQ== + version "8.1.1" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.1.tgz#9c2e8012c2c4c586536fc18402dcd7034c4ff0bd" + integrity sha512-uF/sUvnXTOVF2FHKhQYnxHk4su4JjZR8vr4mA2mBaRwHTbwh0jIlqARz9XJr1tA0l7afJGvEa1dTSi4zt039LQ== dependencies: "@types/prettier" "^2.1.1" debug "^4.3.1" @@ -2620,9 +3003,9 @@ typechain@^8.0.0: ts-essentials "^7.0.1" typescript@^4.6.2: - version "4.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.3.tgz#eefeafa6afdd31d725584c67a0eaba80f6fc6c6c" - integrity sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw== + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== typical@^4.0.0: version "4.0.0" @@ -2634,10 +3017,17 @@ typical@^5.2.0: resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== -undici@^4.14.1: - version "4.16.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-4.16.0.tgz#469bb87b3b918818d3d7843d91a1d08da357d5ff" - integrity sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw== +undici@^5.14.0: + version "5.22.1" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.22.1.tgz#877d512effef2ac8be65e695f3586922e1a57d7b" + integrity sha512-Ji2IJhFXZY0x/0tVBXeQwgPlLWw13GVzpsWPQ3rV50IFMMof2I55PZZxtm4P6iNq+L5znYN9nSTAq0ZyE6lSJw== + dependencies: + busboy "^1.6.0" + +unfetch@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be" + integrity sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA== universalify@^0.1.0: version "0.1.2" @@ -2652,29 +3042,40 @@ universalify@^2.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== util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +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.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz#0582bcb1c74f3a2ee46487ceecf372e46bce53e8" - integrity sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA== +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== -which@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== +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== + +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: - isexe "^2.0.0" + tr46 "~0.0.3" + webidl-conversions "^3.0.0" wordwrapjs@^4.0.0: version "4.0.1" @@ -2684,10 +3085,10 @@ wordwrapjs@^4.0.0: reduce-flatten "^2.0.0" typical "^5.2.0" -workerpool@6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" - integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A== +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@^7.0.0: version "7.0.0" @@ -2701,7 +3102,7 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== ws@7.4.6: version "7.4.6" @@ -2709,14 +3110,9 @@ ws@7.4.6: integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== ws@^7.4.6: - version "7.5.7" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" - integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== - -xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== y18n@^5.0.5: version "5.0.8" @@ -2775,3 +3171,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.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.3.tgz#64ac2a16d597464c3fc4ae07447a8007631c57c9" + integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ==