creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "lib/blueberry-core/contracts/oracle/AggregatorOracle.sol": {
        "content": "// SPDX-License-Identifier: MIT\n/*\n██████╗ ██╗     ██╗   ██╗███████╗██████╗ ███████╗██████╗ ██████╗ ██╗   ██╗\n██╔══██╗██║     ██║   ██║██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝\n██████╔╝██║     ██║   ██║█████╗  ██████╔╝█████╗  ██████╔╝██████╔╝ ╚████╔╝\n██╔══██╗██║     ██║   ██║██╔══╝  ██╔══██╗██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝\n██████╔╝███████╗╚██████╔╝███████╗██████╔╝███████╗██║  ██║██║  ██║   ██║\n╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝\n*/\n\npragma solidity 0.8.22;\n\nimport { Ownable2StepUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"../utils/BlueberryConst.sol\" as Constants;\nimport \"../utils/BlueberryErrors.sol\" as Errors;\n\nimport { BaseOracleExt } from \"./BaseOracleExt.sol\";\nimport { IBaseOracle } from \"../interfaces/IBaseOracle.sol\";\n\n/**\n * @title AggregatorOracle\n * @author BlueberryProtocol\n * @notice This contract aggregates price feeds from multiple oracle sources,\n *         ensuring a more reliable and resilient price data.\n */\ncontract AggregatorOracle is IBaseOracle, Ownable2StepUpgradeable, BaseOracleExt {\n    /*//////////////////////////////////////////////////////////////////////////\n                                      PUBLIC STORAGE \n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @notice Mapping of primary oracle sources associated with each token.\n    mapping(address => uint256) private _primarySourceCount;\n    /// @notice Mapping from token to (mapping from index to oracle source)\n    mapping(address => mapping(uint256 => IBaseOracle)) private _primarySources;\n    //// @notice Maximum allowed price deviation between oracle sources, expressed in base 10000.\n    mapping(address => uint256) private _maxPriceDeviations;\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                      EVENTS \n    //////////////////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Emitted when primary oracle sources are set or updated for a token.\n     * @param token Address of the token whose oracle sources were updated.\n     * @param maxPriceDeviation Maximum allowed price deviation.\n     * @param oracles List of oracle sources set for the token.\n     */\n    event SetPrimarySources(address indexed token, uint256 maxPriceDeviation, IBaseOracle[] oracles);\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                      CONSTRUCTOR\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    /*//////////////////////////////////////////////////////////////////////////\n                                      FUNCTIONS\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Initializes the contract\n     * @param owner Address of the owner of the contract.\n     */\n    function initialize(address owner) external initializer {\n        __Ownable2Step_init();\n        _transferOwnership(owner);\n    }\n\n    /**\n     * @notice Set primary oracle sources for the given token\n     * @dev Only owner can set primary sources\n     * @param token Token address to set oracle sources\n     * @param maxPriceDeviation Maximum price deviation (in 1e18) of price feeds\n     * @param sources Oracle sources for the token\n     */\n    function setPrimarySources(\n        address token,\n        uint256 maxPriceDeviation,\n        IBaseOracle[] memory sources\n    ) external onlyOwner {\n        _setPrimarySources(token, maxPriceDeviation, sources);\n    }\n\n    /**\n     * @notice Set or update the primary oracle sources for multiple tokens at once.\n     * @dev Can only be called by the contract owner.\n     * @param tokens List of token addresses.\n     * @param maxPriceDeviationList List of maximum allowed price deviations (in 1e18).\n     * @param allSources list of oracle sources, one list for each token.\n     */\n    function setMultiPrimarySources(\n        address[] memory tokens,\n        uint256[] memory maxPriceDeviationList,\n        IBaseOracle[][] memory allSources\n    ) external onlyOwner {\n        // Validate inputs\n        if (tokens.length != allSources.length || tokens.length != maxPriceDeviationList.length) {\n            revert Errors.INPUT_ARRAY_MISMATCH();\n        }\n\n        for (uint256 i = 0; i < tokens.length; ++i) {\n            _setPrimarySources(tokens[i], maxPriceDeviationList[i], allSources[i]);\n        }\n    }\n\n    /// @inheritdoc IBaseOracle\n    function getPrice(address token) external view override returns (uint256) {\n        uint256 candidateSourceCount = getPrimarySourceCount(token);\n        if (candidateSourceCount == 0) revert Errors.NO_PRIMARY_SOURCE(token);\n\n        uint256[] memory prices = new uint256[](candidateSourceCount);\n        /// Get valid oracle sources\n        uint256 validSourceCount = 0;\n        for (uint256 i = 0; i < candidateSourceCount; ++i) {\n            try _primarySources[token][i].getPrice(token) returns (uint256 px) {\n                if (px != 0) prices[validSourceCount++] = px;\n            } catch {\n                // solhint-disable-previous-line no-empty-blocks\n            }\n        }\n\n        if (validSourceCount == 0) revert Errors.NO_VALID_SOURCE(token);\n        /// Sort prices in ascending order\n        for (uint256 i = 0; i < validSourceCount - 1; ++i) {\n            for (uint256 j = 0; j < validSourceCount - i - 1; ++j) {\n                if (prices[j] > prices[j + 1]) {\n                    (prices[j], prices[j + 1]) = (prices[j + 1], prices[j]);\n                }\n            }\n        }\n        uint256 maxPriceDeviation = _maxPriceDeviations[token];\n\n        /// Algo:\n        /// - 1 valid source --> return price\n        /// - 2 valid sources\n        ///     --> if the prices within deviation threshold, return average\n        ///     --> else revert\n        /// - 3 valid sources --> check deviation threshold of each pair\n        ///     --> if all within threshold, return median\n        ///     --> if one pair within threshold, return average of the pair\n        ///     --> if none, revert\n        /// - revert Errors.otherwise\n        if (validSourceCount == 1) {\n            return prices[0]; // if 1 valid source, return\n        } else if (validSourceCount == 2) {\n            if (!_isValidPrices(prices[0], prices[1], maxPriceDeviation)) revert Errors.EXCEED_DEVIATION();\n            return (prices[0] + prices[1]) / 2; /// if 2 valid sources, return average\n        } else {\n            bool midMinOk = _isValidPrices(prices[0], prices[1], maxPriceDeviation);\n            bool maxMidOk = _isValidPrices(prices[1], prices[2], maxPriceDeviation);\n\n            if (midMinOk && maxMidOk) {\n                return prices[1]; /// if 3 valid sources, and each pair is within thresh, return median\n            } else if (midMinOk) {\n                return (prices[0] + prices[1]) / 2; /// return average of pair within thresh\n            } else if (maxMidOk) {\n                return (prices[1] + prices[2]) / 2; /// return average of pair within thresh\n            } else {\n                revert Errors.EXCEED_DEVIATION();\n            }\n        }\n    }\n\n    /**\n     * @notice Fetch the amount of primary source oracles associated with a token\n     * @param token Token address to check the primary source count.\n     * @return Number of primary source oracles.\n     */\n    function getPrimarySourceCount(address token) public view returns (uint256) {\n        return _primarySourceCount[token];\n    }\n\n    /**\n     * @notice Fetch the source oracle associate with a given token and index\n     * @param token Token address to check the primary source count.\n     * @param index Index of the primary source oracle.\n     * @return Source Oracle.\n     */\n    function getPrimarySource(address token, uint256 index) external view returns (IBaseOracle) {\n        return _primarySources[token][index];\n    }\n\n    /**\n     * @notice Fetches the upper bound for a token's price deviation\n     * @param token Address of the token to check the deviation cap.\n     * @return The maximum allowed price deviation.\n     */\n    function getMaxPriceDeviation(address token) external view returns (uint256) {\n        return _maxPriceDeviations[token];\n    }\n\n    /**\n     * @notice Set primary oracle sources for given token\n     * @dev Emit SetPrimarySources event when primary oracles set successfully\n     * @param token Token to set oracle sources\n     * @param maxPriceDeviation Maximum price deviation (in 1e18) of price feeds\n     * @param sources Oracle sources for the token\n     */\n    function _setPrimarySources(address token, uint256 maxPriceDeviation, IBaseOracle[] memory sources) internal {\n        // Validate inputs\n        if (token == address(0)) revert Errors.ZERO_ADDRESS();\n        if (maxPriceDeviation > Constants.MAX_PRICE_DEVIATION) {\n            revert Errors.OUT_OF_DEVIATION_CAP(maxPriceDeviation);\n        }\n\n        uint256 sourcesLength = sources.length;\n\n        if (sourcesLength > 3) revert Errors.EXCEED_SOURCE_LEN(sourcesLength);\n\n        _primarySourceCount[token] = sourcesLength;\n        _maxPriceDeviations[token] = maxPriceDeviation;\n\n        for (uint256 i = 0; i < sourcesLength; ++i) {\n            if (address(sources[i]) == address(0)) revert Errors.ZERO_ADDRESS();\n            _primarySources[token][i] = sources[i];\n        }\n\n        emit SetPrimarySources(token, maxPriceDeviation, sources);\n    }\n}\n"
      },
      "lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides 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} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n    address private _pendingOwner;\n\n    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n    function __Ownable2Step_init() internal onlyInitializing {\n        __Ownable_init_unchained();\n    }\n\n    function __Ownable2Step_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns the address of the pending owner.\n     */\n    function pendingOwner() public view virtual returns (address) {\n        return _pendingOwner;\n    }\n\n    /**\n     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual override onlyOwner {\n        _pendingOwner = newOwner;\n        emit OwnershipTransferStarted(owner(), newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual override {\n        delete _pendingOwner;\n        super._transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev The new owner accepts the ownership transfer.\n     */\n    function acceptOwnership() public virtual {\n        address sender = _msgSender();\n        require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n        _transferOwnership(sender);\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"
      },
      "lib/blueberry-core/contracts/utils/BlueberryConst.sol": {
        "content": "// SPDX-License-Identifier: MIT\n/*\n██████╗ ██╗     ██╗   ██╗███████╗██████╗ ███████╗██████╗ ██████╗ ██╗   ██╗\n██╔══██╗██║     ██║   ██║██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝\n██████╔╝██║     ██║   ██║█████╗  ██████╔╝█████╗  ██████╔╝██████╔╝ ╚████╔╝\n██╔══██╗██║     ██║   ██║██╔══╝  ██╔══██╗██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝\n██████╔╝███████╗╚██████╔╝███████╗██████╔╝███████╗██║  ██║██║  ██║   ██║\n╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝\n*/\n\n/**\n * @title BlueberryErrors\n * @author BlueberryProtocol\n * @notice This contract contains the error messages for Blueberry Protocol.\n */\npragma solidity 0.8.22;\n\n/// @dev Common denominator for percentage-based calculations.\nuint256 constant DENOMINATOR = 10000;\n\n/// @dev Minimum threshold for liquidity operations, represented as a fraction of the DENOMINATOR.\nuint256 constant MIN_LIQ_THRESHOLD = 8000; // represent 80%\n\n/// @dev Precision factor to maintain price accuracy.\nuint256 constant PRICE_PRECISION = 1e18;\n\n/// @dev Maximum allowed price deviation, represented as a fraction of the DENOMINATOR.\nuint256 constant MAX_PRICE_DEVIATION = 1000; // represent 10%\n\n/// @dev Minimum time interval for specific time-dependent operations.\nuint32 constant MIN_TIME_GAP = 3 minutes;\n\n/// @dev Maximum time interval for specific time-dependent operations.\nuint32 constant MAX_TIME_GAP = 2 days;\n\n/// @dev Maximum allowed fee rate, represented as a fraction of the DENOMINATOR.\nuint256 constant MAX_FEE_RATE = 2000; // represent 20%\n\n/// @dev Maximum allowed time for vault withdrawal fee calculations.\nuint256 constant MAX_WITHDRAW_VAULT_FEE_WINDOW = 60 days;\n\n/// @dev Maximum delay permitted for swap operations.\nuint32 constant MAX_DELAY_ON_SWAP = 2 hours;\n\n/// @dev Allowed grace period time for sequencer operations.\nuint32 constant SEQUENCER_GRACE_PERIOD_TIME = 3600;\n\n/// @dev Precision factor for Chainlink price feed values.\nuint256 constant CHAINLINK_PRICE_FEED_PRECISION = 1e8;\n\n/// @dev Warm-up period before a liquidation repayment can be initiated.\nuint256 constant LIQUIDATION_REPAY_WARM_UP_PERIOD = 4 hours;\n"
      },
      "lib/blueberry-core/contracts/utils/BlueberryErrors.sol": {
        "content": "// SPDX-License-Identifier: MIT\n/*\n██████╗ ██╗     ██╗   ██╗███████╗██████╗ ███████╗██████╗ ██████╗ ██╗   ██╗\n██╔══██╗██║     ██║   ██║██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝\n██████╔╝██║     ██║   ██║█████╗  ██████╔╝█████╗  ██████╔╝██████╔╝ ╚████╔╝\n██╔══██╗██║     ██║   ██║██╔══╝  ██╔══██╗██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝\n██████╔╝███████╗╚██████╔╝███████╗██████╔╝███████╗██║  ██║██║  ██║   ██║\n╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝\n*/\n/**\n * @title BlueberryErrors\n * @author BlueberryProtocol\n * @notice containing all errors used in Blueberry protocol\n */\n/// title BlueberryErrors\n/// @notice containing all errors used in Blueberry protocol\npragma solidity 0.8.22;\n\n/*//////////////////////////////////////////////////////////////////////////\n                                COMMON ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when an action involves zero amount of tokens.\nerror ZERO_AMOUNT();\n\n/// @notice Thrown when the address provided is the zero address.\nerror ZERO_ADDRESS();\n\n/// @notice Thrown when the lengths of input arrays do not match.\nerror INPUT_ARRAY_MISMATCH();\n\n/// @notice Thrown when the caller is not authorized to call the function.\nerror UNAUTHORIZED();\n\n/*//////////////////////////////////////////////////////////////////////////\n                                ORACLE ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when the delay time exceeds allowed limits.\nerror TOO_LONG_DELAY(uint256 delayTime);\n\n/// @notice Thrown when there's no maximum delay set for a token.\nerror NO_MAX_DELAY(address token);\n\n/// @notice Thrown when the price information for a token is outdated.\nerror PRICE_OUTDATED(address token);\n\n/// @notice Thrown when the price obtained is negative.\nerror PRICE_NEGATIVE(address token);\n\n/// @notice Thrown when the sequencer is offline\nerror SEQUENCER_DOWN(address sequencer);\n\n/// @notice Thrown when the grace period for a sequencer is not over yet.\nerror SEQUENCER_GRACE_PERIOD_NOT_OVER(address sequencer);\n\n/// @notice Thrown when the price deviation exceeds allowed limits.\nerror OUT_OF_DEVIATION_CAP(uint256 deviation);\n\n/// @notice Thrown when the number of sources exceeds the allowed length.\nerror EXCEED_SOURCE_LEN(uint256 length);\n\n/// @notice Thrown when no primary source is available for the token.\nerror NO_PRIMARY_SOURCE(address token);\n\n/// @notice Thrown when no valid price source is available for the token.\nerror NO_VALID_SOURCE(address token);\n\n/// @notice Thrown when the deviation value exceeds the threshold.\nerror EXCEED_DEVIATION();\n\n/// @notice Thrown when the mean price is below the acceptable threshold.\nerror TOO_LOW_MEAN(uint256 mean);\n\n/// @notice Thrown when no mean price is set for the token.\nerror NO_MEAN(address token);\n\n/// @notice Thrown when no stable pool exists for the token.\nerror NO_STABLEPOOL(address token);\n\n/// @notice Thrown when the price fetch process fails for a token.\nerror PRICE_FAILED(address token);\n\n/// @notice Thrown when the liquidation threshold is set too high.\nerror LIQ_THRESHOLD_TOO_HIGH(uint256 threshold);\n\n/// @notice Thrown when the liquidation threshold is set too low.\nerror LIQ_THRESHOLD_TOO_LOW(uint256 threshold);\n\n/// @notice Thrown when the oracle doesn't support a specific token.\nerror ORACLE_NOT_SUPPORT(address token);\n\n/// @notice Thrown when the oracle doesn't support a specific LP pair token.\nerror ORACLE_NOT_SUPPORT_LP(address lp);\n\n/// @notice Thrown when the oracle doesn't support a specific wToken.\nerror ORACLE_NOT_SUPPORT_WTOKEN(address wToken);\n\n/// @notice Thrown when there is no route to fetch data for the oracle\nerror NO_ORACLE_ROUTE(address token);\n\n/// @notice Thrown when a value is out of an acceptable range.\nerror VALUE_OUT_OF_RANGE();\n\n/// @notice Thrown when specified limits are incorrect.\nerror INCORRECT_LIMITS();\n\n/// @notice Thrown when Curve LP is already registered.\nerror CRV_LP_ALREADY_REGISTERED(address lp);\n\n/// @notice Thrown when a pool is subject to read-only reentrancy manipulation.\nerror REENTRANCY_RISK(address pool);\n\n/*//////////////////////////////////////////////////////////////////////////\n                            GENERAL SPELL ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when the caller isn't recognized as a bank.\nerror NOT_BANK(address caller);\n\n/// @notice Thrown when the collateral doesn't exist for a strategy.\nerror COLLATERAL_NOT_EXIST(uint256 strategyId, address colToken);\n\n/// @notice Thrown when the strategy ID doesn't correspond to an existing strategy.\nerror STRATEGY_NOT_EXIST(address spell, uint256 strategyId);\n\n/// @notice Thrown when the position size exceeds maximum limits.\nerror EXCEED_MAX_POS_SIZE(uint256 strategyId);\n\n/// @notice Thrown when the user has not deposited enough isolated collateral for a strategy.\nerror BELOW_MIN_ISOLATED_COLLATERAL(uint256 strategyId);\n\n/// @notice Thrown when the loan-to-value ratio exceeds allowed maximum.\nerror EXCEED_MAX_LTV();\n\n/// @notice Thrown when the strategy ID provided is incorrect.\nerror INCORRECT_STRATEGY_ID(uint256 strategyId);\n\n/// @notice Thrown when the position size is invalid.\nerror INVALID_POS_SIZE();\n\n/// @notice Thrown when an incorrect liquidity pool token is provided.\nerror INCORRECT_LP(address lpToken);\n\n/// @notice Thrown when an incorrect pool ID is provided.\nerror INCORRECT_PID(uint256 pid);\n\n/// @notice Thrown when an incorrect collateral token is provided.\nerror INCORRECT_COLTOKEN(address colToken);\n\n/// @notice Thrown when an incorrect underlying token is provided.\nerror INCORRECT_UNDERLYING(address uToken);\n\n/// @notice Thrown when an incorrect debt token is provided.\nerror INCORRECT_DEBT(address debtToken);\n\n/// @notice Thrown when a swap fails.\nerror SWAP_FAILED(address swapToken);\n\n/*//////////////////////////////////////////////////////////////////////////\n                                VAULT ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when borrowing from the vault fails.\nerror BORROW_FAILED(uint256 amount);\n\n/// @notice Thrown when repaying to the vault fails.\nerror REPAY_FAILED(uint256 amount);\n\n/// @notice Thrown when lending to the vault fails.\nerror LEND_FAILED(uint256 amount);\n\n/// @notice Thrown when redeeming from the vault fails.\nerror REDEEM_FAILED(uint256 amount);\n\n/*//////////////////////////////////////////////////////////////////////////\n                                WRAPPER ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when a duplicate tokenId is added.\nerror DUPLICATE_TOKEN_ID(uint256 tokenId);\n\n/// @notice Thrown when an invalid token ID is provided.\nerror INVALID_TOKEN_ID(uint256 tokenId);\n\n/// @notice Thrown when an incorrect pool ID is provided.\nerror BAD_PID(uint256 pid);\n\n/// @notice Thrown when a mismatch in reward per share is detected.\nerror BAD_REWARD_PER_SHARE(uint256 rewardPerShare);\n\n/*//////////////////////////////////////////////////////////////////////////\n                                BANK ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when a function is called without a required execution flag.\nerror NOT_UNDER_EXECUTION();\n\n/// @notice Thrown when a transaction isn't initiated by the expected spell.\nerror NOT_FROM_SPELL(address from);\n\n/// @notice Thrown when the sender is not the owner of a given position ID.\nerror NOT_FROM_OWNER(uint256 positionId, address sender);\n\n/// @notice Thrown when a spell address isn't whitelisted.\nerror SPELL_NOT_WHITELISTED(address spell);\n\n/// @notice Thrown when a token isn't whitelisted.\nerror TOKEN_NOT_WHITELISTED(address token);\n\n/// @notice Thrown when a bank isn't listed for a given token.\nerror BANK_NOT_LISTED(address token);\n\n/// @notice Thrown when a bank doesn't exist for an index.\nerror BANK_NOT_EXIST(uint8 index);\n\n/// @notice Thrown when a bank is already listed for a given token.\nerror BANK_ALREADY_LISTED();\n\n/// @notice Thrown when the bank limit is reached.\nerror BANK_LIMIT();\n\n/// @notice Thrown when the BTOKEN is already added.\nerror BTOKEN_ALREADY_ADDED();\n\n/// @notice Thrown when the lending action isn't allowed.\nerror LEND_NOT_ALLOWED();\n\n/// @notice Thrown when the borrowing action isn't allowed.\nerror BORROW_NOT_ALLOWED();\n\n/// @notice Thrown when the repaying action isn't allowed.\nerror REPAY_NOT_ALLOWED();\n\n/// @notice Thrown when the redeeming action isn't allowed.\nerror WITHDRAW_LEND_NOT_ALLOWED();\n\n/// @notice Thrown when certain actions are locked.\nerror LOCKED();\n\n/// @notice Thrown when an action isn't executed.\nerror NOT_IN_EXEC();\n\n/// @notice Thrown when the repayment allowance hasn't been warmed up.\nerror REPAY_ALLOW_NOT_WARMED_UP();\n\n/// @notice Thrown when a different collateral type exists.\nerror DIFF_COL_EXIST(address collToken);\n\n/// @notice Thrown when a position is not eligible for liquidation.\nerror NOT_LIQUIDATABLE(uint256 positionId);\n\n/// @notice Thrown when a position is flagged as bad or invalid.\nerror BAD_POSITION(uint256 posId);\n\n/// @notice Thrown when collateral for a specific position is flagged as bad or invalid.\nerror BAD_COLLATERAL(uint256 positionId);\n\n/// @notice Thrown when there's insufficient collateral for an operation.\nerror INSUFFICIENT_COLLATERAL();\n\n/// @notice Thrown when an attempted repayment exceeds the actual debt.\nerror REPAY_EXCEEDS_DEBT(uint256 repay, uint256 debt);\n\n/// @notice Thrown when an invalid utility token is provided.\nerror INVALID_UTOKEN(address uToken);\n\n/// @notice Thrown when a borrow operation results in zero shares.\nerror BORROW_ZERO_SHARE(uint256 borrowAmount);\n\n/*//////////////////////////////////////////////////////////////////////////\n                            CONFIGURATION ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when a certain ratio is too high for an operation.\nerror RATIO_TOO_HIGH(uint256 ratio);\n\n/// @notice Thrown when an invalid fee distribution is detected.\nerror INVALID_FEE_DISTRIBUTION();\n\n/// @notice Thrown when no treasury is set for fee distribution.\nerror NO_TREASURY_SET();\n\n/// @notice Thrown when a fee window has already started.\nerror FEE_WINDOW_ALREADY_STARTED();\n\n/// @notice Thrown when a fee window duration is too long.\nerror FEE_WINDOW_TOO_LONG(uint256 windowTime);\n\n/*//////////////////////////////////////////////////////////////////////////\n                                UTILITY ERRORS\n//////////////////////////////////////////////////////////////////////////*/\n\n/// @notice Thrown when an operation has surpassed its deadline.\nerror EXPIRED(uint256 deadline);\n"
      },
      "lib/blueberry-core/contracts/oracle/BaseOracleExt.sol": {
        "content": "// SPDX-License-Identifier: MIT\n/*\n██████╗ ██╗     ██╗   ██╗███████╗██████╗ ███████╗██████╗ ██████╗ ██╗   ██╗\n██╔══██╗██║     ██║   ██║██╔════╝██╔══██╗██╔════╝██╔══██╗██╔══██╗╚██╗ ██╔╝\n██████╔╝██║     ██║   ██║█████╗  ██████╔╝█████╗  ██████╔╝██████╔╝ ╚████╔╝\n██╔══██╗██║     ██║   ██║██╔══╝  ██╔══██╗██╔══╝  ██╔══██╗██╔══██╗  ╚██╔╝\n██████╔╝███████╗╚██████╔╝███████╗██████╔╝███████╗██║  ██║██║  ██║   ██║\n╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝╚═════╝ ╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝\n*/\n\npragma solidity 0.8.22;\n\nimport \"../utils/BlueberryConst.sol\" as Constants;\n\nabstract contract BaseOracleExt {\n    /*//////////////////////////////////////////////////////////////////////////\n                                      FUNCTIONS\n    //////////////////////////////////////////////////////////////////////////*/\n\n    /**\n     * @notice Internal function to validate deviations of 2 given prices\n     * @param price0 First price to validate, base 1e18\n     * @param price1 Second price to validate, base 1e18\n     * @param maxPriceDeviation Max price deviation of 2 prices, base 10000\n     */\n    function _isValidPrices(uint256 price0, uint256 price1, uint256 maxPriceDeviation) internal pure returns (bool) {\n        uint256 maxPrice = price0 > price1 ? price0 : price1;\n        uint256 minPrice = price0 > price1 ? price1 : price0;\n        return (((maxPrice - minPrice) * Constants.DENOMINATOR) / maxPrice) <= maxPriceDeviation;\n    }\n}\n"
      },
      "lib/blueberry-core/contracts/interfaces/IBaseOracle.sol": {
        "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.8.22;\n\n/**\n * @title IBaseOracle\n * @author BlueberryProtocol\n * @notice Interface for a basic oracle that provides price data for assets.\n */\ninterface IBaseOracle {\n    /**\n     * @notice Event emitted when a new LP token is registered within its respective implementation.\n     * @param token Address of the LP token being registered\n     */\n    event RegisterLpToken(address token);\n\n    /**\n     * @notice Fetches the price of the given token in USD with 18 decimals precision.\n     * @param token Address of the ERC-20 token for which the price is requested.\n     * @return The USD price of the given token, multiplied by 10**18.\n     */\n    function getPrice(address token) external view returns (uint256);\n}\n"
      },
      "lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../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. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby disabling any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        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"
      },
      "lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Indicates that the contract has been initialized.\n     * @custom:oz-retyped-from bool\n     */\n    uint8 private _initialized;\n\n    /**\n     * @dev Indicates that the contract is in the process of being initialized.\n     */\n    bool private _initializing;\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint8 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n     * constructor.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        bool isTopLevelCall = !_initializing;\n        require(\n            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n            \"Initializable: contract is already initialized\"\n        );\n        _initialized = 1;\n        if (isTopLevelCall) {\n            _initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            _initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: setting the version to 255 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint8 version) {\n        require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n        _initialized = version;\n        _initializing = true;\n        _;\n        _initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        require(_initializing, \"Initializable: contract is not initializing\");\n        _;\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        require(!_initializing, \"Initializable: contract is initializing\");\n        if (_initialized != type(uint8).max) {\n            _initialized = type(uint8).max;\n            emit Initialized(type(uint8).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint8) {\n        return _initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _initializing;\n    }\n}\n"
      },
      "lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport {Initializable} from \"../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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\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"
      },
      "lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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     * Furthermore, `isContract` will also return true if the target contract within\n     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n     * which only has an effect at the end of a transaction.\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.8.0/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(address target, bytes memory data, uint256 value) 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"
      }
    },
    "settings": {
      "remappings": [
        "@blueberry/=lib/blueberry-core/contracts/",
        "@blueberry-stakevest/=lib/blueberry-stakevest/src/",
        "@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
        "@openzeppelin/contracts-upgradeable/=lib/blueberry-core/node_modules/@openzeppelin/contracts-upgradeable/",
        "src/=src/BlueberryContracts/",
        "openzeppelin-contracts-upgradeable/contracts/=lib/blueberry-stakevest/lib/openzeppelin-contracts-upgradeable/contracts/",
        "solady/=lib/blueberry-stakevest/lib/solady/",
        "@chainlink/=lib/blueberry-core/node_modules/@chainlink/",
        "@aave/=lib/blueberry-core/node_modules/@aave/",
        "@contracts/=lib/blueberry-core/contracts/",
        "@eth-optimism/=lib/blueberry-core/node_modules/@eth-optimism/contracts/",
        "@test/=lib/blueberry-core/test/foundry/",
        "@uniswap/=lib/blueberry-core/node_modules/@uniswap/",
        "base64-sol/=lib/blueberry-core/node_modules/base64-sol/",
        "blueberry-core/=lib/blueberry-core/",
        "blueberry-stakevest/=lib/blueberry-stakevest/",
        "ds-test/=lib/forge-std/lib/ds-test/src/",
        "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
        "eth-gas-reporter/=lib/blueberry-core/node_modules/eth-gas-reporter/",
        "forge-std/=lib/forge-std/src/",
        "hardhat-deploy/=lib/blueberry-core/node_modules/hardhat-deploy/",
        "hardhat/=lib/blueberry-core/node_modules/hardhat/",
        "openzeppelin-contracts/=lib/openzeppelin-contracts/",
        "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
        "openzeppelin/=lib/blueberry-stakevest/lib/openzeppelin-contracts-upgradeable/contracts/",
        "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
        "v3-core/=lib/blueberry-stakevest/lib/v3-core/contracts/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "useLiteralContent": false,
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "viaIR": false,
      "libraries": {}
    }
  }}