diff --git a/packages/bots/pyth-updater/src/config/base.ts b/packages/bots/pyth-updater/src/config/base.ts new file mode 100644 index 0000000000..8f773c3a04 --- /dev/null +++ b/packages/bots/pyth-updater/src/config/base.ts @@ -0,0 +1,14 @@ +import { PythAssetConfig } from '../types'; + +import { pythConfig as commonPythConfig } from './common'; + +export const pythConfig: PythAssetConfig[] = [ + ...commonPythConfig, + { + // price feed for SOL + priceId: '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d', + configRefreshRateInSeconds: 3600, + validTimePeriodSeconds: 86400, // 24 hrs + deviationThresholdBps: 100, // 1% + }, +]; diff --git a/packages/bots/pyth-updater/src/config/index.ts b/packages/bots/pyth-updater/src/config/index.ts index ff28ebb6e1..3faf4915ed 100644 --- a/packages/bots/pyth-updater/src/config/index.ts +++ b/packages/bots/pyth-updater/src/config/index.ts @@ -1,7 +1,9 @@ -import { mode } from '@ionicprotocol/chains'; +import { base, mode } from '@ionicprotocol/chains'; +import { pythConfig as basePythConfig } from './base'; import { pythConfig as modePythConfig } from './mode'; export const chainIdToConfig = { [mode.chainId]: modePythConfig, + [base.chainId]: basePythConfig, }; diff --git a/packages/chains/src/base/assets.ts b/packages/chains/src/base/assets.ts index 904b1b6795..138959cbcb 100644 --- a/packages/chains/src/base/assets.ts +++ b/packages/chains/src/base/assets.ts @@ -3,6 +3,7 @@ import { ChainlinkFeedBaseCurrency, ChainlinkSpecificParams, OracleTypes, + PythSpecificParams, SupportedAsset, SupportedChains } from "@ionicprotocol/types"; @@ -33,6 +34,7 @@ export const EURC = "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42"; export const USDplus = "0xB79DD08EA68A908A97220C76d19A6aA9cBDE4376"; export const wUSDplus = "0xd95ca61CE9aAF2143E81Ef5462C0c2325172E028"; export const USDz = "0x04D5ddf5f3a8939889F11E97f8c4BB48317F1938"; +export const uSOL = "0x9B8Df6E244526ab5F6e6400d331DB28C8fdDdb55"; export const assets: SupportedAsset[] = [ { @@ -108,7 +110,7 @@ export const assets: SupportedAsset[] = [ underlying: SNX, name: "Synthetix Network Token", decimals: 18, - oracle: OracleTypes.PythPriceOracle, + oracle: OracleTypes.ChainlinkPriceOracleV2, oracleSpecificParams: { aggregator: "0xe3971Ed6F1A5903321479Ef3148B5950c0612075", feedBaseCurrency: ChainlinkFeedBaseCurrency.USD @@ -317,6 +319,20 @@ export const assets: SupportedAsset[] = [ initialCf: "0.80", initialSupplyCap: parseEther(String(13_000_000)).toString(), initialBorrowCap: parseEther(String(10_000_000)).toString() + }, + { + symbol: assetSymbols.uSOL, + underlying: uSOL, + name: "Wrapped Solana", + decimals: 18, + oracle: OracleTypes.PythPriceOracle, + oracleSpecificParams: { + feed: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d" + } as PythSpecificParams, + extraDocs: defaultDocs("https://basescan.org", uSOL), + initialBorrowCap: parseEther(String(1000)).toString(), + initialSupplyCap: parseEther(String(2000)).toString(), + initialCf: "0.80" } // DO NOT ADD TO MARKET UNLESS PROPER ORACLE IS DEPLOYED // { diff --git a/packages/chains/src/base/oracles.ts b/packages/chains/src/base/oracles.ts index 68215a4b21..c120a0e1c4 100644 --- a/packages/chains/src/base/oracles.ts +++ b/packages/chains/src/base/oracles.ts @@ -1,6 +1,11 @@ import { OracleTypes } from "@ionicprotocol/types"; -const baseOracles = [OracleTypes.FixedNativePriceOracle, OracleTypes.MasterPriceOracle, OracleTypes.SimplePriceOracle]; +const baseOracles = [ + OracleTypes.FixedNativePriceOracle, + OracleTypes.MasterPriceOracle, + OracleTypes.SimplePriceOracle, + OracleTypes.PythPriceOracle +]; const oracles: OracleTypes[] = [...baseOracles, OracleTypes.ChainlinkPriceOracleV2]; diff --git a/packages/contracts/chainDeploy/helpers/oracles/pyth.ts b/packages/contracts/chainDeploy/helpers/oracles/pyth.ts index 5efd2a6d8f..80826c41ac 100644 --- a/packages/contracts/chainDeploy/helpers/oracles/pyth.ts +++ b/packages/contracts/chainDeploy/helpers/oracles/pyth.ts @@ -1,10 +1,10 @@ import { Address, encodeFunctionData, GetContractReturnType, WalletClient } from "viem"; import { addTransaction, prepareAndLogTransaction } from "../logging"; -import { pythPriceOracleAbi } from "../../../generated"; import { addUnderlyingsToMpo } from "./utils"; import { PythAsset, PythDeployFnParams } from "../../types"; +import { pythPriceOracleAbi } from "../../../../sdk/src/generated"; export const deployPythPriceOracle = async ({ viem, @@ -15,7 +15,7 @@ export const deployPythPriceOracle = async ({ pythAssets, nativeTokenUsdFeed }: PythDeployFnParams): Promise<{ pythOracle: GetContractReturnType }> => { - const { deployer } = await getNamedAccounts(); + const { deployer, multisig } = await getNamedAccounts(); const publicClient = await viem.getPublicClient(); const walletClient = await viem.getWalletClient(deployer as Address); @@ -24,30 +24,30 @@ export const deployPythPriceOracle = async ({ (await deployments.get("MasterPriceOracle")).address as Address ); - // //// Pyth Oracle - // const pyth = await deployments.deploy("PythPriceOracle", { - // from: deployer, - // args: [], - // log: true, - // proxy: { - // execute: { - // init: { - // methodName: "initialize", - // args: [pythAddress, nativeTokenUsdFeed, usdToken] - // }, - // onUpgrade: { - // methodName: "reinitialize", - // args: [pythAddress, nativeTokenUsdFeed, usdToken] - // } - // }, - // owner: deployer, - // proxyContract: "OpenZeppelinTransparentProxy" - // }, - // waitConfirmations: 1 - // }); + //// Pyth Oracle + const pyth = await deployments.deploy("PythPriceOracle", { + from: deployer, + args: [], + log: true, + proxy: { + execute: { + init: { + methodName: "initialize", + args: [pythAddress, nativeTokenUsdFeed, usdToken] + }, + onUpgrade: { + methodName: "reinitialize", + args: [pythAddress, nativeTokenUsdFeed, usdToken] + } + }, + owner: multisig ?? deployer, + proxyContract: "OpenZeppelinTransparentProxy" + }, + waitConfirmations: 1 + }); - // if (pyth.transactionHash) publicClient.waitForTransactionReceipt({ hash: pyth.transactionHash as Address }); - // console.log("PythPriceOracle: ", pyth.address); + if (pyth.transactionHash) publicClient.waitForTransactionReceipt({ hash: pyth.transactionHash as Address }); + console.log("PythPriceOracle: ", pyth.address); const pythOracle = await viem.getContractAt( "PythPriceOracle", @@ -55,12 +55,15 @@ export const deployPythPriceOracle = async ({ ); const pythAssetsToChange: PythAsset[] = []; + console.log("🚀 ~ pythAssets:", pythAssets); for (const pythAsset of pythAssets) { const currentPriceFeed = await pythOracle.read.priceFeedIds([pythAsset.underlying]); + console.log("🚀 ~ currentPriceFeed:", currentPriceFeed); if (currentPriceFeed !== pythAsset.feed) { pythAssetsToChange.push(pythAsset); } } + console.log("🚀 ~ pythAssetsToChange:", pythAssetsToChange); if (pythAssetsToChange.length > 0) { if (((await pythOracle.read.owner()) as Address).toLowerCase() === deployer.toLowerCase()) { const tx = await pythOracle.write.setPriceFeeds([ diff --git a/packages/contracts/chainDeploy/mainnets/base.ts b/packages/contracts/chainDeploy/mainnets/base.ts index e63b3d621c..a8cc001130 100644 --- a/packages/contracts/chainDeploy/mainnets/base.ts +++ b/packages/contracts/chainDeploy/mainnets/base.ts @@ -1,9 +1,9 @@ -import { ChainDeployConfig, deployChainlinkOracle, deployErc4626PriceOracle } from "../helpers"; +import { ChainDeployConfig, deployChainlinkOracle, deployErc4626PriceOracle, deployPythPriceOracle } from "../helpers"; import { base } from "@ionicprotocol/chains"; import { deployAerodromeOracle } from "../helpers/oracles/aerodrome"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import { Address, zeroAddress } from "viem"; -import { ChainlinkSpecificParams, OracleTypes } from "../types"; +import { ChainlinkSpecificParams, OracleTypes, PythSpecificParams } from "../types"; import { configureAddress } from "../helpers/liquidators/ionicLiquidator"; const assets = base.assets; @@ -43,6 +43,24 @@ export const deploy = async ({ const { deployer, multisig } = await getNamedAccounts(); const publicClient = await viem.getPublicClient(); + //// Pyth Oracle + await deployPythPriceOracle({ + run, + viem, + getNamedAccounts, + deployments, + deployConfig, + pythAssets: base.assets + .filter((asset) => asset.oracle === OracleTypes.PythPriceOracle) + .map((asset) => ({ + feed: (asset.oracleSpecificParams as PythSpecificParams).feed, + underlying: asset.underlying + })), + nativeTokenUsdFeed: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", + pythAddress: "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a", + usdToken: base.chainAddresses.STABLE_TOKEN as Address + }); + //// ERC4626 Oracle await deployErc4626PriceOracle({ run, diff --git a/packages/contracts/deployments/base/IonicFlywheelDynamicRewards_ION_epoch4.json b/packages/contracts/deployments/base/IonicFlywheelDynamicRewards_ION_epoch4.json new file mode 100644 index 0000000000..a5b9a0987c --- /dev/null +++ b/packages/contracts/deployments/base/IonicFlywheelDynamicRewards_ION_epoch4.json @@ -0,0 +1,289 @@ +{ + "address": "0xFf77cC49Ed565B79162a27e9C991Fc2CeFA39d57", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "_flywheel", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_cycleLength", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FlywheelError", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "name": "NewRewardsCycle", + "type": "event" + }, + { + "inputs": [], + "name": "flywheel", + "outputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "name": "getAccruedRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "name": "rewardsCycle", + "outputs": [ + { + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardsCycleLength", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x0e4711372bd5aeba96e3681e79ebe0bae75135850e4ec9fb52a42088bda0d248", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xFf77cC49Ed565B79162a27e9C991Fc2CeFA39d57", + "transactionIndex": 86, + "gasUsed": "546655", + "logsBloom": "0x04000000000000000000000000000000000000000000000000000000000000000000000000408000000000000000100000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000008000000000000000010000000000000000000000000000000000080000000000000000000000000", + "blockHash": "0x69943e0616de52f052d20b1cee3cf8742165fba7216a40a2a1a8e533bf953364", + "transactionHash": "0x0e4711372bd5aeba96e3681e79ebe0bae75135850e4ec9fb52a42088bda0d248", + "logs": [ + { + "transactionIndex": 86, + "blockNumber": 21230758, + "transactionHash": "0x0e4711372bd5aeba96e3681e79ebe0bae75135850e4ec9fb52a42088bda0d248", + "address": "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000ff77cc49ed565b79162a27e9c991fc2cefa39d57", + "0x000000000000000000000000dcf10d5193910e2a76b565c13942bf4eabc9498e" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "logIndex": 277, + "blockHash": "0x69943e0616de52f052d20b1cee3cf8742165fba7216a40a2a1a8e533bf953364" + } + ], + "blockNumber": 21230758, + "cumulativeGasUsed": "16912518", + "status": 1, + "byzantium": true + }, + "args": [ + "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + 2588400 + ], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"_flywheel\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_cycleLength\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FlywheelError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"name\":\"NewRewardsCycle\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"flywheel\",\"outputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"name\":\"getAccruedRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"rewardsCycle\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardsCycleLength\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAccruedRewards(address,uint32)\":{\"params\":{\"strategy\":\"the strategy to accrue rewards for\"},\"returns\":{\"amount\":\"the amount of tokens accrued and transferred\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"FlywheelError()\":[{\"notice\":\"thrown when caller is not the flywheel\"}]},\"kind\":\"user\",\"methods\":{\"flywheel()\":{\"notice\":\"the flywheel core contract\"},\"getAccruedRewards(address,uint32)\":{\"notice\":\"calculate and transfer accrued rewards to flywheel core\"},\"rewardToken()\":{\"notice\":\"the reward token paid\"},\"rewardsCycleLength()\":{\"notice\":\"the length of a rewards cycle\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":\"IonicFlywheelDynamicRewards\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/BaseFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {IFlywheelRewards} from \\\"./IFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/** \\n @title Flywheel Reward Module\\n @notice Determines how many rewards accrue to each strategy globally over a given time period.\\n @dev approves the flywheel core for the reward token to allow balances to be managed by the module but claimed from core.\\n*/\\nabstract contract BaseFlywheelRewards is IFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n\\n /// @notice thrown when caller is not the flywheel\\n error FlywheelError();\\n\\n /// @notice the reward token paid\\n ERC20 public immutable override rewardToken;\\n\\n /// @notice the flywheel core contract\\n IonicFlywheelCore public immutable override flywheel;\\n\\n constructor(IonicFlywheelCore _flywheel) {\\n flywheel = _flywheel;\\n ERC20 _rewardToken = _flywheel.rewardToken();\\n rewardToken = _rewardToken;\\n\\n _rewardToken.safeApprove(address(_flywheel), type(uint256).max);\\n }\\n\\n modifier onlyFlywheel() {\\n if (msg.sender != address(flywheel)) revert FlywheelError();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xc5785aacb20e6bc503ccf9ce4b1fdf7e13e48a3abd32b19b16e30accc3f75d47\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {BaseFlywheelRewards} from \\\"./BaseFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {SafeCastLib} from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\n/** \\n @title Flywheel Dynamic Reward Stream\\n @notice Determines rewards based on a dynamic reward stream.\\n Rewards are transferred linearly over a \\\"rewards cycle\\\" to prevent gaming the reward distribution. \\n The reward source can be arbitrary logic, but most common is to \\\"pass through\\\" rewards from some other source.\\n The getNextCycleRewards() hook should also transfer the next cycle's rewards to this contract to ensure proper accounting.\\n*/\\nabstract contract FlywheelDynamicRewards is BaseFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n event NewRewardsCycle(uint32 indexed start, uint32 indexed end, uint192 reward);\\n\\n /// @notice the length of a rewards cycle\\n uint32 public immutable rewardsCycleLength;\\n\\n struct RewardsCycle {\\n uint32 start;\\n uint32 end;\\n uint192 reward;\\n }\\n\\n mapping(ERC20 => RewardsCycle) public rewardsCycle;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _rewardsCycleLength) BaseFlywheelRewards(_flywheel) {\\n rewardsCycleLength = _rewardsCycleLength;\\n }\\n\\n /**\\n @notice calculate and transfer accrued rewards to flywheel core\\n @param strategy the strategy to accrue rewards for\\n @return amount the amount of tokens accrued and transferred\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp)\\n external\\n override\\n onlyFlywheel\\n returns (uint256 amount)\\n {\\n RewardsCycle memory cycle = rewardsCycle[strategy];\\n\\n uint32 timestamp = block.timestamp.safeCastTo32();\\n\\n uint32 latest = timestamp >= cycle.end ? cycle.end : timestamp;\\n uint32 earliest = lastUpdatedTimestamp <= cycle.start ? cycle.start : lastUpdatedTimestamp;\\n if (cycle.end != 0) {\\n amount = (cycle.reward * (latest - earliest)) / (cycle.end - cycle.start);\\n assert(amount <= cycle.reward); // should never happen because latest <= cycle.end and earliest >= cycle.start\\n }\\n // if cycle has ended, reset cycle and transfer all available\\n if (timestamp >= cycle.end) {\\n uint32 end = ((timestamp + rewardsCycleLength) / rewardsCycleLength) * rewardsCycleLength;\\n uint192 rewards = getNextCycleRewards(strategy);\\n\\n // reset for next cycle\\n rewardsCycle[strategy] = RewardsCycle({start: timestamp, end: end, reward: rewards});\\n\\n emit NewRewardsCycle(timestamp, end, rewards);\\n }\\n }\\n\\n function getNextCycleRewards(ERC20 strategy) internal virtual returns (uint192);\\n}\",\"keccak256\":\"0x92b66dae28b01126410418d50eb0a87c141f903aaaf4c1b5cf391b7896230f4b\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { FlywheelDynamicRewards } from \\\"./FlywheelDynamicRewards.sol\\\";\\nimport { IonicFlywheelCore } from \\\"../IonicFlywheelCore.sol\\\";\\nimport { SafeTransferLib, ERC20 } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\n\\ncontract IonicFlywheelDynamicRewards is FlywheelDynamicRewards {\\n using SafeTransferLib for ERC20;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _cycleLength)\\n FlywheelDynamicRewards(_flywheel, _cycleLength)\\n {}\\n\\n function getNextCycleRewards(ERC20 strategy)\\n internal\\n override\\n returns (uint192)\\n {\\n uint256 rewardAmount = rewardToken.balanceOf(address(strategy));\\n if (rewardAmount != 0) {\\n rewardToken.safeTransferFrom(\\n address(strategy),\\n address(this),\\n rewardAmount\\n );\\n }\\n return uint192(rewardAmount);\\n }\\n}\\n\",\"keccak256\":\"0x00e550d3170b3849c61482719b6ce86178b5027ceab18751c662aeb703b7d29c\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60e060405234801561001057600080fd5b50604051610a2a380380610a2a83398101604081905261002f9161017c565b818181806001600160a01b031660a0816001600160a01b0316815250506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561008c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b091906101bf565b6001600160a01b03811660808190529091506100cf90836000196100e3565b505063ffffffff1660c052506101e3915050565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061015e5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b604482015260640160405180910390fd5b50505050565b6001600160a01b038116811461017957600080fd5b50565b6000806040838503121561018f57600080fd5b825161019a81610164565b602084015190925063ffffffff811681146101b457600080fd5b809150509250929050565b6000602082840312156101d157600080fd5b81516101dc81610164565b9392505050565b60805160a05160c0516107fe61022c600039600081816061015261032001526000818160a201526101a2015260008181610102015281816104db015261055b01526107fe6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "devdoc": { + "kind": "dev", + "methods": { + "getAccruedRewards(address,uint32)": { + "params": { + "strategy": "the strategy to accrue rewards for" + }, + "returns": { + "amount": "the amount of tokens accrued and transferred" + } + } + }, + "version": 1 + }, + "userdoc": { + "errors": { + "FlywheelError()": [ + { + "notice": "thrown when caller is not the flywheel" + } + ] + }, + "kind": "user", + "methods": { + "flywheel()": { + "notice": "the flywheel core contract" + }, + "getAccruedRewards(address,uint32)": { + "notice": "calculate and transfer accrued rewards to flywheel core" + }, + "rewardToken()": { + "notice": "the reward token paid" + }, + "rewardsCycleLength()": { + "notice": "the length of a rewards cycle" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 58045, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "rewardsCycle", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)" + } + ], + "types": { + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct FlywheelDynamicRewards.RewardsCycle)", + "numberOfBytes": "32", + "value": "t_struct(RewardsCycle)58039_storage" + }, + "t_struct(RewardsCycle)58039_storage": { + "encoding": "inplace", + "label": "struct FlywheelDynamicRewards.RewardsCycle", + "members": [ + { + "astId": 58034, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "start", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58036, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "end", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58038, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "reward", + "offset": 8, + "slot": "0", + "type": "t_uint192" + } + ], + "numberOfBytes": "32" + }, + "t_uint192": { + "encoding": "inplace", + "label": "uint192", + "numberOfBytes": "24" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4.json b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4.json new file mode 100644 index 0000000000..8d99a49101 --- /dev/null +++ b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4.json @@ -0,0 +1,1016 @@ +{ + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "transactionIndex": 46, + "gasUsed": "846771", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000200080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000200100000000000000000000000000000080000000000000c00001000800000000000000000000000400000040000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0", + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "logs": [ + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000d6c14644dd5ebde9ef4931f64940100ab55deea0" + ], + "data": "0x", + "logIndex": 78, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 79, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 80, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 81, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 82, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c21db52cca974df3dc019c92e52e522ce57156", + "logIndex": 83, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + } + ], + "blockNumber": 21230755, + "cumulativeGasUsed": "6018492", + "status": 1, + "byzantium": true + }, + "args": [ + "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "0x04C21Db52CcA974dF3Dc019C92E52e522ce57156", + "0xf8c8765e0000000000000000000000003ee5e23eee121094f1cfc0ccc79d6c809ebd22e5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [ + "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5", + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + "0x1155b614971f16758C92c4890eD338C9e3ede6b7" + ] + }, + "implementation": "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Implementation.json b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Implementation.json new file mode 100644 index 0000000000..0f7263273e --- /dev/null +++ b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Implementation.json @@ -0,0 +1,1160 @@ +{ + "address": "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x0073c333bf5e6571277dbdd5e9bc8da410bb8b45f7c91a630c6a110c342790e7", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "transactionIndex": 78, + "gasUsed": "1560163", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000100000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x81e4e0693e0f4ea638420a8d7f1f9f86245883bebaeb8ec373dbc39551f58ee2", + "transactionHash": "0x0073c333bf5e6571277dbdd5e9bc8da410bb8b45f7c91a630c6a110c342790e7", + "logs": [ + { + "transactionIndex": 78, + "blockNumber": 21230751, + "transactionHash": "0x0073c333bf5e6571277dbdd5e9bc8da410bb8b45f7c91a630c6a110c342790e7", + "address": "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 290, + "blockHash": "0x81e4e0693e0f4ea638420a8d7f1f9f86245883bebaeb8ec373dbc39551f58ee2" + } + ], + "blockNumber": 21230751, + "cumulativeGasUsed": "15968634", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsDelta\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsIndex\",\"type\":\"uint256\"}],\"name\":\"AccrueRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newStrategy\",\"type\":\"address\"}],\"name\":\"AddStrategy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ClaimRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"FlywheelBoosterUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"FlywheelRewardsUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPendingOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"NewPendingOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeRecipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeRecipient\",\"type\":\"address\"}],\"name\":\"UpdatedFeeSettings\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_acceptOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"_setPendingOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"secondUser\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addMarketForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addStrategyForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"allStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"claimRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"compAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeRecipient\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelBooster\",\"outputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"}],\"name\":\"flywheelPreBorrowerAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"supplier\",\"type\":\"address\"}],\"name\":\"flywheelPreSupplierAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"flywheelPreTransferAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelRewards\",\"outputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_rewardToken\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"_flywheelRewards\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"_flywheelBooster\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isFlywheel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRewardsDistributor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"marketState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"performanceFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"rewardsAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"setBooster\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"setFlywheelRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"strategyState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"index\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_performanceFee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_feeRecipient\",\"type\":\"address\"}],\"name\":\"updateFeeSettings\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"userIndex\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"params\":{\"rewardsDelta\":\"how many new rewards accrued to the user\",\"rewardsIndex\":\"the market index for rewards per token accrued\",\"strategy\":\"the updated rewards strategy\",\"user\":\"the user of the rewards\"}},\"AddStrategy(address)\":{\"params\":{\"newStrategy\":\"the new added strategy\"}},\"ClaimRewards(address,uint256)\":{\"params\":{\"amount\":\"the amount of rewards claimed\",\"user\":\"the user of the rewards\"}},\"FlywheelBoosterUpdate(address)\":{\"params\":{\"newBooster\":\"the new booster module\"}},\"FlywheelRewardsUpdate(address)\":{\"params\":{\"newFlywheelRewards\":\"the new rewards module\"}},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"_acceptOwner()\":{\"details\":\"Owner function for pending owner to accept role and update owner\"},\"_setPendingOwner(address)\":{\"details\":\"Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\",\"params\":{\"newPendingOwner\":\"New pending owner.\"}},\"accrue(address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to user (including prior)\"}},\"accrue(address,address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the second user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to the first user (including prior)\",\"_1\":\"the cumulative amount of rewards accrued to the second user (including prior)\"}},\"claimRewards(address)\":{\"details\":\"this function is public, and all rewards transfer to the user\",\"params\":{\"user\":\"the user claiming rewards\"}},\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateFeeSettings(uint256,address)\":{\"details\":\"Claim rewards first from the previous feeRecipient before changing it\"}},\"version\":1},\"userdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"notice\":\"Emitted when a user's rewards accrue to a given strategy.\"},\"AddStrategy(address)\":{\"notice\":\"Emitted when a new strategy is added to flywheel by the admin\"},\"ClaimRewards(address,uint256)\":{\"notice\":\"Emitted when a user claims accrued rewards.\"},\"FlywheelBoosterUpdate(address)\":{\"notice\":\"Emitted when the booster module changes\"},\"FlywheelRewardsUpdate(address)\":{\"notice\":\"Emitted when the rewards module changes\"},\"NewOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is accepted, which means owner is updated\"},\"NewPendingOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is changed\"}},\"kind\":\"user\",\"methods\":{\"_acceptOwner()\":{\"notice\":\"Accepts transfer of owner rights. msg.sender must be pendingOwner\"},\"_setPendingOwner(address)\":{\"notice\":\"Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\"},\"accrue(address,address)\":{\"notice\":\"accrue rewards for a single user on a strategy\"},\"accrue(address,address,address)\":{\"notice\":\"accrue rewards for a two users on a strategy\"},\"addStrategyForRewards(address)\":{\"notice\":\"initialize a new strategy\"},\"allStrategies(uint256)\":{\"notice\":\"append-only list of strategies added\"},\"claimRewards(address)\":{\"notice\":\"claim rewards for a given user\"},\"feeRecipient()\":{\"notice\":\"Address that gets rewardsToken accrued by performanceFee\"},\"flywheelBooster()\":{\"notice\":\"optional booster module for calculating virtual balances on strategies\"},\"flywheelRewards()\":{\"notice\":\"the rewards contract for managing streams\"},\"pendingOwner()\":{\"notice\":\"Pending owner of this contract\"},\"performanceFee()\":{\"notice\":\"How much rewardsToken will be send to treasury\"},\"rewardToken()\":{\"notice\":\"The token to reward\"},\"setBooster(address)\":{\"notice\":\"swap out the flywheel booster contract\"},\"setFlywheelRewards(address)\":{\"notice\":\"swap out the flywheel rewards contract\"},\"updateFeeSettings(uint256,address)\":{\"notice\":\"Update performanceFee and/or feeRecipient\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":\"IonicFlywheel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IIonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\n\\ninterface IIonicFlywheel {\\n function isRewardsDistributor() external returns (bool);\\n\\n function isFlywheel() external returns (bool);\\n\\n function flywheelPreSupplierAction(address market, address supplier) external;\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external;\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external;\\n\\n function compAccrued(address user) external view returns (uint256);\\n\\n function addMarketForRewards(ERC20 strategy) external;\\n\\n function marketState(ERC20 strategy) external view returns (uint224 index, uint32 lastUpdatedTimestamp);\\n}\\n\",\"keccak256\":\"0xb24009cac18b0f9b6d12884169ab4461ec04027110a768091077dc5c648e934c\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { IonicFlywheelCore } from \\\"./IonicFlywheelCore.sol\\\";\\nimport \\\"./IIonicFlywheel.sol\\\";\\n\\ncontract IonicFlywheel is IonicFlywheelCore, IIonicFlywheel {\\n bool public constant isRewardsDistributor = true;\\n bool public constant isFlywheel = true;\\n\\n function flywheelPreSupplierAction(address market, address supplier) external {\\n accrue(ERC20(market), supplier);\\n }\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external {}\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external {\\n accrue(ERC20(market), src, dst);\\n }\\n\\n function compAccrued(address user) external view returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function addMarketForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n // TODO remove\\n function marketState(ERC20 strategy) external view returns (uint224, uint32) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0x60d8d5a8feaa7c0373d24d6fbca523eb86ba251f5374a8821a6aee63cdc90e0d\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100dc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ac4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "devdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "params": { + "rewardsDelta": "how many new rewards accrued to the user", + "rewardsIndex": "the market index for rewards per token accrued", + "strategy": "the updated rewards strategy", + "user": "the user of the rewards" + } + }, + "AddStrategy(address)": { + "params": { + "newStrategy": "the new added strategy" + } + }, + "ClaimRewards(address,uint256)": { + "params": { + "amount": "the amount of rewards claimed", + "user": "the user of the rewards" + } + }, + "FlywheelBoosterUpdate(address)": { + "params": { + "newBooster": "the new booster module" + } + }, + "FlywheelRewardsUpdate(address)": { + "params": { + "newFlywheelRewards": "the new rewards module" + } + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "_acceptOwner()": { + "details": "Owner function for pending owner to accept role and update owner" + }, + "_setPendingOwner(address)": { + "details": "Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.", + "params": { + "newPendingOwner": "New pending owner." + } + }, + "accrue(address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to user (including prior)" + } + }, + "accrue(address,address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the second user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to the first user (including prior)", + "_1": "the cumulative amount of rewards accrued to the second user (including prior)" + } + }, + "claimRewards(address)": { + "details": "this function is public, and all rewards transfer to the user", + "params": { + "user": "the user claiming rewards" + } + }, + "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." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateFeeSettings(uint256,address)": { + "details": "Claim rewards first from the previous feeRecipient before changing it" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "notice": "Emitted when a user's rewards accrue to a given strategy." + }, + "AddStrategy(address)": { + "notice": "Emitted when a new strategy is added to flywheel by the admin" + }, + "ClaimRewards(address,uint256)": { + "notice": "Emitted when a user claims accrued rewards." + }, + "FlywheelBoosterUpdate(address)": { + "notice": "Emitted when the booster module changes" + }, + "FlywheelRewardsUpdate(address)": { + "notice": "Emitted when the rewards module changes" + }, + "NewOwner(address,address)": { + "notice": "Emitted when pendingOwner is accepted, which means owner is updated" + }, + "NewPendingOwner(address,address)": { + "notice": "Emitted when pendingOwner is changed" + } + }, + "kind": "user", + "methods": { + "_acceptOwner()": { + "notice": "Accepts transfer of owner rights. msg.sender must be pendingOwner" + }, + "_setPendingOwner(address)": { + "notice": "Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer." + }, + "accrue(address,address)": { + "notice": "accrue rewards for a single user on a strategy" + }, + "accrue(address,address,address)": { + "notice": "accrue rewards for a two users on a strategy" + }, + "addStrategyForRewards(address)": { + "notice": "initialize a new strategy" + }, + "allStrategies(uint256)": { + "notice": "append-only list of strategies added" + }, + "claimRewards(address)": { + "notice": "claim rewards for a given user" + }, + "feeRecipient()": { + "notice": "Address that gets rewardsToken accrued by performanceFee" + }, + "flywheelBooster()": { + "notice": "optional booster module for calculating virtual balances on strategies" + }, + "flywheelRewards()": { + "notice": "the rewards contract for managing streams" + }, + "pendingOwner()": { + "notice": "Pending owner of this contract" + }, + "performanceFee()": { + "notice": "How much rewardsToken will be send to treasury" + }, + "rewardToken()": { + "notice": "The token to reward" + }, + "setBooster(address)": { + "notice": "swap out the flywheel booster contract" + }, + "setFlywheelRewards(address)": { + "notice": "swap out the flywheel rewards contract" + }, + "updateFeeSettings(uint256,address)": { + "notice": "Update performanceFee and/or feeRecipient" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 176201, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 176204, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 178552, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 175825, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 175945, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 47957, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 54736, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "performanceFee", + "offset": 0, + "slot": "102", + "type": "t_uint256" + }, + { + "astId": 54739, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "feeRecipient", + "offset": 0, + "slot": "103", + "type": "t_address" + }, + { + "astId": 54743, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "rewardToken", + "offset": 0, + "slot": "104", + "type": "t_contract(ERC20)180913" + }, + { + "astId": 54748, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "allStrategies", + "offset": 0, + "slot": "105", + "type": "t_array(t_contract(ERC20)180913)dyn_storage" + }, + { + "astId": 54752, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelRewards", + "offset": 0, + "slot": "106", + "type": "t_contract(IFlywheelRewards)58375" + }, + { + "astId": 54756, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelBooster", + "offset": 0, + "slot": "107", + "type": "t_contract(IFlywheelBooster)54379" + }, + { + "astId": 54761, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_rewardsAccrued", + "offset": 0, + "slot": "108", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 54768, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_strategyState", + "offset": 0, + "slot": "109", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)" + }, + { + "astId": 54776, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_userIndex", + "offset": 0, + "slot": "110", + "type": "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(ERC20)180913)dyn_storage": { + "base": "t_contract(ERC20)180913", + "encoding": "dynamic_array", + "label": "contract ERC20[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelBooster)54379": { + "encoding": "inplace", + "label": "contract IFlywheelBooster", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelRewards)58375": { + "encoding": "inplace", + "label": "contract IFlywheelRewards", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint224)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint224)", + "numberOfBytes": "32", + "value": "t_uint224" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => mapping(address => uint224))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint224)" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct IonicFlywheelCore.RewardsState)", + "numberOfBytes": "32", + "value": "t_struct(RewardsState)55244_storage" + }, + "t_struct(RewardsState)55244_storage": { + "encoding": "inplace", + "label": "struct IonicFlywheelCore.RewardsState", + "members": [ + { + "astId": 55240, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "index", + "offset": 0, + "slot": "0", + "type": "t_uint224" + }, + { + "astId": 55243, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "lastUpdatedTimestamp", + "offset": 28, + "slot": "0", + "type": "t_uint32" + } + ], + "numberOfBytes": "32" + }, + "t_uint224": { + "encoding": "inplace", + "label": "uint224", + "numberOfBytes": "28" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Proxy.json b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Proxy.json new file mode 100644 index 0000000000..b768145365 --- /dev/null +++ b/packages/contracts/deployments/base/IonicFlywheel_ION_epoch4_Proxy.json @@ -0,0 +1,289 @@ +{ + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "transactionIndex": 46, + "gasUsed": "846771", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000200080000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000200100000000000000000000000000000080000000000000c00001000800000000000000000000000400000040000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0", + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "logs": [ + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000d6c14644dd5ebde9ef4931f64940100ab55deea0" + ], + "data": "0x", + "logIndex": 78, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 79, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 80, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 81, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 82, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + }, + { + "transactionIndex": 46, + "blockNumber": 21230755, + "transactionHash": "0xe346282fb06e187625d6034371728f96f91c6afd3c91f10381142e772f4288c1", + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c21db52cca974df3dc019c92e52e522ce57156", + "logIndex": 83, + "blockHash": "0x15ecbd9b2d9536364bddfb7a68dd4aba181f65e162dbbe077c550cae422d4ce0" + } + ], + "blockNumber": 21230755, + "cumulativeGasUsed": "6018492", + "status": 1, + "byzantium": true + }, + "args": [ + "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0", + "0x04C21Db52CcA974dF3Dc019C92E52e522ce57156", + "0xf8c8765e0000000000000000000000003ee5e23eee121094f1cfc0ccc79d6c809ebd22e5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/PythPriceOracle.json b/packages/contracts/deployments/base/PythPriceOracle.json new file mode 100644 index 0000000000..43d4b1b209 --- /dev/null +++ b/packages/contracts/deployments/base/PythPriceOracle.json @@ -0,0 +1,580 @@ +{ + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "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" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_USD_FEED", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PYTH", + "outputs": [ + { + "internalType": "contract IPyth", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USD_TOKEN", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ICErc20", + "name": "cToken", + "type": "address" + } + ], + "name": "getUnderlyingPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pythAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nativeTokenUsdFeed", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "usdToken", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying", + "type": "address" + } + ], + "name": "price", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "priceFeedIds", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pythAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nativeTokenUsdFeed", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "usdToken", + "type": "address" + } + ], + "name": "reinitialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "underlyings", + "type": "address[]" + }, + { + "internalType": "bytes32[]", + "name": "feedIds", + "type": "bytes32[]" + } + ], + "name": "setPriceFeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "transactionIndex": 113, + "gasUsed": "840424", + "logsBloom": "0x00000000000000008000000000000000400000000000000000800000000200000000000000000000000000000000000000020000100000000020000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000100000000000800000000800000100000000000000000400000000000000000000000000000000000000000000080000000000000c00000000000000000000000000000000400000000000000000000000000000000000000000020000000000000008000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90", + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "logs": [ + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000017a4df7081f1cd1370c70efecaffa11b5bf217b2" + ], + "data": "0x", + "logIndex": 393, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 394, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 395, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 396, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c21db52cca974df3dc019c92e52e522ce57156", + "logIndex": 397, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + } + ], + "blockNumber": 21219863, + "cumulativeGasUsed": "28257351", + "status": 1, + "byzantium": true + }, + "args": [ + "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2", + "0x04C21Db52CcA974dF3Dc019C92E52e522ce57156", + "0xd26b3e6e0000000000000000000000008250f4af4b972684f7b336503e2d6dfedeb1487aff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [ + "0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a", + "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace", + "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" + ] + }, + "implementation": "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/PythPriceOracle_Implementation.json b/packages/contracts/deployments/base/PythPriceOracle_Implementation.json new file mode 100644 index 0000000000..7542553966 --- /dev/null +++ b/packages/contracts/deployments/base/PythPriceOracle_Implementation.json @@ -0,0 +1,547 @@ +{ + "address": "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "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" + }, + { + "inputs": [], + "name": "NATIVE_TOKEN_USD_FEED", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PYTH", + "outputs": [ + { + "internalType": "contract IPyth", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "USD_TOKEN", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ICErc20", + "name": "cToken", + "type": "address" + } + ], + "name": "getUnderlyingPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pythAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nativeTokenUsdFeed", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "usdToken", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "underlying", + "type": "address" + } + ], + "name": "price", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "priceFeedIds", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pythAddress", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "nativeTokenUsdFeed", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "usdToken", + "type": "address" + } + ], + "name": "reinitialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "underlyings", + "type": "address[]" + }, + { + "internalType": "bytes32[]", + "name": "feedIds", + "type": "bytes32[]" + } + ], + "name": "setPriceFeeds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x9ac5e819fcea0a172d7aa1e624c5d10a776e61e5211aa729ddf8900687a8835f", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2", + "transactionIndex": 80, + "gasUsed": "1060962", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xd858acb03199f7bc7406365d90e16aba9509baa8aba2f4991bbf799eddd33fe7", + "transactionHash": "0x9ac5e819fcea0a172d7aa1e624c5d10a776e61e5211aa729ddf8900687a8835f", + "logs": [], + "blockNumber": 21219859, + "cumulativeGasUsed": "18138941", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPendingOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"NewPendingOwner\",\"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\"},{\"inputs\":[],\"name\":\"NATIVE_TOKEN_USD_FEED\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"PYTH\",\"outputs\":[{\"internalType\":\"contract IPyth\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"USD_TOKEN\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_acceptOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"_setPendingOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ICErc20\",\"name\":\"cToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pythAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"nativeTokenUsdFeed\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"usdToken\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"underlying\",\"type\":\"address\"}],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"priceFeedIds\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pythAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"nativeTokenUsdFeed\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"usdToken\",\"type\":\"address\"}],\"name\":\"reinitialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"underlyings\",\"type\":\"address[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"feedIds\",\"type\":\"bytes32[]\"}],\"name\":\"setPriceFeeds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Rahul Sethuram (https://github.com/rhlsthrm)\",\"details\":\"Implements `PriceOracle`.\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"_acceptOwner()\":{\"details\":\"Owner function for pending owner to accept role and update owner\"},\"_setPendingOwner(address)\":{\"details\":\"Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\",\"params\":{\"newPendingOwner\":\"New pending owner.\"}},\"getUnderlyingPrice(address)\":{\"details\":\"Implements the `PriceOracle` interface for Ionic pools (and Compound v2).\",\"returns\":{\"_0\":\"Price in ETH of the token underlying `cToken`, scaled by `10 ** (36 - underlyingDecimals)`.\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"price(address)\":{\"details\":\"Returns the price in ETH of `underlying` (implements `BasePriceOracle`).\"},\"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[],bytes32[])\":{\"details\":\"Admin-only function to set price feeds.\",\"params\":{\"feedIds\":\"The Pyth Network feed IDs`.\",\"underlyings\":\"Underlying token addresses for which to set price feeds.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"PYTH\":{\"details\":\"Constructor to set admin and canAdminOverwrite, wtoken address and native token USD price feed address\"}},\"title\":\"PythPriceOracle\",\"version\":1},\"userdoc\":{\"events\":{\"NewOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is accepted, which means owner is updated\"},\"NewPendingOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is changed\"}},\"kind\":\"user\",\"methods\":{\"NATIVE_TOKEN_USD_FEED()\":{\"notice\":\"DIA NATIVE/USD price feed contracts.\"},\"USD_TOKEN()\":{\"notice\":\"MasterPriceOracle for backup for USD price.\"},\"_acceptOwner()\":{\"notice\":\"Accepts transfer of owner rights. msg.sender must be pendingOwner\"},\"_setPendingOwner(address)\":{\"notice\":\"Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\"},\"getUnderlyingPrice(address)\":{\"notice\":\"Returns the price in ETH of the token underlying `cToken`.\"},\"pendingOwner()\":{\"notice\":\"Pending owner of this contract\"},\"priceFeedIds(address)\":{\"notice\":\"Maps ERC20 token addresses to Pyth price IDs.\"}},\"notice\":\"Returns prices from Pyth.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/default/PythPriceOracle.sol\":\"PythPriceOracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0xa6a787e7a901af6511e19aa53e1a00352db215a011d2c7a438d0582dd5da76f9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb94eac067c85cd79a4195c0a1f4a878e9827329045c12475a0199f1ae17b9700\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x636eab608b4563c01e88042aba9330e6fe69af2c567fe1adf4d85731974ac81d\",\"license\":\"MIT\"},\"@pythnetwork/pyth-sdk-solidity/IPyth.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.0;\\n\\nimport \\\"./PythStructs.sol\\\";\\nimport \\\"./IPythEvents.sol\\\";\\n\\n/// @title Consume prices from the Pyth Network (https://pyth.network/).\\n/// @dev Please refer to the guidance at https://docs.pyth.network/consumers/best-practices for how to consume prices safely.\\n/// @author Pyth Data Association\\ninterface IPyth is IPythEvents {\\n /// @notice Returns the period (in seconds) that a price feed is considered valid since its publish time\\n function getValidTimePeriod() external view returns (uint validTimePeriod);\\n\\n /// @notice Returns the price and confidence interval.\\n /// @dev Reverts if the price has not been updated within the last `getValidTimePeriod()` seconds.\\n /// @param id The Pyth Price Feed ID of which to fetch the price and confidence interval.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getPrice(\\n bytes32 id\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Returns the exponentially-weighted moving average price and confidence interval.\\n /// @dev Reverts if the EMA price is not available.\\n /// @param id The Pyth Price Feed ID of which to fetch the EMA price and confidence interval.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getEmaPrice(\\n bytes32 id\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Returns the price of a price feed without any sanity checks.\\n /// @dev This function returns the most recent price update in this contract without any recency checks.\\n /// This function is unsafe as the returned price update may be arbitrarily far in the past.\\n ///\\n /// Users of this function should check the `publishTime` in the price to ensure that the returned price is\\n /// sufficiently recent for their application. If you are considering using this function, it may be\\n /// safer / easier to use either `getPrice` or `getPriceNoOlderThan`.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getPriceUnsafe(\\n bytes32 id\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Returns the price that is no older than `age` seconds of the current time.\\n /// @dev This function is a sanity-checked version of `getPriceUnsafe` which is useful in\\n /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently\\n /// recently.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getPriceNoOlderThan(\\n bytes32 id,\\n uint age\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Returns the exponentially-weighted moving average price of a price feed without any sanity checks.\\n /// @dev This function returns the same price as `getEmaPrice` in the case where the price is available.\\n /// However, if the price is not recent this function returns the latest available price.\\n ///\\n /// The returned price can be from arbitrarily far in the past; this function makes no guarantees that\\n /// the returned price is recent or useful for any particular application.\\n ///\\n /// Users of this function should check the `publishTime` in the price to ensure that the returned price is\\n /// sufficiently recent for their application. If you are considering using this function, it may be\\n /// safer / easier to use either `getEmaPrice` or `getEmaPriceNoOlderThan`.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getEmaPriceUnsafe(\\n bytes32 id\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Returns the exponentially-weighted moving average price that is no older than `age` seconds\\n /// of the current time.\\n /// @dev This function is a sanity-checked version of `getEmaPriceUnsafe` which is useful in\\n /// applications that require a sufficiently-recent price. Reverts if the price wasn't updated sufficiently\\n /// recently.\\n /// @return price - please read the documentation of PythStructs.Price to understand how to use this safely.\\n function getEmaPriceNoOlderThan(\\n bytes32 id,\\n uint age\\n ) external view returns (PythStructs.Price memory price);\\n\\n /// @notice Update price feeds with given update messages.\\n /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling\\n /// `getUpdateFee` with the length of the `updateData` array.\\n /// Prices will be updated if they are more recent than the current stored prices.\\n /// The call will succeed even if the update is not the most recent.\\n /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid.\\n /// @param updateData Array of price update data.\\n function updatePriceFeeds(bytes[] calldata updateData) external payable;\\n\\n /// @notice Wrapper around updatePriceFeeds that rejects fast if a price update is not necessary. A price update is\\n /// necessary if the current on-chain publishTime is older than the given publishTime. It relies solely on the\\n /// given `publishTimes` for the price feeds and does not read the actual price update publish time within `updateData`.\\n ///\\n /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling\\n /// `getUpdateFee` with the length of the `updateData` array.\\n ///\\n /// `priceIds` and `publishTimes` are two arrays with the same size that correspond to senders known publishTime\\n /// of each priceId when calling this method. If all of price feeds within `priceIds` have updated and have\\n /// a newer or equal publish time than the given publish time, it will reject the transaction to save gas.\\n /// Otherwise, it calls updatePriceFeeds method to update the prices.\\n ///\\n /// @dev Reverts if update is not needed or the transferred fee is not sufficient or the updateData is invalid.\\n /// @param updateData Array of price update data.\\n /// @param priceIds Array of price ids.\\n /// @param publishTimes Array of publishTimes. `publishTimes[i]` corresponds to known `publishTime` of `priceIds[i]`\\n function updatePriceFeedsIfNecessary(\\n bytes[] calldata updateData,\\n bytes32[] calldata priceIds,\\n uint64[] calldata publishTimes\\n ) external payable;\\n\\n /// @notice Returns the required fee to update an array of price updates.\\n /// @param updateData Array of price update data.\\n /// @return feeAmount The required fee in Wei.\\n function getUpdateFee(\\n bytes[] calldata updateData\\n ) external view returns (uint feeAmount);\\n\\n /// @notice Parse `updateData` and return price feeds of the given `priceIds` if they are all published\\n /// within `minPublishTime` and `maxPublishTime`.\\n ///\\n /// You can use this method if you want to use a Pyth price at a fixed time and not the most recent price;\\n /// otherwise, please consider using `updatePriceFeeds`. This method does not store the price updates on-chain.\\n ///\\n /// This method requires the caller to pay a fee in wei; the required fee can be computed by calling\\n /// `getUpdateFee` with the length of the `updateData` array.\\n ///\\n ///\\n /// @dev Reverts if the transferred fee is not sufficient or the updateData is invalid or there is\\n /// no update for any of the given `priceIds` within the given time range.\\n /// @param updateData Array of price update data.\\n /// @param priceIds Array of price ids.\\n /// @param minPublishTime minimum acceptable publishTime for the given `priceIds`.\\n /// @param maxPublishTime maximum acceptable publishTime for the given `priceIds`.\\n /// @return priceFeeds Array of the price feeds corresponding to the given `priceIds` (with the same order).\\n function parsePriceFeedUpdates(\\n bytes[] calldata updateData,\\n bytes32[] calldata priceIds,\\n uint64 minPublishTime,\\n uint64 maxPublishTime\\n ) external payable returns (PythStructs.PriceFeed[] memory priceFeeds);\\n}\\n\",\"keccak256\":\"0x949c65c65fea0578c09a6fc068e09ed1165adede2c835984cefcb25d76de1de2\",\"license\":\"Apache-2.0\"},\"@pythnetwork/pyth-sdk-solidity/IPythEvents.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.0;\\n\\n/// @title IPythEvents contains the events that Pyth contract emits.\\n/// @dev This interface can be used for listening to the updates for off-chain and testing purposes.\\ninterface IPythEvents {\\n /// @dev Emitted when the price feed with `id` has received a fresh update.\\n /// @param id The Pyth Price Feed ID.\\n /// @param publishTime Publish time of the given price update.\\n /// @param price Price of the given price update.\\n /// @param conf Confidence interval of the given price update.\\n event PriceFeedUpdate(\\n bytes32 indexed id,\\n uint64 publishTime,\\n int64 price,\\n uint64 conf\\n );\\n\\n /// @dev Emitted when a batch price update is processed successfully.\\n /// @param chainId ID of the source chain that the batch price update comes from.\\n /// @param sequenceNumber Sequence number of the batch price update.\\n event BatchPriceFeedUpdate(uint16 chainId, uint64 sequenceNumber);\\n}\\n\",\"keccak256\":\"0x048a35526c2e77d107d43ba336f1dcf31f64cef25ba429ae1f7a0fbc11c23320\",\"license\":\"Apache-2.0\"},\"@pythnetwork/pyth-sdk-solidity/PythStructs.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.0;\\n\\ncontract PythStructs {\\n // A price with a degree of uncertainty, represented as a price +- a confidence interval.\\n //\\n // The confidence interval roughly corresponds to the standard error of a normal distribution.\\n // Both the price and confidence are stored in a fixed-point numeric representation,\\n // `x * (10^expo)`, where `expo` is the exponent.\\n //\\n // Please refer to the documentation at https://docs.pyth.network/consumers/best-practices for how\\n // to how this price safely.\\n struct Price {\\n // Price\\n int64 price;\\n // Confidence interval around the price\\n uint64 conf;\\n // Price exponent\\n int32 expo;\\n // Unix timestamp describing when the price was published\\n uint publishTime;\\n }\\n\\n // PriceFeed represents a current aggregate price from pyth publisher feeds.\\n struct PriceFeed {\\n // The price ID.\\n bytes32 id;\\n // Latest available price\\n Price price;\\n // Latest available exponentially-weighted moving average price\\n Price emaPrice;\\n }\\n}\\n\",\"keccak256\":\"0x95ff0a6d64517348ef604b8bcf246b561a9445d7e607b8f48491c617cfda9b65\",\"license\":\"Apache-2.0\"},\"adrastia-periphery/rates/IHistoricalRates.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.5.0 <0.9.0;\\n\\nimport \\\"./RateLibrary.sol\\\";\\n\\n/**\\n * @title IHistoricalRates\\n * @notice An interface that defines a contract that stores historical rates.\\n */\\ninterface IHistoricalRates {\\n /// @notice Gets an rate for a token at a specific index.\\n /// @param token The address of the token to get the rates for.\\n /// @param index The index of the rate to get, where index 0 contains the latest rate, and the last\\n /// index contains the oldest rate (uses reverse chronological ordering).\\n /// @return rate The rate for the token at the specified index.\\n function getRateAt(address token, uint256 index) external view returns (RateLibrary.Rate memory);\\n\\n /// @notice Gets the latest rates for a token.\\n /// @param token The address of the token to get the rates for.\\n /// @param amount The number of rates to get.\\n /// @return rates The latest rates for the token, in reverse chronological order, from newest to oldest.\\n function getRates(address token, uint256 amount) external view returns (RateLibrary.Rate[] memory);\\n\\n /// @notice Gets the latest rates for a token.\\n /// @param token The address of the token to get the rates for.\\n /// @param amount The number of rates to get.\\n /// @param offset The index of the first rate to get (default: 0).\\n /// @param increment The increment between rates to get (default: 1).\\n /// @return rates The latest rates for the token, in reverse chronological order, from newest to oldest.\\n function getRates(\\n address token,\\n uint256 amount,\\n uint256 offset,\\n uint256 increment\\n ) external view returns (RateLibrary.Rate[] memory);\\n\\n /// @notice Gets the number of rates for a token.\\n /// @param token The address of the token to get the number of rates for.\\n /// @return count The number of rates for the token.\\n function getRatesCount(address token) external view returns (uint256);\\n\\n /// @notice Gets the capacity of rates for a token.\\n /// @param token The address of the token to get the capacity of rates for.\\n /// @return capacity The capacity of rates for the token.\\n function getRatesCapacity(address token) external view returns (uint256);\\n\\n /// @notice Sets the capacity of rates for a token.\\n /// @param token The address of the token to set the capacity of rates for.\\n /// @param amount The new capacity of rates for the token.\\n function setRatesCapacity(address token, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x2754968c368df628f1ed00c2016b1a73f0f9b44f29e48d405887ad108723b3af\",\"license\":\"MIT\"},\"adrastia-periphery/rates/RateLibrary.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity >=0.5.0 <0.9.0;\\n\\npragma experimental ABIEncoderV2;\\n\\nlibrary RateLibrary {\\n struct Rate {\\n uint64 target;\\n uint64 current;\\n uint32 timestamp;\\n }\\n}\\n\",\"keccak256\":\"0x397b79cf9f183afa76db3c8d10cffb408e31ba154900f671a7e93c071bacbff4\",\"license\":\"MIT\"},\"contracts/adrastia/PrudentiaLib.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nlibrary PrudentiaLib {\\n struct PrudentiaConfig {\\n address controller; // Adrastia Prudentia controller address\\n uint8 offset; // Offset for delayed rate activation\\n int8 decimalShift; // Positive values scale the rate up (in powers of 10), negative values scale the rate down\\n }\\n}\\n\",\"keccak256\":\"0x8cc50f1a5dab30e0c205b0bba5f58c18eda9ebf01c661895c8f40678b86bf31f\",\"license\":\"UNLICENSED\"},\"contracts/compound/CTokenInterfaces.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport { IonicComptroller } from \\\"./ComptrollerInterface.sol\\\";\\nimport { InterestRateModel } from \\\"./InterestRateModel.sol\\\";\\nimport { ComptrollerV3Storage } from \\\"./ComptrollerStorage.sol\\\";\\nimport { AddressesProvider } from \\\"../ionic/AddressesProvider.sol\\\";\\n\\nabstract contract CTokenAdminStorage {\\n /*\\n * Administrator for Ionic\\n */\\n address payable public ionicAdmin;\\n}\\n\\nabstract contract CErc20Storage is CTokenAdminStorage {\\n /**\\n * @dev Guard variable for re-entrancy checks\\n */\\n bool internal _notEntered;\\n\\n /**\\n * @notice EIP-20 token name for this token\\n */\\n string public name;\\n\\n /**\\n * @notice EIP-20 token symbol for this token\\n */\\n string public symbol;\\n\\n /**\\n * @notice EIP-20 token decimals for this token\\n */\\n uint8 public decimals;\\n\\n /*\\n * Maximum borrow rate that can ever be applied (.0005% / block)\\n */\\n uint256 internal constant borrowRateMaxMantissa = 0.0005e16;\\n\\n /*\\n * Maximum fraction of interest that can be set aside for reserves + fees\\n */\\n uint256 internal constant reserveFactorPlusFeesMaxMantissa = 1e18;\\n\\n /**\\n * @notice Contract which oversees inter-cToken operations\\n */\\n IonicComptroller public comptroller;\\n\\n /**\\n * @notice Model which tells what the current interest rate should be\\n */\\n InterestRateModel public interestRateModel;\\n\\n /*\\n * Initial exchange rate used when minting the first CTokens (used when totalSupply = 0)\\n */\\n uint256 internal initialExchangeRateMantissa;\\n\\n /**\\n * @notice Fraction of interest currently set aside for admin fees\\n */\\n uint256 public adminFeeMantissa;\\n\\n /**\\n * @notice Fraction of interest currently set aside for Ionic fees\\n */\\n uint256 public ionicFeeMantissa;\\n\\n /**\\n * @notice Fraction of interest currently set aside for reserves\\n */\\n uint256 public reserveFactorMantissa;\\n\\n /**\\n * @notice Block number that interest was last accrued at\\n */\\n uint256 public accrualBlockNumber;\\n\\n /**\\n * @notice Accumulator of the total earned interest rate since the opening of the market\\n */\\n uint256 public borrowIndex;\\n\\n /**\\n * @notice Total amount of outstanding borrows of the underlying in this market\\n */\\n uint256 public totalBorrows;\\n\\n /**\\n * @notice Total amount of reserves of the underlying held in this market\\n */\\n uint256 public totalReserves;\\n\\n /**\\n * @notice Total amount of admin fees of the underlying held in this market\\n */\\n uint256 public totalAdminFees;\\n\\n /**\\n * @notice Total amount of Ionic fees of the underlying held in this market\\n */\\n uint256 public totalIonicFees;\\n\\n /**\\n * @notice Total number of tokens in circulation\\n */\\n uint256 public totalSupply;\\n\\n /*\\n * Official record of token balances for each account\\n */\\n mapping(address => uint256) internal accountTokens;\\n\\n /*\\n * Approved token transfer amounts on behalf of others\\n */\\n mapping(address => mapping(address => uint256)) internal transferAllowances;\\n\\n /**\\n * @notice Container for borrow balance information\\n * @member principal Total balance (with accrued interest), after applying the most recent balance-changing action\\n * @member interestIndex Global borrowIndex as of the most recent balance-changing action\\n */\\n struct BorrowSnapshot {\\n uint256 principal;\\n uint256 interestIndex;\\n }\\n\\n /*\\n * Mapping of account addresses to outstanding borrow balances\\n */\\n mapping(address => BorrowSnapshot) internal accountBorrows;\\n\\n /*\\n * Share of seized collateral that is added to reserves\\n */\\n uint256 public constant protocolSeizeShareMantissa = 2.8e16; //2.8%\\n\\n /*\\n * Share of seized collateral taken as fees\\n */\\n uint256 public constant feeSeizeShareMantissa = 1e17; //10%\\n\\n /**\\n * @notice Underlying asset for this CToken\\n */\\n address public underlying;\\n\\n /**\\n * @notice Addresses Provider\\n */\\n AddressesProvider public ap;\\n}\\n\\nabstract contract CTokenBaseEvents {\\n /* ERC20 */\\n\\n /**\\n * @notice EIP20 Transfer event\\n */\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n /*** Admin Events ***/\\n\\n /**\\n * @notice Event emitted when interestRateModel is changed\\n */\\n event NewMarketInterestRateModel(InterestRateModel oldInterestRateModel, InterestRateModel newInterestRateModel);\\n\\n /**\\n * @notice Event emitted when the reserve factor is changed\\n */\\n event NewReserveFactor(uint256 oldReserveFactorMantissa, uint256 newReserveFactorMantissa);\\n\\n /**\\n * @notice Event emitted when the admin fee is changed\\n */\\n event NewAdminFee(uint256 oldAdminFeeMantissa, uint256 newAdminFeeMantissa);\\n\\n /**\\n * @notice Event emitted when the Ionic fee is changed\\n */\\n event NewIonicFee(uint256 oldIonicFeeMantissa, uint256 newIonicFeeMantissa);\\n\\n /**\\n * @notice EIP20 Approval event\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /**\\n * @notice Event emitted when interest is accrued\\n */\\n event AccrueInterest(uint256 cashPrior, uint256 interestAccumulated, uint256 borrowIndex, uint256 totalBorrows);\\n}\\n\\nabstract contract CTokenFirstExtensionEvents is CTokenBaseEvents {\\n event Flash(address receiver, uint256 amount);\\n}\\n\\nabstract contract CTokenSecondExtensionEvents is CTokenBaseEvents {\\n /*** Market Events ***/\\n\\n /**\\n * @notice Event emitted when tokens are minted\\n */\\n event Mint(address minter, uint256 mintAmount, uint256 mintTokens);\\n\\n /**\\n * @notice Event emitted when tokens are redeemed\\n */\\n event Redeem(address redeemer, uint256 redeemAmount, uint256 redeemTokens);\\n\\n /**\\n * @notice Event emitted when underlying is borrowed\\n */\\n event Borrow(address borrower, uint256 borrowAmount, uint256 accountBorrows, uint256 totalBorrows);\\n\\n /**\\n * @notice Event emitted when a borrow is repaid\\n */\\n event RepayBorrow(address payer, address borrower, uint256 repayAmount, uint256 accountBorrows, uint256 totalBorrows);\\n\\n /**\\n * @notice Event emitted when a borrow is liquidated\\n */\\n event LiquidateBorrow(\\n address liquidator,\\n address borrower,\\n uint256 repayAmount,\\n address cTokenCollateral,\\n uint256 seizeTokens\\n );\\n\\n /**\\n * @notice Event emitted when the reserves are added\\n */\\n event ReservesAdded(address benefactor, uint256 addAmount, uint256 newTotalReserves);\\n\\n /**\\n * @notice Event emitted when the reserves are reduced\\n */\\n event ReservesReduced(address admin, uint256 reduceAmount, uint256 newTotalReserves);\\n}\\n\\ninterface CTokenFirstExtensionInterface {\\n /*** User Interface ***/\\n\\n function transfer(address dst, uint256 amount) external returns (bool);\\n\\n function transferFrom(\\n address src,\\n address dst,\\n uint256 amount\\n ) external returns (bool);\\n\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n function balanceOf(address owner) external view returns (uint256);\\n\\n /*** Admin Functions ***/\\n\\n function _setReserveFactor(uint256 newReserveFactorMantissa) external returns (uint256);\\n\\n function _setAdminFee(uint256 newAdminFeeMantissa) external returns (uint256);\\n\\n function _setInterestRateModel(InterestRateModel newInterestRateModel) external returns (uint256);\\n\\n function getAccountSnapshot(address account)\\n external\\n view\\n returns (\\n uint256,\\n uint256,\\n uint256,\\n uint256\\n );\\n\\n function borrowRatePerBlock() external view returns (uint256);\\n\\n function supplyRatePerBlock() external view returns (uint256);\\n\\n function exchangeRateCurrent() external view returns (uint256);\\n\\n function accrueInterest() external returns (uint256);\\n\\n function totalBorrowsCurrent() external view returns (uint256);\\n\\n function borrowBalanceCurrent(address account) external view returns (uint256);\\n\\n function getTotalUnderlyingSupplied() external view returns (uint256);\\n\\n function balanceOfUnderlying(address owner) external view returns (uint256);\\n\\n function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);\\n\\n function flash(uint256 amount, bytes calldata data) external;\\n\\n function supplyRatePerBlockAfterDeposit(uint256 mintAmount) external view returns (uint256);\\n\\n function supplyRatePerBlockAfterWithdraw(uint256 withdrawAmount) external view returns (uint256);\\n\\n function borrowRatePerBlockAfterBorrow(uint256 borrowAmount) external view returns (uint256);\\n\\n function registerInSFS() external returns (uint256);\\n}\\n\\ninterface CTokenSecondExtensionInterface {\\n function mint(uint256 mintAmount) external returns (uint256);\\n\\n function redeem(uint256 redeemTokens) external returns (uint256);\\n\\n function redeemUnderlying(uint256 redeemAmount) external returns (uint256);\\n\\n function borrow(uint256 borrowAmount) external returns (uint256);\\n\\n function repayBorrow(uint256 repayAmount) external returns (uint256);\\n\\n function repayBorrowBehalf(address borrower, uint256 repayAmount) external returns (uint256);\\n\\n function liquidateBorrow(\\n address borrower,\\n uint256 repayAmount,\\n address cTokenCollateral\\n ) external returns (uint256);\\n\\n function getCash() external view returns (uint256);\\n\\n function seize(\\n address liquidator,\\n address borrower,\\n uint256 seizeTokens\\n ) external returns (uint256);\\n\\n /*** Admin Functions ***/\\n\\n function _withdrawAdminFees(uint256 withdrawAmount) external returns (uint256);\\n\\n function _withdrawIonicFees(uint256 withdrawAmount) external returns (uint256);\\n\\n function selfTransferOut(address to, uint256 amount) external;\\n\\n function selfTransferIn(address from, uint256 amount) external returns (uint256);\\n}\\n\\ninterface CDelegatorInterface {\\n function implementation() external view returns (address);\\n\\n /**\\n * @notice Called by the admin to update the implementation of the delegator\\n * @param implementation_ The address of the new implementation for delegation\\n * @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation\\n */\\n function _setImplementationSafe(address implementation_, bytes calldata becomeImplementationData) external;\\n\\n /**\\n * @dev upgrades the implementation if necessary\\n */\\n function _upgrade() external;\\n}\\n\\ninterface CDelegateInterface {\\n /**\\n * @notice Called by the delegator on a delegate to initialize it for duty\\n * @dev Should revert if any issues arise which make it unfit for delegation\\n * @param data The encoded bytes data for any initialization\\n */\\n function _becomeImplementation(bytes calldata data) external;\\n\\n function delegateType() external pure returns (uint8);\\n\\n function contractType() external pure returns (string memory);\\n}\\n\\nabstract contract CErc20AdminBase is CErc20Storage {\\n /**\\n * @notice Returns a boolean indicating if the sender has admin rights\\n */\\n function hasAdminRights() internal view returns (bool) {\\n ComptrollerV3Storage comptrollerStorage = ComptrollerV3Storage(address(comptroller));\\n return\\n (msg.sender == comptrollerStorage.admin() && comptrollerStorage.adminHasRights()) ||\\n (msg.sender == address(ionicAdmin) && comptrollerStorage.ionicAdminHasRights());\\n }\\n}\\n\\nabstract contract CErc20FirstExtensionBase is\\n CErc20AdminBase,\\n CTokenFirstExtensionEvents,\\n CTokenFirstExtensionInterface\\n{}\\n\\nabstract contract CTokenSecondExtensionBase is\\n CErc20AdminBase,\\n CTokenSecondExtensionEvents,\\n CTokenSecondExtensionInterface,\\n CDelegateInterface\\n{}\\n\\nabstract contract CErc20DelegatorBase is CErc20AdminBase, CTokenSecondExtensionEvents, CDelegatorInterface {}\\n\\ninterface CErc20StorageInterface {\\n function admin() external view returns (address);\\n\\n function adminHasRights() external view returns (bool);\\n\\n function ionicAdmin() external view returns (address);\\n\\n function ionicAdminHasRights() external view returns (bool);\\n\\n function comptroller() external view returns (IonicComptroller);\\n\\n function name() external view returns (string memory);\\n\\n function symbol() external view returns (string memory);\\n\\n function decimals() external view returns (uint8);\\n\\n function totalSupply() external view returns (uint256);\\n\\n function adminFeeMantissa() external view returns (uint256);\\n\\n function ionicFeeMantissa() external view returns (uint256);\\n\\n function reserveFactorMantissa() external view returns (uint256);\\n\\n function protocolSeizeShareMantissa() external view returns (uint256);\\n\\n function feeSeizeShareMantissa() external view returns (uint256);\\n\\n function totalReserves() external view returns (uint256);\\n\\n function totalAdminFees() external view returns (uint256);\\n\\n function totalIonicFees() external view returns (uint256);\\n\\n function totalBorrows() external view returns (uint256);\\n\\n function accrualBlockNumber() external view returns (uint256);\\n\\n function underlying() external view returns (address);\\n\\n function borrowIndex() external view returns (uint256);\\n\\n function interestRateModel() external view returns (address);\\n}\\n\\ninterface CErc20PluginStorageInterface is CErc20StorageInterface {\\n function plugin() external view returns (address);\\n}\\n\\ninterface CErc20PluginRewardsInterface is CErc20PluginStorageInterface {\\n function approve(address, address) external;\\n}\\n\\ninterface ICErc20 is\\n CErc20StorageInterface,\\n CTokenSecondExtensionInterface,\\n CTokenFirstExtensionInterface,\\n CDelegatorInterface,\\n CDelegateInterface\\n{}\\n\\ninterface ICErc20Plugin is CErc20PluginStorageInterface, ICErc20 {\\n function _updatePlugin(address _plugin) external;\\n}\\n\\ninterface ICErc20PluginRewards is CErc20PluginRewardsInterface, ICErc20 {}\\n\",\"keccak256\":\"0x7cc75051a5fa860b9ee93d0ba1ac0608921f02308aeff786ce8bbd8d8a70489a\",\"license\":\"UNLICENSED\"},\"contracts/compound/ComptrollerInterface.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport { BasePriceOracle } from \\\"../oracles/BasePriceOracle.sol\\\";\\nimport { ICErc20 } from \\\"./CTokenInterfaces.sol\\\";\\nimport { DiamondExtension } from \\\"../ionic/DiamondExtension.sol\\\";\\nimport { ComptrollerV4Storage } from \\\"../compound/ComptrollerStorage.sol\\\";\\nimport { PrudentiaLib } from \\\"../adrastia/PrudentiaLib.sol\\\";\\nimport { IHistoricalRates } from \\\"adrastia-periphery/rates/IHistoricalRates.sol\\\";\\n\\ninterface ComptrollerInterface {\\n function isDeprecated(ICErc20 cToken) external view returns (bool);\\n\\n function _becomeImplementation() external;\\n\\n function _deployMarket(\\n uint8 delegateType,\\n bytes memory constructorData,\\n bytes calldata becomeImplData,\\n uint256 collateralFactorMantissa\\n ) external returns (uint256);\\n\\n function getAssetsIn(address account) external view returns (ICErc20[] memory);\\n\\n function checkMembership(address account, ICErc20 cToken) external view returns (bool);\\n\\n function _setPriceOracle(BasePriceOracle newOracle) external returns (uint256);\\n\\n function _setCloseFactor(uint256 newCloseFactorMantissa) external returns (uint256);\\n\\n function _setCollateralFactor(ICErc20 market, uint256 newCollateralFactorMantissa) external returns (uint256);\\n\\n function _setLiquidationIncentive(uint256 newLiquidationIncentiveMantissa) external returns (uint256);\\n\\n function _setWhitelistEnforcement(bool enforce) external returns (uint256);\\n\\n function _setWhitelistStatuses(address[] calldata _suppliers, bool[] calldata statuses) external returns (uint256);\\n\\n function _addRewardsDistributor(address distributor) external returns (uint256);\\n\\n function getHypotheticalAccountLiquidity(\\n address account,\\n address cTokenModify,\\n uint256 redeemTokens,\\n uint256 borrowAmount,\\n uint256 repayAmount\\n ) external view returns (uint256, uint256, uint256, uint256);\\n\\n function getMaxRedeemOrBorrow(address account, ICErc20 cToken, bool isBorrow) external view returns (uint256);\\n\\n /*** Assets You Are In ***/\\n\\n function enterMarkets(address[] calldata cTokens) external returns (uint256[] memory);\\n\\n function exitMarket(address cToken) external returns (uint256);\\n\\n /*** Policy Hooks ***/\\n\\n function mintAllowed(address cToken, address minter, uint256 mintAmount) external returns (uint256);\\n\\n function redeemAllowed(address cToken, address redeemer, uint256 redeemTokens) external returns (uint256);\\n\\n function redeemVerify(address cToken, address redeemer, uint256 redeemAmount, uint256 redeemTokens) external;\\n\\n function borrowAllowed(address cToken, address borrower, uint256 borrowAmount) external returns (uint256);\\n\\n function borrowWithinLimits(address cToken, uint256 accountBorrowsNew) external view returns (uint256);\\n\\n function repayBorrowAllowed(\\n address cToken,\\n address payer,\\n address borrower,\\n uint256 repayAmount\\n ) external returns (uint256);\\n\\n function liquidateBorrowAllowed(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n address liquidator,\\n address borrower,\\n uint256 repayAmount\\n ) external returns (uint256);\\n\\n function seizeAllowed(\\n address cTokenCollateral,\\n address cTokenBorrowed,\\n address liquidator,\\n address borrower,\\n uint256 seizeTokens\\n ) external returns (uint256);\\n\\n function transferAllowed(address cToken, address src, address dst, uint256 transferTokens) external returns (uint256);\\n\\n function mintVerify(address cToken, address minter, uint256 actualMintAmount, uint256 mintTokens) external;\\n\\n /*** Liquidity/Liquidation Calculations ***/\\n\\n function getAccountLiquidity(\\n address account\\n ) external view returns (uint256 error, uint256 collateralValue, uint256 liquidity, uint256 shortfall);\\n\\n function liquidateCalculateSeizeTokens(\\n address cTokenBorrowed,\\n address cTokenCollateral,\\n uint256 repayAmount\\n ) external view returns (uint256, uint256);\\n\\n /*** Pool-Wide/Cross-Asset Reentrancy Prevention ***/\\n\\n function _beforeNonReentrant() external;\\n\\n function _afterNonReentrant() external;\\n\\n /*** New supply and borrow cap view functions ***/\\n\\n /**\\n * @notice Gets the supply cap of a cToken in the units of the underlying asset.\\n * @param cToken The address of the cToken.\\n */\\n function effectiveSupplyCaps(address cToken) external view returns (uint256 supplyCap);\\n\\n /**\\n * @notice Gets the borrow cap of a cToken in the units of the underlying asset.\\n * @param cToken The address of the cToken.\\n */\\n function effectiveBorrowCaps(address cToken) external view returns (uint256 borrowCap);\\n}\\n\\ninterface ComptrollerStorageInterface {\\n function admin() external view returns (address);\\n\\n function adminHasRights() external view returns (bool);\\n\\n function ionicAdmin() external view returns (address);\\n\\n function ionicAdminHasRights() external view returns (bool);\\n\\n function pendingAdmin() external view returns (address);\\n\\n function oracle() external view returns (BasePriceOracle);\\n\\n function pauseGuardian() external view returns (address);\\n\\n function closeFactorMantissa() external view returns (uint256);\\n\\n function liquidationIncentiveMantissa() external view returns (uint256);\\n\\n function isUserOfPool(address user) external view returns (bool);\\n\\n function whitelist(address account) external view returns (bool);\\n\\n function enforceWhitelist() external view returns (bool);\\n\\n function borrowCapForCollateral(address borrowed, address collateral) external view returns (uint256);\\n\\n function borrowingAgainstCollateralBlacklist(address borrowed, address collateral) external view returns (bool);\\n\\n function suppliers(address account) external view returns (bool);\\n\\n function cTokensByUnderlying(address) external view returns (address);\\n\\n /**\\n * Gets the supply cap of a cToken in the units of the underlying asset.\\n * @dev WARNING: This function is misleading if Adrastia Prudentia is being used for the supply cap. Instead, use\\n * `effectiveSupplyCaps` to get the correct supply cap.\\n * @param cToken The address of the cToken.\\n * @return The supply cap in the units of the underlying asset.\\n */\\n function supplyCaps(address cToken) external view returns (uint256);\\n\\n /**\\n * Gets the borrow cap of a cToken in the units of the underlying asset.\\n * @dev WARNING: This function is misleading if Adrastia Prudentia is being used for the borrow cap. Instead, use\\n * `effectiveBorrowCaps` to get the correct borrow cap.\\n * @param cToken The address of the cToken.\\n * @return The borrow cap in the units of the underlying asset.\\n */\\n function borrowCaps(address cToken) external view returns (uint256);\\n\\n function markets(address cToken) external view returns (bool, uint256);\\n\\n function accountAssets(address, uint256) external view returns (address);\\n\\n function borrowGuardianPaused(address cToken) external view returns (bool);\\n\\n function mintGuardianPaused(address cToken) external view returns (bool);\\n\\n function rewardsDistributors(uint256) external view returns (address);\\n}\\n\\ninterface SFSRegister {\\n function register(address _recipient) external returns (uint256 tokenId);\\n}\\n\\ninterface ComptrollerExtensionInterface {\\n function getWhitelistedSuppliersSupply(address cToken) external view returns (uint256 supplied);\\n\\n function getWhitelistedBorrowersBorrows(address cToken) external view returns (uint256 borrowed);\\n\\n function getAllMarkets() external view returns (ICErc20[] memory);\\n\\n function getAllBorrowers() external view returns (address[] memory);\\n\\n function getAllBorrowersCount() external view returns (uint256);\\n\\n function getPaginatedBorrowers(\\n uint256 page,\\n uint256 pageSize\\n ) external view returns (uint256 _totalPages, address[] memory _pageOfBorrowers);\\n\\n function getRewardsDistributors() external view returns (address[] memory);\\n\\n function getAccruingFlywheels() external view returns (address[] memory);\\n\\n function _supplyCapWhitelist(address cToken, address account, bool whitelisted) external;\\n\\n function _setBorrowCapForCollateral(address cTokenBorrow, address cTokenCollateral, uint256 borrowCap) external;\\n\\n function _setBorrowCapForCollateralWhitelist(\\n address cTokenBorrow,\\n address cTokenCollateral,\\n address account,\\n bool whitelisted\\n ) external;\\n\\n function isBorrowCapForCollateralWhitelisted(\\n address cTokenBorrow,\\n address cTokenCollateral,\\n address account\\n ) external view returns (bool);\\n\\n function _blacklistBorrowingAgainstCollateral(\\n address cTokenBorrow,\\n address cTokenCollateral,\\n bool blacklisted\\n ) external;\\n\\n function _blacklistBorrowingAgainstCollateralWhitelist(\\n address cTokenBorrow,\\n address cTokenCollateral,\\n address account,\\n bool whitelisted\\n ) external;\\n\\n function isBlacklistBorrowingAgainstCollateralWhitelisted(\\n address cTokenBorrow,\\n address cTokenCollateral,\\n address account\\n ) external view returns (bool);\\n\\n function isSupplyCapWhitelisted(address cToken, address account) external view returns (bool);\\n\\n function _borrowCapWhitelist(address cToken, address account, bool whitelisted) external;\\n\\n function isBorrowCapWhitelisted(address cToken, address account) external view returns (bool);\\n\\n function _removeFlywheel(address flywheelAddress) external returns (bool);\\n\\n function getWhitelist() external view returns (address[] memory);\\n\\n function addNonAccruingFlywheel(address flywheelAddress) external returns (bool);\\n\\n function _setMarketSupplyCaps(ICErc20[] calldata cTokens, uint256[] calldata newSupplyCaps) external;\\n\\n function _setMarketBorrowCaps(ICErc20[] calldata cTokens, uint256[] calldata newBorrowCaps) external;\\n\\n function _setBorrowCapGuardian(address newBorrowCapGuardian) external;\\n\\n function _setPauseGuardian(address newPauseGuardian) external returns (uint256);\\n\\n function _setMintPaused(ICErc20 cToken, bool state) external returns (bool);\\n\\n function _setBorrowPaused(ICErc20 cToken, bool state) external returns (bool);\\n\\n function _setTransferPaused(bool state) external returns (bool);\\n\\n function _setSeizePaused(bool state) external returns (bool);\\n\\n function _unsupportMarket(ICErc20 cToken) external returns (uint256);\\n\\n function getAssetAsCollateralValueCap(\\n ICErc20 collateral,\\n ICErc20 cTokenModify,\\n bool redeeming,\\n address account\\n ) external view returns (uint256);\\n\\n function registerInSFS() external returns (uint256);\\n}\\n\\ninterface ComptrollerPrudentiaCapsExtInterface {\\n /**\\n * @notice Retrieves Adrastia Prudentia borrow cap config from storage.\\n * @return The config.\\n */\\n function getBorrowCapConfig() external view returns (PrudentiaLib.PrudentiaConfig memory);\\n\\n /**\\n * @notice Retrieves Adrastia Prudentia supply cap config from storage.\\n * @return The config.\\n */\\n function getSupplyCapConfig() external view returns (PrudentiaLib.PrudentiaConfig memory);\\n\\n /**\\n * @notice Sets the Adrastia Prudentia supply cap config.\\n * @dev Specifying a zero address for the `controller` parameter will make the Comptroller use the native supply caps.\\n * @param newConfig The new config.\\n */\\n function _setSupplyCapConfig(PrudentiaLib.PrudentiaConfig calldata newConfig) external;\\n\\n /**\\n * @notice Sets the Adrastia Prudentia supply cap config.\\n * @dev Specifying a zero address for the `controller` parameter will make the Comptroller use the native borrow caps.\\n * @param newConfig The new config.\\n */\\n function _setBorrowCapConfig(PrudentiaLib.PrudentiaConfig calldata newConfig) external;\\n}\\n\\ninterface UnitrollerInterface {\\n function comptrollerImplementation() external view returns (address);\\n\\n function _upgrade() external;\\n\\n function _acceptAdmin() external returns (uint256);\\n\\n function _setPendingAdmin(address newPendingAdmin) external returns (uint256);\\n\\n function _toggleAdminRights(bool hasRights) external returns (uint256);\\n}\\n\\ninterface IComptrollerExtension is ComptrollerExtensionInterface, ComptrollerStorageInterface {}\\n\\n//interface IComptrollerBase is ComptrollerInterface, ComptrollerStorageInterface {}\\n\\ninterface IonicComptroller is\\n ComptrollerInterface,\\n ComptrollerExtensionInterface,\\n UnitrollerInterface,\\n ComptrollerStorageInterface\\n{\\n\\n}\\n\\nabstract contract ComptrollerBase is ComptrollerV4Storage {\\n /// @notice Indicator that this is a Comptroller contract (for inspection)\\n bool public constant isComptroller = true;\\n\\n /**\\n * @notice Gets the supply cap of a cToken in the units of the underlying asset.\\n * @param cToken The address of the cToken.\\n */\\n function effectiveSupplyCaps(address cToken) public view virtual returns (uint256 supplyCap) {\\n PrudentiaLib.PrudentiaConfig memory capConfig = supplyCapConfig;\\n\\n // Check if we're using Adrastia Prudentia for the supply cap\\n if (capConfig.controller != address(0)) {\\n // We have a controller, so we're using Adrastia Prudentia\\n\\n address underlyingToken = ICErc20(cToken).underlying();\\n\\n // Get the supply cap from Adrastia Prudentia\\n supplyCap = IHistoricalRates(capConfig.controller).getRateAt(underlyingToken, capConfig.offset).current;\\n\\n // Prudentia trims decimal points from amounts while our code requires the mantissa amount, so we\\n // must scale the supply cap to get the correct amount\\n\\n int256 scaleByDecimals = 18;\\n // Not all ERC20s implement decimals(), so we use a staticcall and check the return data\\n (bool success, bytes memory data) = underlyingToken.staticcall(abi.encodeWithSignature(\\\"decimals()\\\"));\\n if (success && data.length == 32) {\\n scaleByDecimals = int256(uint256(abi.decode(data, (uint8))));\\n }\\n\\n scaleByDecimals += capConfig.decimalShift;\\n\\n if (scaleByDecimals >= 0) {\\n // We're scaling up, so we need to multiply\\n supplyCap *= 10 ** uint256(scaleByDecimals);\\n } else {\\n // We're scaling down, so we need to divide\\n supplyCap /= 10 ** uint256(-scaleByDecimals);\\n }\\n } else {\\n // We don't have a controller, so we're using the local supply cap\\n\\n // Get the supply cap from the local supply cap\\n supplyCap = supplyCaps[cToken];\\n }\\n }\\n\\n /**\\n * @notice Gets the borrow cap of a cToken in the units of the underlying asset.\\n * @param cToken The address of the cToken.\\n */\\n function effectiveBorrowCaps(address cToken) public view virtual returns (uint256 borrowCap) {\\n PrudentiaLib.PrudentiaConfig memory capConfig = borrowCapConfig;\\n\\n // Check if we're using Adrastia Prudentia for the borrow cap\\n if (capConfig.controller != address(0)) {\\n // We have a controller, so we're using Adrastia Prudentia\\n\\n address underlyingToken = ICErc20(cToken).underlying();\\n\\n // Get the borrow cap from Adrastia Prudentia\\n borrowCap = IHistoricalRates(capConfig.controller).getRateAt(underlyingToken, capConfig.offset).current;\\n\\n // Prudentia trims decimal points from amounts while our code requires the mantissa amount, so we\\n // must scale the supply cap to get the correct amount\\n\\n int256 scaleByDecimals = 18;\\n // Not all ERC20s implement decimals(), so we use a staticcall and check the return data\\n (bool success, bytes memory data) = underlyingToken.staticcall(abi.encodeWithSignature(\\\"decimals()\\\"));\\n if (success && data.length == 32) {\\n scaleByDecimals = int256(uint256(abi.decode(data, (uint8))));\\n }\\n\\n scaleByDecimals += capConfig.decimalShift;\\n\\n if (scaleByDecimals >= 0) {\\n // We're scaling up, so we need to multiply\\n borrowCap *= 10 ** uint256(scaleByDecimals);\\n } else {\\n // We're scaling down, so we need to divide\\n borrowCap /= 10 ** uint256(-scaleByDecimals);\\n }\\n } else {\\n // We don't have a controller, so we're using the local borrow cap\\n borrowCap = borrowCaps[cToken];\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7632af3b32bc1fccd14255b6885e74c4d5ac8de5f00fb8ed67186810d286424f\",\"license\":\"UNLICENSED\"},\"contracts/compound/ComptrollerStorage.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"./IFeeDistributor.sol\\\";\\nimport \\\"../oracles/BasePriceOracle.sol\\\";\\nimport { ICErc20 } from \\\"./CTokenInterfaces.sol\\\";\\nimport { PrudentiaLib } from \\\"../adrastia/PrudentiaLib.sol\\\";\\n\\nimport \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\ncontract UnitrollerAdminStorage {\\n /*\\n * Administrator for Ionic\\n */\\n address payable public ionicAdmin;\\n\\n /**\\n * @notice Administrator for this contract\\n */\\n address public admin;\\n\\n /**\\n * @notice Pending administrator for this contract\\n */\\n address public pendingAdmin;\\n\\n /**\\n * @notice Whether or not the Ionic admin has admin rights\\n */\\n bool public ionicAdminHasRights = true;\\n\\n /**\\n * @notice Whether or not the admin has admin rights\\n */\\n bool public adminHasRights = true;\\n\\n /**\\n * @notice Returns a boolean indicating if the sender has admin rights\\n */\\n function hasAdminRights() internal view returns (bool) {\\n return (msg.sender == admin && adminHasRights) || (msg.sender == address(ionicAdmin) && ionicAdminHasRights);\\n }\\n}\\n\\ncontract ComptrollerV1Storage is UnitrollerAdminStorage {\\n /**\\n * @notice Oracle which gives the price of any given asset\\n */\\n BasePriceOracle public oracle;\\n\\n /**\\n * @notice Multiplier used to calculate the maximum repayAmount when liquidating a borrow\\n */\\n uint256 public closeFactorMantissa;\\n\\n /**\\n * @notice Multiplier representing the discount on collateral that a liquidator receives\\n */\\n uint256 public liquidationIncentiveMantissa;\\n\\n /*\\n * UNUSED AFTER UPGRADE: Max number of assets a single account can participate in (borrow or use as collateral)\\n */\\n uint256 internal maxAssets;\\n\\n /**\\n * @notice Per-account mapping of \\\"assets you are in\\\", capped by maxAssets\\n */\\n mapping(address => ICErc20[]) public accountAssets;\\n}\\n\\ncontract ComptrollerV2Storage is ComptrollerV1Storage {\\n struct Market {\\n // Whether or not this market is listed\\n bool isListed;\\n // Multiplier representing the most one can borrow against their collateral in this market.\\n // For instance, 0.9 to allow borrowing 90% of collateral value.\\n // Must be between 0 and 1, and stored as a mantissa.\\n uint256 collateralFactorMantissa;\\n // Per-market mapping of \\\"accounts in this asset\\\"\\n mapping(address => bool) accountMembership;\\n }\\n\\n /**\\n * @notice Official mapping of cTokens -> Market metadata\\n * @dev Used e.g. to determine if a market is supported\\n */\\n mapping(address => Market) public markets;\\n\\n /// @notice A list of all markets\\n ICErc20[] public allMarkets;\\n\\n /**\\n * @dev Maps borrowers to booleans indicating if they have entered any markets\\n */\\n mapping(address => bool) internal borrowers;\\n\\n /// @notice A list of all borrowers who have entered markets\\n address[] public allBorrowers;\\n\\n // Indexes of borrower account addresses in the `allBorrowers` array\\n mapping(address => uint256) internal borrowerIndexes;\\n\\n /**\\n * @dev Maps suppliers to booleans indicating if they have ever supplied to any markets\\n */\\n mapping(address => bool) public suppliers;\\n\\n /// @notice All cTokens addresses mapped by their underlying token addresses\\n mapping(address => ICErc20) public cTokensByUnderlying;\\n\\n /// @notice Whether or not the supplier whitelist is enforced\\n bool public enforceWhitelist;\\n\\n /// @notice Maps addresses to booleans indicating if they are allowed to supply assets (i.e., mint cTokens)\\n mapping(address => bool) public whitelist;\\n\\n /// @notice An array of all whitelisted accounts\\n address[] public whitelistArray;\\n\\n // Indexes of account addresses in the `whitelistArray` array\\n mapping(address => uint256) internal whitelistIndexes;\\n\\n /**\\n * @notice The Pause Guardian can pause certain actions as a safety mechanism.\\n * Actions which allow users to remove their own assets cannot be paused.\\n * Liquidation / seizing / transfer can only be paused globally, not by market.\\n */\\n address public pauseGuardian;\\n bool public _mintGuardianPaused;\\n bool public _borrowGuardianPaused;\\n bool public transferGuardianPaused;\\n bool public seizeGuardianPaused;\\n mapping(address => bool) public mintGuardianPaused;\\n mapping(address => bool) public borrowGuardianPaused;\\n}\\n\\ncontract ComptrollerV3Storage is ComptrollerV2Storage {\\n /// @notice The borrowCapGuardian can set borrowCaps to any number for any market. Lowering the borrow cap could disable borrowing on the given market.\\n /// @dev If Adrastia Prudentia is enabled, the values the borrow cap guardian sets are ignored.\\n address public borrowCapGuardian;\\n\\n /// @notice Borrow caps enforced by borrowAllowed for each cToken address. Defaults to zero which corresponds to unlimited borrowing.\\n /// @dev If Adrastia Prudentia is enabled, this value is ignored. Use `effectiveBorrowCaps` instead.\\n mapping(address => uint256) public borrowCaps;\\n\\n /// @notice Supply caps enforced by mintAllowed for each cToken address. Defaults to zero which corresponds to unlimited supplying.\\n /// @dev If Adrastia Prudentia is enabled, this value is ignored. Use `effectiveSupplyCaps` instead.\\n mapping(address => uint256) public supplyCaps;\\n\\n /// @notice RewardsDistributor contracts to notify of flywheel changes.\\n address[] public rewardsDistributors;\\n\\n /// @dev Guard variable for pool-wide/cross-asset re-entrancy checks\\n bool internal _notEntered;\\n\\n /// @dev Whether or not _notEntered has been initialized\\n bool internal _notEnteredInitialized;\\n\\n /// @notice RewardsDistributor to list for claiming, but not to notify of flywheel changes.\\n address[] public nonAccruingRewardsDistributors;\\n\\n /// @dev cap for each user's borrows against specific assets - denominated in the borrowed asset\\n mapping(address => mapping(address => uint256)) public borrowCapForCollateral;\\n\\n /// @dev blacklist to disallow the borrowing of an asset against specific collateral\\n mapping(address => mapping(address => bool)) public borrowingAgainstCollateralBlacklist;\\n\\n /// @dev set of whitelisted accounts that are allowed to bypass the borrowing against specific collateral cap\\n mapping(address => mapping(address => EnumerableSet.AddressSet)) internal borrowCapForCollateralWhitelist;\\n\\n /// @dev set of whitelisted accounts that are allowed to bypass the borrow cap\\n mapping(address => mapping(address => EnumerableSet.AddressSet))\\n internal borrowingAgainstCollateralBlacklistWhitelist;\\n\\n /// @dev set of whitelisted accounts that are allowed to bypass the supply cap\\n mapping(address => EnumerableSet.AddressSet) internal supplyCapWhitelist;\\n\\n /// @dev set of whitelisted accounts that are allowed to bypass the borrow cap\\n mapping(address => EnumerableSet.AddressSet) internal borrowCapWhitelist;\\n}\\n\\ncontract ComptrollerV4Storage is ComptrollerV3Storage {\\n /// @dev Adrastia Prudentia config for controlling borrow caps.\\n PrudentiaLib.PrudentiaConfig internal borrowCapConfig;\\n\\n /// @dev Adrastia Prudentia config for controlling supply caps.\\n PrudentiaLib.PrudentiaConfig internal supplyCapConfig;\\n}\\n\",\"keccak256\":\"0xa4a8110e666a93c1228c914f1414131e0f3b93385826bb72f6f93d429e514286\",\"license\":\"UNLICENSED\"},\"contracts/compound/IFeeDistributor.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"../ionic/AuthoritiesRegistry.sol\\\";\\n\\ninterface IFeeDistributor {\\n function minBorrowEth() external view returns (uint256);\\n\\n function maxUtilizationRate() external view returns (uint256);\\n\\n function interestFeeRate() external view returns (uint256);\\n\\n function latestComptrollerImplementation(address oldImplementation) external view returns (address);\\n\\n function latestCErc20Delegate(uint8 delegateType)\\n external\\n view\\n returns (address cErc20Delegate, bytes memory becomeImplementationData);\\n\\n function latestPluginImplementation(address oldImplementation) external view returns (address);\\n\\n function getComptrollerExtensions(address comptroller) external view returns (address[] memory);\\n\\n function getCErc20DelegateExtensions(address cErc20Delegate) external view returns (address[] memory);\\n\\n function deployCErc20(\\n uint8 delegateType,\\n bytes calldata constructorData,\\n bytes calldata becomeImplData\\n ) external returns (address);\\n\\n function canCall(\\n address pool,\\n address user,\\n address target,\\n bytes4 functionSig\\n ) external view returns (bool);\\n\\n function authoritiesRegistry() external view returns (AuthoritiesRegistry);\\n\\n fallback() external payable;\\n\\n receive() external payable;\\n}\\n\",\"keccak256\":\"0xa822e2942e6a88851968d5f3bda48709713c84d556031a1dd3db5dfd06121d3e\",\"license\":\"UNLICENSED\"},\"contracts/compound/InterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\n/**\\n * @title Compound's InterestRateModel Interface\\n * @author Compound\\n */\\nabstract contract InterestRateModel {\\n /// @notice Indicator that this is an InterestRateModel contract (for inspection)\\n bool public constant isInterestRateModel = true;\\n\\n /**\\n * @notice Calculates the current borrow interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @return The borrow rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getBorrowRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves\\n ) public view virtual returns (uint256);\\n\\n /**\\n * @notice Calculates the current supply interest rate per block\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @return The supply rate per block (as a percentage, and scaled by 1e18)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa\\n ) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x587a54b49d48df2cd91583eac93ddde4e2849f79d0441f179bf835e9dffe24e9\",\"license\":\"UNLICENSED\"},\"contracts/ionic/AddressesProvider.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport { SafeOwnableUpgradeable } from \\\"../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\n/**\\n * @title AddressesProvider\\n * @notice The Addresses Provider serves as a central storage of system internal and external\\n * contract addresses that change between deploys and across chains\\n * @author Veliko Minkov \\n */\\ncontract AddressesProvider is SafeOwnableUpgradeable {\\n mapping(string => address) private _addresses;\\n mapping(address => Contract) public plugins;\\n mapping(address => Contract) public flywheelRewards;\\n mapping(address => RedemptionStrategy) public redemptionStrategiesConfig;\\n mapping(address => FundingStrategy) public fundingStrategiesConfig;\\n JarvisPool[] public jarvisPoolsConfig;\\n CurveSwapPool[] public curveSwapPoolsConfig;\\n mapping(address => mapping(address => address)) public balancerPoolForTokens;\\n\\n /// @dev Initializer to set the admin that can set and change contracts addresses\\n function initialize(address owner) public initializer {\\n __SafeOwnable_init(owner);\\n }\\n\\n /**\\n * @dev The contract address and a string that uniquely identifies the contract's interface\\n */\\n struct Contract {\\n address addr;\\n string contractInterface;\\n }\\n\\n struct RedemptionStrategy {\\n address addr;\\n string contractInterface;\\n address outputToken;\\n }\\n\\n struct FundingStrategy {\\n address addr;\\n string contractInterface;\\n address inputToken;\\n }\\n\\n struct JarvisPool {\\n address syntheticToken;\\n address collateralToken;\\n address liquidityPool;\\n uint256 expirationTime;\\n }\\n\\n struct CurveSwapPool {\\n address poolAddress;\\n address[] coins;\\n }\\n\\n /**\\n * @dev sets the address and contract interface ID of the flywheel for the reward token\\n * @param rewardToken the reward token address\\n * @param flywheelRewardsModule the flywheel rewards module address\\n * @param contractInterface a string that uniquely identifies the contract's interface\\n */\\n function setFlywheelRewards(\\n address rewardToken,\\n address flywheelRewardsModule,\\n string calldata contractInterface\\n ) public onlyOwner {\\n flywheelRewards[rewardToken] = Contract(flywheelRewardsModule, contractInterface);\\n }\\n\\n /**\\n * @dev sets the address and contract interface ID of the ERC4626 plugin for the asset\\n * @param asset the asset address\\n * @param plugin the ERC4626 plugin address\\n * @param contractInterface a string that uniquely identifies the contract's interface\\n */\\n function setPlugin(\\n address asset,\\n address plugin,\\n string calldata contractInterface\\n ) public onlyOwner {\\n plugins[asset] = Contract(plugin, contractInterface);\\n }\\n\\n /**\\n * @dev sets the address and contract interface ID of the redemption strategy for the asset\\n * @param asset the asset address\\n * @param strategy redemption strategy address\\n * @param contractInterface a string that uniquely identifies the contract's interface\\n */\\n function setRedemptionStrategy(\\n address asset,\\n address strategy,\\n string calldata contractInterface,\\n address outputToken\\n ) public onlyOwner {\\n redemptionStrategiesConfig[asset] = RedemptionStrategy(strategy, contractInterface, outputToken);\\n }\\n\\n function getRedemptionStrategy(address asset) public view returns (RedemptionStrategy memory) {\\n return redemptionStrategiesConfig[asset];\\n }\\n\\n /**\\n * @dev sets the address and contract interface ID of the funding strategy for the asset\\n * @param asset the asset address\\n * @param strategy funding strategy address\\n * @param contractInterface a string that uniquely identifies the contract's interface\\n */\\n function setFundingStrategy(\\n address asset,\\n address strategy,\\n string calldata contractInterface,\\n address inputToken\\n ) public onlyOwner {\\n fundingStrategiesConfig[asset] = FundingStrategy(strategy, contractInterface, inputToken);\\n }\\n\\n function getFundingStrategy(address asset) public view returns (FundingStrategy memory) {\\n return fundingStrategiesConfig[asset];\\n }\\n\\n /**\\n * @dev configures the Jarvis pool of a Jarvis synthetic token\\n * @param syntheticToken the synthetic token address\\n * @param collateralToken the collateral token address\\n * @param liquidityPool the liquidity pool address\\n * @param expirationTime the operation expiration time\\n */\\n function setJarvisPool(\\n address syntheticToken,\\n address collateralToken,\\n address liquidityPool,\\n uint256 expirationTime\\n ) public onlyOwner {\\n jarvisPoolsConfig.push(JarvisPool(syntheticToken, collateralToken, liquidityPool, expirationTime));\\n }\\n\\n function setCurveSwapPool(address poolAddress, address[] calldata coins) public onlyOwner {\\n curveSwapPoolsConfig.push(CurveSwapPool(poolAddress, coins));\\n }\\n\\n /**\\n * @dev Sets an address for an id replacing the address saved in the addresses map\\n * @param id The id\\n * @param newAddress The address to set\\n */\\n function setAddress(string calldata id, address newAddress) external onlyOwner {\\n _addresses[id] = newAddress;\\n }\\n\\n /**\\n * @dev Returns an address by id\\n * @return The address\\n */\\n function getAddress(string calldata id) public view returns (address) {\\n return _addresses[id];\\n }\\n\\n function getCurveSwapPools() public view returns (CurveSwapPool[] memory) {\\n return curveSwapPoolsConfig;\\n }\\n\\n function getJarvisPools() public view returns (JarvisPool[] memory) {\\n return jarvisPoolsConfig;\\n }\\n\\n function setBalancerPoolForTokens(\\n address inputToken,\\n address outputToken,\\n address pool\\n ) external onlyOwner {\\n balancerPoolForTokens[inputToken][outputToken] = pool;\\n }\\n\\n function getBalancerPoolForTokens(address inputToken, address outputToken) external view returns (address) {\\n return balancerPoolForTokens[inputToken][outputToken];\\n }\\n}\\n\",\"keccak256\":\"0xf48e9e8b2150408c1c6b68dd957226c342ba47396da792fdaa0922f539a7e163\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/AuthoritiesRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport { PoolRolesAuthority } from \\\"../ionic/PoolRolesAuthority.sol\\\";\\nimport { SafeOwnableUpgradeable } from \\\"../ionic/SafeOwnableUpgradeable.sol\\\";\\nimport { IonicComptroller } from \\\"../compound/ComptrollerInterface.sol\\\";\\n\\nimport { TransparentUpgradeableProxy } from \\\"@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol\\\";\\n\\ncontract AuthoritiesRegistry is SafeOwnableUpgradeable {\\n mapping(address => PoolRolesAuthority) public poolsAuthorities;\\n PoolRolesAuthority public poolAuthLogic;\\n address public leveredPositionsFactory;\\n bool public noAuthRequired;\\n\\n function initialize(address _leveredPositionsFactory) public initializer {\\n __SafeOwnable_init(msg.sender);\\n leveredPositionsFactory = _leveredPositionsFactory;\\n poolAuthLogic = new PoolRolesAuthority();\\n }\\n\\n function reinitialize(address _leveredPositionsFactory) public onlyOwnerOrAdmin {\\n leveredPositionsFactory = _leveredPositionsFactory;\\n poolAuthLogic = new PoolRolesAuthority();\\n // for Neon the auth is not required\\n noAuthRequired = block.chainid == 245022934;\\n }\\n\\n function createPoolAuthority(address pool) public onlyOwner returns (PoolRolesAuthority auth) {\\n require(address(poolsAuthorities[pool]) == address(0), \\\"already created\\\");\\n\\n TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(poolAuthLogic), _getProxyAdmin(), \\\"\\\");\\n auth = PoolRolesAuthority(address(proxy));\\n auth.initialize(address(this));\\n poolsAuthorities[pool] = auth;\\n\\n auth.openPoolSupplierCapabilities(IonicComptroller(pool));\\n auth.setUserRole(address(this), auth.REGISTRY_ROLE(), true);\\n // sets the registry owner as the auth owner\\n reconfigureAuthority(pool);\\n }\\n\\n function reconfigureAuthority(address poolAddress) public {\\n IonicComptroller pool = IonicComptroller(poolAddress);\\n PoolRolesAuthority auth = poolsAuthorities[address(pool)];\\n\\n if (msg.sender != poolAddress || address(auth) != address(0)) {\\n require(address(auth) != address(0), \\\"no such authority\\\");\\n require(msg.sender == owner() || msg.sender == poolAddress, \\\"not owner or pool\\\");\\n\\n auth.configureRegistryCapabilities();\\n auth.configurePoolSupplierCapabilities(pool);\\n auth.configurePoolBorrowerCapabilities(pool);\\n // everyone can be a liquidator\\n auth.configureOpenPoolLiquidatorCapabilities(pool);\\n auth.configureLeveredPositionCapabilities(pool);\\n\\n if (auth.owner() != owner()) {\\n auth.setOwner(owner());\\n }\\n }\\n }\\n\\n function canCall(\\n address pool,\\n address user,\\n address target,\\n bytes4 functionSig\\n ) external view returns (bool) {\\n PoolRolesAuthority authorityForPool = poolsAuthorities[pool];\\n if (address(authorityForPool) == address(0)) {\\n return noAuthRequired;\\n } else {\\n // allow only if an auth exists and it allows the action\\n return authorityForPool.canCall(user, target, functionSig);\\n }\\n }\\n\\n function setUserRole(\\n address pool,\\n address user,\\n uint8 role,\\n bool enabled\\n ) external {\\n PoolRolesAuthority poolAuth = poolsAuthorities[pool];\\n\\n require(address(poolAuth) != address(0), \\\"auth does not exist\\\");\\n require(msg.sender == owner() || msg.sender == leveredPositionsFactory, \\\"not owner or factory\\\");\\n require(msg.sender != leveredPositionsFactory || role == poolAuth.LEVERED_POSITION_ROLE(), \\\"only lev pos role\\\");\\n\\n poolAuth.setUserRole(user, role, enabled);\\n }\\n}\\n\",\"keccak256\":\"0x98fc1f8a735b5759fc7524e3065ae322703d2771e7ec429e1cc9b60a4b1028dd\",\"license\":\"UNLICENSED\"},\"contracts/ionic/DiamondExtension.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\n/**\\n * @notice a base contract for logic extensions that use the diamond pattern storage\\n * to map the functions when looking up the extension contract to delegate to.\\n */\\nabstract contract DiamondExtension {\\n /**\\n * @return a list of all the function selectors that this logic extension exposes\\n */\\n function _getExtensionFunctions() external pure virtual returns (bytes4[] memory);\\n}\\n\\n// When no function exists for function called\\nerror FunctionNotFound(bytes4 _functionSelector);\\n\\n// When no extension exists for function called\\nerror ExtensionNotFound(bytes4 _functionSelector);\\n\\n// When the function is already added\\nerror FunctionAlreadyAdded(bytes4 _functionSelector, address _currentImpl);\\n\\nabstract contract DiamondBase {\\n /**\\n * @dev register a logic extension\\n * @param extensionToAdd the extension whose functions are to be added\\n * @param extensionToReplace the extension whose functions are to be removed/replaced\\n */\\n function _registerExtension(DiamondExtension extensionToAdd, DiamondExtension extensionToReplace) external virtual;\\n\\n function _listExtensions() public view returns (address[] memory) {\\n return LibDiamond.listExtensions();\\n }\\n\\n fallback() external {\\n address extension = LibDiamond.getExtensionForFunction(msg.sig);\\n if (extension == address(0)) revert FunctionNotFound(msg.sig);\\n // Execute external function from extension using delegatecall and return any value.\\n assembly {\\n // copy function selector and any arguments\\n calldatacopy(0, 0, calldatasize())\\n // execute function call using the extension\\n let result := delegatecall(gas(), extension, 0, calldatasize(), 0, 0)\\n // get any return value\\n returndatacopy(0, 0, returndatasize())\\n // return any return value or error back to the caller\\n switch result\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n}\\n\\n/**\\n * @notice a library to use in a contract, whose logic is extended with diamond extension\\n */\\nlibrary LibDiamond {\\n bytes32 constant DIAMOND_STORAGE_POSITION = keccak256(\\\"diamond.extensions.diamond.storage\\\");\\n\\n struct Function {\\n address extension;\\n bytes4 selector;\\n }\\n\\n struct LogicStorage {\\n Function[] functions;\\n address[] extensions;\\n }\\n\\n function getExtensionForFunction(bytes4 msgSig) internal view returns (address) {\\n return getExtensionForSelector(msgSig, diamondStorage());\\n }\\n\\n function diamondStorage() internal pure returns (LogicStorage storage ds) {\\n bytes32 position = DIAMOND_STORAGE_POSITION;\\n assembly {\\n ds.slot := position\\n }\\n }\\n\\n function listExtensions() internal view returns (address[] memory) {\\n return diamondStorage().extensions;\\n }\\n\\n function registerExtension(DiamondExtension extensionToAdd, DiamondExtension extensionToReplace) internal {\\n if (address(extensionToReplace) != address(0)) {\\n removeExtension(extensionToReplace);\\n }\\n addExtension(extensionToAdd);\\n }\\n\\n function removeExtension(DiamondExtension extension) internal {\\n LogicStorage storage ds = diamondStorage();\\n // remove all functions of the extension to replace\\n removeExtensionFunctions(extension);\\n for (uint8 i = 0; i < ds.extensions.length; i++) {\\n if (ds.extensions[i] == address(extension)) {\\n ds.extensions[i] = ds.extensions[ds.extensions.length - 1];\\n ds.extensions.pop();\\n }\\n }\\n }\\n\\n function addExtension(DiamondExtension extension) internal {\\n LogicStorage storage ds = diamondStorage();\\n for (uint8 i = 0; i < ds.extensions.length; i++) {\\n require(ds.extensions[i] != address(extension), \\\"extension already added\\\");\\n }\\n addExtensionFunctions(extension);\\n ds.extensions.push(address(extension));\\n }\\n\\n function removeExtensionFunctions(DiamondExtension extension) internal {\\n bytes4[] memory fnsToRemove = extension._getExtensionFunctions();\\n LogicStorage storage ds = diamondStorage();\\n for (uint16 i = 0; i < fnsToRemove.length; i++) {\\n bytes4 selectorToRemove = fnsToRemove[i];\\n // must never fail\\n assert(address(extension) == getExtensionForSelector(selectorToRemove, ds));\\n // swap with the last element in the selectorAtIndex array and remove the last element\\n uint16 indexToKeep = getIndexForSelector(selectorToRemove, ds);\\n ds.functions[indexToKeep] = ds.functions[ds.functions.length - 1];\\n ds.functions.pop();\\n }\\n }\\n\\n function addExtensionFunctions(DiamondExtension extension) internal {\\n bytes4[] memory fnsToAdd = extension._getExtensionFunctions();\\n LogicStorage storage ds = diamondStorage();\\n uint16 functionsCount = uint16(ds.functions.length);\\n for (uint256 functionsIndex = 0; functionsIndex < fnsToAdd.length; functionsIndex++) {\\n bytes4 selector = fnsToAdd[functionsIndex];\\n address oldImplementation = getExtensionForSelector(selector, ds);\\n if (oldImplementation != address(0)) revert FunctionAlreadyAdded(selector, oldImplementation);\\n ds.functions.push(Function(address(extension), selector));\\n functionsCount++;\\n }\\n }\\n\\n function getExtensionForSelector(bytes4 selector, LogicStorage storage ds) internal view returns (address) {\\n uint256 fnsLen = ds.functions.length;\\n for (uint256 i = 0; i < fnsLen; i++) {\\n if (ds.functions[i].selector == selector) return ds.functions[i].extension;\\n }\\n\\n return address(0);\\n }\\n\\n function getIndexForSelector(bytes4 selector, LogicStorage storage ds) internal view returns (uint16) {\\n uint16 fnsLen = uint16(ds.functions.length);\\n for (uint16 i = 0; i < fnsLen; i++) {\\n if (ds.functions[i].selector == selector) return i;\\n }\\n\\n return type(uint16).max;\\n }\\n}\\n\",\"keccak256\":\"0x6d33291928e3c255f0276fa465dcc5ea88d74a6562241a39ad2e52ae8abaf7bc\",\"license\":\"UNLICENSED\"},\"contracts/ionic/PoolRolesAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport { IonicComptroller, ComptrollerInterface } from \\\"../compound/ComptrollerInterface.sol\\\";\\nimport { ICErc20, CTokenSecondExtensionInterface, CTokenFirstExtensionInterface } from \\\"../compound/CTokenInterfaces.sol\\\";\\n\\nimport { RolesAuthority, Authority } from \\\"solmate/auth/authorities/RolesAuthority.sol\\\";\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\\\";\\n\\ncontract PoolRolesAuthority is RolesAuthority, Initializable {\\n constructor() RolesAuthority(address(0), Authority(address(0))) {\\n _disableInitializers();\\n }\\n\\n function initialize(address _owner) public initializer {\\n owner = _owner;\\n authority = this;\\n }\\n\\n // up to 256 roles\\n uint8 public constant REGISTRY_ROLE = 0;\\n uint8 public constant SUPPLIER_ROLE = 1;\\n uint8 public constant BORROWER_ROLE = 2;\\n uint8 public constant LIQUIDATOR_ROLE = 3;\\n uint8 public constant LEVERED_POSITION_ROLE = 4;\\n\\n function configureRegistryCapabilities() external requiresAuth {\\n setRoleCapability(REGISTRY_ROLE, address(this), PoolRolesAuthority.configureRegistryCapabilities.selector, true);\\n setRoleCapability(\\n REGISTRY_ROLE,\\n address(this),\\n PoolRolesAuthority.configurePoolSupplierCapabilities.selector,\\n true\\n );\\n setRoleCapability(\\n REGISTRY_ROLE,\\n address(this),\\n PoolRolesAuthority.configurePoolBorrowerCapabilities.selector,\\n true\\n );\\n setRoleCapability(\\n REGISTRY_ROLE,\\n address(this),\\n PoolRolesAuthority.configureClosedPoolLiquidatorCapabilities.selector,\\n true\\n );\\n setRoleCapability(\\n REGISTRY_ROLE,\\n address(this),\\n PoolRolesAuthority.configureOpenPoolLiquidatorCapabilities.selector,\\n true\\n );\\n setRoleCapability(\\n REGISTRY_ROLE,\\n address(this),\\n PoolRolesAuthority.configureLeveredPositionCapabilities.selector,\\n true\\n );\\n setRoleCapability(REGISTRY_ROLE, address(this), RolesAuthority.setUserRole.selector, true);\\n }\\n\\n function openPoolSupplierCapabilities(IonicComptroller pool) external requiresAuth {\\n _setPublicPoolSupplierCapabilities(pool, true);\\n }\\n\\n function closePoolSupplierCapabilities(IonicComptroller pool) external requiresAuth {\\n _setPublicPoolSupplierCapabilities(pool, false);\\n }\\n\\n function _setPublicPoolSupplierCapabilities(IonicComptroller pool, bool setPublic) internal {\\n setPublicCapability(address(pool), pool.enterMarkets.selector, setPublic);\\n setPublicCapability(address(pool), pool.exitMarket.selector, setPublic);\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n bytes4[] memory selectors = getSupplierMarketSelectors();\\n for (uint256 j = 0; j < selectors.length; j++) {\\n setPublicCapability(address(allMarkets[i]), selectors[j], setPublic);\\n }\\n }\\n }\\n\\n function configurePoolSupplierCapabilities(IonicComptroller pool) external requiresAuth {\\n _configurePoolSupplierCapabilities(pool, SUPPLIER_ROLE);\\n }\\n\\n function getSupplierMarketSelectors() internal pure returns (bytes4[] memory selectors) {\\n uint8 fnsCount = 6;\\n selectors = new bytes4[](fnsCount);\\n selectors[--fnsCount] = CTokenSecondExtensionInterface.mint.selector;\\n selectors[--fnsCount] = CTokenSecondExtensionInterface.redeem.selector;\\n selectors[--fnsCount] = CTokenSecondExtensionInterface.redeemUnderlying.selector;\\n selectors[--fnsCount] = CTokenFirstExtensionInterface.transfer.selector;\\n selectors[--fnsCount] = CTokenFirstExtensionInterface.transferFrom.selector;\\n selectors[--fnsCount] = CTokenFirstExtensionInterface.approve.selector;\\n\\n require(fnsCount == 0, \\\"use the correct array length\\\");\\n return selectors;\\n }\\n\\n function _configurePoolSupplierCapabilities(IonicComptroller pool, uint8 role) internal {\\n setRoleCapability(role, address(pool), pool.enterMarkets.selector, true);\\n setRoleCapability(role, address(pool), pool.exitMarket.selector, true);\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n bytes4[] memory selectors = getSupplierMarketSelectors();\\n for (uint256 j = 0; j < selectors.length; j++) {\\n setRoleCapability(role, address(allMarkets[i]), selectors[j], true);\\n }\\n }\\n }\\n\\n function openPoolBorrowerCapabilities(IonicComptroller pool) external requiresAuth {\\n _setPublicPoolBorrowerCapabilities(pool, true);\\n }\\n\\n function closePoolBorrowerCapabilities(IonicComptroller pool) external requiresAuth {\\n _setPublicPoolBorrowerCapabilities(pool, false);\\n }\\n\\n function _setPublicPoolBorrowerCapabilities(IonicComptroller pool, bool setPublic) internal {\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].borrow.selector, setPublic);\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].repayBorrow.selector, setPublic);\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].repayBorrowBehalf.selector, setPublic);\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].flash.selector, setPublic);\\n }\\n }\\n\\n function configurePoolBorrowerCapabilities(IonicComptroller pool) external requiresAuth {\\n // borrowers have the SUPPLIER_ROLE capabilities by default\\n _configurePoolSupplierCapabilities(pool, BORROWER_ROLE);\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n setRoleCapability(BORROWER_ROLE, address(allMarkets[i]), allMarkets[i].borrow.selector, true);\\n setRoleCapability(BORROWER_ROLE, address(allMarkets[i]), allMarkets[i].repayBorrow.selector, true);\\n setRoleCapability(BORROWER_ROLE, address(allMarkets[i]), allMarkets[i].repayBorrowBehalf.selector, true);\\n setRoleCapability(BORROWER_ROLE, address(allMarkets[i]), allMarkets[i].flash.selector, true);\\n }\\n }\\n\\n function configureClosedPoolLiquidatorCapabilities(IonicComptroller pool) external requiresAuth {\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].liquidateBorrow.selector, false);\\n setRoleCapability(LIQUIDATOR_ROLE, address(allMarkets[i]), allMarkets[i].liquidateBorrow.selector, true);\\n setRoleCapability(LIQUIDATOR_ROLE, address(allMarkets[i]), allMarkets[i].redeem.selector, true);\\n }\\n }\\n\\n function configureOpenPoolLiquidatorCapabilities(IonicComptroller pool) external requiresAuth {\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].liquidateBorrow.selector, true);\\n // TODO this leaves redeeming open for everyone\\n setPublicCapability(address(allMarkets[i]), allMarkets[i].redeem.selector, true);\\n }\\n }\\n\\n function configureLeveredPositionCapabilities(IonicComptroller pool) external requiresAuth {\\n setRoleCapability(LEVERED_POSITION_ROLE, address(pool), pool.enterMarkets.selector, true);\\n setRoleCapability(LEVERED_POSITION_ROLE, address(pool), pool.exitMarket.selector, true);\\n ICErc20[] memory allMarkets = pool.getAllMarkets();\\n for (uint256 i = 0; i < allMarkets.length; i++) {\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].mint.selector, true);\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].redeem.selector, true);\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].redeemUnderlying.selector, true);\\n\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].borrow.selector, true);\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].repayBorrow.selector, true);\\n setRoleCapability(LEVERED_POSITION_ROLE, address(allMarkets[i]), allMarkets[i].flash.selector, true);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1ec824166a7b4b1e67384a25d231d3acab89ef90ff43ff380cbf1715410d9851\",\"license\":\"UNLICENSED\"},\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/oracles/BasePriceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"../compound/CTokenInterfaces.sol\\\";\\n\\n/**\\n * @title BasePriceOracle\\n * @notice Returns prices of underlying tokens directly without the caller having to specify a cToken address.\\n * @dev Implements the `PriceOracle` interface.\\n * @author David Lucid (https://github.com/davidlucid)\\n */\\ninterface BasePriceOracle {\\n /**\\n * @notice Get the price of an underlying asset.\\n * @param underlying The underlying asset to get the price of.\\n * @return The underlying asset price in ETH as a mantissa (scaled by 1e18).\\n * Zero means the price is unavailable.\\n */\\n function price(address underlying) external view returns (uint256);\\n\\n /**\\n * @notice Get the underlying price of a cToken asset\\n * @param cToken The cToken to get the underlying price of\\n * @return The underlying asset price mantissa (scaled by 1e18).\\n * Zero means the price is unavailable.\\n */\\n function getUnderlyingPrice(ICErc20 cToken) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xed2a27a8dc71a4280c0ef19d3165ff237d8066ae782e750b071bb39d12e73404\",\"license\":\"UNLICENSED\"},\"contracts/oracles/MasterPriceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\\\";\\n\\nimport { ICErc20 } from \\\"../compound/CTokenInterfaces.sol\\\";\\n\\nimport { BasePriceOracle } from \\\"./BasePriceOracle.sol\\\";\\n\\n/**\\n * @title MasterPriceOracle\\n * @notice Use a combination of price oracles.\\n * @dev Implements `PriceOracle`.\\n * @author David Lucid (https://github.com/davidlucid)\\n */\\ncontract MasterPriceOracle is Initializable, BasePriceOracle {\\n /**\\n * @dev Maps underlying token addresses to `PriceOracle` contracts (can be `BasePriceOracle` contracts too).\\n */\\n mapping(address => BasePriceOracle) public oracles;\\n\\n /**\\n * @dev Default/fallback `PriceOracle`.\\n */\\n BasePriceOracle public defaultOracle;\\n\\n /**\\n * @dev The administrator of this `MasterPriceOracle`.\\n */\\n address public admin;\\n\\n /**\\n * @dev Controls if `admin` can overwrite existing assignments of oracles to underlying tokens.\\n */\\n bool internal noAdminOverwrite;\\n\\n /**\\n * @dev The Wrapped native asset address.\\n */\\n address public wtoken;\\n\\n /**\\n * @dev Maps underlying token addresses to `PriceOracle` contracts (can be `BasePriceOracle` contracts too).\\n */\\n mapping(address => BasePriceOracle) public fallbackOracles;\\n\\n /**\\n * @dev Returns a boolean indicating if `admin` can overwrite existing assignments of oracles to underlying tokens.\\n */\\n function canAdminOverwrite() external view returns (bool) {\\n return !noAdminOverwrite;\\n }\\n\\n /**\\n * @dev Event emitted when `admin` is changed.\\n */\\n event NewAdmin(address oldAdmin, address newAdmin);\\n\\n /**\\n * @dev Event emitted when the default oracle is changed.\\n */\\n event NewDefaultOracle(address oldOracle, address newOracle);\\n\\n /**\\n * @dev Event emitted when an underlying token's oracle is changed.\\n */\\n event NewOracle(address underlying, address oldOracle, address newOracle);\\n\\n /**\\n * @dev Initialize state variables.\\n * @param underlyings The underlying ERC20 token addresses to link to `_oracles`.\\n * @param _oracles The `PriceOracle` contracts to be assigned to `underlyings`.\\n * @param _defaultOracle The default `PriceOracle` contract to use.\\n * @param _admin The admin who can assign oracles to underlying tokens.\\n * @param _canAdminOverwrite Controls if `admin` can overwrite existing assignments of oracles to underlying tokens.\\n * @param _wtoken The Wrapped native asset address\\n */\\n function initialize(\\n address[] memory underlyings,\\n BasePriceOracle[] memory _oracles,\\n BasePriceOracle _defaultOracle,\\n address _admin,\\n bool _canAdminOverwrite,\\n address _wtoken\\n ) external initializer {\\n // Input validation\\n require(underlyings.length == _oracles.length, \\\"Lengths of both arrays must be equal.\\\");\\n\\n // Initialize state variables\\n for (uint256 i = 0; i < underlyings.length; i++) {\\n address underlying = underlyings[i];\\n BasePriceOracle newOracle = _oracles[i];\\n oracles[underlying] = newOracle;\\n emit NewOracle(underlying, address(0), address(newOracle));\\n }\\n\\n defaultOracle = _defaultOracle;\\n admin = _admin;\\n noAdminOverwrite = !_canAdminOverwrite;\\n wtoken = _wtoken;\\n }\\n\\n /**\\n * @dev Sets `_oracles` for `underlyings`.\\n */\\n function add(address[] calldata underlyings, BasePriceOracle[] calldata _oracles) external onlyAdmin {\\n // Input validation\\n require(\\n underlyings.length > 0 && underlyings.length == _oracles.length,\\n \\\"Lengths of both arrays must be equal and greater than 0.\\\"\\n );\\n\\n // Assign oracles to underlying tokens\\n for (uint256 i = 0; i < underlyings.length; i++) {\\n address underlying = underlyings[i];\\n address oldOracle = address(oracles[underlying]);\\n if (noAdminOverwrite)\\n require(\\n oldOracle == address(0),\\n \\\"Admin cannot overwrite existing assignments of oracles to underlying tokens.\\\"\\n );\\n BasePriceOracle newOracle = _oracles[i];\\n oracles[underlying] = newOracle;\\n emit NewOracle(underlying, oldOracle, address(newOracle));\\n }\\n }\\n\\n /**\\n * @dev Sets `_oracles` for `underlyings`.\\n */\\n function addFallbacks(address[] calldata underlyings, BasePriceOracle[] calldata _oracles) external onlyAdmin {\\n // Input validation\\n require(\\n underlyings.length > 0 && underlyings.length == _oracles.length,\\n \\\"Lengths of both arrays must be equal and greater than 0.\\\"\\n );\\n\\n // Assign oracles to underlying tokens\\n for (uint256 i = 0; i < underlyings.length; i++) {\\n address underlying = underlyings[i];\\n address oldOracle = address(fallbackOracles[underlying]);\\n if (noAdminOverwrite)\\n require(\\n oldOracle == address(0),\\n \\\"Admin cannot overwrite existing assignments of oracles to underlying tokens.\\\"\\n );\\n BasePriceOracle newOracle = _oracles[i];\\n fallbackOracles[underlying] = newOracle;\\n emit NewOracle(underlying, oldOracle, address(newOracle));\\n }\\n }\\n\\n /**\\n * @dev Changes the default price oracle\\n */\\n function setDefaultOracle(BasePriceOracle newOracle) external onlyAdmin {\\n BasePriceOracle oldOracle = defaultOracle;\\n defaultOracle = newOracle;\\n emit NewDefaultOracle(address(oldOracle), address(newOracle));\\n }\\n\\n /**\\n * @dev Changes the admin and emits an event.\\n */\\n function changeAdmin(address newAdmin) external onlyAdmin {\\n address oldAdmin = admin;\\n admin = newAdmin;\\n emit NewAdmin(oldAdmin, newAdmin);\\n }\\n\\n /**\\n * @dev Modifier that checks if `msg.sender == admin`.\\n */\\n modifier onlyAdmin() {\\n require(msg.sender == admin, \\\"Sender is not the admin.\\\");\\n _;\\n }\\n\\n /**\\n * @notice Returns the price in ETH of the token underlying `cToken`.\\n * @dev Implements the `PriceOracle` interface for Ionic pools (and Compound v2).\\n * @return Price in ETH of the token underlying `cToken`, scaled by `10 ** (36 - underlyingDecimals)`.\\n */\\n function getUnderlyingPrice(ICErc20 cToken) external view override returns (uint256) {\\n // Get underlying ERC20 token address\\n address underlying = address(ICErc20(address(cToken)).underlying());\\n\\n if (underlying == wtoken) return 1e18;\\n\\n BasePriceOracle oracle = oracles[underlying];\\n BasePriceOracle fallbackOracle = fallbackOracles[underlying];\\n\\n if (address(oracle) != address(0)) {\\n try oracle.getUnderlyingPrice(cToken) returns (uint256 underlyingPrice) {\\n if (underlyingPrice == 0) {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.getUnderlyingPrice(cToken);\\n } else {\\n return underlyingPrice;\\n }\\n } catch {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.getUnderlyingPrice(cToken);\\n }\\n } else {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.getUnderlyingPrice(cToken);\\n }\\n revert(\\\"Price oracle not found for this underlying token address.\\\");\\n }\\n\\n /**\\n * @dev Attempts to return the price in ETH of `underlying` (implements `BasePriceOracle`).\\n */\\n function price(address underlying) public view override returns (uint256) {\\n // Return 1e18 for WETH\\n if (underlying == wtoken) return 1e18;\\n\\n // Get underlying price from assigned oracle\\n BasePriceOracle oracle = oracles[underlying];\\n BasePriceOracle fallbackOracle = fallbackOracles[underlying];\\n\\n if (address(oracle) != address(0)) {\\n try oracle.price(underlying) returns (uint256 underlyingPrice) {\\n if (underlyingPrice == 0) {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.price(underlying);\\n } else {\\n return underlyingPrice;\\n }\\n } catch {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.price(underlying);\\n }\\n } else {\\n if (address(fallbackOracle) != address(0)) return fallbackOracle.price(underlying);\\n }\\n revert(\\\"Price oracle not found for this underlying token address.\\\");\\n }\\n}\\n\",\"keccak256\":\"0x8748b7e74b8f789617f0b387cd2e2259a0fa3639d54234d7e6c99cb3eae6fc9a\",\"license\":\"UNLICENSED\"},\"contracts/oracles/default/PythPriceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport { ERC20Upgradeable } from \\\"openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol\\\";\\n\\nimport { MasterPriceOracle } from \\\"../MasterPriceOracle.sol\\\";\\nimport { BasePriceOracle, ICErc20 } from \\\"../BasePriceOracle.sol\\\";\\nimport { IPyth } from \\\"@pythnetwork/pyth-sdk-solidity/IPyth.sol\\\";\\nimport { PythStructs } from \\\"@pythnetwork/pyth-sdk-solidity/PythStructs.sol\\\";\\nimport { SafeOwnableUpgradeable } from \\\"../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\n/**\\n * @title PythPriceOracle\\n * @notice Returns prices from Pyth.\\n * @dev Implements `PriceOracle`.\\n * @author Rahul Sethuram (https://github.com/rhlsthrm)\\n */\\ncontract PythPriceOracle is BasePriceOracle, SafeOwnableUpgradeable {\\n /**\\n * @notice Maps ERC20 token addresses to Pyth price IDs.\\n */\\n mapping(address => bytes32) public priceFeedIds;\\n\\n /**\\n * @notice DIA NATIVE/USD price feed contracts.\\n */\\n bytes32 public NATIVE_TOKEN_USD_FEED;\\n\\n /**\\n * @notice MasterPriceOracle for backup for USD price.\\n */\\n address public USD_TOKEN; // token to use as USD price (i.e. USDC)\\n\\n /**\\n * @dev Constructor to set admin and canAdminOverwrite, wtoken address and native token USD price feed address\\n */\\n\\n IPyth public PYTH;\\n\\n function initialize(\\n address pythAddress,\\n bytes32 nativeTokenUsdFeed,\\n address usdToken\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n NATIVE_TOKEN_USD_FEED = nativeTokenUsdFeed;\\n USD_TOKEN = usdToken;\\n PYTH = IPyth(pythAddress);\\n }\\n\\n function reinitialize(\\n address pythAddress,\\n bytes32 nativeTokenUsdFeed,\\n address usdToken\\n ) public onlyOwnerOrAdmin {\\n NATIVE_TOKEN_USD_FEED = nativeTokenUsdFeed;\\n USD_TOKEN = usdToken;\\n PYTH = IPyth(pythAddress);\\n }\\n\\n /**\\n * @dev Admin-only function to set price feeds.\\n * @param underlyings Underlying token addresses for which to set price feeds.\\n * @param feedIds The Pyth Network feed IDs`.\\n */\\n function setPriceFeeds(address[] memory underlyings, bytes32[] memory feedIds) external onlyOwner {\\n // Input validation\\n require(\\n underlyings.length > 0 && underlyings.length == feedIds.length,\\n \\\"Lengths of both arrays must be equal and greater than 0.\\\"\\n );\\n\\n // For each token/feed\\n for (uint256 i = 0; i < underlyings.length; i++) {\\n address underlying = underlyings[i];\\n // Set feed and base currency\\n priceFeedIds[underlying] = feedIds[i];\\n }\\n }\\n\\n /**\\n * @dev Internal function returning the price in ETH of `underlying`.\\n * Assumes price feeds are 8 decimals (TODO: doublecheck)\\n */\\n function _price(address underlying) internal view returns (uint256) {\\n // Get token/native price from Oracle\\n bytes32 feed = priceFeedIds[underlying];\\n require(feed != \\\"\\\", \\\"No oracle price feed found for this underlying ERC20 token.\\\");\\n\\n if (NATIVE_TOKEN_USD_FEED == \\\"\\\") {\\n // Get price from MasterPriceOracle\\n uint256 usdNativeTokenPrice = BasePriceOracle(msg.sender).price(USD_TOKEN);\\n uint256 nativeTokenUsdPrice = 1e36 / usdNativeTokenPrice; // 18 decimals -- TODO: doublecheck\\n PythStructs.Price memory tokenUsdPrice = PYTH.getPriceUnsafe(feed); // 8 decimals --- TODO: doublecheck\\n return\\n tokenUsdPrice.price >= 0 ? (uint256(uint64(tokenUsdPrice.price)) * 1e28) / uint256(nativeTokenUsdPrice) : 0;\\n } else {\\n uint128 nativeTokenUsdPrice = uint128(uint64(PYTH.getPriceUnsafe(NATIVE_TOKEN_USD_FEED).price));\\n if (nativeTokenUsdPrice <= 0) return 0;\\n uint128 tokenUsdPrice = uint128(uint64(PYTH.getPriceUnsafe(feed).price));\\n return tokenUsdPrice >= 0 ? (uint256(tokenUsdPrice) * 1e18) / uint256(nativeTokenUsdPrice) : 0;\\n }\\n }\\n\\n /**\\n * @dev Returns the price in ETH of `underlying` (implements `BasePriceOracle`).\\n */\\n function price(address underlying) external view override returns (uint256) {\\n return _price(underlying);\\n }\\n\\n /**\\n * @notice Returns the price in ETH of the token underlying `cToken`.\\n * @dev Implements the `PriceOracle` interface for Ionic pools (and Compound v2).\\n * @return Price in ETH of the token underlying `cToken`, scaled by `10 ** (36 - underlyingDecimals)`.\\n */\\n function getUnderlyingPrice(ICErc20 cToken) external view override returns (uint256) {\\n // Get underlying token address\\n address underlying = cToken.underlying();\\n\\n // Get price\\n uint256 oraclePrice = _price(underlying);\\n\\n // Format and return price\\n uint256 underlyingDecimals = uint256(ERC20Upgradeable(underlying).decimals());\\n return\\n underlyingDecimals <= 18\\n ? uint256(oraclePrice) * (10**(18 - underlyingDecimals))\\n : uint256(oraclePrice) / (10**(underlyingDecimals - 18));\\n }\\n}\\n\",\"keccak256\":\"0x78b807249630d7858b00a94b941e23b7d30c85831214b328f08877db4e32a771\",\"license\":\"UNLICENSED\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"./extensions/IERC20MetadataUpgradeable.sol\\\";\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\\n * instead returning `false` on failure. This behavior is nonetheless\\n * conventional and does not conflict with the expectations of ERC20\\n * applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {\\n mapping(address => uint256) private _balances;\\n\\n mapping(address => mapping(address => uint256)) private _allowances;\\n\\n uint256 private _totalSupply;\\n\\n string private _name;\\n string private _symbol;\\n\\n /**\\n * @dev Sets the values for {name} and {symbol}.\\n *\\n * The default value of {decimals} is 18. To select a different value for\\n * {decimals} you should overload it.\\n *\\n * All two of these values are immutable: they can only be set once during\\n * construction.\\n */\\n function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {\\n __ERC20_init_unchained(name_, symbol_);\\n }\\n\\n function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() public view virtual override returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev Returns the symbol of the token, usually a shorter version of the\\n * name.\\n */\\n function symbol() public view virtual override returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev Returns the number of decimals used to get its user representation.\\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\\n *\\n * Tokens usually opt for a value of 18, imitating the relationship between\\n * Ether and Wei. This is the value {ERC20} uses, unless this function is\\n * overridden;\\n *\\n * NOTE: This information is only used for _display_ purposes: it in\\n * no way affects any of the arithmetic of the contract, including\\n * {IERC20-balanceOf} and {IERC20-transfer}.\\n */\\n function decimals() public view virtual override returns (uint8) {\\n return 18;\\n }\\n\\n /**\\n * @dev See {IERC20-totalSupply}.\\n */\\n function totalSupply() public view virtual override returns (uint256) {\\n return _totalSupply;\\n }\\n\\n /**\\n * @dev See {IERC20-balanceOf}.\\n */\\n function balanceOf(address account) public view virtual override returns (uint256) {\\n return _balances[account];\\n }\\n\\n /**\\n * @dev See {IERC20-transfer}.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - the caller must have a balance of at least `amount`.\\n */\\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _transfer(owner, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-allowance}.\\n */\\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n return _allowances[owner][spender];\\n }\\n\\n /**\\n * @dev See {IERC20-approve}.\\n *\\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\\n * `transferFrom`. This is semantically equivalent to an infinite approval.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, amount);\\n return true;\\n }\\n\\n /**\\n * @dev See {IERC20-transferFrom}.\\n *\\n * Emits an {Approval} event indicating the updated allowance. This is not\\n * required by the EIP. See the note at the beginning of {ERC20}.\\n *\\n * NOTE: Does not update the allowance if the current allowance\\n * is the maximum `uint256`.\\n *\\n * Requirements:\\n *\\n * - `from` and `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n * - the caller must have allowance for ``from``'s tokens of at least\\n * `amount`.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual override returns (bool) {\\n address spender = _msgSender();\\n _spendAllowance(from, spender, amount);\\n _transfer(from, to, amount);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically increases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n */\\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n _approve(owner, spender, allowance(owner, spender) + addedValue);\\n return true;\\n }\\n\\n /**\\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n *\\n * This is an alternative to {approve} that can be used as a mitigation for\\n * problems described in {IERC20-approve}.\\n *\\n * Emits an {Approval} event indicating the updated allowance.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `spender` must have allowance for the caller of at least\\n * `subtractedValue`.\\n */\\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n address owner = _msgSender();\\n uint256 currentAllowance = allowance(owner, spender);\\n require(currentAllowance >= subtractedValue, \\\"ERC20: decreased allowance below zero\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - subtractedValue);\\n }\\n\\n return true;\\n }\\n\\n /**\\n * @dev Moves `amount` of tokens from `from` to `to`.\\n *\\n * This internal function is equivalent to {transfer}, and can be used to\\n * e.g. implement automatic token fees, slashing mechanisms, etc.\\n *\\n * Emits a {Transfer} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of at least `amount`.\\n */\\n function _transfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC20: transfer from the zero address\\\");\\n require(to != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n _beforeTokenTransfer(from, to, amount);\\n\\n uint256 fromBalance = _balances[from];\\n require(fromBalance >= amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n unchecked {\\n _balances[from] = fromBalance - amount;\\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\\n // decrementing then incrementing.\\n _balances[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n _afterTokenTransfer(from, to, amount);\\n }\\n\\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n * the total supply.\\n *\\n * Emits a {Transfer} event with `from` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function _mint(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n _beforeTokenTransfer(address(0), account, amount);\\n\\n _totalSupply += amount;\\n unchecked {\\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\\n _balances[account] += amount;\\n }\\n emit Transfer(address(0), account, amount);\\n\\n _afterTokenTransfer(address(0), account, amount);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens from `account`, reducing the\\n * total supply.\\n *\\n * Emits a {Transfer} event with `to` set to the zero address.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n * - `account` must have at least `amount` tokens.\\n */\\n function _burn(address account, uint256 amount) internal virtual {\\n require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n _beforeTokenTransfer(account, address(0), amount);\\n\\n uint256 accountBalance = _balances[account];\\n require(accountBalance >= amount, \\\"ERC20: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[account] = accountBalance - amount;\\n // Overflow not possible: amount <= accountBalance <= totalSupply.\\n _totalSupply -= amount;\\n }\\n\\n emit Transfer(account, address(0), amount);\\n\\n _afterTokenTransfer(account, address(0), amount);\\n }\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n *\\n * This internal function is equivalent to `approve`, and can be used to\\n * e.g. set automatic allowances for certain subsystems, etc.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `owner` cannot be the zero address.\\n * - `spender` cannot be the zero address.\\n */\\n function _approve(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n _allowances[owner][spender] = amount;\\n emit Approval(owner, spender, amount);\\n }\\n\\n /**\\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\\n *\\n * Does not update the allowance amount in case of infinite allowance.\\n * Revert if not enough allowance is available.\\n *\\n * Might emit an {Approval} event.\\n */\\n function _spendAllowance(\\n address owner,\\n address spender,\\n uint256 amount\\n ) internal virtual {\\n uint256 currentAllowance = allowance(owner, spender);\\n if (currentAllowance != type(uint256).max) {\\n require(currentAllowance >= amount, \\\"ERC20: insufficient allowance\\\");\\n unchecked {\\n _approve(owner, spender, currentAllowance - amount);\\n }\\n }\\n }\\n\\n /**\\n * @dev Hook that is called before any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * will be transferred to `to`.\\n * - when `from` is zero, `amount` tokens will be minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any transfer of tokens. This includes\\n * minting and burning.\\n *\\n * Calling conditions:\\n *\\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * has been transferred to `to`.\\n * - when `from` is zero, `amount` tokens have been minted for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\\n * - `from` and `to` are never both zero.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address from,\\n address to,\\n uint256 amount\\n ) internal virtual {}\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[45] private __gap;\\n}\\n\",\"keccak256\":\"0x17aff86be546601617585e91fd98aad74cf39f1be65d8eb6f93b7f3c30181275\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/IERC20MetadataUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20MetadataUpgradeable is IERC20Upgradeable {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x605434219ebbe4653f703640f06969faa5a1d78f0bfef878e5ddbb1ca369ceeb\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/auth/Auth.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Provides a flexible and updatable auth pattern which is completely separate from application logic.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)\\n/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)\\nabstract contract Auth {\\n event OwnerUpdated(address indexed user, address indexed newOwner);\\n\\n event AuthorityUpdated(address indexed user, Authority indexed newAuthority);\\n\\n address public owner;\\n\\n Authority public authority;\\n\\n constructor(address _owner, Authority _authority) {\\n owner = _owner;\\n authority = _authority;\\n\\n emit OwnerUpdated(msg.sender, _owner);\\n emit AuthorityUpdated(msg.sender, _authority);\\n }\\n\\n modifier requiresAuth() virtual {\\n require(isAuthorized(msg.sender, msg.sig), \\\"UNAUTHORIZED\\\");\\n\\n _;\\n }\\n\\n function isAuthorized(address user, bytes4 functionSig) internal view virtual returns (bool) {\\n Authority auth = authority; // Memoizing authority saves us a warm SLOAD, around 100 gas.\\n\\n // Checking if the caller is the owner only after calling the authority saves gas in most cases, but be\\n // aware that this makes protected functions uncallable even to the owner if the authority is out of order.\\n return (address(auth) != address(0) && auth.canCall(user, address(this), functionSig)) || user == owner;\\n }\\n\\n function setAuthority(Authority newAuthority) public virtual {\\n // We check if the caller is the owner first because we want to ensure they can\\n // always swap out the authority even if it's reverting or using up a lot of gas.\\n require(msg.sender == owner || authority.canCall(msg.sender, address(this), msg.sig));\\n\\n authority = newAuthority;\\n\\n emit AuthorityUpdated(msg.sender, newAuthority);\\n }\\n\\n function setOwner(address newOwner) public virtual requiresAuth {\\n owner = newOwner;\\n\\n emit OwnerUpdated(msg.sender, newOwner);\\n }\\n}\\n\\n/// @notice A generic interface for a contract which provides authorization data to an Auth instance.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Auth.sol)\\n/// @author Modified from Dappsys (https://github.com/dapphub/ds-auth/blob/master/src/auth.sol)\\ninterface Authority {\\n function canCall(\\n address user,\\n address target,\\n bytes4 functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd5cf8213a40d727af89c93dd359ad68984c123c1a1a93fc9ad7ba62b3436fb75\",\"license\":\"AGPL-3.0-only\"},\"solmate/auth/authorities/RolesAuthority.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {Auth, Authority} from \\\"../Auth.sol\\\";\\n\\n/// @notice Role based Authority that supports up to 256 roles.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/authorities/RolesAuthority.sol)\\n/// @author Modified from Dappsys (https://github.com/dapphub/ds-roles/blob/master/src/roles.sol)\\ncontract RolesAuthority is Auth, Authority {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event UserRoleUpdated(address indexed user, uint8 indexed role, bool enabled);\\n\\n event PublicCapabilityUpdated(address indexed target, bytes4 indexed functionSig, bool enabled);\\n\\n event RoleCapabilityUpdated(uint8 indexed role, address indexed target, bytes4 indexed functionSig, bool enabled);\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(address _owner, Authority _authority) Auth(_owner, _authority) {}\\n\\n /*//////////////////////////////////////////////////////////////\\n ROLE/USER STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n mapping(address => bytes32) public getUserRoles;\\n\\n mapping(address => mapping(bytes4 => bool)) public isCapabilityPublic;\\n\\n mapping(address => mapping(bytes4 => bytes32)) public getRolesWithCapability;\\n\\n function doesUserHaveRole(address user, uint8 role) public view virtual returns (bool) {\\n return (uint256(getUserRoles[user]) >> role) & 1 != 0;\\n }\\n\\n function doesRoleHaveCapability(\\n uint8 role,\\n address target,\\n bytes4 functionSig\\n ) public view virtual returns (bool) {\\n return (uint256(getRolesWithCapability[target][functionSig]) >> role) & 1 != 0;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n AUTHORIZATION LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function canCall(\\n address user,\\n address target,\\n bytes4 functionSig\\n ) public view virtual override returns (bool) {\\n return\\n isCapabilityPublic[target][functionSig] ||\\n bytes32(0) != getUserRoles[user] & getRolesWithCapability[target][functionSig];\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ROLE CAPABILITY CONFIGURATION LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function setPublicCapability(\\n address target,\\n bytes4 functionSig,\\n bool enabled\\n ) public virtual requiresAuth {\\n isCapabilityPublic[target][functionSig] = enabled;\\n\\n emit PublicCapabilityUpdated(target, functionSig, enabled);\\n }\\n\\n function setRoleCapability(\\n uint8 role,\\n address target,\\n bytes4 functionSig,\\n bool enabled\\n ) public virtual requiresAuth {\\n if (enabled) {\\n getRolesWithCapability[target][functionSig] |= bytes32(1 << role);\\n } else {\\n getRolesWithCapability[target][functionSig] &= ~bytes32(1 << role);\\n }\\n\\n emit RoleCapabilityUpdated(role, target, functionSig, enabled);\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n USER ROLE ASSIGNMENT LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function setUserRole(\\n address user,\\n uint8 role,\\n bool enabled\\n ) public virtual requiresAuth {\\n if (enabled) {\\n getUserRoles[user] |= bytes32(1 << role);\\n } else {\\n getUserRoles[user] &= ~bytes32(1 << role);\\n }\\n\\n emit UserRoleUpdated(user, role, enabled);\\n }\\n}\\n\",\"keccak256\":\"0x278247a2c5b0accb60af8d3749e34ab5d4436ee4f35a8fff301aaa25ab690762\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061123a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80639d23c81211610097578063e30c397811610066578063e30c3978146101ee578063f2fde38b14610201578063fc4d33f914610214578063fc57d4df1461021c57600080fd5b80639d23c812146101a2578063aea91078146101b5578063ca4737ca146101c8578063d26b3e6e146101db57600080fd5b80636e96dfd7116100d35780636e96dfd71461016d578063715018a61461018057806380f96bd1146101885780638da5cb5b1461019157600080fd5b806301e169e4146100fa578063336eb6ae1461010f57806367e406d514610142575b600080fd5b61010d610108366004610e39565b61022f565b005b61012f61011d366004610efb565b60666020526000908152604090205481565b6040519081526020015b60405180910390f35b606954610155906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b61010d61017b366004610efb565b61032f565b61010d610399565b61012f60675481565b6033546001600160a01b0316610155565b606854610155906001600160a01b031681565b61012f6101c3366004610efb565b6103dc565b61010d6101d6366004610f1f565b6103ed565b61010d6101e9366004610f1f565b6104e4565b606554610155906001600160a01b031681565b61010d61020f366004610efb565b61062e565b61010d61069f565b61012f61022a366004610efb565b6107b3565b6102376108e7565b60008251118015610249575080518251145b6102c05760405162461bcd60e51b815260206004820152603860248201527f4c656e67746873206f6620626f746820617272617973206d757374206265206560448201527f7175616c20616e642067726561746572207468616e20302e000000000000000060648201526084015b60405180910390fd5b60005b825181101561032a5760008382815181106102e0576102e0610f61565b602002602001015190508282815181106102fc576102fc610f61565b6020908102919091018101516001600160a01b039092166000908152606690915260409020556001016102c3565b505050565b6103376108e7565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6103a16108e7565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064016102b7565b60006103e782610943565b92915050565b6033546001600160a01b03163314806104ac5760006104337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b90506001600160a01b0381163314806104a95760405162461bcd60e51b815260206004820152603260248201527f4f776e61626c653a2063616c6c6572206973206e65697468657220746865206f6044820152713bb732b9103737b9103a34329030b236b4b760711b60648201526084016102b7565b50505b50606791909155606880546001600160a01b039283166001600160a01b03199182161790915560698054939092169216919091179055565b600054610100900460ff16158080156105045750600054600160ff909116105b8061051e5750303b15801561051e575060005460ff166001145b6105815760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b7565b6000805460ff1916600117905580156105a4576000805461ff0019166101001790555b6105ad33610c63565b6067839055606880546001600160a01b038085166001600160a01b03199283161790925560698054928716929091169190911790558015610628576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6106366108e7565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b031633146106f15760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016102b7565b60006107056033546001600160a01b031690565b6065549091506001600160a01b031661071d81610c9e565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161038d565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108189190610f77565b9050600061082582610943565b90506000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190610f94565b60ff16905060128111156108be576108a4601282610fcd565b6108af90600a6110c4565b6108b990836110d0565b6108de565b6108c9816012610fcd565b6108d490600a6110c4565b6108de90836110f2565b95945050505050565b6033546001600160a01b031633146109415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b7565b565b6001600160a01b0381166000908152606660205260408120548082036109d15760405162461bcd60e51b815260206004820152603b60248201527f4e6f206f7261636c65207072696365206665656420666f756e6420666f72207460448201527f68697320756e6465726c79696e6720455243323020746f6b656e2e000000000060648201526084016102b7565b606754600003610b2b576068546040516315d5220f60e31b81526001600160a01b039091166004820152600090339063aea9107890602401602060405180830381865afa158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a9190611109565b90506000610a67826ec097ce7bc90715b34b9f10000000006110d0565b6069546040516396834ad360e01b8152600481018690529192506000916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610ab6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ada9190611122565b90506000816000015160070b1215610af3576000610b21565b80518290610b179067ffffffffffffffff166b204fce5e3e250261100000006110f2565b610b2191906110d0565b9695505050505050565b6069546067546040516396834ad360e01b815260048101919091526000916001600160a01b0316906396834ad390602401608060405180830381865afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190611122565b5167ffffffffffffffff16905080610bb9575060009392505050565b6069546040516396834ad360e01b8152600481018490526000916001600160a01b0316906396834ad390602401608060405180830381865afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611122565b5167ffffffffffffffff1690506fffffffffffffffffffffffffffffffff8216610c5982670de0b6b3a76400006110f2565b6108de91906110d0565b600054610100900460ff16610c8a5760405162461bcd60e51b81526004016102b7906111b9565b610c92610cf0565b610c9b81610c9e565b50565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610d175760405162461bcd60e51b81526004016102b7906111b9565b610941600054610100900460ff16610d415760405162461bcd60e51b81526004016102b7906111b9565b61094133610c9e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610d8957610d89610d4a565b604052919050565b600067ffffffffffffffff821115610dab57610dab610d4a565b5060051b60200190565b6001600160a01b0381168114610c9b57600080fd5b600082601f830112610ddb57600080fd5b81356020610df0610deb83610d91565b610d60565b8083825260208201915060208460051b870101935086841115610e1257600080fd5b602086015b84811015610e2e5780358352918301918301610e17565b509695505050505050565b60008060408385031215610e4c57600080fd5b823567ffffffffffffffff80821115610e6457600080fd5b818501915085601f830112610e7857600080fd5b81356020610e88610deb83610d91565b82815260059290921b84018101918181019089841115610ea757600080fd5b948201945b83861015610ece578535610ebf81610db5565b82529482019490820190610eac565b96505086013592505080821115610ee457600080fd5b50610ef185828601610dca565b9150509250929050565b600060208284031215610f0d57600080fd5b8135610f1881610db5565b9392505050565b600080600060608486031215610f3457600080fd5b8335610f3f81610db5565b9250602084013591506040840135610f5681610db5565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8957600080fd5b8151610f1881610db5565b600060208284031215610fa657600080fd5b815160ff81168114610f1857600080fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156103e7576103e7610fb7565b600181815b8085111561101b57816000190482111561100157611001610fb7565b8085161561100e57918102915b93841c9390800290610fe5565b509250929050565b600082611032575060016103e7565b8161103f575060006103e7565b8160018114611055576002811461105f5761107b565b60019150506103e7565b60ff84111561107057611070610fb7565b50506001821b6103e7565b5060208310610133831016604e8410600b841016171561109e575081810a6103e7565b6110a88383610fe0565b80600019048211156110bc576110bc610fb7565b029392505050565b6000610f188383611023565b6000826110ed57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103e7576103e7610fb7565b60006020828403121561111b57600080fd5b5051919050565b60006080828403121561113457600080fd5b6040516080810167ffffffffffffffff828210818311171561115857611158610d4a565b81604052845191508160070b821461116f57600080fd5b908252602084015190808216821461118657600080fd5b5060208201526040830151600381900b81146111a157600080fd5b60408201526060928301519281019290925250919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122080619e5eea511ef0cb0acdc761199b2b9dcb339a8de7601385f7fc6fcf2dfa5c64736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80639d23c81211610097578063e30c397811610066578063e30c3978146101ee578063f2fde38b14610201578063fc4d33f914610214578063fc57d4df1461021c57600080fd5b80639d23c812146101a2578063aea91078146101b5578063ca4737ca146101c8578063d26b3e6e146101db57600080fd5b80636e96dfd7116100d35780636e96dfd71461016d578063715018a61461018057806380f96bd1146101885780638da5cb5b1461019157600080fd5b806301e169e4146100fa578063336eb6ae1461010f57806367e406d514610142575b600080fd5b61010d610108366004610e39565b61022f565b005b61012f61011d366004610efb565b60666020526000908152604090205481565b6040519081526020015b60405180910390f35b606954610155906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b61010d61017b366004610efb565b61032f565b61010d610399565b61012f60675481565b6033546001600160a01b0316610155565b606854610155906001600160a01b031681565b61012f6101c3366004610efb565b6103dc565b61010d6101d6366004610f1f565b6103ed565b61010d6101e9366004610f1f565b6104e4565b606554610155906001600160a01b031681565b61010d61020f366004610efb565b61062e565b61010d61069f565b61012f61022a366004610efb565b6107b3565b6102376108e7565b60008251118015610249575080518251145b6102c05760405162461bcd60e51b815260206004820152603860248201527f4c656e67746873206f6620626f746820617272617973206d757374206265206560448201527f7175616c20616e642067726561746572207468616e20302e000000000000000060648201526084015b60405180910390fd5b60005b825181101561032a5760008382815181106102e0576102e0610f61565b602002602001015190508282815181106102fc576102fc610f61565b6020908102919091018101516001600160a01b039092166000908152606690915260409020556001016102c3565b505050565b6103376108e7565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6103a16108e7565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064016102b7565b60006103e782610943565b92915050565b6033546001600160a01b03163314806104ac5760006104337fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b031690565b90506001600160a01b0381163314806104a95760405162461bcd60e51b815260206004820152603260248201527f4f776e61626c653a2063616c6c6572206973206e65697468657220746865206f6044820152713bb732b9103737b9103a34329030b236b4b760711b60648201526084016102b7565b50505b50606791909155606880546001600160a01b039283166001600160a01b03199182161790915560698054939092169216919091179055565b600054610100900460ff16158080156105045750600054600160ff909116105b8061051e5750303b15801561051e575060005460ff166001145b6105815760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102b7565b6000805460ff1916600117905580156105a4576000805461ff0019166101001790555b6105ad33610c63565b6067839055606880546001600160a01b038085166001600160a01b03199283161790925560698054928716929091169190911790558015610628576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b6106366108e7565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b6065546001600160a01b031633146106f15760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016102b7565b60006107056033546001600160a01b031690565b6065549091506001600160a01b031661071d81610c9e565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161038d565b600080826001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108189190610f77565b9050600061082582610943565b90506000826001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190610f94565b60ff16905060128111156108be576108a4601282610fcd565b6108af90600a6110c4565b6108b990836110d0565b6108de565b6108c9816012610fcd565b6108d490600a6110c4565b6108de90836110f2565b95945050505050565b6033546001600160a01b031633146109415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102b7565b565b6001600160a01b0381166000908152606660205260408120548082036109d15760405162461bcd60e51b815260206004820152603b60248201527f4e6f206f7261636c65207072696365206665656420666f756e6420666f72207460448201527f68697320756e6465726c79696e6720455243323020746f6b656e2e000000000060648201526084016102b7565b606754600003610b2b576068546040516315d5220f60e31b81526001600160a01b039091166004820152600090339063aea9107890602401602060405180830381865afa158015610a26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4a9190611109565b90506000610a67826ec097ce7bc90715b34b9f10000000006110d0565b6069546040516396834ad360e01b8152600481018690529192506000916001600160a01b03909116906396834ad390602401608060405180830381865afa158015610ab6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ada9190611122565b90506000816000015160070b1215610af3576000610b21565b80518290610b179067ffffffffffffffff166b204fce5e3e250261100000006110f2565b610b2191906110d0565b9695505050505050565b6069546067546040516396834ad360e01b815260048101919091526000916001600160a01b0316906396834ad390602401608060405180830381865afa158015610b79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9d9190611122565b5167ffffffffffffffff16905080610bb9575060009392505050565b6069546040516396834ad360e01b8152600481018490526000916001600160a01b0316906396834ad390602401608060405180830381865afa158015610c03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c279190611122565b5167ffffffffffffffff1690506fffffffffffffffffffffffffffffffff8216610c5982670de0b6b3a76400006110f2565b6108de91906110d0565b600054610100900460ff16610c8a5760405162461bcd60e51b81526004016102b7906111b9565b610c92610cf0565b610c9b81610c9e565b50565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610d175760405162461bcd60e51b81526004016102b7906111b9565b610941600054610100900460ff16610d415760405162461bcd60e51b81526004016102b7906111b9565b61094133610c9e565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610d8957610d89610d4a565b604052919050565b600067ffffffffffffffff821115610dab57610dab610d4a565b5060051b60200190565b6001600160a01b0381168114610c9b57600080fd5b600082601f830112610ddb57600080fd5b81356020610df0610deb83610d91565b610d60565b8083825260208201915060208460051b870101935086841115610e1257600080fd5b602086015b84811015610e2e5780358352918301918301610e17565b509695505050505050565b60008060408385031215610e4c57600080fd5b823567ffffffffffffffff80821115610e6457600080fd5b818501915085601f830112610e7857600080fd5b81356020610e88610deb83610d91565b82815260059290921b84018101918181019089841115610ea757600080fd5b948201945b83861015610ece578535610ebf81610db5565b82529482019490820190610eac565b96505086013592505080821115610ee457600080fd5b50610ef185828601610dca565b9150509250929050565b600060208284031215610f0d57600080fd5b8135610f1881610db5565b9392505050565b600080600060608486031215610f3457600080fd5b8335610f3f81610db5565b9250602084013591506040840135610f5681610db5565b809150509250925092565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8957600080fd5b8151610f1881610db5565b600060208284031215610fa657600080fd5b815160ff81168114610f1857600080fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156103e7576103e7610fb7565b600181815b8085111561101b57816000190482111561100157611001610fb7565b8085161561100e57918102915b93841c9390800290610fe5565b509250929050565b600082611032575060016103e7565b8161103f575060006103e7565b8160018114611055576002811461105f5761107b565b60019150506103e7565b60ff84111561107057611070610fb7565b50506001821b6103e7565b5060208310610133831016604e8410600b841016171561109e575081810a6103e7565b6110a88383610fe0565b80600019048211156110bc576110bc610fb7565b029392505050565b6000610f188383611023565b6000826110ed57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176103e7576103e7610fb7565b60006020828403121561111b57600080fd5b5051919050565b60006080828403121561113457600080fd5b6040516080810167ffffffffffffffff828210818311171561115857611158610d4a565b81604052845191508160070b821461116f57600080fd5b908252602084015190808216821461118657600080fd5b5060208201526040830151600381900b81146111a157600080fd5b60408201526060928301519281019290925250919050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea264697066735822122080619e5eea511ef0cb0acdc761199b2b9dcb339a8de7601385f7fc6fcf2dfa5c64736f6c63430008160033", + "devdoc": { + "author": "Rahul Sethuram (https://github.com/rhlsthrm)", + "details": "Implements `PriceOracle`.", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "_acceptOwner()": { + "details": "Owner function for pending owner to accept role and update owner" + }, + "_setPendingOwner(address)": { + "details": "Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.", + "params": { + "newPendingOwner": "New pending owner." + } + }, + "getUnderlyingPrice(address)": { + "details": "Implements the `PriceOracle` interface for Ionic pools (and Compound v2).", + "returns": { + "_0": "Price in ETH of the token underlying `cToken`, scaled by `10 ** (36 - underlyingDecimals)`." + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "price(address)": { + "details": "Returns the price in ETH of `underlying` (implements `BasePriceOracle`)." + }, + "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[],bytes32[])": { + "details": "Admin-only function to set price feeds.", + "params": { + "feedIds": "The Pyth Network feed IDs`.", + "underlyings": "Underlying token addresses for which to set price feeds." + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "stateVariables": { + "PYTH": { + "details": "Constructor to set admin and canAdminOverwrite, wtoken address and native token USD price feed address" + } + }, + "title": "PythPriceOracle", + "version": 1 + }, + "userdoc": { + "events": { + "NewOwner(address,address)": { + "notice": "Emitted when pendingOwner is accepted, which means owner is updated" + }, + "NewPendingOwner(address,address)": { + "notice": "Emitted when pendingOwner is changed" + } + }, + "kind": "user", + "methods": { + "NATIVE_TOKEN_USD_FEED()": { + "notice": "DIA NATIVE/USD price feed contracts." + }, + "USD_TOKEN()": { + "notice": "MasterPriceOracle for backup for USD price." + }, + "_acceptOwner()": { + "notice": "Accepts transfer of owner rights. msg.sender must be pendingOwner" + }, + "_setPendingOwner(address)": { + "notice": "Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer." + }, + "getUnderlyingPrice(address)": { + "notice": "Returns the price in ETH of the token underlying `cToken`." + }, + "pendingOwner()": { + "notice": "Pending owner of this contract" + }, + "priceFeedIds(address)": { + "notice": "Maps ERC20 token addresses to Pyth price IDs." + } + }, + "notice": "Returns prices from Pyth.", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 176201, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 176204, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 178552, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 175825, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 175945, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 47957, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 79738, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "priceFeedIds", + "offset": 0, + "slot": "102", + "type": "t_mapping(t_address,t_bytes32)" + }, + { + "astId": 79741, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "NATIVE_TOKEN_USD_FEED", + "offset": 0, + "slot": "103", + "type": "t_bytes32" + }, + { + "astId": 79744, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "USD_TOKEN", + "offset": 0, + "slot": "104", + "type": "t_address" + }, + { + "astId": 79748, + "contract": "contracts/oracles/default/PythPriceOracle.sol:PythPriceOracle", + "label": "PYTH", + "offset": 0, + "slot": "105", + "type": "t_contract(IPyth)4921" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IPyth)4921": { + "encoding": "inplace", + "label": "contract IPyth", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bytes32)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/base/PythPriceOracle_Proxy.json b/packages/contracts/deployments/base/PythPriceOracle_Proxy.json new file mode 100644 index 0000000000..cdc8548a02 --- /dev/null +++ b/packages/contracts/deployments/base/PythPriceOracle_Proxy.json @@ -0,0 +1,275 @@ +{ + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "transactionIndex": 113, + "gasUsed": "840424", + "logsBloom": "0x00000000000000008000000000000000400000000000000000800000000200000000000000000000000000000000000000020000100000000020000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000100000000000800000000800000100000000000000000400000000000000000000000000000000000000000000080000000000000c00000000000000000000000000000000400000000000000000000000000000000000000000020000000000000008000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90", + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "logs": [ + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000017a4df7081f1cd1370c70efecaffa11b5bf217b2" + ], + "data": "0x", + "logIndex": 393, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 394, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 395, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 396, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + }, + { + "transactionIndex": 113, + "blockNumber": 21219863, + "transactionHash": "0x61c72cd9a117244e13f5881c3aa0c1a2f04f4cf31345bf154338e60a5eefcfb4", + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c21db52cca974df3dc019c92e52e522ce57156", + "logIndex": 397, + "blockHash": "0xf663c1583cacc105b8b23ff7e5316121e1cdbdc5d593a0068917ba803d272f90" + } + ], + "blockNumber": 21219863, + "cumulativeGasUsed": "28257351", + "status": 1, + "byzantium": true + }, + "args": [ + "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2", + "0x04C21Db52CcA974dF3Dc019C92E52e522ce57156", + "0xd26b3e6e0000000000000000000000008250f4af4b972684f7b336503e2d6dfedeb1487aff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/mode/IonicFlywheelDynamicRewards_ION_epoch4.json b/packages/contracts/deployments/mode/IonicFlywheelDynamicRewards_ION_epoch4.json new file mode 100644 index 0000000000..201ade52ea --- /dev/null +++ b/packages/contracts/deployments/mode/IonicFlywheelDynamicRewards_ION_epoch4.json @@ -0,0 +1,289 @@ +{ + "address": "0xBFAE7571C47A1D42BcEAd3D57d116Ca69495d989", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "_flywheel", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_cycleLength", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FlywheelError", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "name": "NewRewardsCycle", + "type": "event" + }, + { + "inputs": [], + "name": "flywheel", + "outputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "name": "getAccruedRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "name": "rewardsCycle", + "outputs": [ + { + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardsCycleLength", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xe5c424e87d7459ef6927f9139a58cb006be3a64424d0ab120b2d47c0d30ca590", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xBFAE7571C47A1D42BcEAd3D57d116Ca69495d989", + "transactionIndex": 2, + "gasUsed": "546655", + "logsBloom": "0x00000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000004000000000000000000000000000004000800000000000000020000000000000000000000000000000000004000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000010000002000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4857239cf7b3dc6a4466c4018e3869092445fe8056cc81ff0d59158858a16efb", + "transactionHash": "0xe5c424e87d7459ef6927f9139a58cb006be3a64424d0ab120b2d47c0d30ca590", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 14540737, + "transactionHash": "0xe5c424e87d7459ef6927f9139a58cb006be3a64424d0ab120b2d47c0d30ca590", + "address": "0x18470019bF0E94611f15852F7e93cf5D65BC34CA", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bfae7571c47a1d42bcead3d57d116ca69495d989", + "0x0000000000000000000000006afcca37cc93db6bed729d20adf203290d465df5" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "logIndex": 3, + "blockHash": "0x4857239cf7b3dc6a4466c4018e3869092445fe8056cc81ff0d59158858a16efb" + } + ], + "blockNumber": 14540737, + "cumulativeGasUsed": "733732", + "status": 1, + "byzantium": true + }, + "args": [ + "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + 2588400 + ], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"_flywheel\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_cycleLength\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FlywheelError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"name\":\"NewRewardsCycle\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"flywheel\",\"outputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"name\":\"getAccruedRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"rewardsCycle\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardsCycleLength\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAccruedRewards(address,uint32)\":{\"params\":{\"strategy\":\"the strategy to accrue rewards for\"},\"returns\":{\"amount\":\"the amount of tokens accrued and transferred\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"FlywheelError()\":[{\"notice\":\"thrown when caller is not the flywheel\"}]},\"kind\":\"user\",\"methods\":{\"flywheel()\":{\"notice\":\"the flywheel core contract\"},\"getAccruedRewards(address,uint32)\":{\"notice\":\"calculate and transfer accrued rewards to flywheel core\"},\"rewardToken()\":{\"notice\":\"the reward token paid\"},\"rewardsCycleLength()\":{\"notice\":\"the length of a rewards cycle\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":\"IonicFlywheelDynamicRewards\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/BaseFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {IFlywheelRewards} from \\\"./IFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/** \\n @title Flywheel Reward Module\\n @notice Determines how many rewards accrue to each strategy globally over a given time period.\\n @dev approves the flywheel core for the reward token to allow balances to be managed by the module but claimed from core.\\n*/\\nabstract contract BaseFlywheelRewards is IFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n\\n /// @notice thrown when caller is not the flywheel\\n error FlywheelError();\\n\\n /// @notice the reward token paid\\n ERC20 public immutable override rewardToken;\\n\\n /// @notice the flywheel core contract\\n IonicFlywheelCore public immutable override flywheel;\\n\\n constructor(IonicFlywheelCore _flywheel) {\\n flywheel = _flywheel;\\n ERC20 _rewardToken = _flywheel.rewardToken();\\n rewardToken = _rewardToken;\\n\\n _rewardToken.safeApprove(address(_flywheel), type(uint256).max);\\n }\\n\\n modifier onlyFlywheel() {\\n if (msg.sender != address(flywheel)) revert FlywheelError();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xc5785aacb20e6bc503ccf9ce4b1fdf7e13e48a3abd32b19b16e30accc3f75d47\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {BaseFlywheelRewards} from \\\"./BaseFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {SafeCastLib} from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\n/** \\n @title Flywheel Dynamic Reward Stream\\n @notice Determines rewards based on a dynamic reward stream.\\n Rewards are transferred linearly over a \\\"rewards cycle\\\" to prevent gaming the reward distribution. \\n The reward source can be arbitrary logic, but most common is to \\\"pass through\\\" rewards from some other source.\\n The getNextCycleRewards() hook should also transfer the next cycle's rewards to this contract to ensure proper accounting.\\n*/\\nabstract contract FlywheelDynamicRewards is BaseFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n event NewRewardsCycle(uint32 indexed start, uint32 indexed end, uint192 reward);\\n\\n /// @notice the length of a rewards cycle\\n uint32 public immutable rewardsCycleLength;\\n\\n struct RewardsCycle {\\n uint32 start;\\n uint32 end;\\n uint192 reward;\\n }\\n\\n mapping(ERC20 => RewardsCycle) public rewardsCycle;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _rewardsCycleLength) BaseFlywheelRewards(_flywheel) {\\n rewardsCycleLength = _rewardsCycleLength;\\n }\\n\\n /**\\n @notice calculate and transfer accrued rewards to flywheel core\\n @param strategy the strategy to accrue rewards for\\n @return amount the amount of tokens accrued and transferred\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp)\\n external\\n override\\n onlyFlywheel\\n returns (uint256 amount)\\n {\\n RewardsCycle memory cycle = rewardsCycle[strategy];\\n\\n uint32 timestamp = block.timestamp.safeCastTo32();\\n\\n uint32 latest = timestamp >= cycle.end ? cycle.end : timestamp;\\n uint32 earliest = lastUpdatedTimestamp <= cycle.start ? cycle.start : lastUpdatedTimestamp;\\n if (cycle.end != 0) {\\n amount = (cycle.reward * (latest - earliest)) / (cycle.end - cycle.start);\\n assert(amount <= cycle.reward); // should never happen because latest <= cycle.end and earliest >= cycle.start\\n }\\n // if cycle has ended, reset cycle and transfer all available\\n if (timestamp >= cycle.end) {\\n uint32 end = ((timestamp + rewardsCycleLength) / rewardsCycleLength) * rewardsCycleLength;\\n uint192 rewards = getNextCycleRewards(strategy);\\n\\n // reset for next cycle\\n rewardsCycle[strategy] = RewardsCycle({start: timestamp, end: end, reward: rewards});\\n\\n emit NewRewardsCycle(timestamp, end, rewards);\\n }\\n }\\n\\n function getNextCycleRewards(ERC20 strategy) internal virtual returns (uint192);\\n}\",\"keccak256\":\"0x92b66dae28b01126410418d50eb0a87c141f903aaaf4c1b5cf391b7896230f4b\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { FlywheelDynamicRewards } from \\\"./FlywheelDynamicRewards.sol\\\";\\nimport { IonicFlywheelCore } from \\\"../IonicFlywheelCore.sol\\\";\\nimport { SafeTransferLib, ERC20 } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\n\\ncontract IonicFlywheelDynamicRewards is FlywheelDynamicRewards {\\n using SafeTransferLib for ERC20;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _cycleLength)\\n FlywheelDynamicRewards(_flywheel, _cycleLength)\\n {}\\n\\n function getNextCycleRewards(ERC20 strategy)\\n internal\\n override\\n returns (uint192)\\n {\\n uint256 rewardAmount = rewardToken.balanceOf(address(strategy));\\n if (rewardAmount != 0) {\\n rewardToken.safeTransferFrom(\\n address(strategy),\\n address(this),\\n rewardAmount\\n );\\n }\\n return uint192(rewardAmount);\\n }\\n}\\n\",\"keccak256\":\"0x00e550d3170b3849c61482719b6ce86178b5027ceab18751c662aeb703b7d29c\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60e060405234801561001057600080fd5b50604051610a2a380380610a2a83398101604081905261002f9161017c565b818181806001600160a01b031660a0816001600160a01b0316815250506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561008c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b091906101bf565b6001600160a01b03811660808190529091506100cf90836000196100e3565b505063ffffffff1660c052506101e3915050565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061015e5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b604482015260640160405180910390fd5b50505050565b6001600160a01b038116811461017957600080fd5b50565b6000806040838503121561018f57600080fd5b825161019a81610164565b602084015190925063ffffffff811681146101b457600080fd5b809150509250929050565b6000602082840312156101d157600080fd5b81516101dc81610164565b9392505050565b60805160a05160c0516107fe61022c600039600081816061015261032001526000818160a201526101a2015260008181610102015281816104db015261055b01526107fe6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "devdoc": { + "kind": "dev", + "methods": { + "getAccruedRewards(address,uint32)": { + "params": { + "strategy": "the strategy to accrue rewards for" + }, + "returns": { + "amount": "the amount of tokens accrued and transferred" + } + } + }, + "version": 1 + }, + "userdoc": { + "errors": { + "FlywheelError()": [ + { + "notice": "thrown when caller is not the flywheel" + } + ] + }, + "kind": "user", + "methods": { + "flywheel()": { + "notice": "the flywheel core contract" + }, + "getAccruedRewards(address,uint32)": { + "notice": "calculate and transfer accrued rewards to flywheel core" + }, + "rewardToken()": { + "notice": "the reward token paid" + }, + "rewardsCycleLength()": { + "notice": "the length of a rewards cycle" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 58045, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "rewardsCycle", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)" + } + ], + "types": { + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct FlywheelDynamicRewards.RewardsCycle)", + "numberOfBytes": "32", + "value": "t_struct(RewardsCycle)58039_storage" + }, + "t_struct(RewardsCycle)58039_storage": { + "encoding": "inplace", + "label": "struct FlywheelDynamicRewards.RewardsCycle", + "members": [ + { + "astId": 58034, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "start", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58036, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "end", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58038, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "reward", + "offset": 8, + "slot": "0", + "type": "t_uint192" + } + ], + "numberOfBytes": "32" + }, + "t_uint192": { + "encoding": "inplace", + "label": "uint192", + "numberOfBytes": "24" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4.json b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4.json new file mode 100644 index 0000000000..ef44128db2 --- /dev/null +++ b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4.json @@ -0,0 +1,1016 @@ +{ + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "transactionIndex": 1, + "gasUsed": "846759", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000200000000000000000000000000000000000000000000100000000000000000000000000000000000000000200000000002000001000000000000000000000000000000000000020000400000000000000800000000800000000000000000000000400000000000000000001000000000000000000000000080000000000001c00000000000000000000000000000000400000000000000000000000000000000000000000420000000000000000000040000000000000402000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9", + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000092ce3434f254161178a4b4a786c7be559b752497" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af9cc7599defd86226e0f3a6810c4976e4a10f83", + "logIndex": 5, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + } + ], + "blockNumber": 14540734, + "cumulativeGasUsed": "890622", + "status": 1, + "byzantium": true + }, + "args": [ + "0x92ce3434F254161178A4b4a786C7Be559b752497", + "0xaF9cc7599DEFd86226e0f3A6810c4976E4a10f83", + "0xf8c8765e00000000000000000000000018470019bf0e94611f15852f7e93cf5d65bc34ca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [ + "0x18470019bf0e94611f15852f7e93cf5d65bc34ca", + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + "0x1155b614971f16758C92c4890eD338C9e3ede6b7" + ] + }, + "implementation": "0x92ce3434F254161178A4b4a786C7Be559b752497", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Implementation.json b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Implementation.json new file mode 100644 index 0000000000..2b89556a6b --- /dev/null +++ b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Implementation.json @@ -0,0 +1,1160 @@ +{ + "address": "0x92ce3434F254161178A4b4a786C7Be559b752497", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x631869605ea1c9347aaf3fbfc505c5d654e4747e50b9980a8127ab4744e5b764", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x92ce3434F254161178A4b4a786C7Be559b752497", + "transactionIndex": 3, + "gasUsed": "1560163", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001080000000000000000800000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x1ad3bde18656ea4c5c2231cd70bfef468917a0a2bb0b288455d14af56f0c0fc7", + "transactionHash": "0x631869605ea1c9347aaf3fbfc505c5d654e4747e50b9980a8127ab4744e5b764", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 14540729, + "transactionHash": "0x631869605ea1c9347aaf3fbfc505c5d654e4747e50b9980a8127ab4744e5b764", + "address": "0x92ce3434F254161178A4b4a786C7Be559b752497", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 17, + "blockHash": "0x1ad3bde18656ea4c5c2231cd70bfef468917a0a2bb0b288455d14af56f0c0fc7" + } + ], + "blockNumber": 14540729, + "cumulativeGasUsed": "2022872", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsDelta\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsIndex\",\"type\":\"uint256\"}],\"name\":\"AccrueRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newStrategy\",\"type\":\"address\"}],\"name\":\"AddStrategy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ClaimRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"FlywheelBoosterUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"FlywheelRewardsUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPendingOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"NewPendingOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeRecipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeRecipient\",\"type\":\"address\"}],\"name\":\"UpdatedFeeSettings\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_acceptOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"_setPendingOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"secondUser\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addMarketForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addStrategyForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"allStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"claimRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"compAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeRecipient\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelBooster\",\"outputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"}],\"name\":\"flywheelPreBorrowerAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"supplier\",\"type\":\"address\"}],\"name\":\"flywheelPreSupplierAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"flywheelPreTransferAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelRewards\",\"outputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_rewardToken\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"_flywheelRewards\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"_flywheelBooster\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isFlywheel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRewardsDistributor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"marketState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"performanceFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"rewardsAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"setBooster\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"setFlywheelRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"strategyState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"index\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_performanceFee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_feeRecipient\",\"type\":\"address\"}],\"name\":\"updateFeeSettings\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"userIndex\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"params\":{\"rewardsDelta\":\"how many new rewards accrued to the user\",\"rewardsIndex\":\"the market index for rewards per token accrued\",\"strategy\":\"the updated rewards strategy\",\"user\":\"the user of the rewards\"}},\"AddStrategy(address)\":{\"params\":{\"newStrategy\":\"the new added strategy\"}},\"ClaimRewards(address,uint256)\":{\"params\":{\"amount\":\"the amount of rewards claimed\",\"user\":\"the user of the rewards\"}},\"FlywheelBoosterUpdate(address)\":{\"params\":{\"newBooster\":\"the new booster module\"}},\"FlywheelRewardsUpdate(address)\":{\"params\":{\"newFlywheelRewards\":\"the new rewards module\"}},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"_acceptOwner()\":{\"details\":\"Owner function for pending owner to accept role and update owner\"},\"_setPendingOwner(address)\":{\"details\":\"Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\",\"params\":{\"newPendingOwner\":\"New pending owner.\"}},\"accrue(address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to user (including prior)\"}},\"accrue(address,address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the second user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to the first user (including prior)\",\"_1\":\"the cumulative amount of rewards accrued to the second user (including prior)\"}},\"claimRewards(address)\":{\"details\":\"this function is public, and all rewards transfer to the user\",\"params\":{\"user\":\"the user claiming rewards\"}},\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateFeeSettings(uint256,address)\":{\"details\":\"Claim rewards first from the previous feeRecipient before changing it\"}},\"version\":1},\"userdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"notice\":\"Emitted when a user's rewards accrue to a given strategy.\"},\"AddStrategy(address)\":{\"notice\":\"Emitted when a new strategy is added to flywheel by the admin\"},\"ClaimRewards(address,uint256)\":{\"notice\":\"Emitted when a user claims accrued rewards.\"},\"FlywheelBoosterUpdate(address)\":{\"notice\":\"Emitted when the booster module changes\"},\"FlywheelRewardsUpdate(address)\":{\"notice\":\"Emitted when the rewards module changes\"},\"NewOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is accepted, which means owner is updated\"},\"NewPendingOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is changed\"}},\"kind\":\"user\",\"methods\":{\"_acceptOwner()\":{\"notice\":\"Accepts transfer of owner rights. msg.sender must be pendingOwner\"},\"_setPendingOwner(address)\":{\"notice\":\"Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\"},\"accrue(address,address)\":{\"notice\":\"accrue rewards for a single user on a strategy\"},\"accrue(address,address,address)\":{\"notice\":\"accrue rewards for a two users on a strategy\"},\"addStrategyForRewards(address)\":{\"notice\":\"initialize a new strategy\"},\"allStrategies(uint256)\":{\"notice\":\"append-only list of strategies added\"},\"claimRewards(address)\":{\"notice\":\"claim rewards for a given user\"},\"feeRecipient()\":{\"notice\":\"Address that gets rewardsToken accrued by performanceFee\"},\"flywheelBooster()\":{\"notice\":\"optional booster module for calculating virtual balances on strategies\"},\"flywheelRewards()\":{\"notice\":\"the rewards contract for managing streams\"},\"pendingOwner()\":{\"notice\":\"Pending owner of this contract\"},\"performanceFee()\":{\"notice\":\"How much rewardsToken will be send to treasury\"},\"rewardToken()\":{\"notice\":\"The token to reward\"},\"setBooster(address)\":{\"notice\":\"swap out the flywheel booster contract\"},\"setFlywheelRewards(address)\":{\"notice\":\"swap out the flywheel rewards contract\"},\"updateFeeSettings(uint256,address)\":{\"notice\":\"Update performanceFee and/or feeRecipient\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":\"IonicFlywheel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IIonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\n\\ninterface IIonicFlywheel {\\n function isRewardsDistributor() external returns (bool);\\n\\n function isFlywheel() external returns (bool);\\n\\n function flywheelPreSupplierAction(address market, address supplier) external;\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external;\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external;\\n\\n function compAccrued(address user) external view returns (uint256);\\n\\n function addMarketForRewards(ERC20 strategy) external;\\n\\n function marketState(ERC20 strategy) external view returns (uint224 index, uint32 lastUpdatedTimestamp);\\n}\\n\",\"keccak256\":\"0xb24009cac18b0f9b6d12884169ab4461ec04027110a768091077dc5c648e934c\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { IonicFlywheelCore } from \\\"./IonicFlywheelCore.sol\\\";\\nimport \\\"./IIonicFlywheel.sol\\\";\\n\\ncontract IonicFlywheel is IonicFlywheelCore, IIonicFlywheel {\\n bool public constant isRewardsDistributor = true;\\n bool public constant isFlywheel = true;\\n\\n function flywheelPreSupplierAction(address market, address supplier) external {\\n accrue(ERC20(market), supplier);\\n }\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external {}\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external {\\n accrue(ERC20(market), src, dst);\\n }\\n\\n function compAccrued(address user) external view returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function addMarketForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n // TODO remove\\n function marketState(ERC20 strategy) external view returns (uint224, uint32) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0x60d8d5a8feaa7c0373d24d6fbca523eb86ba251f5374a8821a6aee63cdc90e0d\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100dc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ac4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "devdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "params": { + "rewardsDelta": "how many new rewards accrued to the user", + "rewardsIndex": "the market index for rewards per token accrued", + "strategy": "the updated rewards strategy", + "user": "the user of the rewards" + } + }, + "AddStrategy(address)": { + "params": { + "newStrategy": "the new added strategy" + } + }, + "ClaimRewards(address,uint256)": { + "params": { + "amount": "the amount of rewards claimed", + "user": "the user of the rewards" + } + }, + "FlywheelBoosterUpdate(address)": { + "params": { + "newBooster": "the new booster module" + } + }, + "FlywheelRewardsUpdate(address)": { + "params": { + "newFlywheelRewards": "the new rewards module" + } + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "_acceptOwner()": { + "details": "Owner function for pending owner to accept role and update owner" + }, + "_setPendingOwner(address)": { + "details": "Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.", + "params": { + "newPendingOwner": "New pending owner." + } + }, + "accrue(address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to user (including prior)" + } + }, + "accrue(address,address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the second user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to the first user (including prior)", + "_1": "the cumulative amount of rewards accrued to the second user (including prior)" + } + }, + "claimRewards(address)": { + "details": "this function is public, and all rewards transfer to the user", + "params": { + "user": "the user claiming rewards" + } + }, + "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." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateFeeSettings(uint256,address)": { + "details": "Claim rewards first from the previous feeRecipient before changing it" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "notice": "Emitted when a user's rewards accrue to a given strategy." + }, + "AddStrategy(address)": { + "notice": "Emitted when a new strategy is added to flywheel by the admin" + }, + "ClaimRewards(address,uint256)": { + "notice": "Emitted when a user claims accrued rewards." + }, + "FlywheelBoosterUpdate(address)": { + "notice": "Emitted when the booster module changes" + }, + "FlywheelRewardsUpdate(address)": { + "notice": "Emitted when the rewards module changes" + }, + "NewOwner(address,address)": { + "notice": "Emitted when pendingOwner is accepted, which means owner is updated" + }, + "NewPendingOwner(address,address)": { + "notice": "Emitted when pendingOwner is changed" + } + }, + "kind": "user", + "methods": { + "_acceptOwner()": { + "notice": "Accepts transfer of owner rights. msg.sender must be pendingOwner" + }, + "_setPendingOwner(address)": { + "notice": "Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer." + }, + "accrue(address,address)": { + "notice": "accrue rewards for a single user on a strategy" + }, + "accrue(address,address,address)": { + "notice": "accrue rewards for a two users on a strategy" + }, + "addStrategyForRewards(address)": { + "notice": "initialize a new strategy" + }, + "allStrategies(uint256)": { + "notice": "append-only list of strategies added" + }, + "claimRewards(address)": { + "notice": "claim rewards for a given user" + }, + "feeRecipient()": { + "notice": "Address that gets rewardsToken accrued by performanceFee" + }, + "flywheelBooster()": { + "notice": "optional booster module for calculating virtual balances on strategies" + }, + "flywheelRewards()": { + "notice": "the rewards contract for managing streams" + }, + "pendingOwner()": { + "notice": "Pending owner of this contract" + }, + "performanceFee()": { + "notice": "How much rewardsToken will be send to treasury" + }, + "rewardToken()": { + "notice": "The token to reward" + }, + "setBooster(address)": { + "notice": "swap out the flywheel booster contract" + }, + "setFlywheelRewards(address)": { + "notice": "swap out the flywheel rewards contract" + }, + "updateFeeSettings(uint256,address)": { + "notice": "Update performanceFee and/or feeRecipient" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 176201, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 176204, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 178552, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 175825, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 175945, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 47957, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 54736, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "performanceFee", + "offset": 0, + "slot": "102", + "type": "t_uint256" + }, + { + "astId": 54739, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "feeRecipient", + "offset": 0, + "slot": "103", + "type": "t_address" + }, + { + "astId": 54743, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "rewardToken", + "offset": 0, + "slot": "104", + "type": "t_contract(ERC20)180913" + }, + { + "astId": 54748, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "allStrategies", + "offset": 0, + "slot": "105", + "type": "t_array(t_contract(ERC20)180913)dyn_storage" + }, + { + "astId": 54752, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelRewards", + "offset": 0, + "slot": "106", + "type": "t_contract(IFlywheelRewards)58375" + }, + { + "astId": 54756, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelBooster", + "offset": 0, + "slot": "107", + "type": "t_contract(IFlywheelBooster)54379" + }, + { + "astId": 54761, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_rewardsAccrued", + "offset": 0, + "slot": "108", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 54768, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_strategyState", + "offset": 0, + "slot": "109", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)" + }, + { + "astId": 54776, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_userIndex", + "offset": 0, + "slot": "110", + "type": "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(ERC20)180913)dyn_storage": { + "base": "t_contract(ERC20)180913", + "encoding": "dynamic_array", + "label": "contract ERC20[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelBooster)54379": { + "encoding": "inplace", + "label": "contract IFlywheelBooster", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelRewards)58375": { + "encoding": "inplace", + "label": "contract IFlywheelRewards", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint224)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint224)", + "numberOfBytes": "32", + "value": "t_uint224" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => mapping(address => uint224))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint224)" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct IonicFlywheelCore.RewardsState)", + "numberOfBytes": "32", + "value": "t_struct(RewardsState)55244_storage" + }, + "t_struct(RewardsState)55244_storage": { + "encoding": "inplace", + "label": "struct IonicFlywheelCore.RewardsState", + "members": [ + { + "astId": 55240, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "index", + "offset": 0, + "slot": "0", + "type": "t_uint224" + }, + { + "astId": 55243, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "lastUpdatedTimestamp", + "offset": 28, + "slot": "0", + "type": "t_uint32" + } + ], + "numberOfBytes": "32" + }, + "t_uint224": { + "encoding": "inplace", + "label": "uint224", + "numberOfBytes": "28" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Proxy.json b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Proxy.json new file mode 100644 index 0000000000..3bb5a9c5fd --- /dev/null +++ b/packages/contracts/deployments/mode/IonicFlywheel_ION_epoch4_Proxy.json @@ -0,0 +1,289 @@ +{ + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "transactionIndex": 1, + "gasUsed": "846759", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000200000000000000000000000000000000000000000000100000000000000000000000000000000000000000200000000002000001000000000000000000000000000000000000020000400000000000000800000000800000000000000000000000400000000000000000001000000000000000000000000080000000000001c00000000000000000000000000000000400000000000000000000000000000000000000000420000000000000000000040000000000000402000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9", + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x00000000000000000000000092ce3434f254161178a4b4a786c7be559b752497" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + }, + { + "transactionIndex": 1, + "blockNumber": 14540734, + "transactionHash": "0x033f62d330ecb77e7fca66aad259c9ee4015ade8060f017f8f359cd021544380", + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af9cc7599defd86226e0f3a6810c4976e4a10f83", + "logIndex": 5, + "blockHash": "0x84db07a7659555b7d54a487a08a94d62e6be48d565a754320ddc84cfa9da83a9" + } + ], + "blockNumber": 14540734, + "cumulativeGasUsed": "890622", + "status": 1, + "byzantium": true + }, + "args": [ + "0x92ce3434F254161178A4b4a786C7Be559b752497", + "0xaF9cc7599DEFd86226e0f3A6810c4976E4a10f83", + "0xf8c8765e00000000000000000000000018470019bf0e94611f15852f7e93cf5d65bc34ca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/optimism/IonicFlywheelDynamicRewards_ION_epoch4.json b/packages/contracts/deployments/optimism/IonicFlywheelDynamicRewards_ION_epoch4.json new file mode 100644 index 0000000000..9c48c7db6f --- /dev/null +++ b/packages/contracts/deployments/optimism/IonicFlywheelDynamicRewards_ION_epoch4.json @@ -0,0 +1,289 @@ +{ + "address": "0xAE8D590B31c3De396B8B97a27A2039Bbd1fc2B35", + "abi": [ + { + "inputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "_flywheel", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_cycleLength", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "FlywheelError", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "name": "NewRewardsCycle", + "type": "event" + }, + { + "inputs": [], + "name": "flywheel", + "outputs": [ + { + "internalType": "contract IonicFlywheelCore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "name": "getAccruedRewards", + "outputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "name": "rewardsCycle", + "outputs": [ + { + "internalType": "uint32", + "name": "start", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "end", + "type": "uint32" + }, + { + "internalType": "uint192", + "name": "reward", + "type": "uint192" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewardsCycleLength", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xddba45032ef93bae6c6290f4d86bc430a493801f4b644698c362f8626e9322d2", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xAE8D590B31c3De396B8B97a27A2039Bbd1fc2B35", + "transactionIndex": 4, + "gasUsed": "546655", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000200004000000000000010000000000000000000000000000000000000020000000000000000400000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000008000000000000000020000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000200000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6a204b90175e730851edff551e1bba272c0e2e72fdb845709c77456d59a5023a", + "transactionHash": "0xddba45032ef93bae6c6290f4d86bc430a493801f4b644698c362f8626e9322d2", + "logs": [ + { + "transactionIndex": 4, + "blockNumber": 126874622, + "transactionHash": "0xddba45032ef93bae6c6290f4d86bc430a493801f4b644698c362f8626e9322d2", + "address": "0x887d1c6A4f3548279c2a8A9D0FA61B5D458d14fC", + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000ae8d590b31c3de396b8b97a27a2039bbd1fc2b35", + "0x0000000000000000000000006671afe7c3abd9db195b3e58d348166c21405b88" + ], + "data": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "logIndex": 7, + "blockHash": "0x6a204b90175e730851edff551e1bba272c0e2e72fdb845709c77456d59a5023a" + } + ], + "blockNumber": 126874622, + "cumulativeGasUsed": "911962", + "status": 1, + "byzantium": true + }, + "args": [ + "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + 2588400 + ], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"_flywheel\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_cycleLength\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FlywheelError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"name\":\"NewRewardsCycle\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"flywheel\",\"outputs\":[{\"internalType\":\"contract IonicFlywheelCore\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"name\":\"getAccruedRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"rewardsCycle\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"start\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"end\",\"type\":\"uint32\"},{\"internalType\":\"uint192\",\"name\":\"reward\",\"type\":\"uint192\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardsCycleLength\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getAccruedRewards(address,uint32)\":{\"params\":{\"strategy\":\"the strategy to accrue rewards for\"},\"returns\":{\"amount\":\"the amount of tokens accrued and transferred\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"FlywheelError()\":[{\"notice\":\"thrown when caller is not the flywheel\"}]},\"kind\":\"user\",\"methods\":{\"flywheel()\":{\"notice\":\"the flywheel core contract\"},\"getAccruedRewards(address,uint32)\":{\"notice\":\"calculate and transfer accrued rewards to flywheel core\"},\"rewardToken()\":{\"notice\":\"the reward token paid\"},\"rewardsCycleLength()\":{\"notice\":\"the length of a rewards cycle\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":\"IonicFlywheelDynamicRewards\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/BaseFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {IFlywheelRewards} from \\\"./IFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/** \\n @title Flywheel Reward Module\\n @notice Determines how many rewards accrue to each strategy globally over a given time period.\\n @dev approves the flywheel core for the reward token to allow balances to be managed by the module but claimed from core.\\n*/\\nabstract contract BaseFlywheelRewards is IFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n\\n /// @notice thrown when caller is not the flywheel\\n error FlywheelError();\\n\\n /// @notice the reward token paid\\n ERC20 public immutable override rewardToken;\\n\\n /// @notice the flywheel core contract\\n IonicFlywheelCore public immutable override flywheel;\\n\\n constructor(IonicFlywheelCore _flywheel) {\\n flywheel = _flywheel;\\n ERC20 _rewardToken = _flywheel.rewardToken();\\n rewardToken = _rewardToken;\\n\\n _rewardToken.safeApprove(address(_flywheel), type(uint256).max);\\n }\\n\\n modifier onlyFlywheel() {\\n if (msg.sender != address(flywheel)) revert FlywheelError();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0xc5785aacb20e6bc503ccf9ce4b1fdf7e13e48a3abd32b19b16e30accc3f75d47\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/FlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {BaseFlywheelRewards} from \\\"./BaseFlywheelRewards.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\nimport {SafeTransferLib, ERC20} from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport {SafeCastLib} from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\n/** \\n @title Flywheel Dynamic Reward Stream\\n @notice Determines rewards based on a dynamic reward stream.\\n Rewards are transferred linearly over a \\\"rewards cycle\\\" to prevent gaming the reward distribution. \\n The reward source can be arbitrary logic, but most common is to \\\"pass through\\\" rewards from some other source.\\n The getNextCycleRewards() hook should also transfer the next cycle's rewards to this contract to ensure proper accounting.\\n*/\\nabstract contract FlywheelDynamicRewards is BaseFlywheelRewards {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n event NewRewardsCycle(uint32 indexed start, uint32 indexed end, uint192 reward);\\n\\n /// @notice the length of a rewards cycle\\n uint32 public immutable rewardsCycleLength;\\n\\n struct RewardsCycle {\\n uint32 start;\\n uint32 end;\\n uint192 reward;\\n }\\n\\n mapping(ERC20 => RewardsCycle) public rewardsCycle;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _rewardsCycleLength) BaseFlywheelRewards(_flywheel) {\\n rewardsCycleLength = _rewardsCycleLength;\\n }\\n\\n /**\\n @notice calculate and transfer accrued rewards to flywheel core\\n @param strategy the strategy to accrue rewards for\\n @return amount the amount of tokens accrued and transferred\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp)\\n external\\n override\\n onlyFlywheel\\n returns (uint256 amount)\\n {\\n RewardsCycle memory cycle = rewardsCycle[strategy];\\n\\n uint32 timestamp = block.timestamp.safeCastTo32();\\n\\n uint32 latest = timestamp >= cycle.end ? cycle.end : timestamp;\\n uint32 earliest = lastUpdatedTimestamp <= cycle.start ? cycle.start : lastUpdatedTimestamp;\\n if (cycle.end != 0) {\\n amount = (cycle.reward * (latest - earliest)) / (cycle.end - cycle.start);\\n assert(amount <= cycle.reward); // should never happen because latest <= cycle.end and earliest >= cycle.start\\n }\\n // if cycle has ended, reset cycle and transfer all available\\n if (timestamp >= cycle.end) {\\n uint32 end = ((timestamp + rewardsCycleLength) / rewardsCycleLength) * rewardsCycleLength;\\n uint192 rewards = getNextCycleRewards(strategy);\\n\\n // reset for next cycle\\n rewardsCycle[strategy] = RewardsCycle({start: timestamp, end: end, reward: rewards});\\n\\n emit NewRewardsCycle(timestamp, end, rewards);\\n }\\n }\\n\\n function getNextCycleRewards(ERC20 strategy) internal virtual returns (uint192);\\n}\",\"keccak256\":\"0x92b66dae28b01126410418d50eb0a87c141f903aaaf4c1b5cf391b7896230f4b\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { FlywheelDynamicRewards } from \\\"./FlywheelDynamicRewards.sol\\\";\\nimport { IonicFlywheelCore } from \\\"../IonicFlywheelCore.sol\\\";\\nimport { SafeTransferLib, ERC20 } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\n\\ncontract IonicFlywheelDynamicRewards is FlywheelDynamicRewards {\\n using SafeTransferLib for ERC20;\\n\\n constructor(IonicFlywheelCore _flywheel, uint32 _cycleLength)\\n FlywheelDynamicRewards(_flywheel, _cycleLength)\\n {}\\n\\n function getNextCycleRewards(ERC20 strategy)\\n internal\\n override\\n returns (uint192)\\n {\\n uint256 rewardAmount = rewardToken.balanceOf(address(strategy));\\n if (rewardAmount != 0) {\\n rewardToken.safeTransferFrom(\\n address(strategy),\\n address(this),\\n rewardAmount\\n );\\n }\\n return uint192(rewardAmount);\\n }\\n}\\n\",\"keccak256\":\"0x00e550d3170b3849c61482719b6ce86178b5027ceab18751c662aeb703b7d29c\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x60e060405234801561001057600080fd5b50604051610a2a380380610a2a83398101604081905261002f9161017c565b818181806001600160a01b031660a0816001600160a01b0316815250506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561008c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100b091906101bf565b6001600160a01b03811660808190529091506100cf90836000196100e3565b505063ffffffff1660c052506101e3915050565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061015e5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b604482015260640160405180910390fd5b50505050565b6001600160a01b038116811461017957600080fd5b50565b6000806040838503121561018f57600080fd5b825161019a81610164565b602084015190925063ffffffff811681146101b457600080fd5b809150509250929050565b6000602082840312156101d157600080fd5b81516101dc81610164565b9392505050565b60805160a05160c0516107fe61022c600039600081816061015261032001526000818160a201526101a2015260008181610102015281816104db015261055b01526107fe6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80636fcf5e5f1461005c5780637acf5b921461009d578063b334db7b146100dc578063f7c618c1146100fd578063faa6c3c814610124575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610094565b6100ef6100ea366004610633565b610195565b604051908152602001610094565b6100c47f000000000000000000000000000000000000000000000000000000000000000081565b610169610132366004610673565b60006020819052908152604090205463ffffffff80821691640100000000810490911690600160401b90046001600160c01b031683565b6040805163ffffffff94851681529390921660208401526001600160c01b031690820152606001610094565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101e05760405163739e221160e01b815260040160405180910390fd5b6001600160a01b0383166000908152602081815260408083208151606081018352905463ffffffff808216835264010000000082041693820193909352600160401b9092046001600160c01b0316908201529061023c426104a0565b90506000826020015163ffffffff168263ffffffff16101561025e5781610264565b82602001515b90506000836000015163ffffffff168663ffffffff1611156102865785610289565b83515b9050836020015163ffffffff1660001461030557835160208501516102ae91906106ab565b63ffffffff166102be82846106ab565b63ffffffff1685604001516102d391906106cf565b6102dd9190610717565b6001600160c01b0316945083604001516001600160c01b03168511156103055761030561073d565b836020015163ffffffff168363ffffffff16106104965760007f00000000000000000000000000000000000000000000000000000000000000008061034a8187610753565b6103549190610770565b61035e9190610787565b9050600061036b896104b7565b905060405180606001604052808663ffffffff1681526020018363ffffffff168152602001826001600160c01b03168152506000808b6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160086101000a8154816001600160c01b0302191690836001600160c01b031602179055509050508163ffffffff168563ffffffff167f2bc72eed7f7ea7cb3bf6969b33e204748849532a1f8e4ca68ba1bc97c4cf2e008360405161048b91906001600160c01b0391909116815260200190565b60405180910390a350505b5050505092915050565b600064010000000082106104b357600080fd5b5090565b6040516370a0823160e01b81526001600160a01b03828116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610522573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054691906107af565b90508015610583576105836001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016843084610589565b92915050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806106105760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b604482015260640160405180910390fd5b5050505050565b80356001600160a01b038116811461062e57600080fd5b919050565b6000806040838503121561064657600080fd5b61064f83610617565b9150602083013563ffffffff8116811461066857600080fd5b809150509250929050565b60006020828403121561068557600080fd5b61068e82610617565b9392505050565b634e487b7160e01b600052601160045260246000fd5b63ffffffff8281168282160390808211156106c8576106c8610695565b5092915050565b6001600160c01b038281168282168181028316929181158285048214176106f8576106f8610695565b50505092915050565b634e487b7160e01b600052601260045260246000fd5b60006001600160c01b038381168061073157610731610701565b92169190910492915050565b634e487b7160e01b600052600160045260246000fd5b63ffffffff8181168382160190808211156106c8576106c8610695565b600063ffffffff8084168061073157610731610701565b63ffffffff8181168382160280821691908281146107a7576107a7610695565b505092915050565b6000602082840312156107c157600080fd5b505191905056fea2646970667358221220646c258708889e1305fd76a596ee90c9094a55adc02339359e3eb516f79a2f9d64736f6c63430008160033", + "devdoc": { + "kind": "dev", + "methods": { + "getAccruedRewards(address,uint32)": { + "params": { + "strategy": "the strategy to accrue rewards for" + }, + "returns": { + "amount": "the amount of tokens accrued and transferred" + } + } + }, + "version": 1 + }, + "userdoc": { + "errors": { + "FlywheelError()": [ + { + "notice": "thrown when caller is not the flywheel" + } + ] + }, + "kind": "user", + "methods": { + "flywheel()": { + "notice": "the flywheel core contract" + }, + "getAccruedRewards(address,uint32)": { + "notice": "calculate and transfer accrued rewards to flywheel core" + }, + "rewardToken()": { + "notice": "the reward token paid" + }, + "rewardsCycleLength()": { + "notice": "the length of a rewards cycle" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 58045, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "rewardsCycle", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)" + } + ], + "types": { + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsCycle)58039_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct FlywheelDynamicRewards.RewardsCycle)", + "numberOfBytes": "32", + "value": "t_struct(RewardsCycle)58039_storage" + }, + "t_struct(RewardsCycle)58039_storage": { + "encoding": "inplace", + "label": "struct FlywheelDynamicRewards.RewardsCycle", + "members": [ + { + "astId": 58034, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "start", + "offset": 0, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58036, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "end", + "offset": 4, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 58038, + "contract": "contracts/ionic/strategies/flywheel/rewards/IonicFlywheelDynamicRewards.sol:IonicFlywheelDynamicRewards", + "label": "reward", + "offset": 8, + "slot": "0", + "type": "t_uint192" + } + ], + "numberOfBytes": "32" + }, + "t_uint192": { + "encoding": "inplace", + "label": "uint192", + "numberOfBytes": "24" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4.json b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4.json new file mode 100644 index 0000000000..b4746cd3f6 --- /dev/null +++ b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4.json @@ -0,0 +1,1016 @@ +{ + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "transactionIndex": 9, + "gasUsed": "846771", + "logsBloom": "0x00004000000000000000000000000000400000000000000000800000000200080000000008000000000020000000000000000010100000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400020000000000000000000000000000000000000000080000000000000c00000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6", + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "logs": [ + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000a1b7c312499e2fbe663b4a1bc8c38fced27eade9" + ], + "data": "0x", + "logIndex": 34, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 35, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 36, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 37, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 38, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7b9f9b18587a3854ae41c80a08291eca149bcb7", + "logIndex": 39, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + } + ], + "blockNumber": 126874619, + "cumulativeGasUsed": "2060372", + "status": 1, + "byzantium": true + }, + "args": [ + "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "0xA7B9F9B18587A3854aE41C80a08291eca149bCB7", + "0xf8c8765e000000000000000000000000887d1c6a4f3548279c2a8a9d0fa61b5d458d14fc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": [ + "0x887d1c6A4f3548279c2a8A9D0FA61B5D458d14fC", + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + "0x1155b614971f16758C92c4890eD338C9e3ede6b7" + ] + }, + "implementation": "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Implementation.json b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Implementation.json new file mode 100644 index 0000000000..7d6a74f4bc --- /dev/null +++ b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Implementation.json @@ -0,0 +1,1160 @@ +{ + "address": "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsDelta", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rewardsIndex", + "type": "uint256" + } + ], + "name": "AccrueRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newStrategy", + "type": "address" + } + ], + "name": "AddStrategy", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ClaimRewards", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newBooster", + "type": "address" + } + ], + "name": "FlywheelBoosterUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "FlywheelRewardsUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "NewOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldPendingOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "NewPendingOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newPerformanceFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "oldFeeRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newFeeRecipient", + "type": "address" + } + ], + "name": "UpdatedFeeSettings", + "type": "event" + }, + { + "inputs": [], + "name": "_acceptOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newPendingOwner", + "type": "address" + } + ], + "name": "_setPendingOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "secondUser", + "type": "address" + } + ], + "name": "accrue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addMarketForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "addStrategyForRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allStrategies", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "compAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeRecipient", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelBooster", + "outputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "borrower", + "type": "address" + } + ], + "name": "flywheelPreBorrowerAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "supplier", + "type": "address" + } + ], + "name": "flywheelPreSupplierAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "src", + "type": "address" + }, + { + "internalType": "address", + "name": "dst", + "type": "address" + } + ], + "name": "flywheelPreTransferAction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "flywheelRewards", + "outputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllStrategies", + "outputs": [ + { + "internalType": "contract ERC20[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "_rewardToken", + "type": "address" + }, + { + "internalType": "contract IFlywheelRewards", + "name": "_flywheelRewards", + "type": "address" + }, + { + "internalType": "contract IFlywheelBooster", + "name": "_flywheelBooster", + "type": "address" + }, + { + "internalType": "address", + "name": "_owner", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isFlywheel", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isRewardsDistributor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "marketState", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "performanceFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rewardToken", + "outputs": [ + { + "internalType": "contract ERC20", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "rewardsAccrued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelBooster", + "name": "newBooster", + "type": "address" + } + ], + "name": "setBooster", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlywheelRewards", + "name": "newFlywheelRewards", + "type": "address" + } + ], + "name": "setFlywheelRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + } + ], + "name": "strategyState", + "outputs": [ + { + "internalType": "uint224", + "name": "index", + "type": "uint224" + }, + { + "internalType": "uint32", + "name": "lastUpdatedTimestamp", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_performanceFee", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_feeRecipient", + "type": "address" + } + ], + "name": "updateFeeSettings", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ERC20", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "userIndex", + "outputs": [ + { + "internalType": "uint224", + "name": "", + "type": "uint224" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x0344cd1e5c53ae34e1be6fc7b7a27b552035d666e8762785797194f3e5ba7950", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "transactionIndex": 8, + "gasUsed": "1560163", + "logsBloom": "0x00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x3a77a0ee8872f1c969d8fc0a40bee67e45dc3153f551066e8c813d2e67f85197", + "transactionHash": "0x0344cd1e5c53ae34e1be6fc7b7a27b552035d666e8762785797194f3e5ba7950", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 126874615, + "transactionHash": "0x0344cd1e5c53ae34e1be6fc7b7a27b552035d666e8762785797194f3e5ba7950", + "address": "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 35, + "blockHash": "0x3a77a0ee8872f1c969d8fc0a40bee67e45dc3153f551066e8c813d2e67f85197" + } + ], + "blockNumber": 126874615, + "cumulativeGasUsed": "3794231", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "0f216c69ca7d69b5e67c1cffac004e22", + "metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsDelta\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"rewardsIndex\",\"type\":\"uint256\"}],\"name\":\"AccrueRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newStrategy\",\"type\":\"address\"}],\"name\":\"AddStrategy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ClaimRewards\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"FlywheelBoosterUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"FlywheelRewardsUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldPendingOwner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"NewPendingOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newPerformanceFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeRecipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeRecipient\",\"type\":\"address\"}],\"name\":\"UpdatedFeeSettings\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_acceptOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"_setPendingOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"secondUser\",\"type\":\"address\"}],\"name\":\"accrue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addMarketForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"addStrategyForRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"allStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"claimRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"compAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeRecipient\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelBooster\",\"outputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"borrower\",\"type\":\"address\"}],\"name\":\"flywheelPreBorrowerAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"supplier\",\"type\":\"address\"}],\"name\":\"flywheelPreSupplierAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"market\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"src\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"flywheelPreTransferAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"flywheelRewards\",\"outputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllStrategies\",\"outputs\":[{\"internalType\":\"contract ERC20[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"_rewardToken\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"_flywheelRewards\",\"type\":\"address\"},{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"_flywheelBooster\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isFlywheel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isRewardsDistributor\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"marketState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"performanceFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rewardToken\",\"outputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"rewardsAccrued\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelBooster\",\"name\":\"newBooster\",\"type\":\"address\"}],\"name\":\"setBooster\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFlywheelRewards\",\"name\":\"newFlywheelRewards\",\"type\":\"address\"}],\"name\":\"setFlywheelRewards\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"}],\"name\":\"strategyState\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"index\",\"type\":\"uint224\"},{\"internalType\":\"uint32\",\"name\":\"lastUpdatedTimestamp\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_performanceFee\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_feeRecipient\",\"type\":\"address\"}],\"name\":\"updateFeeSettings\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ERC20\",\"name\":\"strategy\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"userIndex\",\"outputs\":[{\"internalType\":\"uint224\",\"name\":\"\",\"type\":\"uint224\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"params\":{\"rewardsDelta\":\"how many new rewards accrued to the user\",\"rewardsIndex\":\"the market index for rewards per token accrued\",\"strategy\":\"the updated rewards strategy\",\"user\":\"the user of the rewards\"}},\"AddStrategy(address)\":{\"params\":{\"newStrategy\":\"the new added strategy\"}},\"ClaimRewards(address,uint256)\":{\"params\":{\"amount\":\"the amount of rewards claimed\",\"user\":\"the user of the rewards\"}},\"FlywheelBoosterUpdate(address)\":{\"params\":{\"newBooster\":\"the new booster module\"}},\"FlywheelRewardsUpdate(address)\":{\"params\":{\"newFlywheelRewards\":\"the new rewards module\"}},\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"_acceptOwner()\":{\"details\":\"Owner function for pending owner to accept role and update owner\"},\"_setPendingOwner(address)\":{\"details\":\"Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\",\"params\":{\"newPendingOwner\":\"New pending owner.\"}},\"accrue(address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to user (including prior)\"}},\"accrue(address,address,address)\":{\"params\":{\"strategy\":\"the strategy to accrue a user's rewards on\",\"user\":\"the second user to be accrued\"},\"returns\":{\"_0\":\"the cumulative amount of rewards accrued to the first user (including prior)\",\"_1\":\"the cumulative amount of rewards accrued to the second user (including prior)\"}},\"claimRewards(address)\":{\"details\":\"this function is public, and all rewards transfer to the user\",\"params\":{\"user\":\"the user claiming rewards\"}},\"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.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateFeeSettings(uint256,address)\":{\"details\":\"Claim rewards first from the previous feeRecipient before changing it\"}},\"version\":1},\"userdoc\":{\"events\":{\"AccrueRewards(address,address,uint256,uint256)\":{\"notice\":\"Emitted when a user's rewards accrue to a given strategy.\"},\"AddStrategy(address)\":{\"notice\":\"Emitted when a new strategy is added to flywheel by the admin\"},\"ClaimRewards(address,uint256)\":{\"notice\":\"Emitted when a user claims accrued rewards.\"},\"FlywheelBoosterUpdate(address)\":{\"notice\":\"Emitted when the booster module changes\"},\"FlywheelRewardsUpdate(address)\":{\"notice\":\"Emitted when the rewards module changes\"},\"NewOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is accepted, which means owner is updated\"},\"NewPendingOwner(address,address)\":{\"notice\":\"Emitted when pendingOwner is changed\"}},\"kind\":\"user\",\"methods\":{\"_acceptOwner()\":{\"notice\":\"Accepts transfer of owner rights. msg.sender must be pendingOwner\"},\"_setPendingOwner(address)\":{\"notice\":\"Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\"},\"accrue(address,address)\":{\"notice\":\"accrue rewards for a single user on a strategy\"},\"accrue(address,address,address)\":{\"notice\":\"accrue rewards for a two users on a strategy\"},\"addStrategyForRewards(address)\":{\"notice\":\"initialize a new strategy\"},\"allStrategies(uint256)\":{\"notice\":\"append-only list of strategies added\"},\"claimRewards(address)\":{\"notice\":\"claim rewards for a given user\"},\"feeRecipient()\":{\"notice\":\"Address that gets rewardsToken accrued by performanceFee\"},\"flywheelBooster()\":{\"notice\":\"optional booster module for calculating virtual balances on strategies\"},\"flywheelRewards()\":{\"notice\":\"the rewards contract for managing streams\"},\"pendingOwner()\":{\"notice\":\"Pending owner of this contract\"},\"performanceFee()\":{\"notice\":\"How much rewardsToken will be send to treasury\"},\"rewardToken()\":{\"notice\":\"The token to reward\"},\"setBooster(address)\":{\"notice\":\"swap out the flywheel booster contract\"},\"setFlywheelRewards(address)\":{\"notice\":\"swap out the flywheel rewards contract\"},\"updateFeeSettings(uint256,address)\":{\"notice\":\"Update performanceFee and/or feeRecipient\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":\"IonicFlywheel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/ionic/SafeOwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity >=0.8.0;\\n\\nimport \\\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\\\";\\n\\n/**\\n * @dev Ownable extension that requires a two-step process of setting the pending owner and the owner accepting it.\\n * @notice Existing OwnableUpgradeable contracts cannot be upgraded due to the extra storage variable\\n * that will shift the other.\\n */\\nabstract contract SafeOwnableUpgradeable is OwnableUpgradeable {\\n /**\\n * @notice Pending owner of this contract\\n */\\n address public pendingOwner;\\n\\n function __SafeOwnable_init(address owner_) internal onlyInitializing {\\n __Ownable_init();\\n _transferOwnership(owner_);\\n }\\n\\n struct AddressSlot {\\n address value;\\n }\\n\\n modifier onlyOwnerOrAdmin() {\\n bool isOwner = owner() == _msgSender();\\n if (!isOwner) {\\n address admin = _getProxyAdmin();\\n bool isAdmin = admin == _msgSender();\\n require(isAdmin, \\\"Ownable: caller is neither the owner nor the admin\\\");\\n }\\n _;\\n }\\n\\n /**\\n * @notice Emitted when pendingOwner is changed\\n */\\n event NewPendingOwner(address oldPendingOwner, address newPendingOwner);\\n\\n /**\\n * @notice Emitted when pendingOwner is accepted, which means owner is updated\\n */\\n event NewOwner(address oldOwner, address newOwner);\\n\\n /**\\n * @notice Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @dev Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.\\n * @param newPendingOwner New pending owner.\\n */\\n function _setPendingOwner(address newPendingOwner) public onlyOwner {\\n // Save current value, if any, for inclusion in log\\n address oldPendingOwner = pendingOwner;\\n\\n // Store pendingOwner with value newPendingOwner\\n pendingOwner = newPendingOwner;\\n\\n // Emit NewPendingOwner(oldPendingOwner, newPendingOwner)\\n emit NewPendingOwner(oldPendingOwner, newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts transfer of owner rights. msg.sender must be pendingOwner\\n * @dev Owner function for pending owner to accept role and update owner\\n */\\n function _acceptOwner() public {\\n // Check caller is pendingOwner and pendingOwner \\u2260 address(0)\\n require(msg.sender == pendingOwner, \\\"not the pending owner\\\");\\n\\n // Save current values for inclusion in log\\n address oldOwner = owner();\\n address oldPendingOwner = pendingOwner;\\n\\n // Store owner with value pendingOwner\\n _transferOwnership(pendingOwner);\\n\\n // Clear the pending value\\n pendingOwner = address(0);\\n\\n emit NewOwner(oldOwner, pendingOwner);\\n emit NewPendingOwner(oldPendingOwner, pendingOwner);\\n }\\n\\n function renounceOwnership() public override onlyOwner {\\n // do not remove this overriding fn\\n revert(\\\"not used anymore\\\");\\n }\\n\\n function transferOwnership(address newOwner) public override onlyOwner {\\n emit NewPendingOwner(pendingOwner, newOwner);\\n pendingOwner = newOwner;\\n }\\n\\n function _getProxyAdmin() internal view returns (address admin) {\\n bytes32 _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n AddressSlot storage adminSlot;\\n assembly {\\n adminSlot.slot := _ADMIN_SLOT\\n }\\n admin = adminSlot.value;\\n }\\n}\\n\",\"keccak256\":\"0x73f50a022ee86874b63ebd7e418b5948ef2913e32cb80024fe3cd4f17be7f2a5\",\"license\":\"UNLICENSED\"},\"contracts/ionic/strategies/flywheel/IFlywheelBooster.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\n\\n/**\\n @title Balance Booster Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Booster module is an optional module for virtually boosting or otherwise transforming user balances. \\n If a booster is not configured, the strategies ERC-20 balanceOf/totalSupply will be used instead.\\n \\n Boosting logic can be associated with referrals, vote-escrow, or other strategies.\\n\\n SECURITY NOTE: similar to how Core needs to be notified any time the strategy user composition changes, the booster would need to be notified of any conditions which change the boosted balances atomically.\\n This prevents gaming of the reward calculation function by using manipulated balances when accruing.\\n*/\\ninterface IFlywheelBooster {\\n /**\\n @notice calculate the boosted supply of a strategy.\\n @param strategy the strategy to calculate boosted supply of\\n @return the boosted supply\\n */\\n function boostedTotalSupply(ERC20 strategy) external view returns (uint256);\\n\\n /**\\n @notice calculate the boosted balance of a user in a given strategy.\\n @param strategy the strategy to calculate boosted balance of\\n @param user the user to calculate boosted balance of\\n @return the boosted balance\\n */\\n function boostedBalanceOf(ERC20 strategy, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xcdab1b4b5662148d74acc3491a810d263ec509f9f81a267e9f6c1542ba15eabc\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IIonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\n\\ninterface IIonicFlywheel {\\n function isRewardsDistributor() external returns (bool);\\n\\n function isFlywheel() external returns (bool);\\n\\n function flywheelPreSupplierAction(address market, address supplier) external;\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external;\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external;\\n\\n function compAccrued(address user) external view returns (uint256);\\n\\n function addMarketForRewards(ERC20 strategy) external;\\n\\n function marketState(ERC20 strategy) external view returns (uint224 index, uint32 lastUpdatedTimestamp);\\n}\\n\",\"keccak256\":\"0xb24009cac18b0f9b6d12884169ab4461ec04027110a768091077dc5c648e934c\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheel.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { IonicFlywheelCore } from \\\"./IonicFlywheelCore.sol\\\";\\nimport \\\"./IIonicFlywheel.sol\\\";\\n\\ncontract IonicFlywheel is IonicFlywheelCore, IIonicFlywheel {\\n bool public constant isRewardsDistributor = true;\\n bool public constant isFlywheel = true;\\n\\n function flywheelPreSupplierAction(address market, address supplier) external {\\n accrue(ERC20(market), supplier);\\n }\\n\\n function flywheelPreBorrowerAction(address market, address borrower) external {}\\n\\n function flywheelPreTransferAction(address market, address src, address dst) external {\\n accrue(ERC20(market), src, dst);\\n }\\n\\n function compAccrued(address user) external view returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function addMarketForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n // TODO remove\\n function marketState(ERC20 strategy) external view returns (uint224, uint32) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0x60d8d5a8feaa7c0373d24d6fbca523eb86ba251f5374a8821a6aee63cdc90e0d\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/IonicFlywheelCore.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport { ERC20 } from \\\"solmate/tokens/ERC20.sol\\\";\\nimport { SafeTransferLib } from \\\"solmate/utils/SafeTransferLib.sol\\\";\\nimport { SafeCastLib } from \\\"solmate/utils/SafeCastLib.sol\\\";\\n\\nimport { IFlywheelRewards } from \\\"./rewards/IFlywheelRewards.sol\\\";\\nimport { IFlywheelBooster } from \\\"./IFlywheelBooster.sol\\\";\\n\\nimport { SafeOwnableUpgradeable } from \\\"../../../ionic/SafeOwnableUpgradeable.sol\\\";\\n\\ncontract IonicFlywheelCore is SafeOwnableUpgradeable {\\n using SafeTransferLib for ERC20;\\n using SafeCastLib for uint256;\\n\\n /// @notice How much rewardsToken will be send to treasury\\n uint256 public performanceFee;\\n\\n /// @notice Address that gets rewardsToken accrued by performanceFee\\n address public feeRecipient;\\n\\n /// @notice The token to reward\\n ERC20 public rewardToken;\\n\\n /// @notice append-only list of strategies added\\n ERC20[] public allStrategies;\\n\\n /// @notice the rewards contract for managing streams\\n IFlywheelRewards public flywheelRewards;\\n\\n /// @notice optional booster module for calculating virtual balances on strategies\\n IFlywheelBooster public flywheelBooster;\\n\\n /// @notice The accrued but not yet transferred rewards for each user\\n mapping(address => uint256) internal _rewardsAccrued;\\n\\n /// @notice The strategy index and last updated per strategy\\n mapping(ERC20 => RewardsState) internal _strategyState;\\n\\n /// @notice user index per strategy\\n mapping(ERC20 => mapping(address => uint224)) internal _userIndex;\\n\\n constructor() {\\n // prevents the misusage of the implementation contract\\n _disableInitializers();\\n }\\n\\n function initialize(\\n ERC20 _rewardToken,\\n IFlywheelRewards _flywheelRewards,\\n IFlywheelBooster _flywheelBooster,\\n address _owner\\n ) public initializer {\\n __SafeOwnable_init(msg.sender);\\n\\n rewardToken = _rewardToken;\\n flywheelRewards = _flywheelRewards;\\n flywheelBooster = _flywheelBooster;\\n\\n _transferOwnership(_owner);\\n\\n performanceFee = 10e16; // 10%\\n feeRecipient = _owner;\\n }\\n\\n /*----------------------------------------------------------------\\n ACCRUE/CLAIM LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a user's rewards accrue to a given strategy.\\n @param strategy the updated rewards strategy\\n @param user the user of the rewards\\n @param rewardsDelta how many new rewards accrued to the user\\n @param rewardsIndex the market index for rewards per token accrued\\n */\\n event AccrueRewards(ERC20 indexed strategy, address indexed user, uint256 rewardsDelta, uint256 rewardsIndex);\\n\\n /** \\n @notice Emitted when a user claims accrued rewards.\\n @param user the user of the rewards\\n @param amount the amount of rewards claimed\\n */\\n event ClaimRewards(address indexed user, uint256 amount);\\n\\n /** \\n @notice accrue rewards for a single user on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the user to be accrued\\n @return the cumulative amount of rewards accrued to user (including prior)\\n */\\n function accrue(ERC20 strategy, address user) public returns (uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return 0;\\n\\n state = accrueStrategy(strategy, state);\\n return accrueUser(strategy, user, state);\\n }\\n\\n /** \\n @notice accrue rewards for a two users on a strategy\\n @param strategy the strategy to accrue a user's rewards on\\n @param user the first user to be accrued\\n @param user the second user to be accrued\\n @return the cumulative amount of rewards accrued to the first user (including prior)\\n @return the cumulative amount of rewards accrued to the second user (including prior)\\n */\\n function accrue(\\n ERC20 strategy,\\n address user,\\n address secondUser\\n ) public returns (uint256, uint256) {\\n (uint224 index, uint32 ts) = strategyState(strategy);\\n RewardsState memory state = RewardsState(index, ts);\\n\\n if (state.index == 0) return (0, 0);\\n\\n state = accrueStrategy(strategy, state);\\n return (accrueUser(strategy, user, state), accrueUser(strategy, secondUser, state));\\n }\\n\\n /** \\n @notice claim rewards for a given user\\n @param user the user claiming rewards\\n @dev this function is public, and all rewards transfer to the user\\n */\\n function claimRewards(address user) external {\\n uint256 accrued = rewardsAccrued(user);\\n\\n if (accrued != 0) {\\n _rewardsAccrued[user] = 0;\\n\\n rewardToken.safeTransferFrom(address(flywheelRewards), user, accrued);\\n\\n emit ClaimRewards(user, accrued);\\n }\\n }\\n\\n /*----------------------------------------------------------------\\n ADMIN LOGIC\\n ----------------------------------------------------------------*/\\n\\n /** \\n @notice Emitted when a new strategy is added to flywheel by the admin\\n @param newStrategy the new added strategy\\n */\\n event AddStrategy(address indexed newStrategy);\\n\\n /// @notice initialize a new strategy\\n function addStrategyForRewards(ERC20 strategy) external onlyOwner {\\n _addStrategyForRewards(strategy);\\n }\\n\\n function _addStrategyForRewards(ERC20 strategy) internal {\\n (uint224 index, ) = strategyState(strategy);\\n require(index == 0, \\\"strategy\\\");\\n _strategyState[strategy] = RewardsState({\\n index: (10**rewardToken.decimals()).safeCastTo224(),\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n\\n allStrategies.push(strategy);\\n emit AddStrategy(address(strategy));\\n }\\n\\n function getAllStrategies() external view returns (ERC20[] memory) {\\n return allStrategies;\\n }\\n\\n /** \\n @notice Emitted when the rewards module changes\\n @param newFlywheelRewards the new rewards module\\n */\\n event FlywheelRewardsUpdate(address indexed newFlywheelRewards);\\n\\n /// @notice swap out the flywheel rewards contract\\n function setFlywheelRewards(IFlywheelRewards newFlywheelRewards) external onlyOwner {\\n if (address(flywheelRewards) != address(0)) {\\n uint256 oldRewardBalance = rewardToken.balanceOf(address(flywheelRewards));\\n if (oldRewardBalance > 0) {\\n rewardToken.safeTransferFrom(address(flywheelRewards), address(newFlywheelRewards), oldRewardBalance);\\n }\\n }\\n\\n flywheelRewards = newFlywheelRewards;\\n\\n emit FlywheelRewardsUpdate(address(newFlywheelRewards));\\n }\\n\\n /** \\n @notice Emitted when the booster module changes\\n @param newBooster the new booster module\\n */\\n event FlywheelBoosterUpdate(address indexed newBooster);\\n\\n /// @notice swap out the flywheel booster contract\\n function setBooster(IFlywheelBooster newBooster) external onlyOwner {\\n flywheelBooster = newBooster;\\n\\n emit FlywheelBoosterUpdate(address(newBooster));\\n }\\n\\n event UpdatedFeeSettings(\\n uint256 oldPerformanceFee,\\n uint256 newPerformanceFee,\\n address oldFeeRecipient,\\n address newFeeRecipient\\n );\\n\\n /**\\n * @notice Update performanceFee and/or feeRecipient\\n * @dev Claim rewards first from the previous feeRecipient before changing it\\n */\\n function updateFeeSettings(uint256 _performanceFee, address _feeRecipient) external onlyOwner {\\n _updateFeeSettings(_performanceFee, _feeRecipient);\\n }\\n\\n function _updateFeeSettings(uint256 _performanceFee, address _feeRecipient) internal {\\n emit UpdatedFeeSettings(performanceFee, _performanceFee, feeRecipient, _feeRecipient);\\n\\n if (feeRecipient != _feeRecipient) {\\n _rewardsAccrued[_feeRecipient] += rewardsAccrued(feeRecipient);\\n _rewardsAccrued[feeRecipient] = 0;\\n }\\n performanceFee = _performanceFee;\\n feeRecipient = _feeRecipient;\\n }\\n\\n /*----------------------------------------------------------------\\n INTERNAL ACCOUNTING LOGIC\\n ----------------------------------------------------------------*/\\n\\n struct RewardsState {\\n /// @notice The strategy's last updated index\\n uint224 index;\\n /// @notice The timestamp the index was last updated at\\n uint32 lastUpdatedTimestamp;\\n }\\n\\n /// @notice accumulate global rewards on a strategy\\n function accrueStrategy(ERC20 strategy, RewardsState memory state)\\n private\\n returns (RewardsState memory rewardsState)\\n {\\n // calculate accrued rewards through module\\n uint256 strategyRewardsAccrued = flywheelRewards.getAccruedRewards(strategy, state.lastUpdatedTimestamp);\\n\\n rewardsState = state;\\n\\n if (strategyRewardsAccrued > 0) {\\n // use the booster or token supply to calculate reward index denominator\\n uint256 supplyTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedTotalSupply(strategy)\\n : strategy.totalSupply();\\n\\n // 100% = 100e16\\n uint256 accruedFees = (strategyRewardsAccrued * performanceFee) / uint224(100e16);\\n\\n _rewardsAccrued[feeRecipient] += accruedFees;\\n strategyRewardsAccrued -= accruedFees;\\n\\n uint224 deltaIndex;\\n\\n if (supplyTokens != 0)\\n deltaIndex = ((strategyRewardsAccrued * (10**strategy.decimals())) / supplyTokens).safeCastTo224();\\n\\n // accumulate rewards per token onto the index, multiplied by fixed-point factor\\n rewardsState = RewardsState({\\n index: state.index + deltaIndex,\\n lastUpdatedTimestamp: block.timestamp.safeCastTo32()\\n });\\n _strategyState[strategy] = rewardsState;\\n }\\n }\\n\\n /// @notice accumulate rewards on a strategy for a specific user\\n function accrueUser(\\n ERC20 strategy,\\n address user,\\n RewardsState memory state\\n ) private returns (uint256) {\\n // load indices\\n uint224 strategyIndex = state.index;\\n uint224 supplierIndex = userIndex(strategy, user);\\n\\n // sync user index to global\\n _userIndex[strategy][user] = strategyIndex;\\n\\n // if user hasn't yet accrued rewards, grant them interest from the strategy beginning if they have a balance\\n // zero balances will have no effect other than syncing to global index\\n if (supplierIndex == 0) {\\n supplierIndex = (10**rewardToken.decimals()).safeCastTo224();\\n }\\n\\n uint224 deltaIndex = strategyIndex - supplierIndex;\\n // use the booster or token balance to calculate reward balance multiplier\\n uint256 supplierTokens = address(flywheelBooster) != address(0)\\n ? flywheelBooster.boostedBalanceOf(strategy, user)\\n : strategy.balanceOf(user);\\n\\n // accumulate rewards by multiplying user tokens by rewardsPerToken index and adding on unclaimed\\n uint256 supplierDelta = (deltaIndex * supplierTokens) / (10**strategy.decimals());\\n uint256 supplierAccrued = rewardsAccrued(user) + supplierDelta;\\n\\n _rewardsAccrued[user] = supplierAccrued;\\n\\n emit AccrueRewards(strategy, user, supplierDelta, strategyIndex);\\n\\n return supplierAccrued;\\n }\\n\\n function rewardsAccrued(address user) public virtual returns (uint256) {\\n return _rewardsAccrued[user];\\n }\\n\\n function userIndex(ERC20 strategy, address user) public virtual returns (uint224) {\\n return _userIndex[strategy][user];\\n }\\n\\n function strategyState(ERC20 strategy) public virtual returns (uint224 index, uint32 lastUpdatedTimestamp) {\\n return (_strategyState[strategy].index, _strategyState[strategy].lastUpdatedTimestamp);\\n }\\n}\\n\",\"keccak256\":\"0xbd54c90dbc7f93cad52016f14eb5f9b634f98d18da083ef443951deebc5f82aa\",\"license\":\"AGPL-3.0-only\"},\"contracts/ionic/strategies/flywheel/rewards/IFlywheelRewards.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity ^0.8.10;\\n\\nimport {ERC20} from \\\"solmate/tokens/ERC20.sol\\\";\\nimport {IonicFlywheelCore} from \\\"../IonicFlywheelCore.sol\\\";\\n\\n/**\\n @title Rewards Module for Flywheel\\n @notice Flywheel is a general framework for managing token incentives.\\n It takes reward streams to various *strategies* such as staking LP tokens and divides them among *users* of those strategies.\\n\\n The Rewards module is responsible for:\\n * determining the ongoing reward amounts to entire strategies (core handles the logic for dividing among users)\\n * actually holding rewards that are yet to be claimed\\n\\n The reward stream can follow arbitrary logic as long as the amount of rewards passed to flywheel core has been sent to this contract.\\n\\n Different module strategies include:\\n * a static reward rate per second\\n * a decaying reward rate\\n * a dynamic just-in-time reward stream\\n * liquid governance reward delegation (Curve Gauge style)\\n\\n SECURITY NOTE: The rewards strategy should be smooth and continuous, to prevent gaming the reward distribution by frontrunning.\\n */\\ninterface IFlywheelRewards {\\n /**\\n @notice calculate the rewards amount accrued to a strategy since the last update.\\n @param strategy the strategy to accrue rewards for.\\n @param lastUpdatedTimestamp the last time rewards were accrued for the strategy.\\n @return rewards the amount of rewards accrued to the market\\n */\\n function getAccruedRewards(ERC20 strategy, uint32 lastUpdatedTimestamp) external returns (uint256 rewards);\\n\\n /// @notice return the flywheel core address\\n function flywheel() external view returns (IonicFlywheelCore);\\n\\n /// @notice return the reward token associated with flywheel core.\\n function rewardToken() external view returns (ERC20);\\n}\\n\",\"keccak256\":\"0x7e966a0e7cc80f799ee7cb3611027381847dafb92b8d8c0f3e96500ecbe217f7\",\"license\":\"AGPL-3.0-only\"},\"openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x6c2b54ec184943843041ab77f61988b5060f6f03acbfe92cdc125f95f00891da\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0a3b4afc301241e2629ad192fa02e0f8626e3cf38ab6f45342bfd7afbde16ee0\",\"license\":\"MIT\"},\"openzeppelin-contracts-upgradeable/contracts/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"solmate/tokens/ERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)\\n/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)\\n/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.\\nabstract contract ERC20 {\\n /*//////////////////////////////////////////////////////////////\\n EVENTS\\n //////////////////////////////////////////////////////////////*/\\n\\n event Transfer(address indexed from, address indexed to, uint256 amount);\\n\\n event Approval(address indexed owner, address indexed spender, uint256 amount);\\n\\n /*//////////////////////////////////////////////////////////////\\n METADATA STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n string public name;\\n\\n string public symbol;\\n\\n uint8 public immutable decimals;\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 public totalSupply;\\n\\n mapping(address => uint256) public balanceOf;\\n\\n mapping(address => mapping(address => uint256)) public allowance;\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 STORAGE\\n //////////////////////////////////////////////////////////////*/\\n\\n uint256 internal immutable INITIAL_CHAIN_ID;\\n\\n bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;\\n\\n mapping(address => uint256) public nonces;\\n\\n /*//////////////////////////////////////////////////////////////\\n CONSTRUCTOR\\n //////////////////////////////////////////////////////////////*/\\n\\n constructor(\\n string memory _name,\\n string memory _symbol,\\n uint8 _decimals\\n ) {\\n name = _name;\\n symbol = _symbol;\\n decimals = _decimals;\\n\\n INITIAL_CHAIN_ID = block.chainid;\\n INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function approve(address spender, uint256 amount) public virtual returns (bool) {\\n allowance[msg.sender][spender] = amount;\\n\\n emit Approval(msg.sender, spender, amount);\\n\\n return true;\\n }\\n\\n function transfer(address to, uint256 amount) public virtual returns (bool) {\\n balanceOf[msg.sender] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(msg.sender, to, amount);\\n\\n return true;\\n }\\n\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) public virtual returns (bool) {\\n uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.\\n\\n if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;\\n\\n balanceOf[from] -= amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(from, to, amount);\\n\\n return true;\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n EIP-2612 LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n require(deadline >= block.timestamp, \\\"PERMIT_DEADLINE_EXPIRED\\\");\\n\\n // Unchecked because the only math done is incrementing\\n // the owner's nonce which cannot realistically overflow.\\n unchecked {\\n address recoveredAddress = ecrecover(\\n keccak256(\\n abi.encodePacked(\\n \\\"\\\\x19\\\\x01\\\",\\n DOMAIN_SEPARATOR(),\\n keccak256(\\n abi.encode(\\n keccak256(\\n \\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\"\\n ),\\n owner,\\n spender,\\n value,\\n nonces[owner]++,\\n deadline\\n )\\n )\\n )\\n ),\\n v,\\n r,\\n s\\n );\\n\\n require(recoveredAddress != address(0) && recoveredAddress == owner, \\\"INVALID_SIGNER\\\");\\n\\n allowance[recoveredAddress][spender] = value;\\n }\\n\\n emit Approval(owner, spender, value);\\n }\\n\\n function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {\\n return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();\\n }\\n\\n function computeDomainSeparator() internal view virtual returns (bytes32) {\\n return\\n keccak256(\\n abi.encode(\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\"),\\n keccak256(bytes(name)),\\n keccak256(\\\"1\\\"),\\n block.chainid,\\n address(this)\\n )\\n );\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n INTERNAL MINT/BURN LOGIC\\n //////////////////////////////////////////////////////////////*/\\n\\n function _mint(address to, uint256 amount) internal virtual {\\n totalSupply += amount;\\n\\n // Cannot overflow because the sum of all user\\n // balances can't exceed the max uint256 value.\\n unchecked {\\n balanceOf[to] += amount;\\n }\\n\\n emit Transfer(address(0), to, amount);\\n }\\n\\n function _burn(address from, uint256 amount) internal virtual {\\n balanceOf[from] -= amount;\\n\\n // Cannot underflow because a user's balance\\n // will never be larger than the total supply.\\n unchecked {\\n totalSupply -= amount;\\n }\\n\\n emit Transfer(from, address(0), amount);\\n }\\n}\\n\",\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeCastLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\n/// @notice Safe unsigned integer casting library that reverts on overflow.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeCastLib.sol)\\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeCast.sol)\\nlibrary SafeCastLib {\\n function safeCastTo248(uint256 x) internal pure returns (uint248 y) {\\n require(x < 1 << 248);\\n\\n y = uint248(x);\\n }\\n\\n function safeCastTo224(uint256 x) internal pure returns (uint224 y) {\\n require(x < 1 << 224);\\n\\n y = uint224(x);\\n }\\n\\n function safeCastTo192(uint256 x) internal pure returns (uint192 y) {\\n require(x < 1 << 192);\\n\\n y = uint192(x);\\n }\\n\\n function safeCastTo160(uint256 x) internal pure returns (uint160 y) {\\n require(x < 1 << 160);\\n\\n y = uint160(x);\\n }\\n\\n function safeCastTo128(uint256 x) internal pure returns (uint128 y) {\\n require(x < 1 << 128);\\n\\n y = uint128(x);\\n }\\n\\n function safeCastTo96(uint256 x) internal pure returns (uint96 y) {\\n require(x < 1 << 96);\\n\\n y = uint96(x);\\n }\\n\\n function safeCastTo64(uint256 x) internal pure returns (uint64 y) {\\n require(x < 1 << 64);\\n\\n y = uint64(x);\\n }\\n\\n function safeCastTo32(uint256 x) internal pure returns (uint32 y) {\\n require(x < 1 << 32);\\n\\n y = uint32(x);\\n }\\n\\n function safeCastTo24(uint256 x) internal pure returns (uint24 y) {\\n require(x < 1 << 24);\\n\\n y = uint24(x);\\n }\\n\\n function safeCastTo16(uint256 x) internal pure returns (uint16 y) {\\n require(x < 1 << 16);\\n\\n y = uint16(x);\\n }\\n\\n function safeCastTo8(uint256 x) internal pure returns (uint8 y) {\\n require(x < 1 << 8);\\n\\n y = uint8(x);\\n }\\n}\\n\",\"keccak256\":\"0xb784a14411858036491124e677aecde6d500e695b7a70c74aa8f1001bda2ccab\",\"license\":\"AGPL-3.0-only\"},\"solmate/utils/SafeTransferLib.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0-only\\npragma solidity >=0.8.0;\\n\\nimport {ERC20} from \\\"../tokens/ERC20.sol\\\";\\n\\n/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.\\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)\\n/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.\\n/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.\\nlibrary SafeTransferLib {\\n /*//////////////////////////////////////////////////////////////\\n ETH OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferETH(address to, uint256 amount) internal {\\n bool success;\\n\\n assembly {\\n // Transfer the ETH and store if it succeeded or not.\\n success := call(gas(), to, amount, 0, 0, 0, 0)\\n }\\n\\n require(success, \\\"ETH_TRANSFER_FAILED\\\");\\n }\\n\\n /*//////////////////////////////////////////////////////////////\\n ERC20 OPERATIONS\\n //////////////////////////////////////////////////////////////*/\\n\\n function safeTransferFrom(\\n ERC20 token,\\n address from,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), from) // Append the \\\"from\\\" argument.\\n mstore(add(freeMemoryPointer, 36), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 68), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FROM_FAILED\\\");\\n }\\n\\n function safeTransfer(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"TRANSFER_FAILED\\\");\\n }\\n\\n function safeApprove(\\n ERC20 token,\\n address to,\\n uint256 amount\\n ) internal {\\n bool success;\\n\\n assembly {\\n // Get a pointer to some free memory.\\n let freeMemoryPointer := mload(0x40)\\n\\n // Write the abi-encoded calldata into memory, beginning with the function selector.\\n mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)\\n mstore(add(freeMemoryPointer, 4), to) // Append the \\\"to\\\" argument.\\n mstore(add(freeMemoryPointer, 36), amount) // Append the \\\"amount\\\" argument.\\n\\n success := and(\\n // Set success to whether the call reverted, if not we check it either\\n // returned exactly 1 (can't just be non-zero data), or had no return data.\\n or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),\\n // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.\\n // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.\\n // Counterintuitively, this call must be positioned second to the or() call in the\\n // surrounding and() call or else returndatasize() will be zero during the computation.\\n call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)\\n )\\n }\\n\\n require(success, \\\"APPROVE_FAILED\\\");\\n }\\n}\\n\",\"keccak256\":\"0x333b56bef66ff71e3838910781df214acbeb6c2d6ace27a04ebb510f0e669300\",\"license\":\"AGPL-3.0-only\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b5061001961001e565b6100de565b600054610100900460ff161561008a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811610156100dc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b611ac4806100ed6000396000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063abc6d72d1161010f578063e30c3978116100a2578063f2fde38b11610071578063f2fde38b14610440578063f7c618c114610453578063f8c8765e14610466578063fc4d33f91461047957600080fd5b8063e30c3978146103f5578063e6e162e814610408578063ef5cfb8c1461041a578063f046ee5c1461042d57600080fd5b8063cc6bc101116100de578063cc6bc101146103ba578063cc7ebdc4146102e4578063dde684a514610348578063e1e3dfeb146103e257600080fd5b8063abc6d72d1461023a578063b006340d146102d1578063b9be44ac14610392578063c3b28864146103a557600080fd5b8063715018a6116101875780638da5cb5b116101565780638da5cb5b146103245780638fb0091314610335578063a7a9a62c14610348578063ab5497d71461037f57600080fd5b8063715018a6146102c9578063715cad16146102d15780637fb5ad38146102e4578063877887821461031b57600080fd5b806346904840116101c357806346904840146102655780634e081c95146102905780635a826df3146102a35780636e96dfd7146102b657600080fd5b806310509aa9146101f5578063116139d31461020a57806317e6a45f1461023a5780631c9161e014610252575b600080fd5b6102086102033660046116d0565b610481565b005b61021d610218366004611700565b610493565b6040516001600160e01b0390911681526020015b60405180910390f35b610242600181565b6040519015158152602001610231565b610208610260366004611700565b6104c9565b606754610278906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b61020861029e36600461172e565b6104d8565b6102086102b1366004611779565b6104ea565b6102086102c4366004611779565b61053c565b6102086105a6565b6102086102df366004611779565b6105ee565b61030d6102f2366004611779565b6001600160a01b03166000908152606c602052604090205490565b604051908152602001610231565b61030d60665481565b6033546001600160a01b0316610278565b610208610343366004611779565b610602565b61035b610356366004611779565b610702565b604080516001600160e01b03909316835263ffffffff909116602083015201610231565b606b54610278906001600160a01b031681565b61030d6103a0366004611700565b610736565b6103ad6107a2565b604051610231919061179d565b6103cd6103c836600461172e565b610804565b60408051928352602083019190915201610231565b6102786103f03660046117ea565b610885565b606554610278906001600160a01b031681565b610208610416366004611700565b5050565b610208610428366004611779565b6108af565b606a54610278906001600160a01b031681565b61020861044e366004611779565b610945565b606854610278906001600160a01b031681565b610208610474366004611803565b6109b6565b610208610b38565b610489610c4c565b6104168282610ca8565b6001600160a01b038083166000908152606e60209081526040808320938516835292905220546001600160e01b03165b92915050565b6104d38282610736565b505050565b6104e3838383610804565b5050505050565b6104f2610c4c565b606b80546001600160a01b0319166001600160a01b0383169081179091556040517ff2fb4350e8466c152b500f8e58c0c23f01bbc332dc82f5375267e70b5f50f19990600090a250565b610544610c4c565b606580546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b91015b60405180910390a15050565b6105ae610c4c565b60405162461bcd60e51b815260206004820152601060248201526f6e6f74207573656420616e796d6f726560801b60448201526064015b60405180910390fd5b6105f6610c4c565b6105ff81610d91565b50565b61060a610c4c565b606a546001600160a01b0316156106b857606854606a546040516370a0823160e01b81526001600160a01b03918216600482015260009291909116906370a0823190602401602060405180830381865afa15801561066c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610690919061185f565b905080156106b657606a546068546106b6916001600160a01b0391821691168484610f32565b505b606a80546001600160a01b0319166001600160a01b0383169081179091556040517ff1ba364f52e65f08563196b608289b1da2a923cdd0aa7e20dfe664c4ad294c9590600090a250565b6001600160a01b03166000908152606d60205260409020546001600160e01b03811691600160e01b90910463ffffffff1690565b600080600061074485610702565b604080518082019091526001600160e01b03831680825263ffffffff831660208301529294509092509060000361078157600093505050506104c3565b61078b8682610fb5565b90506107988686836112c3565b9695505050505050565b606060698054806020026020016040519081016040528092919081815260200182805480156107fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107dc575b5050505050905090565b60008060008061081387610702565b604080518082019091526001600160e01b03831680825263ffffffff8316602083015292945090925090600003610853576000809450945050505061087d565b61085d8882610fb5565b905061086a8888836112c3565b6108758988846112c3565b945094505050505b935093915050565b6069818154811061089557600080fd5b6000918252602090912001546001600160a01b0316905081565b6001600160a01b0381166000908152606c60205260409020548015610416576001600160a01b038083166000908152606c6020526040812055606a546068546108fe9290811691168484610f32565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc678260405161093991815260200190565b60405180910390a25050565b61094d610c4c565b606554604080516001600160a01b03928316815291831660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910160405180910390a1606580546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16158080156109d65750600054600160ff909116105b806109f05750303b1580156109f0575060005460ff166001145b610a535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e5565b6000805460ff191660011790558015610a76576000805461ff0019166101001790555b610a7f336115b2565b606880546001600160a01b038088166001600160a01b031992831617909255606a8054878416908316179055606b805492861692909116919091179055610ac5826115e6565b67016345785d8a0000606655606780546001600160a01b0319166001600160a01b03841617905580156104e3576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050505050565b6065546001600160a01b03163314610b8a5760405162461bcd60e51b81526020600482015260156024820152743737ba103a3432903832b73234b7339037bbb732b960591b60448201526064016105e5565b6000610b9e6033546001600160a01b031690565b6065549091506001600160a01b0316610bb6816115e6565b606580546001600160a01b0319169055604080516001600160a01b0384168152600060208201527f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b2364910160405180910390a1606554604080516001600160a01b03808516825290921660208301527fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b910161059a565b6033546001600160a01b03163314610ca65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105e5565b565b60665460675460408051928352602083018590526001600160a01b0391821690830152821660608201527fb3b62da5184b9e7e2f5d280014bb485d4444b66738025e5fb5738bbddcb6b8489060800160405180910390a16067546001600160a01b03828116911614610d6a576067546001600160a01b039081166000908152606c602052604080822054928416825281208054909190610d4990849061188e565b90915550506067546001600160a01b03166000908152606c60205260408120555b606691909155606780546001600160a01b0319166001600160a01b03909216919091179055565b6000610d9c82610702565b5090506001600160e01b03811615610de15760405162461bcd60e51b8152602060048201526008602482015267737472617465677960c01b60448201526064016105e5565b6040805180820180835260685463313ce56760e01b909152915190918291610e69916001600160a01b03169063313ce567906044808601916020918188030181865afa158015610e35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5991906118a1565b610e6490600a6119a8565b611638565b6001600160e01b03168152602001610e804261164e565b63ffffffff9081169091526001600160a01b0384166000818152606d6020908152604080832086519690920151909416600160e01b026001600160e01b0390951694909417909355606980546001810182559084527f7fb4302e8e91f9110a6554c2c0a24601252c2a42c2220ca988efcfe3999143080180546001600160a01b03191682179055905190917f69887873d46778fb35539b0a9992d9176ca03c1820b0afb538bc3a6f63326b1091a25050565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806104e35760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b60448201526064016105e5565b6040805180820190915260008082526020820152606a54602083015160405163b334db7b60e01b81526001600160a01b03868116600483015263ffffffff9092166024820152600092919091169063b334db7b906044016020604051808303816000875af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f919061185f565b839250905080156112bc57606b546000906001600160a01b03166110d457846001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf919061185f565b611142565b606b54604051631e1932fb60e01b81526001600160a01b03878116600483015290911690631e1932fb90602401602060405180830381865afa15801561111e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611142919061185f565b90506000670de0b6b3a76400006001600160e01b03166066548461116691906119b7565b61117091906119ce565b6067546001600160a01b03166000908152606c602052604081208054929350839290919061119f90849061188e565b909155506111af905081846119f0565b9250600082156112415761123e83886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156111fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061121f91906118a1565b61122a90600a6119a8565b61123490876119b7565b610e6491906119ce565b90505b604051806040016040528082886000015161125c9190611a03565b6001600160e01b031681526020016112734261164e565b63ffffffff9081169091526001600160a01b0389166000908152606d60209081526040909120835191840151909216600160e01b026001600160e01b0390911617905594505050505b5092915050565b8051600090816112d38686610493565b6001600160a01b038781166000908152606e60209081526040808320938a16835292905290812080546001600160e01b0319166001600160e01b03868116919091179091559192509082169003611372576068546040805163313ce56760e01b8152905161136f926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610e35573d6000803e3d6000fd5b90505b600061137e8284611a23565b606b549091506000906001600160a01b0316611403576040516370a0823160e01b81526001600160a01b0388811660048301528916906370a0823190602401602060405180830381865afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe919061185f565b611479565b606b54604051631a50ef2f60e01b81526001600160a01b038a81166004830152898116602483015290911690631a50ef2f90604401602060405180830381865afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611479919061185f565b90506000886001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114df91906118a1565b6114ea90600a6119a8565b6114fd836001600160e01b0386166119b7565b61150791906119ce565b905060008161152b8a6001600160a01b03166000908152606c602052604090205490565b611535919061188e565b6001600160a01b03808b166000818152606c6020526040908190208490555192935091908c16907f35a61f3c719e8f59f636c336e563ba74f667fadafcc80d709231ca8bb59eecce9061159d9086908b909182526001600160e01b0316602082015260400190565b60405180910390a39998505050505050505050565b600054610100900460ff166115d95760405162461bcd60e51b81526004016105e590611a43565b6115e1611661565b6105ff815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600160e01b821061164a57600080fd5b5090565b6000640100000000821061164a57600080fd5b600054610100900460ff166116885760405162461bcd60e51b81526004016105e590611a43565b610ca6600054610100900460ff166116b25760405162461bcd60e51b81526004016105e590611a43565b610ca6336115e6565b6001600160a01b03811681146105ff57600080fd5b600080604083850312156116e357600080fd5b8235915060208301356116f5816116bb565b809150509250929050565b6000806040838503121561171357600080fd5b823561171e816116bb565b915060208301356116f5816116bb565b60008060006060848603121561174357600080fd5b833561174e816116bb565b9250602084013561175e816116bb565b9150604084013561176e816116bb565b809150509250925092565b60006020828403121561178b57600080fd5b8135611796816116bb565b9392505050565b6020808252825182820181905260009190848201906040850190845b818110156117de5783516001600160a01b0316835292840192918401916001016117b9565b50909695505050505050565b6000602082840312156117fc57600080fd5b5035919050565b6000806000806080858703121561181957600080fd5b8435611824816116bb565b93506020850135611834816116bb565b92506040850135611844816116bb565b91506060850135611854816116bb565b939692955090935050565b60006020828403121561187157600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156104c3576104c3611878565b6000602082840312156118b357600080fd5b815160ff8116811461179657600080fd5b600181815b808511156118ff5781600019048211156118e5576118e5611878565b808516156118f257918102915b93841c93908002906118c9565b509250929050565b600082611916575060016104c3565b81611923575060006104c3565b816001811461193957600281146119435761195f565b60019150506104c3565b60ff84111561195457611954611878565b50506001821b6104c3565b5060208310610133831016604e8410600b8410161715611982575081810a6104c3565b61198c83836118c4565b80600019048211156119a0576119a0611878565b029392505050565b600061179660ff841683611907565b80820281158282048414176104c3576104c3611878565b6000826119eb57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156104c3576104c3611878565b6001600160e01b038181168382160190808211156112bc576112bc611878565b6001600160e01b038281168282160390808211156112bc576112bc611878565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220164bb12959af9fa74b00c600ad82d721c3381582e577f78e12ca5dd1661eec6764736f6c63430008160033", + "devdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "params": { + "rewardsDelta": "how many new rewards accrued to the user", + "rewardsIndex": "the market index for rewards per token accrued", + "strategy": "the updated rewards strategy", + "user": "the user of the rewards" + } + }, + "AddStrategy(address)": { + "params": { + "newStrategy": "the new added strategy" + } + }, + "ClaimRewards(address,uint256)": { + "params": { + "amount": "the amount of rewards claimed", + "user": "the user of the rewards" + } + }, + "FlywheelBoosterUpdate(address)": { + "params": { + "newBooster": "the new booster module" + } + }, + "FlywheelRewardsUpdate(address)": { + "params": { + "newFlywheelRewards": "the new rewards module" + } + }, + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "_acceptOwner()": { + "details": "Owner function for pending owner to accept role and update owner" + }, + "_setPendingOwner(address)": { + "details": "Owner function to begin change of owner. The newPendingOwner must call `_acceptOwner` to finalize the transfer.", + "params": { + "newPendingOwner": "New pending owner." + } + }, + "accrue(address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to user (including prior)" + } + }, + "accrue(address,address,address)": { + "params": { + "strategy": "the strategy to accrue a user's rewards on", + "user": "the second user to be accrued" + }, + "returns": { + "_0": "the cumulative amount of rewards accrued to the first user (including prior)", + "_1": "the cumulative amount of rewards accrued to the second user (including prior)" + } + }, + "claimRewards(address)": { + "details": "this function is public, and all rewards transfer to the user", + "params": { + "user": "the user claiming rewards" + } + }, + "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." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "updateFeeSettings(uint256,address)": { + "details": "Claim rewards first from the previous feeRecipient before changing it" + } + }, + "version": 1 + }, + "userdoc": { + "events": { + "AccrueRewards(address,address,uint256,uint256)": { + "notice": "Emitted when a user's rewards accrue to a given strategy." + }, + "AddStrategy(address)": { + "notice": "Emitted when a new strategy is added to flywheel by the admin" + }, + "ClaimRewards(address,uint256)": { + "notice": "Emitted when a user claims accrued rewards." + }, + "FlywheelBoosterUpdate(address)": { + "notice": "Emitted when the booster module changes" + }, + "FlywheelRewardsUpdate(address)": { + "notice": "Emitted when the rewards module changes" + }, + "NewOwner(address,address)": { + "notice": "Emitted when pendingOwner is accepted, which means owner is updated" + }, + "NewPendingOwner(address,address)": { + "notice": "Emitted when pendingOwner is changed" + } + }, + "kind": "user", + "methods": { + "_acceptOwner()": { + "notice": "Accepts transfer of owner rights. msg.sender must be pendingOwner" + }, + "_setPendingOwner(address)": { + "notice": "Begins transfer of owner rights. The newPendingOwner must call `_acceptOwner` to finalize the transfer." + }, + "accrue(address,address)": { + "notice": "accrue rewards for a single user on a strategy" + }, + "accrue(address,address,address)": { + "notice": "accrue rewards for a two users on a strategy" + }, + "addStrategyForRewards(address)": { + "notice": "initialize a new strategy" + }, + "allStrategies(uint256)": { + "notice": "append-only list of strategies added" + }, + "claimRewards(address)": { + "notice": "claim rewards for a given user" + }, + "feeRecipient()": { + "notice": "Address that gets rewardsToken accrued by performanceFee" + }, + "flywheelBooster()": { + "notice": "optional booster module for calculating virtual balances on strategies" + }, + "flywheelRewards()": { + "notice": "the rewards contract for managing streams" + }, + "pendingOwner()": { + "notice": "Pending owner of this contract" + }, + "performanceFee()": { + "notice": "How much rewardsToken will be send to treasury" + }, + "rewardToken()": { + "notice": "The token to reward" + }, + "setBooster(address)": { + "notice": "swap out the flywheel booster contract" + }, + "setFlywheelRewards(address)": { + "notice": "swap out the flywheel rewards contract" + }, + "updateFeeSettings(uint256,address)": { + "notice": "Update performanceFee and/or feeRecipient" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 176201, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 176204, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 178552, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 175825, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 175945, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 47957, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 54736, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "performanceFee", + "offset": 0, + "slot": "102", + "type": "t_uint256" + }, + { + "astId": 54739, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "feeRecipient", + "offset": 0, + "slot": "103", + "type": "t_address" + }, + { + "astId": 54743, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "rewardToken", + "offset": 0, + "slot": "104", + "type": "t_contract(ERC20)180913" + }, + { + "astId": 54748, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "allStrategies", + "offset": 0, + "slot": "105", + "type": "t_array(t_contract(ERC20)180913)dyn_storage" + }, + { + "astId": 54752, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelRewards", + "offset": 0, + "slot": "106", + "type": "t_contract(IFlywheelRewards)58375" + }, + { + "astId": 54756, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "flywheelBooster", + "offset": 0, + "slot": "107", + "type": "t_contract(IFlywheelBooster)54379" + }, + { + "astId": 54761, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_rewardsAccrued", + "offset": 0, + "slot": "108", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 54768, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_strategyState", + "offset": 0, + "slot": "109", + "type": "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)" + }, + { + "astId": 54776, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "_userIndex", + "offset": 0, + "slot": "110", + "type": "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(ERC20)180913)dyn_storage": { + "base": "t_contract(ERC20)180913", + "encoding": "dynamic_array", + "label": "contract ERC20[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(ERC20)180913": { + "encoding": "inplace", + "label": "contract ERC20", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelBooster)54379": { + "encoding": "inplace", + "label": "contract IFlywheelBooster", + "numberOfBytes": "20" + }, + "t_contract(IFlywheelRewards)58375": { + "encoding": "inplace", + "label": "contract IFlywheelRewards", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint224)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint224)", + "numberOfBytes": "32", + "value": "t_uint224" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_contract(ERC20)180913,t_mapping(t_address,t_uint224))": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => mapping(address => uint224))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_uint224)" + }, + "t_mapping(t_contract(ERC20)180913,t_struct(RewardsState)55244_storage)": { + "encoding": "mapping", + "key": "t_contract(ERC20)180913", + "label": "mapping(contract ERC20 => struct IonicFlywheelCore.RewardsState)", + "numberOfBytes": "32", + "value": "t_struct(RewardsState)55244_storage" + }, + "t_struct(RewardsState)55244_storage": { + "encoding": "inplace", + "label": "struct IonicFlywheelCore.RewardsState", + "members": [ + { + "astId": 55240, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "index", + "offset": 0, + "slot": "0", + "type": "t_uint224" + }, + { + "astId": 55243, + "contract": "contracts/ionic/strategies/flywheel/IonicFlywheel.sol:IonicFlywheel", + "label": "lastUpdatedTimestamp", + "offset": 28, + "slot": "0", + "type": "t_uint32" + } + ], + "numberOfBytes": "32" + }, + "t_uint224": { + "encoding": "inplace", + "label": "uint224", + "numberOfBytes": "28" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Proxy.json b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Proxy.json new file mode 100644 index 0000000000..36a03e8517 --- /dev/null +++ b/packages/contracts/deployments/optimism/IonicFlywheel_ION_epoch4_Proxy.json @@ -0,0 +1,289 @@ +{ + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "receipt": { + "to": null, + "from": "0x1155b614971f16758C92c4890eD338C9e3ede6b7", + "contractAddress": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "transactionIndex": 9, + "gasUsed": "846771", + "logsBloom": "0x00004000000000000000000000000000400000000000000000800000000200080000000008000000000020000000000000000010100000000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400020000000000000000000000000000000000000000080000000000000c00000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6", + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "logs": [ + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000a1b7c312499e2fbe663b4a1bc8c38fced27eade9" + ], + "data": "0x", + "logIndex": 34, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 35, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 36, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7", + "0x0000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "data": "0x", + "logIndex": 37, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 38, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + }, + { + "transactionIndex": 9, + "blockNumber": 126874619, + "transactionHash": "0xbc2579d306408196f17d8eba0f43caa94c2353e2f9ae7cb6083f5bba12b1a9fb", + "address": "0x6671AfE7c3aBd9Db195b3e58D348166c21405B88", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a7b9f9b18587a3854ae41c80a08291eca149bcb7", + "logIndex": 39, + "blockHash": "0x4ba703cc2df6ca958d634af84e037510f799e79a4def886a60a1e7b645c561d6" + } + ], + "blockNumber": 126874619, + "cumulativeGasUsed": "2060372", + "status": 1, + "byzantium": true + }, + "args": [ + "0xa1B7c312499E2FBE663B4A1BC8c38fCED27eAde9", + "0xA7B9F9B18587A3854aE41C80a08291eca149bCB7", + "0xf8c8765e000000000000000000000000887d1c6a4f3548279c2a8a9d0fa61b5d458d14fc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001155b614971f16758c92c4890ed338c9e3ede6b7" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/packages/contracts/tasks/chain-specific/base/liquidation.ts b/packages/contracts/tasks/chain-specific/base/liquidation.ts index e592a2edb9..e18fd402a9 100644 --- a/packages/contracts/tasks/chain-specific/base/liquidation.ts +++ b/packages/contracts/tasks/chain-specific/base/liquidation.ts @@ -159,8 +159,9 @@ task("base:liquidation:set-redemption-strategies", "Set redemption strategy").se const weethUnderlying = await weethContract.read.underlying(); const ognAsset = base.assets.find((asset) => asset.symbol === assetSymbols.OGN); const eurcAsset = base.assets.find((asset) => asset.symbol === assetSymbols.EURC); - if (!ognAsset || !eurcAsset) { - throw new Error("OGN or EURC asset not found in base assets"); + const uSOLAsset = base.assets.find((asset) => asset.symbol === assetSymbols.uSOL); + if (!ognAsset || !eurcAsset || !uSOLAsset) { + throw new Error("OGN or EURC or uSOL asset not found in base assets"); } const readTick = await liquidatorRegistry.read.aeroCLTickSpacings([wsuperOETHUnderlying, wethUnderlying]); @@ -183,6 +184,23 @@ task("base:liquidation:set-redemption-strategies", "Set redemption strategy").se await publicClient.waitForTransactionReceipt({ hash: tickTx2 }); console.log("Transaction sent to set tick spacing:", tickTx2); } + const readTickuSOLWETH = await liquidatorRegistry.read.aeroCLTickSpacings([uSOLAsset.underlying, wethUnderlying]); + const readTickWETHuSOL = await liquidatorRegistry.read.aeroCLTickSpacings([wethUnderlying, uSOLAsset.underlying]); + console.log("🚀 ~ readTick usol weth:", readTickuSOLWETH, readTickWETHuSOL); + if (readTickuSOLWETH !== 200) { + const tickTx3 = await liquidatorRegistry.write._setAeroCLTickSpacings([uSOLAsset.underlying, wethUnderlying, 1]); + await publicClient.waitForTransactionReceipt({ hash: tickTx3 }); + console.log("Transaction sent to set tick spacing:", tickTx3); + } + if (readTickWETHuSOL !== 200) { + const tickTx4 = await liquidatorRegistry.write._setAeroCLTickSpacings([ + wethUnderlying, + uSOLAsset.underlying, + 200 + ]); + await publicClient.waitForTransactionReceipt({ hash: tickTx4 }); + console.log("Transaction sent to set tick spacing:", tickTx4); + } const readWrapped = await liquidatorRegistry.read.wrappedToUnwrapped4626([wsuperOETHUnderlying]); console.log("🚀 ~ readWrapped:", readWrapped); if (readWrapped.toLowerCase() !== superOETH.toLowerCase()) { @@ -328,6 +346,16 @@ task("base:liquidation:set-redemption-strategies", "Set redemption strategy").se outputToken: eurcAsset.underlying, strategy: aeroV2Liquidator.address as Address }, + { + inputToken: uSOLAsset.underlying, + outputToken: wethUnderlying, + strategy: aeroCLLiquidator.address as Address + }, + { + inputToken: wethUnderlying, + outputToken: uSOLAsset.underlying, + strategy: aeroCLLiquidator.address as Address + }, { inputToken: wethUnderlying, outputToken: usdcUnderlying, diff --git a/packages/contracts/tasks/chain-specific/base/markets.ts b/packages/contracts/tasks/chain-specific/base/markets.ts index 1d662c9144..b7f15db271 100644 --- a/packages/contracts/tasks/chain-specific/base/markets.ts +++ b/packages/contracts/tasks/chain-specific/base/markets.ts @@ -4,7 +4,7 @@ import { assetSymbols } from "@ionicprotocol/types"; import { COMPTROLLER } from "."; task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem, run }) => { - const assetsToDeploy: string[] = [assetSymbols.wUSDM]; + const assetsToDeploy: string[] = [assetSymbols.uSOL]; for (const asset of base.assets.filter((asset) => assetsToDeploy.includes(asset.symbol))) { if (!asset.underlying || !asset.symbol) { throw new Error("Invalid asset"); @@ -34,7 +34,7 @@ task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem }); task("base:set-caps:new", "one time setup").setAction(async (_, { viem, run }) => { - const asset = base.assets.find((asset) => asset.symbol === assetSymbols.wUSDM); + const asset = base.assets.find((asset) => asset.symbol === assetSymbols.uSOL); if (!asset) { throw new Error("asset not found in base assets"); } diff --git a/packages/contracts/tasks/chain-specific/base/rewards.ts b/packages/contracts/tasks/chain-specific/base/rewards.ts index 8e5aebc504..6a5e60cc24 100644 --- a/packages/contracts/tasks/chain-specific/base/rewards.ts +++ b/packages/contracts/tasks/chain-specific/base/rewards.ts @@ -383,16 +383,16 @@ task("base:add-rewards:epoch3:borrow", "add rewards to a market").setAction( } ); -task("base:add-rewards:epoch3:supply", "add rewards to a market").setAction( +task("base:add-rewards:epoch4:supply", "add rewards to a market").setAction( async (_, { viem, deployments, getNamedAccounts }) => { const { deployer, multisig } = await getNamedAccounts(); const rewardToken = ION; const rewardTokenName = "ION"; - const market = wstETH_MARKET; + const market = USDz_MARKET; const _market = await viem.getContractAt("EIP20Interface", market); const name = await _market.read.name(); - const rewardAmount = (50_000).toString(); + const rewardAmount = (35_000).toString(); console.log("setting rewards for token: ", name, rewardAmount); await new Promise((resolve) => setTimeout(resolve, 4000)); @@ -417,7 +417,27 @@ task("base:add-rewards:epoch3:supply", "add rewards to a market").setAction( deployer as Address, viem, deployments, - multisig as Address + multisig as Address, + "IonicFlywheel_ION_epoch4", + "IonicFlywheelDynamicRewards_ION_epoch4" ); } -); \ No newline at end of file +); + +task("base:approve-flywheel", "approve flywheel for market").setAction( + async (_, { viem, deployments, getNamedAccounts }) => { + const { deployer } = await getNamedAccounts(); + const markets: Address[] = [hyUSD_MARKET, RSR_MARKET, wusdm_MARKET, wusdPlus_MARKET, USDz_MARKET]; + const rewardToken = ION; + + const fwRewards = await deployments.get("IonicFlywheelDynamicRewards_ION_epoch4"); + + for (const market of markets) { + const _market = await viem.getContractAt("CErc20RewardsDelegate", market); + const tx = await _market.write.approve([rewardToken as Address, fwRewards.address as Address]); + console.log( + `Approved flywheel ${fwRewards.address} to pull reward token ${rewardToken} from market ${market}: ${tx}` + ); + } + } +); diff --git a/packages/contracts/tasks/chain-specific/mode/rewards.ts b/packages/contracts/tasks/chain-specific/mode/rewards.ts index cee2d624c1..355d266d08 100644 --- a/packages/contracts/tasks/chain-specific/mode/rewards.ts +++ b/packages/contracts/tasks/chain-specific/mode/rewards.ts @@ -2,6 +2,7 @@ import { task } from "hardhat/config"; import { dmBTC_MARKET, ION, + MBTC_MARKET, MODE_NATIVE_MARKET, USDC_NATIVE_MARKET, USDT_NATIVE_MARKET, @@ -130,13 +131,13 @@ task("mode:add-rewards:epoch3:borrow", "add rewards to a market").setAction( } ); -task("mode:add-rewards:epoch3:supply", "add rewards to a market").setAction( +task("mode:add-rewards:epoch4:supply", "add rewards to a market").setAction( async (_, { viem, deployments, getNamedAccounts }) => { const { deployer, multisig } = await getNamedAccounts(); const rewardToken = ION; const rewardTokenName = "ION"; - const market = USDT_NATIVE_MARKET; - const rewardAmount = (0).toString(); + const market = dmBTC_MARKET; + const rewardAmount = (50_000).toString(); // Sending tokens const _rewardToken = await viem.getContractAt("EIP20Interface", rewardToken); @@ -158,7 +159,9 @@ task("mode:add-rewards:epoch3:supply", "add rewards to a market").setAction( deployer as Address, viem, deployments, - multisig as Address + multisig as Address, + "IonicFlywheel_ION_epoch4", + "IonicFlywheelDynamicRewards_ION_epoch4" ); } ); \ No newline at end of file diff --git a/packages/contracts/tasks/chain-specific/optimism/index.ts b/packages/contracts/tasks/chain-specific/optimism/index.ts index 1c390547a4..9c281a9bf6 100644 --- a/packages/contracts/tasks/chain-specific/optimism/index.ts +++ b/packages/contracts/tasks/chain-specific/optimism/index.ts @@ -5,4 +5,5 @@ import "./leverage"; export const COMPTROLLER_MAIN = "0xaFB4A254D125B0395610fdc8f1D022936c7b166B"; export const ION = "0x887d1c6A4f3548279c2a8A9D0FA61B5D458d14fC"; export const USDC_MARKET = "0x50549be7e21C3dc0Db03c3AbAb83e1a78d07e6e0"; -export const wUSDM_MARKET = "0xc63B18Fc9025ACC7830B9df05e5A0B208940a3EE"; \ No newline at end of file +export const wUSDM_MARKET = "0xc63B18Fc9025ACC7830B9df05e5A0B208940a3EE"; +export const WETH_MARKET = "0x53b1D15b24d93330b2fD359C798dE7183255e7f2"; \ No newline at end of file diff --git a/packages/contracts/tasks/chain-specific/optimism/rewards.ts b/packages/contracts/tasks/chain-specific/optimism/rewards.ts index ac3e2640d5..e145ac7f41 100644 --- a/packages/contracts/tasks/chain-specific/optimism/rewards.ts +++ b/packages/contracts/tasks/chain-specific/optimism/rewards.ts @@ -1,27 +1,47 @@ import { task } from "hardhat/config"; import { Address, parseEther } from "viem"; -import { ION, USDC_MARKET, wUSDM_MARKET } from "."; +import { ION, USDC_MARKET, WETH_MARKET, wUSDM_MARKET } from "."; import { setupRewards } from "../../flywheel/setup"; import { SUPPLY_DURATION } from ".."; -task("optimism:add-rewards:supply:epoch2", "add rewards to a market").setAction( +task("optimism:add-rewards:supply:epoch4", "add rewards to a market").setAction( async (_, { viem, deployments, getNamedAccounts }) => { - const { deployer } = await getNamedAccounts(); - const rewardAmount = "49872"; - const market = wUSDM_MARKET; + const { deployer, multisig } = await getNamedAccounts(); + const rewardToken = ION; const rewardTokenName = "ION"; + const market = WETH_MARKET; + const _market = await viem.getContractAt("EIP20Interface", market); + const name = await _market.read.name(); + + const rewardAmount = (50_000).toString(); + + console.log("setting rewards for token: ", name, rewardAmount); + await new Promise((resolve) => setTimeout(resolve, 4000)); // Sending tokens - const ionToken = await viem.getContractAt("EIP20Interface", ION); - let balance = await ionToken.read.balanceOf([market]); + const _rewardToken = await viem.getContractAt("EIP20Interface", rewardToken); + let balance = await _rewardToken.read.balanceOf([market]); + console.log("balance: ", balance); if (balance < parseEther(rewardAmount)) { - const tx = await ionToken.write.transfer([market, parseEther(rewardAmount) - balance]); - console.log("Sent rewards: ", tx); + const tx = await _rewardToken.write.transfer([market, parseEther(rewardAmount) - balance]); + console.log(`Sent ${rewardAmount} ${rewardTokenName} to ${market} - ${tx}`); } else { - console.log("No rewards sent, already enough"); + console.log(`Market already has enough ${rewardTokenName} - ${market}`); } - await setupRewards("supply", market, rewardTokenName, ION, SUPPLY_DURATION, deployer as Address, viem, deployments); + await setupRewards( + "supply", + market, + rewardTokenName, + rewardToken, + SUPPLY_DURATION, + deployer as Address, + viem, + deployments, + multisig as Address, + "IonicFlywheel_ION_epoch4", + "IonicFlywheelDynamicRewards_ION_epoch4" + ); } ); diff --git a/packages/contracts/tasks/flywheel/setup.ts b/packages/contracts/tasks/flywheel/setup.ts index 879b71a5df..569a2d939e 100644 --- a/packages/contracts/tasks/flywheel/setup.ts +++ b/packages/contracts/tasks/flywheel/setup.ts @@ -14,7 +14,9 @@ export const setupRewards = async ( deployer: Address, viem: HardhatRuntimeEnvironment["viem"], deployments: HardhatRuntimeEnvironment["deployments"], - multisig?: Address + multisig?: Address, + _flywheelName?: string, + _flywheelRewardsName?: string ) => { const publicClient = await viem.getPublicClient(); const needsMultisig = await upgradeMarketToSupportFlywheel(market, viem, deployer, deployments); @@ -39,7 +41,9 @@ export const setupRewards = async ( ); } - const flywheelName = `${contractName}${publicClient.chain.id === base.id && type === "borrow" ? "_Borrow" : ""}_${rewardTokenName}${publicClient.chain.id === base.id && type === "supply" ? "_v3" : ""}`; + const flywheelName = + _flywheelName ?? + `${contractName}${publicClient.chain.id === base.id && type === "borrow" ? "_Borrow" : ""}_${rewardTokenName}${publicClient.chain.id === base.id && type === "supply" ? "_v3" : ""}`; const _flywheel = await deployments.deploy(flywheelName, { contract: contractName, from: deployer, @@ -62,7 +66,9 @@ export const setupRewards = async ( ); // accidentally deployed the wrong flywheel rewards contract for mode for borrow, without the borrow prefix - const flywheelRewardsName = `IonicFlywheelDynamicRewards_${publicClient.chain.id !== mode.id && type === "borrow" ? "Borrow_" : ""}${rewardTokenName}${type === "supply" ? "_v3" : ""}`; + const flywheelRewardsName = + _flywheelRewardsName ?? + `IonicFlywheelDynamicRewards_${publicClient.chain.id !== mode.id && type === "borrow" ? "Borrow_" : ""}${rewardTokenName}${type === "supply" ? "_v3" : ""}`; const flywheelRewards = await deployments.deploy(flywheelRewardsName, { contract: "IonicFlywheelDynamicRewards", from: deployer, @@ -71,8 +77,8 @@ export const setupRewards = async ( _flywheel.address, // flywheel epochDuration // epoch duration ], - waitConfirmations: 1, - skipIfAlreadyDeployed: true + waitConfirmations: 1 + // skipIfAlreadyDeployed: true }); console.log( `Deployed flywheel rewards ${flywheelRewardsName}: ${flywheelRewards.address} - ${flywheelRewards.newlyDeployed ? "NEW: " : "reused: "} ${flywheelRewards.transactionHash}` @@ -115,8 +121,7 @@ export const setupRewards = async ( const _market = await viem.getContractAt("CErc20RewardsDelegate", market); const fwRewards = await flywheel.read.flywheelRewards(); if (!rewardsDistributors.map((s) => s.toLowerCase()).includes(flywheel.address.toLowerCase())) { - // if (owner.toLowerCase() !== deployer.toLowerCase()) { - if (false) { + if (owner.toLowerCase() !== deployer.toLowerCase()) { await prepareAndLogTransaction({ contractInstance: comptroller, functionName: "_addRewardsDistributor", @@ -134,8 +139,7 @@ export const setupRewards = async ( console.log(`Flywheel ${flywheel.address} already added to pool ${_comptroller}`); } - // if (owner.toLowerCase() !== deployer.toLowerCase()) { - if (false) { + if (owner.toLowerCase() !== deployer.toLowerCase()) { await prepareAndLogTransaction({ contractInstance: _market, functionName: "approve", diff --git a/packages/contracts/tasks/market/admin.ts b/packages/contracts/tasks/market/admin.ts index eec447366e..f3822f761f 100644 --- a/packages/contracts/tasks/market/admin.ts +++ b/packages/contracts/tasks/market/admin.ts @@ -171,9 +171,22 @@ task("market:mint-pause", "Pauses minting on a market") const isPaused: boolean = await pool.read.mintGuardianPaused([market.address]); console.log(`The market at ${market.address} minting pause is currently set to ${isPaused}`); + const admin = await pool.read.admin(); if (isPaused != taskArgs.paused) { - tx = await pool.write._setMintPaused([market.address, taskArgs.paused]); - await publicClient.waitForTransactionReceipt({ hash: tx }); + if (admin.toLowerCase() !== deployer.toLowerCase()) { + await prepareAndLogTransaction({ + contractInstance: pool, + functionName: "_setMintPaused", + args: [market.address, taskArgs.paused], + description: "Set Mint Pause", + inputs: [ + { internalType: "address", name: "cToken", type: "address" }, + { internalType: "bool", name: "state", type: "bool" } + ] + }); + } else { + tx = await pool.write._setMintPaused([market.address, taskArgs.paused]); + } console.log(`Market mint pause tx ${tx}`); } else { @@ -210,11 +223,22 @@ task("markets:borrow-pause", "Pauses borrowing on a market") } const isPaused: boolean = await pool.read.borrowGuardianPaused([market.address]); + const admin = await pool.read.admin(); if (isPaused != taskArgs.paused) { - console.log(`setting market ${market.address} pause to ${taskArgs.paused}`); - tx = await pool.write._setBorrowPaused([market.address, taskArgs.paused]); - console.log(`waiting for tx ${tx}`); - await publicClient.waitForTransactionReceipt({ hash: tx }); + if (admin.toLowerCase() !== deployer.toLowerCase()) { + await prepareAndLogTransaction({ + contractInstance: pool, + functionName: "_setBorrowPaused", + args: [market.address, taskArgs.paused], + description: "Set Borrow Pause", + inputs: [ + { internalType: "address", name: "cToken", type: "address" }, + { internalType: "bool", name: "state", type: "bool" } + ] + }); + } else { + tx = await pool.write._setBorrowPaused([market.address, taskArgs.paused]); + } console.log(`Market borrow pause tx ${tx}`); } else { diff --git a/packages/sdk/deployments/base.json b/packages/sdk/deployments/base.json index 39df4213e0..c4488a9936 100644 --- a/packages/sdk/deployments/base.json +++ b/packages/sdk/deployments/base.json @@ -137,6 +137,9 @@ "IonicFlywheelDynamicRewards_ION": { "address": "0x6660174886cb3B26B38E5D4c1324E0BfB361F7CA" }, + "IonicFlywheelDynamicRewards_ION_epoch4": { + "address": "0xFf77cC49Ed565B79162a27e9C991Fc2CeFA39d57" + }, "IonicFlywheelDynamicRewards_ION_v3": { "address": "0x57913CfF75Acd553923E58D3EAFbCDDCCf7816d7" }, @@ -158,6 +161,15 @@ "IonicFlywheel_ION_Proxy": { "address": "0x6e93f617AB6CEfFec7c276B4fD4c136B7A7aDD54" }, + "IonicFlywheel_ION_epoch4": { + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E" + }, + "IonicFlywheel_ION_epoch4_Implementation": { + "address": "0xd6c14644Dd5EBde9Ef4931F64940100Ab55DEeA0" + }, + "IonicFlywheel_ION_epoch4_Proxy": { + "address": "0xDcF10D5193910e2A76B565C13942bF4EABc9498E" + }, "IonicFlywheel_ION_v2": { "address": "0x8D3879dAd76CaFF4b79F45Ca56bb90713182058a" }, @@ -278,6 +290,15 @@ "PoolLensSecondary": { "address": "0x431C87E08e2636733a945D742d25Ba77577ED480" }, + "PythPriceOracle": { + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62" + }, + "PythPriceOracle_Implementation": { + "address": "0x17a4dF7081F1cd1370C70eFeCaFfa11b5bf217b2" + }, + "PythPriceOracle_Proxy": { + "address": "0x32A5DA657D8DAae1F6B5df1CD400E058e80C1f62" + }, "SimplePriceOracle": { "address": "0xBbDcA7858ac2417b06636F7BA35e7d9EA39402ea" }, diff --git a/packages/sdk/deployments/mode.json b/packages/sdk/deployments/mode.json index e429fe3564..9cd3eb7ddc 100644 --- a/packages/sdk/deployments/mode.json +++ b/packages/sdk/deployments/mode.json @@ -110,6 +110,9 @@ "IonicFlywheelDynamicRewards_ION": { "address": "0xdb93567451Cc2D785fAB5744a07dbF0C7a90415f" }, + "IonicFlywheelDynamicRewards_ION_epoch4": { + "address": "0xBFAE7571C47A1D42BcEAd3D57d116Ca69495d989" + }, "IonicFlywheelDynamicRewards_ION_v3": { "address": "0x4a003b110162C86fE10cD39822c782eb08C2549C" }, @@ -125,6 +128,15 @@ "IonicFlywheel_ION_Proxy": { "address": "0xcC11Fc7048db155F691Cc20Ac9958Fc465fa0062" }, + "IonicFlywheel_ION_epoch4": { + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5" + }, + "IonicFlywheel_ION_epoch4_Implementation": { + "address": "0x92ce3434F254161178A4b4a786C7Be559b752497" + }, + "IonicFlywheel_ION_epoch4_Proxy": { + "address": "0x6AfCca37CC93DB6bed729d20ADF203290d465df5" + }, "IonicLiquidator": { "address": "0x5782c512c07F217A8DE9611E7CE8c98f13193a46" }, diff --git a/packages/sdk/src/IonicSdk/index.ts b/packages/sdk/src/IonicSdk/index.ts index 9144e8299b..3870b4d0d6 100644 --- a/packages/sdk/src/IonicSdk/index.ts +++ b/packages/sdk/src/IonicSdk/index.ts @@ -306,7 +306,7 @@ export class IonicBase { } } if (irmModel === null) { - throw Error("InterestRateModel not found"); + return new JumpRateModel(); } return irmModel; } diff --git a/packages/types/src/enums.ts b/packages/types/src/enums.ts index fa309abe8c..75a3d4277b 100644 --- a/packages/types/src/enums.ts +++ b/packages/types/src/enums.ts @@ -202,6 +202,7 @@ export enum assetSymbols { USDplus = "USD+", wUSDplus = "wUSD+", USDz = "USDz", + uSOL = "uSOL", // optimism OP = "OP", diff --git a/packages/ui/app/_components/dashboards/InfoRows.tsx b/packages/ui/app/_components/dashboards/InfoRows.tsx index 72a3c3a4c4..eaf6dc3012 100644 --- a/packages/ui/app/_components/dashboards/InfoRows.tsx +++ b/packages/ui/app/_components/dashboards/InfoRows.tsx @@ -64,6 +64,11 @@ const InfoRows = ({ ), [selectedChain, rewards] ); + const totalSupplyRewardsAPR = useMemo( + () => + supplyRewards?.reduce((acc, reward) => acc + (reward.apy ?? 0), 0) ?? 0, + [supplyRewards] + ); const borrowRewards = useMemo( () => @@ -79,6 +84,10 @@ const InfoRows = ({ borrowRewards?.reduce((acc, reward) => acc + (reward.apy ?? 0), 0) ?? 0, [borrowRewards] ); + const totalApr = + mode === InfoMode.BORROW + ? 0 - Number(apr) + totalBorrowRewardsAPR + : Number(apr) + totalSupplyRewardsAPR; return (
- {apr} + {mode === InfoMode.SUPPLY + ? totalApr.toLocaleString('en-US', { + maximumFractionDigits: 2 + }) + : (totalApr > 0 ? '+' : '') + + totalApr.toLocaleString('en-US', { + maximumFractionDigits: 1 + })} + % {mode === InfoMode.SUPPLY ? ( <> (false); const [loopOpen, setLoopOpen] = useState(false); const [swapWidgetOpen, setSwapWidgetOpen] = useState(false); + const predictedHealthFactor = useMemo(() => { + if (updatedAsset && updatedAsset?.supplyBalanceFiat < 0.01) { + return maxUint256; + } + + return _predictedHealthFactor; + }, [_predictedHealthFactor, updatedAsset]); + const hfpStatus = useMemo(() => { if (!predictedHealthFactor) { return HFPStatus.UNKNOWN; } + if (predictedHealthFactor === maxUint256) { + return HFPStatus.NORMAL; + } + + if (updatedAsset && updatedAsset?.supplyBalanceFiat < 0.01) { + return HFPStatus.NORMAL; + } + const predictedHealthFactorNumber = Number( formatEther(predictedHealthFactor) ); @@ -324,7 +348,7 @@ const Popup = ({ } return HFPStatus.NORMAL; - }, [predictedHealthFactor]); + }, [predictedHealthFactor, updatedAsset]); const queryClient = useQueryClient(); /** @@ -1147,6 +1171,22 @@ const Popup = ({ } }; + const normalizeHealthFactor = ( + healthFactor: string | null | undefined + ): string | undefined => + healthFactor + ? healthFactor === '-1' + ? '∞' + : Number(healthFactor).toFixed(2) + : undefined; + + const normalizePredictedHealthFactor = ( + predictedHealthFactor: bigint | null | undefined + ): string | undefined => + predictedHealthFactor === maxUint256 + ? '∞' + : Number(formatEther(predictedHealthFactor ?? 0n)).toFixed(2); + return ( <>
Health Factor - {`${Number(healthFactor).toFixed(2)}`} + {`${normalizeHealthFactor(healthFactor)}`} {`->`} - {Number( - formatEther(predictedHealthFactor ?? 0n) - ).toFixed(2)} + {normalizePredictedHealthFactor(predictedHealthFactor)}
@@ -1597,16 +1635,14 @@ const Popup = ({ > Health Factor - {`${Number(healthFactor).toFixed(2)}`} + {`${normalizeHealthFactor(healthFactor)}`} {`->`} - {Number( - formatEther(predictedHealthFactor ?? 0n) - ).toFixed(2)} + {normalizePredictedHealthFactor(predictedHealthFactor)}
@@ -1751,16 +1787,14 @@ const Popup = ({ > Health Factor - {`${Number(healthFactor).toFixed(2)}`} + {`${normalizeHealthFactor(healthFactor)}`} {`->`} - {Number( - formatEther(predictedHealthFactor ?? 0n) - ).toFixed(2)} + {normalizePredictedHealthFactor(predictedHealthFactor)} diff --git a/packages/ui/app/dashboard/page.tsx b/packages/ui/app/dashboard/page.tsx index ccdb1be3b1..abc0886234 100644 --- a/packages/ui/app/dashboard/page.tsx +++ b/packages/ui/app/dashboard/page.tsx @@ -2,13 +2,11 @@ 'use client'; import millify from 'millify'; -// import Link from 'next/link'; import dynamic from 'next/dynamic'; import { useSearchParams } from 'next/navigation'; import { useMemo, useState } from 'react'; -import type { FlywheelReward } from 'types/dist'; +import type { FlywheelReward, OpenPosition, PositionInfo } from 'types/dist'; import { type Address, formatEther, formatUnits, parseEther } from 'viem'; -// import { base } from 'viem/chains'; // import { useChainId } from 'wagmi'; import ClaimRewardPopover from '../_components/dashboards/ClaimRewardPopover'; @@ -24,7 +22,6 @@ const PoolToggle = dynamic(() => import('../_components/markets/PoolToggle'), { import { pools } from '@ui/constants/index'; import { useMultiIonic } from '@ui/context/MultiIonicContext'; -// import { useSdk } from '@ui/hooks/fuse/useSdk'; import { useCurrentLeverageRatios } from '@ui/hooks/leverage/useCurrentLeverageRatio'; import { usePositionsInfo } from '@ui/hooks/leverage/usePositionInfo'; import { usePositionsQuery } from '@ui/hooks/leverage/usePositions'; @@ -35,18 +32,10 @@ import { useUsdPrice } from '@ui/hooks/useAllUsdPrices'; import { useFusePoolData } from '@ui/hooks/useFusePoolData'; import { useLoopMarkets } from '@ui/hooks/useLoopMarkets'; import { useOutsideClick } from '@ui/hooks/useOutsideClick'; -import { - usePointsForBorrowModeNative, - usePointsForSupplyModeNative, - usePointsForBorrowBaseMain, - usePointsForBorrowModeMain, - usePointsForSupplyBaseMain, - usePointsForSupplyModeMain -} from '@ui/hooks/usePointsQueries'; import { useRewards } from '@ui/hooks/useRewards'; import { useTotalSupplyAPYs } from '@ui/hooks/useTotalSupplyAPYs'; import { useUserNetApr } from '@ui/hooks/useUserNetApr'; -import type { MarketData } from '@ui/types/TokensDataMap'; +import type { MarketData, PoolData } from '@ui/types/TokensDataMap'; import { getBlockTimePerMinuteByChainId } from '@ui/utils/networkData'; export default function Dashboard() { @@ -65,6 +54,7 @@ export default function Dashboard() { ); const { data: positions, isLoading: isLoadingPositions } = usePositionsQuery(+chain); + const collateralsAPR = usePositionsSupplyApy( positions?.openPositions.map((position) => position.collateral) ?? [], positions?.openPositions.map((position) => position.chainId) ?? [] @@ -186,18 +176,6 @@ export default function Dashboard() { return healthData ?? '∞'; }, [healthData, marketData]); - const { data: supplyPointsNative, isLoading: isLoadingSupplyPointsNative } = - usePointsForSupplyModeNative(); - const { data: borrowPointsNative, isLoading: isLoadingBorrowPointsNative } = - usePointsForBorrowModeNative(); - const { data: borrowPointsBase, isLoading: isLoadingBorrowPointsBase } = - usePointsForBorrowBaseMain(); - const { data: borrowPointsMain, isLoading: isLoadingBorrowPointsMain } = - usePointsForBorrowModeMain(); - const { data: supplyPointsBase, isLoading: isLoadingSupplyPointsBase } = - usePointsForSupplyBaseMain(); - const { data: supplyPointsMain, isLoading: isLoadingSupplyPointsMain } = - usePointsForSupplyModeMain(); // for utilization: // const { data: borrowCaps, isLoading: isLoadingBorrowCaps } = // useMaxBorrowAmounts( @@ -206,89 +184,6 @@ export default function Dashboard() { // +chain // ); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const totalPoints = useMemo(() => { - if ( - supplyPointsNative && - borrowPointsNative && - borrowPointsBase && - borrowPointsMain && - supplyPointsBase && - supplyPointsMain - ) { - return ( - supplyPointsNative.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) + - borrowPointsNative.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) + - borrowPointsBase.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) + - borrowPointsMain.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) + - supplyPointsBase.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) + - supplyPointsMain.rows.reduce( - (accumulator, current) => - accumulator + - current.reduce( - (innerAccumulator, innerCurrent) => - innerAccumulator + innerCurrent, - 0 - ), - 0 - ) - ); - } - - return 0; - }, [ - supplyPointsNative, - borrowPointsNative, - borrowPointsBase, - borrowPointsMain, - supplyPointsBase, - supplyPointsMain - ]); const { data: userNetApr, isLoading: isLoadingUserNetApr } = useUserNetApr(); const healthColorClass = useMemo(() => { const healthDataAsNumber = parseFloat(healthData ?? '0'); @@ -353,14 +248,15 @@ export default function Dashboard() { }); const allChains: number[] = Object.keys(pools).map(Number); - const { data: claimableRewardsAcrossAllChains } = - useAllClaimableRewards(allChains); + const { + data: claimableRewardsAcrossAllChains, + isLoading: isLoadingClaimableRewardsAcrossAllChains + } = useAllClaimableRewards(allChains); const totalRewardsAcrossAllChains = claimableRewardsAcrossAllChains?.reduce( (acc, reward) => acc + reward.amount, 0n ) ?? 0n; - // console.log(claimableRewardsAcrossAllChains , totalRewardsAcrossAllChains) const { componentRef: rewardRef, @@ -511,14 +407,7 @@ export default function Dashboard() { Claimable Rewards @@ -527,7 +416,9 @@ export default function Dashboard() { ).toLocaleString('en-us', { maximumFractionDigits: 0 })}{' '} - (ION+RSR) + + (ION+hyUSD+eUSD) + @@ -648,7 +539,7 @@ export default function Dashboard() { getBlockTimePerMinuteByChainId(+chain) ) .toFixed(2) ?? '0.00' - }%`} + }`} asset={asset.underlyingSymbol} collateralApr={`${ assetsSupplyAprData @@ -738,7 +629,7 @@ export default function Dashboard() { getBlockTimePerMinuteByChainId(+chain) ) .toFixed(2) ?? '0.00' - }%`} + }`} asset={asset.underlyingSymbol} collateralApr={`${ assetsSupplyAprData @@ -816,125 +707,17 @@ export default function Dashboard() { } return ( -
-
- {position.address} -

{position.collateral.symbol}

- / - {position.address} -

{position.borrowable.symbol}

-
- -

- - POSITION VALUE: - - {Number( - formatUnits( - currentPositionInfo.positionSupplyAmount, - Number(position.collateral.underlyingDecimals) - ) - ).toLocaleString('en-US', { - maximumFractionDigits: 2 - })}{' '} - / $ - {millify( - Number( - formatUnits( - currentPositionInfo.positionSupplyAmount, - Number(position.collateral.underlyingDecimals) - ) - ) * - ((usdPrice ?? 0) * - Number( - formatEther( - marketData?.assets.find( - (asset) => - asset.underlyingSymbol === - position.collateral.symbol - )?.underlyingPrice ?? 0n - ) - )) - )} -

- -

- - BORROW: - - {Number( - formatUnits( - currentPositionInfo.debtAmount, - position.borrowable.underlyingDecimals - ) - ).toLocaleString('en-US', { - maximumFractionDigits: 2 - })}{' '} - / $ - {millify( - Number( - formatUnits( - currentPositionInfo.debtAmount, - position.borrowable.underlyingDecimals - ) - ) * - ((usdPrice ?? 0) * - Number( - formatEther( - marketData?.assets.find( - (asset) => - asset.underlyingSymbol === - position.borrowable.symbol - )?.underlyingPrice ?? 0n - ) - )) - )} -

- -

- - LOOPS: - - - {( - Math.ceil( - positionLeverages ? positionLeverages[i] : 0 - ) - 1 - ).toFixed(1)} -

- -

- -

-
+ currentPositionInfo={currentPositionInfo} + marketData={marketData ?? undefined} + position={position} + positionLeverage={positionLeverages?.[i] ?? undefined} + usdPrice={usdPrice ?? undefined} + setSelectedLoopBorrowData={setSelectedLoopBorrowData} + setSelectedSymbol={setSelectedSymbol} + setLoopOpen={setLoopOpen} + /> ); })} @@ -972,3 +755,145 @@ export default function Dashboard() { ); } +type LoopRowProps = { + position: OpenPosition; + currentPositionInfo: PositionInfo; + usdPrice?: number; + positionLeverage?: number; + marketData?: PoolData; + setSelectedLoopBorrowData: (asset?: MarketData) => void; + setSelectedSymbol: (symbol: string) => void; + setLoopOpen: (open: boolean) => void; +}; +const LoopRow = ({ + position, + currentPositionInfo, + usdPrice, + positionLeverage, + marketData, + setSelectedLoopBorrowData, + setSelectedSymbol, + setLoopOpen +}: LoopRowProps) => { + // const walletChain = useChainId(); + // const { data: allClaimableRewards } = useAllClaimableRewards( + // [walletChain], + // position.address + // ); + // console.log( + // '🚀 ~ allClaimableRewards:', + // position.address, + // allClaimableRewards + // ); + return ( +
+
+ {position.address} +

{position.collateral.symbol}

+ / + {position.address} +

{position.borrowable.symbol}

+
+ +

+ + POSITION VALUE: + + {Number( + formatUnits( + currentPositionInfo.positionSupplyAmount, + Number(position.collateral.underlyingDecimals) + ) + ).toLocaleString('en-US', { + maximumFractionDigits: 2 + })}{' '} + / $ + {millify( + Number( + formatUnits( + currentPositionInfo.positionSupplyAmount, + Number(position.collateral.underlyingDecimals) + ) + ) * + ((usdPrice ?? 0) * + Number( + formatEther( + marketData?.assets.find( + (asset) => + asset.underlyingSymbol === position.collateral.symbol + )?.underlyingPrice ?? 0n + ) + )) + )} +

+ +

+ + BORROW: + + {Number( + formatUnits( + currentPositionInfo.debtAmount, + position.borrowable.underlyingDecimals + ) + ).toLocaleString('en-US', { + maximumFractionDigits: 2 + })}{' '} + / $ + {millify( + Number( + formatUnits( + currentPositionInfo.debtAmount, + position.borrowable.underlyingDecimals + ) + ) * + ((usdPrice ?? 0) * + Number( + formatEther( + marketData?.assets.find( + (asset) => + asset.underlyingSymbol === position.borrowable.symbol + )?.underlyingPrice ?? 0n + ) + )) + )} +

+ +

+ + LOOPS: + + + {(Math.ceil(positionLeverage ? positionLeverage : 0) - 1).toFixed(1)} +

+ +

+ +

+
+ ); +}; diff --git a/packages/ui/constants/index.ts b/packages/ui/constants/index.ts index 5f11525c17..eff68304d3 100644 --- a/packages/ui/constants/index.ts +++ b/packages/ui/constants/index.ts @@ -95,7 +95,10 @@ export const FLYWHEEL_TYPE_MAP: Record< Record<'borrow' | 'supply', Address[]> > = { [mode.id]: { - supply: ['0xcC11Fc7048db155F691Cc20Ac9958Fc465fa0062'], + supply: [ + '0xcC11Fc7048db155F691Cc20Ac9958Fc465fa0062', + '0x6AfCca37CC93DB6bed729d20ADF203290d465df5' + ], borrow: [ '0x2DC3f7B18e8F62F7fE7819596D15E521EEf3b1ec', '0x4E854cde138495a3eB9CFe48e50F12dC352cD834' @@ -107,7 +110,8 @@ export const FLYWHEEL_TYPE_MAP: Record< '0x6e93f617AB6CEfFec7c276B4fD4c136B7A7aDD54', '0x5Dc1fd5cFA5F1efdaCBC790b41A2BfB41bf4F122', '0xf638994B1155DfE2cbDd9589365960DD8dcDE6B4', - '0xc39441b305705AfD07de97237bC835a4501AbbEC' + '0xc39441b305705AfD07de97237bC835a4501AbbEC', + '0xDcF10D5193910e2A76B565C13942bF4EABc9498E' // '0xCc7FF230365bD730eE4B352cC2492CEdAC49383e' ], borrow: [ @@ -116,7 +120,10 @@ export const FLYWHEEL_TYPE_MAP: Record< ] }, [optimism.id]: { - supply: ['0x4D01bb5710F1989b6C2Dde496a5400E7F3b88162'], + supply: [ + '0x6671AfE7c3aBd9Db195b3e58D348166c21405B88', + '0x4D01bb5710F1989b6C2Dde496a5400E7F3b88162' + ], borrow: [] } }; @@ -202,7 +209,7 @@ export const pools: Record = { 'USDz', 'wUSD+', 'wUSDM', - 'USD+', + 'uSOL', 'EURC', 'cbBTC', 'eUSD', @@ -213,7 +220,8 @@ export const pools: Record = { 'AERO', 'RSR', 'wstETH', - 'cbETH' + 'cbETH', + 'USD+' ] } ] diff --git a/packages/ui/public/img/symbols/32/color/usol.png b/packages/ui/public/img/symbols/32/color/usol.png new file mode 100644 index 0000000000..b60d8c5fd9 Binary files /dev/null and b/packages/ui/public/img/symbols/32/color/usol.png differ diff --git a/packages/ui/utils/multipliers.ts b/packages/ui/utils/multipliers.ts index 7ec4e1eeb8..fe23dec837 100644 --- a/packages/ui/utils/multipliers.ts +++ b/packages/ui/utils/multipliers.ts @@ -53,7 +53,8 @@ export const multipliers: Record< mode: 2, turtle: true, rewards: true, - ionAPR: false + ionAPR: true, + flywheel: true } }, dMBTC: { @@ -100,8 +101,8 @@ export const multipliers: Record< mode: 1, turtle: true, rewards: true, - ionAPR: true, - flywheel: true + ionAPR: false, + flywheel: false }, decimals: 6, market: 'usdc_market', @@ -156,8 +157,8 @@ export const multipliers: Record< mode: 1, turtle: true, rewards: true, - ionAPR: true, - flywheel: true + ionAPR: false, + flywheel: false }, market: 'weth_market', multiplier: 3000, @@ -245,8 +246,8 @@ export const multipliers: Record< mode: 1, turtle: true, rewards: true, - ionAPR: true, - flywheel: true + ionAPR: false, + flywheel: false }, market: 'weeth_market_new', multiplier: 3000, @@ -258,8 +259,8 @@ export const multipliers: Record< underlyingAPR: 2.99, turtle: true, rewards: true, - ionAPR: false, - flywheel: false + ionAPR: true, + flywheel: true } }, wrsETH: { @@ -410,7 +411,7 @@ export const multipliers: Record< underlyingAPR: 3.5, turtle: false, rewards: true, - ionAPR: false + ionAPR: true }, borrow: { flywheel: true, @@ -517,8 +518,8 @@ export const multipliers: Record< underlyingAPR: 2.99, turtle: false, rewards: true, - ionAPR: false, - flywheel: false + ionAPR: true, + flywheel: true } }, RSR: { @@ -533,8 +534,8 @@ export const multipliers: Record< ionic: 0, turtle: false, rewards: false, - ionAPR: false, - flywheel: false + ionAPR: true, + flywheel: true } }, wstETH: { @@ -597,9 +598,9 @@ export const multipliers: Record< supply: { ionic: 0, turtle: false, - rewards: true, - ionAPR: true, - flywheel: true + rewards: false, + ionAPR: false, + flywheel: false } }, 'wUSD+': { @@ -613,7 +614,7 @@ export const multipliers: Record< ionic: 0, underlyingAPR: 10, turtle: false, - rewards: true, + rewards: false, ionAPR: true, flywheel: true } @@ -623,15 +624,15 @@ export const multipliers: Record< ionic: 0, turtle: false, rewards: true, - ionAPR: false, - flywheel: false + ionAPR: true, + flywheel: true }, supply: { ionic: 0, turtle: false, rewards: true, - ionAPR: false, - flywheel: false + ionAPR: true, + flywheel: true } }, EURC: { @@ -756,6 +757,15 @@ export const multipliers: Record< }, [optimism.id]: { '0': { + WETH: { + supply: { + ionic: 0, + turtle: false, + rewards: true, + ionAPR: true, + flywheel: true + } + }, USDC: { supply: { ionic: 0, @@ -786,8 +796,8 @@ export const multipliers: Record< underlyingAPR: 5, turtle: false, rewards: true, - ionAPR: true, - flywheel: true + ionAPR: false, + flywheel: false } } }