{"constructor_args":"0x0000000000000000000000003f0da1c363e34802c6f12f9c27276dc0e6696fd84dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af0000000000000000000000000000000000000000000000000efcee47256c00000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000127500000000000000000000000000000000000000000000000000000000000001fa4000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000f2522e5b43c6a00000000000000000000000000000000000000000000000000000000006a669ca3","is_partially_verified":true,"is_changed_bytecode":false,"abi":[{"inputs":[{"internalType":"address","name":"initialAuthority","type":"address"},{"components":[{"internalType":"bytes32","name":"feedId","type":"bytes32"},{"internalType":"uint256","name":"bootstrapMinNAV","type":"uint256"},{"internalType":"uint256","name":"maxNAV","type":"uint256"},{"internalType":"uint256","name":"normalBandBps","type":"uint256"},{"internalType":"uint256","name":"forceBandBps","type":"uint256"},{"internalType":"uint256","name":"maxCumulativeBps","type":"uint256"},{"internalType":"uint256","name":"velocityWindow","type":"uint256"},{"internalType":"uint256","name":"stalenessWindow","type":"uint256"},{"internalType":"uint256","name":"markdownDelay","type":"uint256"}],"internalType":"struct NAVOracle.InitParams","name":"p","type":"tuple"},{"internalType":"uint256","name":"initialNAV","type":"uint256"},{"internalType":"uint256","name":"initialDataTimestamp","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"authority","type":"address"}],"name":"AccessManagedInvalidAuthority","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"uint32","name":"delay","type":"uint32"}],"name":"AccessManagedRequiredDelay","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"AccessManagedUnauthorized","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"currentNav","type":"uint256"},{"internalType":"uint256","name":"deviationBps","type":"uint256"}],"name":"DeviationExceeded","type":"error"},{"inputs":[{"internalType":"uint256","name":"elapsed","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"ForceUpdateTooFrequent","type":"error"},{"inputs":[{"internalType":"uint256","name":"observationTimestamp","type":"uint256"},{"internalType":"uint256","name":"blockTimestamp","type":"uint256"}],"name":"FutureObservation","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"InsufficientGasForSinkPush","type":"error"},{"inputs":[],"name":"InvalidBand","type":"error"},{"inputs":[],"name":"InvalidBounds","type":"error"},{"inputs":[],"name":"InvalidMarkdownDelay","type":"error"},{"inputs":[],"name":"InvalidStaleness","type":"error"},{"inputs":[],"name":"InvalidVelocity","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"floor","type":"uint256"}],"name":"MarkdownBelowFloor","type":"error"},{"inputs":[{"internalType":"uint256","name":"readyAt","type":"uint256"},{"internalType":"uint256","name":"nowTs","type":"uint256"}],"name":"MarkdownDelayNotElapsed","type":"error"},{"inputs":[{"internalType":"uint256","name":"providedEpisode","type":"uint256"},{"internalType":"uint256","name":"currentEpisode","type":"uint256"}],"name":"MarkdownEpisodeMismatch","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"currentNav","type":"uint256"}],"name":"MarkdownMustDecrease","type":"error"},{"inputs":[{"internalType":"uint256","name":"elapsed","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"MarkdownTooFrequent","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"currentNav","type":"uint256"}],"name":"NAVMustNotDecrease","type":"error"},{"inputs":[{"internalType":"uint80","name":"roundId","type":"uint80"}],"name":"NoData","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"}],"name":"OutOfBounds","type":"error"},{"inputs":[],"name":"ProtectionEntryNotArmed","type":"error"},{"inputs":[],"name":"ProtectionModeActive","type":"error"},{"inputs":[],"name":"ProtectionModeNotActive","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"SinkAlreadyRegistered","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"SinkNotAContract","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"SinkNotFound","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"nav","type":"uint256"}],"name":"SinkSyncFailed","type":"error"},{"inputs":[],"name":"SinkZeroAddress","type":"error"},{"inputs":[{"internalType":"uint256","name":"observationTimestamp","type":"uint256"}],"name":"StaleObservation","type":"error"},{"inputs":[],"name":"TooManySinks","type":"error"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"moveWad","type":"uint256"},{"internalType":"uint256","name":"budgetWad","type":"uint256"}],"name":"VelocityExceeded","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroFeedId","type":"error"},{"inputs":[],"name":"ZeroObservationTimestamp","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"int256","name":"current","type":"int256"},{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedAt","type":"uint256"}],"name":"AnswerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"authority","type":"address"}],"name":"AuthorityUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dataTimestamp","type":"uint256"}],"name":"Bootstrapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previous","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"current","type":"uint256"}],"name":"ForceBandUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint80","name":"roundId","type":"uint80"},{"indexed":false,"internalType":"uint256","name":"previousNav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newNav","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"MarkdownApplied","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previous","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"current","type":"uint256"}],"name":"MaxNAVUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"observationTimestamp","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"NAVForceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint80","name":"roundId","type":"uint80"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"observationTimestamp","type":"uint256"},{"indexed":false,"internalType":"enum UpdateKind","name":"kind","type":"uint8"}],"name":"NAVUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"roundId","type":"uint256"},{"indexed":true,"internalType":"address","name":"startedBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"startedAt","type":"uint256"}],"name":"NewRound","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"previous","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"current","type":"uint256"}],"name":"NormalBandUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"}],"name":"ProtectionEntryRearmed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"uint256","name":"episodeId","type":"uint256"},{"indexed":false,"internalType":"string","name":"reason","type":"string"}],"name":"ProtectionModeEntered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"}],"name":"ProtectionModeExited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"feedId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"observationTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"deviationBps","type":"uint256"}],"name":"ReportAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"feedId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"observationTimestamp","type":"uint256"},{"indexed":false,"internalType":"bytes4","name":"reason","type":"bytes4"}],"name":"ReportDiscarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"feedId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"observationTimestamp","type":"uint256"}],"name":"ReportIgnoredInProtection","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"}],"name":"SinkAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"uint256","name":"nav","type":"uint256"}],"name":"SinkPushFailed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"target","type":"address"}],"name":"SinkRemoved","type":"event"},{"inputs":[],"name":"MAX_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MARKDOWN_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_NORMAL_BAND_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SINKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_STALENESS_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_VELOCITY_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_FORCE_UPDATE_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_MARKDOWN_DELAY_FLOOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_MARKDOWN_INTERVAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_MARKDOWN_NAV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_VELOCITY_WINDOW","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SINK_GAS_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"addSink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"protectionEpisode","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"applyMarkdown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"authority","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bootstrapMinNAV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentDataTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"name":"enterProtectionMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exitProtectionMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feedId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forceBandBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"forceNAVUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentNAV","outputs":[{"internalType":"uint256","name":"nav","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"roundId","type":"uint80"}],"name":"getRound","outputs":[{"internalType":"uint256","name":"answer","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isConsumingScheduledOp","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"episode","type":"uint256"}],"name":"isMarkdownExecutable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastForceUpdateTs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastMarkdownTs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastObservationTs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRound","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"markdownDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxCumulativeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxNAV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"navDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"normalBandBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protectionEnteredAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protectionEntryArmed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protectionEpisodeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protectionMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rearmProtectionEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"removeSink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAuthority","type":"address"}],"name":"setAuthority","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bps","type":"uint256"}],"name":"setForceBandBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxNAV","type":"uint256"}],"name":"setMaxNAV","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bps","type":"uint256"}],"name":"setNormalBandBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sinks","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stalenessWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"navValue","type":"uint256"},{"internalType":"uint256","name":"observationTimestamp","type":"uint256"}],"name":"submitReport","outputs":[{"internalType":"enum SubmitStatus","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"syncSink","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"velocityAnchorNAV","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"velocityBudgetWad","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"velocityLastAccrual","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"velocityWindow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}],"conflicting_implementations":null,"certified":false,"additional_sources":[{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/access/manager/AccessManaged.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/manager/AccessManaged.sol)\n\npragma solidity ^0.8.20;\n\nimport {AuthorityUtils} from \"./AuthorityUtils.sol\";\nimport {IAccessManager} from \"./IAccessManager.sol\";\nimport {IAccessManaged} from \"./IAccessManaged.sol\";\nimport {Context} from \"../../utils/Context.sol\";\n\n/**\n * @dev This contract module makes available a {restricted} modifier. Functions decorated with this modifier will be\n * permissioned according to an \"authority\": a contract like {AccessManager} that follows the {IAuthority} interface,\n * implementing a policy that allows certain callers to access certain functions.\n *\n * IMPORTANT: The `restricted` modifier should never be used on `internal` functions, judiciously used in `public`\n * functions, and ideally only used in `external` functions. See {restricted}.\n */\nabstract contract AccessManaged is Context, IAccessManaged {\n    address private _authority;\n\n    bool private _consumingSchedule;\n\n    /**\n     * @dev Initializes the contract connected to an initial authority.\n     */\n    constructor(address initialAuthority) {\n        _setAuthority(initialAuthority);\n    }\n\n    /**\n     * @dev Restricts access to a function as defined by the connected Authority for this contract and the\n     * caller and selector of the function that entered the contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * In general, this modifier should only be used on `external` functions. It is okay to use it on `public`\n     * functions that are used as external entry points and are not called internally. Unless you know what you're\n     * doing, it should never be used on `internal` functions. Failure to follow these rules can have critical security\n     * implications! This is because the permissions are determined by the function that entered the contract, i.e. the\n     * function at the bottom of the call stack, and not the function where the modifier is visible in the source code.\n     * ====\n     *\n     * [WARNING]\n     * ====\n     * Avoid adding this modifier to the https://docs.soliditylang.org/en/v0.8.20/contracts.html#receive-ether-function[`receive()`]\n     * function or the https://docs.soliditylang.org/en/v0.8.20/contracts.html#fallback-function[`fallback()`]. These\n     * functions are the only execution paths where a function selector cannot be unambiguously determined from the calldata\n     * since the selector defaults to `0x00000000` in the `receive()` function and similarly in the `fallback()` function\n     * if no calldata is provided. (See {_checkCanCall}).\n     *\n     * The `receive()` function will always panic whereas the `fallback()` may panic depending on the calldata length.\n     * ====\n     */\n    modifier restricted() {\n        _checkCanCall(_msgSender(), _msgData());\n        _;\n    }\n\n    /// @inheritdoc IAccessManaged\n    function authority() public view virtual returns (address) {\n        return _authority;\n    }\n\n    /// @inheritdoc IAccessManaged\n    function setAuthority(address newAuthority) public virtual {\n        address caller = _msgSender();\n        if (caller != authority()) {\n            revert AccessManagedUnauthorized(caller);\n        }\n        if (newAuthority.code.length == 0) {\n            revert AccessManagedInvalidAuthority(newAuthority);\n        }\n        _setAuthority(newAuthority);\n    }\n\n    /// @inheritdoc IAccessManaged\n    function isConsumingScheduledOp() public view returns (bytes4) {\n        return _consumingSchedule ? this.isConsumingScheduledOp.selector : bytes4(0);\n    }\n\n    /**\n     * @dev Transfers control to a new authority. Internal function with no access restriction. Allows bypassing the\n     * permissions set by the current authority.\n     */\n    function _setAuthority(address newAuthority) internal virtual {\n        _authority = newAuthority;\n        emit AuthorityUpdated(newAuthority);\n    }\n\n    /**\n     * @dev Reverts if the caller is not allowed to call the function identified by a selector. Panics if the calldata\n     * is less than 4 bytes long.\n     */\n    function _checkCanCall(address caller, bytes calldata data) internal virtual {\n        (bool immediate, uint32 delay) = AuthorityUtils.canCallWithDelay(\n            authority(),\n            caller,\n            address(this),\n            bytes4(data[0:4])\n        );\n        if (!immediate) {\n            if (delay > 0) {\n                _consumingSchedule = true;\n                IAccessManager(authority()).consumeScheduledOp(caller, data);\n                _consumingSchedule = false;\n            } else {\n                revert AccessManagedUnauthorized(caller);\n            }\n        }\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/src/nav/interfaces/INAVReceiver.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\n/**\n * @title NAV Receiver Interface\n * @notice Interface for downstream contracts that receive NAV updates from the oracle fan-out.\n */\ninterface INAVReceiver {\n    /**\n     * @notice Update the receiver's share price from a NAV value.\n     * @param nav The NAV value with 18 decimal places.\n     * @dev A receiver revert is isolated and reported by the oracle fan-out. The oracle write can\n     *      still revert if the transaction lacks enough gas to reserve the receiver's call budget.\n     */\n    function setSharePrice(uint256 nav) external;\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/access/manager/AuthorityUtils.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (access/manager/AuthorityUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAuthority} from \"./IAuthority.sol\";\n\nlibrary AuthorityUtils {\n    /**\n     * @dev Since `AccessManager` implements an extended IAuthority interface, invoking `canCall` with backwards compatibility\n     * for the preexisting `IAuthority` interface requires special care to avoid reverting on insufficient return data.\n     * This helper function takes care of invoking `canCall` in a backwards compatible way without reverting.\n     */\n    function canCallWithDelay(\n        address authority,\n        address caller,\n        address target,\n        bytes4 selector\n    ) internal view returns (bool immediate, uint32 delay) {\n        bytes memory data = abi.encodeCall(IAuthority.canCall, (caller, target, selector));\n\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x00)\n            mstore(0x20, 0x00)\n\n            if staticcall(gas(), authority, add(data, 0x20), mload(data), 0x00, 0x40) {\n                immediate := mload(0x00)\n                delay := mload(0x20)\n\n                // If delay does not fit in a uint32, return 0 (no delay)\n                // equivalent to: if gt(delay, 0xFFFFFFFF) { delay := 0 }\n                delay := mul(delay, iszero(shr(32, delay)))\n            }\n        }\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/access/manager/IAccessManaged.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/manager/IAccessManaged.sol)\n\npragma solidity >=0.8.4;\n\ninterface IAccessManaged {\n    /**\n     * @dev Authority that manages this contract was updated.\n     */\n    event AuthorityUpdated(address authority);\n\n    error AccessManagedUnauthorized(address caller);\n    error AccessManagedRequiredDelay(address caller, uint32 delay);\n    error AccessManagedInvalidAuthority(address authority);\n\n    /**\n     * @dev Returns the current authority.\n     */\n    function authority() external view returns (address);\n\n    /**\n     * @dev Transfers control to a new authority. The caller must be the current authority.\n     */\n    function setAuthority(address) external;\n\n    /**\n     * @dev Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is\n     * being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs\n     * attacker controlled calls.\n     */\n    function isConsumingScheduledOp() external view returns (bytes4);\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/access/manager/IAccessManager.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/manager/IAccessManager.sol)\n\npragma solidity >=0.8.4;\n\ninterface IAccessManager {\n    /**\n     * @dev A delayed operation was scheduled.\n     */\n    event OperationScheduled(\n        bytes32 indexed operationId,\n        uint32 indexed nonce,\n        uint48 schedule,\n        address caller,\n        address target,\n        bytes data\n    );\n\n    /**\n     * @dev A scheduled operation was executed.\n     */\n    event OperationExecuted(bytes32 indexed operationId, uint32 indexed nonce);\n\n    /**\n     * @dev A scheduled operation was canceled.\n     */\n    event OperationCanceled(bytes32 indexed operationId, uint32 indexed nonce);\n\n    /**\n     * @dev Informational labelling for a roleId.\n     */\n    event RoleLabel(uint64 indexed roleId, string label);\n\n    /**\n     * @dev Emitted when `account` is granted `roleId`.\n     *\n     * NOTE: The meaning of the `since` argument depends on the `newMember` argument.\n     * If the role is granted to a new member, the `since` argument indicates when the account becomes a member of the role,\n     * otherwise it indicates the execution delay for this account and roleId is updated.\n     */\n    event RoleGranted(uint64 indexed roleId, address indexed account, uint32 delay, uint48 since, bool newMember);\n\n    /**\n     * @dev Emitted when `account` membership or `roleId` is revoked. Unlike granting, revoking is instantaneous.\n     */\n    event RoleRevoked(uint64 indexed roleId, address indexed account);\n\n    /**\n     * @dev Role acting as admin over a given `roleId` is updated.\n     */\n    event RoleAdminChanged(uint64 indexed roleId, uint64 indexed admin);\n\n    /**\n     * @dev Role acting as guardian over a given `roleId` is updated.\n     */\n    event RoleGuardianChanged(uint64 indexed roleId, uint64 indexed guardian);\n\n    /**\n     * @dev Grant delay for a given `roleId` will be updated to `delay` when `since` is reached.\n     */\n    event RoleGrantDelayChanged(uint64 indexed roleId, uint32 delay, uint48 since);\n\n    /**\n     * @dev Target mode is updated (true = closed, false = open).\n     */\n    event TargetClosed(address indexed target, bool closed);\n\n    /**\n     * @dev Role required to invoke `selector` on `target` is updated to `roleId`.\n     */\n    event TargetFunctionRoleUpdated(address indexed target, bytes4 selector, uint64 indexed roleId);\n\n    /**\n     * @dev Admin delay for a given `target` will be updated to `delay` when `since` is reached.\n     */\n    event TargetAdminDelayUpdated(address indexed target, uint32 delay, uint48 since);\n\n    error AccessManagerAlreadyScheduled(bytes32 operationId);\n    error AccessManagerNotScheduled(bytes32 operationId);\n    error AccessManagerNotReady(bytes32 operationId);\n    error AccessManagerExpired(bytes32 operationId);\n    error AccessManagerLockedRole(uint64 roleId);\n    error AccessManagerBadConfirmation();\n    error AccessManagerUnauthorizedAccount(address msgsender, uint64 roleId);\n    error AccessManagerUnauthorizedCall(address caller, address target, bytes4 selector);\n    error AccessManagerUnauthorizedConsume(address target);\n    error AccessManagerUnauthorizedCancel(address msgsender, address caller, address target, bytes4 selector);\n    error AccessManagerInvalidInitialAdmin(address initialAdmin);\n\n    /**\n     * @dev Check if an address (`caller`) is authorised to call a given function on a given contract directly (with\n     * no restriction). Additionally, it returns the delay needed to perform the call indirectly through the {schedule}\n     * & {execute} workflow.\n     *\n     * This function is usually called by the targeted contract to control immediate execution of restricted functions.\n     * Therefore we only return true if the call can be performed without any delay. If the call is subject to a\n     * previously set delay (not zero), then the function should return false and the caller should schedule the operation\n     * for future execution.\n     *\n     * If `allowed` is true, the delay can be disregarded and the operation can be immediately executed, otherwise\n     * the operation can be executed if and only if delay is greater than 0.\n     *\n     * NOTE: The IAuthority interface does not include the `uint32` delay. This is an extension of that interface that\n     * is backward compatible. Some contracts may thus ignore the second return argument. In that case they will fail\n     * to identify the indirect workflow, and will consider calls that require a delay to be forbidden.\n     *\n     * NOTE: This function does not report the permissions of the admin functions in the manager itself. These are defined by the\n     * {AccessManager} documentation.\n     */\n    function canCall(\n        address caller,\n        address target,\n        bytes4 selector\n    ) external view returns (bool allowed, uint32 delay);\n\n    /**\n     * @dev Expiration delay for scheduled proposals. Defaults to 1 week.\n     *\n     * IMPORTANT: Avoid overriding the expiration with 0. Otherwise every contract proposal will be expired immediately,\n     * disabling any scheduling usage.\n     */\n    function expiration() external view returns (uint32);\n\n    /**\n     * @dev Minimum setback for all delay updates, with the exception of execution delays. It\n     * can be increased without setback (and reset via {revokeRole} in the case event of an\n     * accidental increase). Defaults to 5 days.\n     */\n    function minSetback() external view returns (uint32);\n\n    /**\n     * @dev Get whether the contract is closed disabling any access. Otherwise role permissions are applied.\n     *\n     * NOTE: When the manager itself is closed, admin functions are still accessible to avoid locking the contract.\n     */\n    function isTargetClosed(address target) external view returns (bool);\n\n    /**\n     * @dev Get the role required to call a function.\n     */\n    function getTargetFunctionRole(address target, bytes4 selector) external view returns (uint64);\n\n    /**\n     * @dev Get the admin delay for a target contract. Changes to contract configuration are subject to this delay.\n     */\n    function getTargetAdminDelay(address target) external view returns (uint32);\n\n    /**\n     * @dev Get the id of the role that acts as an admin for the given role.\n     *\n     * The admin permission is required to grant the role, revoke the role and update the execution delay to execute\n     * an operation that is restricted to this role.\n     */\n    function getRoleAdmin(uint64 roleId) external view returns (uint64);\n\n    /**\n     * @dev Get the role that acts as a guardian for a given role.\n     *\n     * The guardian permission allows canceling operations that have been scheduled under the role.\n     */\n    function getRoleGuardian(uint64 roleId) external view returns (uint64);\n\n    /**\n     * @dev Get the role current grant delay.\n     *\n     * Its value may change at any point without an event emitted following a call to {setGrantDelay}.\n     * Changes to this value, including effect timepoint are notified in advance by the {RoleGrantDelayChanged} event.\n     */\n    function getRoleGrantDelay(uint64 roleId) external view returns (uint32);\n\n    /**\n     * @dev Get the access details for a given account for a given role. These details include the timepoint at which\n     * membership becomes active, and the delay applied to all operation by this user that requires this permission\n     * level.\n     *\n     * Returns:\n     * [0] Timestamp at which the account membership becomes valid. 0 means role is not granted.\n     * [1] Current execution delay for the account.\n     * [2] Pending execution delay for the account.\n     * [3] Timestamp at which the pending execution delay will become active. 0 means no delay update is scheduled.\n     */\n    function getAccess(\n        uint64 roleId,\n        address account\n    ) external view returns (uint48 since, uint32 currentDelay, uint32 pendingDelay, uint48 effect);\n\n    /**\n     * @dev Check if a given account currently has the permission level corresponding to a given role. Note that this\n     * permission might be associated with an execution delay. {getAccess} can provide more details.\n     */\n    function hasRole(uint64 roleId, address account) external view returns (bool isMember, uint32 executionDelay);\n\n    /**\n     * @dev Give a label to a role, for improved role discoverability by UIs.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleLabel} event.\n     */\n    function labelRole(uint64 roleId, string calldata label) external;\n\n    /**\n     * @dev Add `account` to `roleId`, or change its execution delay.\n     *\n     * This gives the account the authorization to call any function that is restricted to this role. An optional\n     * execution delay (in seconds) can be set. If that delay is non 0, the user is required to schedule any operation\n     * that is restricted to members of this role. The user will only be able to execute the operation after the delay has\n     * passed, before it has expired. During this period, admin and guardians can cancel the operation (see {cancel}).\n     *\n     * If the account has already been granted this role, the execution delay will be updated. This update is not\n     * immediate and follows the delay rules. For example, if a user currently has a delay of 3 hours, and this is\n     * called to reduce that delay to 1 hour, the new delay will take some time to take effect, enforcing that any\n     * operation executed in the 3 hours that follows this update was indeed scheduled before this update.\n     *\n     * Requirements:\n     *\n     * - the caller must be an admin for the role (see {getRoleAdmin})\n     * - granted role must not be the `PUBLIC_ROLE`\n     *\n     * Emits a {RoleGranted} event.\n     */\n    function grantRole(uint64 roleId, address account, uint32 executionDelay) external;\n\n    /**\n     * @dev Remove an account from a role, with immediate effect. If the account does not have the role, this call has\n     * no effect.\n     *\n     * Requirements:\n     *\n     * - the caller must be an admin for the role (see {getRoleAdmin})\n     * - revoked role must not be the `PUBLIC_ROLE`\n     *\n     * Emits a {RoleRevoked} event if the account had the role.\n     */\n    function revokeRole(uint64 roleId, address account) external;\n\n    /**\n     * @dev Renounce role permissions for the calling account with immediate effect. If the sender is not in\n     * the role this call has no effect.\n     *\n     * Requirements:\n     *\n     * - the caller must be `callerConfirmation`.\n     *\n     * Emits a {RoleRevoked} event if the account had the role.\n     */\n    function renounceRole(uint64 roleId, address callerConfirmation) external;\n\n    /**\n     * @dev Change admin role for a given role.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleAdminChanged} event\n     */\n    function setRoleAdmin(uint64 roleId, uint64 admin) external;\n\n    /**\n     * @dev Change guardian role for a given role.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleGuardianChanged} event\n     */\n    function setRoleGuardian(uint64 roleId, uint64 guardian) external;\n\n    /**\n     * @dev Update the delay for granting a `roleId`.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {RoleGrantDelayChanged} event.\n     */\n    function setGrantDelay(uint64 roleId, uint32 newDelay) external;\n\n    /**\n     * @dev Set the role required to call functions identified by the `selectors` in the `target` contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetFunctionRoleUpdated} event per selector.\n     */\n    function setTargetFunctionRole(address target, bytes4[] calldata selectors, uint64 roleId) external;\n\n    /**\n     * @dev Set the delay for changing the configuration of a given target contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetAdminDelayUpdated} event.\n     */\n    function setTargetAdminDelay(address target, uint32 newDelay) external;\n\n    /**\n     * @dev Set the closed flag for a contract.\n     *\n     * Closing the manager itself won't disable access to admin methods to avoid locking the contract.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     *\n     * Emits a {TargetClosed} event.\n     */\n    function setTargetClosed(address target, bool closed) external;\n\n    /**\n     * @dev Return the timepoint at which a scheduled operation will be ready for execution. This returns 0 if the\n     * operation is not yet scheduled, has expired, was executed, or was canceled.\n     */\n    function getSchedule(bytes32 id) external view returns (uint48);\n\n    /**\n     * @dev Return the nonce for the latest scheduled operation with a given id. Returns 0 if the operation has never\n     * been scheduled.\n     */\n    function getNonce(bytes32 id) external view returns (uint32);\n\n    /**\n     * @dev Schedule a delayed operation for future execution, and return the operation identifier. It is possible to\n     * choose the timestamp at which the operation becomes executable as long as it satisfies the execution delays\n     * required for the caller. The special value zero will automatically set the earliest possible time.\n     *\n     * Returns the `operationId` that was scheduled. Since this value is a hash of the parameters, it can reoccur when\n     * the same parameters are used; if this is relevant, the returned `nonce` can be used to uniquely identify this\n     * scheduled operation from other occurrences of the same `operationId` in invocations of {execute} and {cancel}.\n     *\n     * Emits a {OperationScheduled} event.\n     *\n     * NOTE: It is not possible to concurrently schedule more than one operation with the same `target` and `data`. If\n     * this is necessary, a random byte can be appended to `data` to act as a salt that will be ignored by the target\n     * contract if it is using standard Solidity ABI encoding.\n     */\n    function schedule(\n        address target,\n        bytes calldata data,\n        uint48 when\n    ) external returns (bytes32 operationId, uint32 nonce);\n\n    /**\n     * @dev Execute a function that is delay restricted, provided it was properly scheduled beforehand, or the\n     * execution delay is 0.\n     *\n     * Returns the nonce that identifies the previously scheduled operation that is executed, or 0 if the\n     * operation wasn't previously scheduled (if the caller doesn't have an execution delay).\n     *\n     * Emits an {OperationExecuted} event only if the call was scheduled and delayed.\n     */\n    function execute(address target, bytes calldata data) external payable returns (uint32);\n\n    /**\n     * @dev Cancel a scheduled (delayed) operation. Returns the nonce that identifies the previously scheduled\n     * operation that is cancelled.\n     *\n     * Requirements:\n     *\n     * - the caller must be the proposer, a guardian of the targeted function, or a global admin\n     *\n     * Emits a {OperationCanceled} event.\n     */\n    function cancel(address caller, address target, bytes calldata data) external returns (uint32);\n\n    /**\n     * @dev Consume a scheduled operation targeting the caller. If such an operation exists, mark it as consumed\n     * (emit an {OperationExecuted} event and clean the state). Otherwise, throw an error.\n     *\n     * This is useful for contract that want to enforce that calls targeting them were scheduled on the manager,\n     * with all the verifications that it implies.\n     *\n     * Emit a {OperationExecuted} event.\n     */\n    function consumeScheduledOp(address caller, bytes calldata data) external;\n\n    /**\n     * @dev Hashing function for delayed operations.\n     */\n    function hashOperation(address caller, address target, bytes calldata data) external view returns (bytes32);\n\n    /**\n     * @dev Changes the authority of a target managed by this manager instance.\n     *\n     * Requirements:\n     *\n     * - the caller must be a global admin\n     */\n    function updateAuthority(address target, address newAuthority) external;\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/access/manager/IAuthority.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (access/manager/IAuthority.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Standard interface for permissioning originally defined in Dappsys.\n */\ninterface IAuthority {\n    /**\n     * @dev Returns true if the caller can invoke on a target the function identified by a function selector.\n     */\n    function canCall(address caller, address target, bytes4 selector) external view returns (bool allowed);\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n\n    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/utils/Panic.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,\n * consider using {ReentrancyGuardTransient} instead.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n    // Booleans are more expensive than uint256 or any type that takes up a full\n    // word because each write operation emits an extra SLOAD to first read the\n    // slot's contents, replace the bits taken up by the boolean, and then write\n    // back. This is the compiler's defense against contract upgrades and\n    // pointer aliasing, and it cannot be disabled.\n\n    // The values being non-zero value makes deployment a bit more expensive,\n    // but in exchange the refund on every call to nonReentrant will be lower in\n    // amount. Since refunds are capped to a percentage of the total\n    // transaction's gas, it is best to keep them low in cases like this one, to\n    // increase the likelihood of the full refund coming into effect.\n    uint256 private constant NOT_ENTERED = 1;\n    uint256 private constant ENTERED = 2;\n\n    uint256 private _status;\n\n    /**\n     * @dev Unauthorized reentrant call.\n     */\n    error ReentrancyGuardReentrantCall();\n\n    constructor() {\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     * Calling a `nonReentrant` function from another `nonReentrant`\n     * function is not supported. It is possible to prevent this from happening\n     * by making the `nonReentrant` function external, and making it call a\n     * `private` function that does the actual work.\n     */\n    modifier nonReentrant() {\n        _nonReentrantBefore();\n        _;\n        _nonReentrantAfter();\n    }\n\n    function _nonReentrantBefore() private {\n        // On the first call to nonReentrant, _status will be NOT_ENTERED\n        if (_status == ENTERED) {\n            revert ReentrancyGuardReentrantCall();\n        }\n\n        // Any calls to nonReentrant after this point will fail\n        _status = ENTERED;\n    }\n\n    function _nonReentrantAfter() private {\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = NOT_ENTERED;\n    }\n\n    /**\n     * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n     * `nonReentrant` function in the call stack.\n     */\n    function _reentrancyGuardEntered() internal view returns (bool) {\n        return _status == ENTERED;\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/utils/math/Math.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two numbers.\n     */\n    function max(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a > b, a, b);\n    }\n\n    /**\n     * @dev Returns the smallest of two numbers.\n     */\n    function min(uint256 a, uint256 b) internal pure returns (uint256) {\n        return ternary(a < b, a, b);\n    }\n\n    /**\n     * @dev Returns the average of two numbers. The result is rounded towards\n     * zero.\n     */\n    function average(uint256 a, uint256 b) internal pure returns (uint256) {\n        // (a + b) / 2 can overflow.\n        return (a & b) + (a ^ b) / 2;\n    }\n\n    /**\n     * @dev Returns the ceiling of the division of two numbers.\n     *\n     * This differs from standard division with `/` in that it rounds towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 0) {\n                // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n                // The surrounding unchecked block does not change this fact.\n                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n                return low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / twos. If twos is zero, then it becomes one.\n                twos := add(div(sub(0, twos), twos), 1)\n            }\n\n            // Shift in bits from high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\n            uint256 inverse = (3 * denominator) ^ 2;\n\n            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\n\n            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n            // This will give us the correct result modulo 2²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev Calculates x * y / denominator with full precision, following the selected rounding direction.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev Calculates sqrt(a), following the selected rounding direction.\n     */\n    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = sqrt(a);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log2(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value) internal pure returns (uint256) {\n        uint256 result = 0;\n        unchecked {\n            if (value >= 10 ** 64) {\n                value /= 10 ** 64;\n                result += 64;\n            }\n            if (value >= 10 ** 32) {\n                value /= 10 ** 32;\n                result += 32;\n            }\n            if (value >= 10 ** 16) {\n                value /= 10 ** 16;\n                result += 16;\n            }\n            if (value >= 10 ** 8) {\n                value /= 10 ** 8;\n                result += 8;\n            }\n            if (value >= 10 ** 4) {\n                value /= 10 ** 4;\n                result += 4;\n            }\n            if (value >= 10 ** 2) {\n                value /= 10 ** 2;\n                result += 2;\n            }\n            if (value >= 10 ** 1) {\n                result += 1;\n            }\n        }\n        return result;\n    }\n\n    /**\n     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log10(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     *\n     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n     */\n    function log256(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\n    }\n\n    /**\n     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n     * Returns 0 if given 0.\n     */\n    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n        unchecked {\n            uint256 result = log256(value);\n            return result + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/src/nav/interfaces/INAVDataProvider.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\n/**\n * @title NAV Data Provider Interface\n * @notice Minimal read surface for a NAV value and its source-data timestamp.\n */\ninterface INAVDataProvider {\n    /**\n     * @notice Return the current NAV and the time its source data was observed.\n     * @return nav The latest NAV value with 18 decimal places.\n     * @return timestamp The source observation time in Unix seconds. An intermediary must preserve\n     *         this value rather than replace it with its own acceptance time.\n     */\n    function getCurrentNAV() external view returns (uint256 nav, uint256 timestamp);\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/src/nav/interfaces/INAVOracle.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {INAVDataProvider} from \"./INAVDataProvider.sol\";\n\n/// @notice How an accepted NAV round was produced. Emitted with every round for monitoring/audit.\nenum UpdateKind {\n    Bootstrap, // initial seed recorded by the NAVOracle constructor\n    Report, // automated up-or-flat write submitted through an authorized provider\n    Force, // authorized manual up-or-flat write for outage or recovery use\n    Markdown // delayed write-down; the only NAVOracle path that can decrease NAV\n}\n\n/// @notice Outcome of a {INAVOracle.submitReport} call.\n/// @dev NAVOracle returns a status for accepted reports and terminal no-write outcomes; future-dated\n///      observations and value-rail violations revert. Report providers are expected to treat a\n///      returned status as transport success, but that mapping is provider behavior.\nenum SubmitStatus {\n    Accepted,\n    IgnoredInProtection,\n    DiscardedNonMonotonic,\n    DiscardedStale\n}\n\n// ----- Shared events (file-level so NAVOracle and its report providers use one set of\n//       declarations without inheritance) -----\n\n/// @notice A new NAV round was accepted (any path — see kind).\nevent NAVUpdated(\n    uint80 indexed roundId, uint256 nav, uint256 observationTimestamp, UpdateKind kind\n);\n/// @notice Chainlink V2 event signatures emitted by NAVOracle when it records a core round.\n/// @dev `AnswerUpdated.current` is the raw 18-decimal core NAV, and the log emitter is NAVOracle.\n///      It is not a scaled feed answer: for example, an 8-decimal NAVFeed returns\n///      `floor(current / 1e10)` as `latestRoundData().answer`, while an 8-decimal NAVFeedProxy\n///      returns that value from both `latestAnswer()` and `latestRoundData().answer`.\nevent AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt);\nevent NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt);\n/// @notice A provider report arrived during Protection Mode and was ignored. The returned status\n///         can be mapped to transport acknowledgement by the provider.\nevent ReportIgnoredInProtection(bytes32 indexed feedId, uint256 nav, uint256 observationTimestamp);\n/// @notice A non-monotonic or stale provider observation was discarded.\n/// @dev NAVOracle returns a discard status; transport retry behavior belongs to the provider.\nevent ReportDiscarded(\n    bytes32 indexed feedId, uint256 nav, uint256 observationTimestamp, bytes4 reason\n);\n/// @notice An accepted provider report was written.\nevent ReportAccepted(\n    bytes32 indexed feedId, uint256 nav, uint256 observationTimestamp, uint256 deviationBps\n);\n/// @notice Protection Mode entered (`by` is the enterer; every entry consumes the one-shot arming).\nevent ProtectionModeEntered(address indexed by, uint256 indexed episodeId, string reason);\n/// @notice Protection Mode exited by an authorized caller.\nevent ProtectionModeExited(address indexed by);\n/// @notice Protection entry was re-armed by an authorized caller.\nevent ProtectionEntryRearmed(address indexed by);\n/// @notice A timelocked markdown executed: NAV decreased from previousNav to newNav.\nevent MarkdownApplied(uint80 indexed roundId, uint256 previousNav, uint256 newNav, string reason);\n/// @notice Authorized manual up-or-flat write.\nevent NAVForceUpdated(address indexed by, uint256 nav, uint256 observationTimestamp, string reason);\n/// @notice Constructor seed recorded as round 1 (no sink push).\nevent Bootstrapped(address indexed deployer, uint256 nav, uint256 dataTimestamp);\n\n// Configuration events.\nevent NormalBandUpdated(uint256 previous, uint256 current);\nevent ForceBandUpdated(uint256 previous, uint256 current);\nevent MaxNAVUpdated(uint256 previous, uint256 current);\n\n// ----- Shared errors (file-level for the same reason) -----\n\nerror ZeroAddress();\nerror ZeroFeedId();\nerror InvalidBounds();\nerror InvalidBand();\nerror InvalidVelocity();\nerror InvalidStaleness();\nerror NoData(uint80 roundId);\n/// @dev Used as the {ReportDiscarded} reason selector for a non-monotonic observation; the\n///      submission returns a discard status instead of reverting with this error.\nerror NonMonotonicObservation(uint256 observationTimestamp, uint256 lastObservationTs);\nerror ZeroObservationTimestamp();\nerror FutureObservation(uint256 observationTimestamp, uint256 blockTimestamp);\nerror StaleObservation(uint256 observationTimestamp);\nerror OutOfBounds(uint256 navValue);\nerror DeviationExceeded(uint256 navValue, uint256 currentNav, uint256 deviationBps);\nerror VelocityExceeded(uint256 navValue, uint256 moveWad, uint256 budgetWad);\nerror NAVMustNotDecrease(uint256 navValue, uint256 currentNav);\nerror ProtectionModeActive();\nerror ProtectionModeNotActive();\nerror ProtectionEntryNotArmed();\nerror MarkdownMustDecrease(uint256 navValue, uint256 currentNav);\nerror MarkdownBelowFloor(uint256 navValue, uint256 floor);\nerror MarkdownEpisodeMismatch(uint256 providedEpisode, uint256 currentEpisode);\nerror MarkdownTooFrequent(uint256 elapsed, uint256 required);\nerror MarkdownDelayNotElapsed(uint256 readyAt, uint256 nowTs);\nerror InvalidMarkdownDelay();\nerror ForceUpdateTooFrequent(uint256 elapsed, uint256 required);\n\n/**\n * @title INAVOracle\n * @notice Protocol-facing surface implemented by {NAVOracle}. NAV uses 18-decimal fixed-point units\n *         on this surface; an integrator-facing feed may scale values to different decimals.\n *\n * @dev NAVOracle ignores automated reports and blocks force writes during Protection Mode, while\n *      delayed markdowns remain available. If no markdown executes, the latest round timestamp\n *      remains unchanged. AccessManager scheduling and any market action triggered by feed\n *      staleness are deployment and integrator policy rather than guarantees of this interface.\n */\ninterface INAVOracle is INAVDataProvider {\n    /// @notice Number of decimals used by the protocol NAV surface.\n    /// @dev NAVOracle returns 18. The distinct name avoids confusing protocol NAV decimals with an\n    ///      AggregatorV3 feed's `decimals()`.\n    function navDecimals() external pure returns (uint8);\n\n    /// @notice Latest accepted round id (at least 1 because the constructor records the seed).\n    function latestRound() external view returns (uint80);\n\n    /// @notice Return a stored round. NAVOracle reverts {NoData} for a nonexistent round id.\n    function getRound(uint80 roundId) external view returns (uint256 answer, uint256 updatedAt);\n\n    /// @notice Whether Protection Mode is active.\n    /// @dev NAVOracle ignores reports and blocks force writes while active; markdowns remain\n    ///      available subject to their episode and timing gates.\n    function protectionMode() external view returns (bool);\n\n    /// @notice Monotonically increasing protection episode id used to bind NAVOracle markdowns.\n    function protectionEpisodeId() external view returns (uint256);\n\n    /// @notice Source-data timestamp associated with the current NAV value.\n    /// @dev Bootstrap and reports preserve their source observation time; force writes and\n    ///      markdowns use their execution block time. This is distinct from a round's `updatedAt`,\n    ///      which records when this oracle accepted the round. It can move backward when a report\n    ///      observed shortly before a force write is accepted afterward.\n    function currentDataTimestamp() external view returns (uint256);\n\n    /// @notice Timestamp used only for automated-report ordering and replay protection.\n    /// @dev NAVOracle initializes it from the constructor seed's source-data timestamp. Accepted\n    ///      reports and markdowns advance it; force writes do not. It is not necessarily the\n    ///      timestamp associated with the current NAV value; use {currentDataTimestamp} for that.\n    function lastObservationTs() external view returns (uint256);\n\n    /// @notice The feed identifier this oracle serves (report providers bind against it).\n    function feedId() external view returns (bytes32);\n\n    /// @notice Submit a NAV observation to the implementing oracle.\n    /// @dev NAVOracle restricts this call through its authority and enforces its value and ordering\n    ///      rails. Transport authentication, decoding, and chain/feed binding remain provider\n    ///      responsibilities; provider authorization is deployment wiring.\n    /// @param navValue NAV in 18-decimal fixed-point units.\n    /// @param observationTimestamp Observation time in Unix seconds.\n    /// @return status Accepted or terminal no-write outcome.\n    function submitReport(uint256 navValue, uint256 observationTimestamp)\n        external\n        returns (SubmitStatus);\n}\n"},{"file_path":"../vendor/smart-contracts-oracle/src/nav/interfaces/NAVSinkTypes.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\n// Shared sink events/errors and the legacy-consumer write surface used by NAVPushSinks and\n// LegacyConsumerSinkAdapter. Sink callbacks use INAVReceiver. Registration and caller permissions\n// are implementation and deployment concerns; local wiring checks live in\n// script/VerifyAccessManagerWiring.s.sol.\n\n/// @notice Minimal legacy-consumer write surface used by LegacyConsumerSinkAdapter.\n/// @dev Authorization and legacy write rails are enforced by the deployed legacy consumer.\ninterface ILegacyNAVConsumer {\n    function forceNAVUpdate(uint256 navValue, string calldata reason) external;\n}\n\nevent SinkAdded(address indexed target);\nevent SinkRemoved(address indexed target);\n/// @notice A sink call failed or exhausted its gas cap; fan-out continues to the next sink.\nevent SinkPushFailed(address indexed target, uint256 nav);\n\nerror SinkZeroAddress();\nerror SinkAlreadyRegistered(address target);\nerror SinkNotFound(address target);\nerror SinkNotAContract(address target);\nerror TooManySinks();\nerror InsufficientGasForSinkPush(address target);\n/// @notice An explicit governance synchronization attempt failed to update the target sink.\nerror SinkSyncFailed(address target, uint256 nav);\n"},{"file_path":"../vendor/smart-contracts-oracle/src/nav/sinks/NAVPushSinks.sol","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {AccessManaged} from \"@openzeppelin/contracts/access/manager/AccessManaged.sol\";\nimport {INAVReceiver} from \"../interfaces/INAVReceiver.sol\";\n// solhint-disable-next-line no-global-import — pulls in the sink events/errors.\nimport \"../interfaces/NAVSinkTypes.sol\";\n\n/**\n * @title NAVPushSinks\n * @notice Access-managed registry and fan-out for downstream {INAVReceiver} sinks. NAVOracle pushes\n *         report, force-update, and markdown rounds; the constructor seed is not fanned out. Compatible\n *         receivers register directly, while targets with another write interface use an adapter.\n * @dev Each target's execution is gas-capped and return data is not copied. An ordinary target\n *      failure is reported without stopping fan-out. The write still reverts if it cannot reserve\n *      a target's full gas budget.\n */\nabstract contract NAVPushSinks is AccessManaged {\n    /// @notice Gas requested for target execution in each sink call.\n    /// @dev Callers must also provision transaction gas for every registered sink and fan-out\n    ///      overhead. Re-measure when sinks change.\n    uint256 public constant SINK_GAS_LIMIT = 500_000;\n    /// @notice Cap on registered sinks; bounds the number of external calls in each fan-out.\n    uint256 public constant MAX_SINKS = 8;\n\n    address[] private _sinks;\n\n    /// @notice The registered downstream sinks, in push order.\n    function sinks() external view returns (address[] memory) {\n        return _sinks;\n    }\n\n    /// @notice Register a sink. Production AccessManager wiring should restrict this selector to\n    ///         governance-authorized callers.\n    function addSink(address target) external restricted {\n        if (target == address(0)) revert SinkZeroAddress();\n        // A codeless target would make every low-level push a silent success — fail at registration.\n        if (target.code.length == 0) revert SinkNotAContract(target);\n        uint256 n = _sinks.length;\n        if (n >= MAX_SINKS) revert TooManySinks();\n        for (uint256 i; i < n; ++i) {\n            if (_sinks[i] == target) revert SinkAlreadyRegistered(target);\n        }\n        _sinks.push(target);\n        emit SinkAdded(target);\n    }\n\n    /// @notice Deregister a sink (swap-and-pop; push order of the remaining sinks may change).\n    function removeSink(address target) external restricted {\n        uint256 n = _sinks.length;\n        for (uint256 i; i < n; ++i) {\n            if (_sinks[i] == target) {\n                _sinks[i] = _sinks[n - 1];\n                _sinks.pop();\n                emit SinkRemoved(target);\n                return;\n            }\n        }\n        revert SinkNotFound(target);\n    }\n\n    /// @dev Whether `target` is currently registered.\n    function _hasSink(address target) internal view returns (bool) {\n        uint256 n = _sinks.length;\n        for (uint256 i; i < n; ++i) {\n            if (_sinks[i] == target) return true;\n        }\n        return false;\n    }\n\n    /// @dev Gas-capped push to a single sink (shared by the fan-out and {syncSink}).\n    function _pushOne(address target, uint256 nav) internal returns (bool ok) {\n        if (gasleft() < SINK_GAS_LIMIT + SINK_GAS_LIMIT / 63 + 5_000) {\n            revert InsufficientGasForSinkPush(target);\n        }\n        bytes memory data = abi.encodeCall(INAVReceiver.setSharePrice, (nav));\n        uint256 gasLimit = SINK_GAS_LIMIT;\n        // Request zero output bytes so a sink cannot impose caller-side return-data copy costs.\n        assembly (\"memory-safe\") {\n            ok := call(gasLimit, target, 0, add(data, 0x20), mload(data), 0, 0)\n        }\n        if (!ok) emit SinkPushFailed(target, nav);\n    }\n\n    /// @dev Attempt to push an accepted NAV to every sink. A target failure emits {SinkPushFailed} and\n    ///      iteration continues. Insufficient gas to reserve a target's full budget reverts the\n    ///      write.\n    function _pushSinks(uint256 nav) internal {\n        uint256 n = _sinks.length;\n        // EIP-150 can reduce forwarded gas to 63/64 of the caller's remaining gas. Before each call,\n        // _pushOne requires enough gas to forward the full target budget. An underfunded iteration\n        // reverts rather than committing without attempting that sink. The check is per iteration\n        // because preceding sinks may consume different amounts.\n        for (uint256 i; i < n; ++i) {\n            _pushOne(_sinks[i], nav);\n        }\n    }\n}\n"}],"is_verified_via_sourcify":false,"can_be_visualized_via_sol2uml":true,"evm_version":"shanghai","language":"solidity","is_verified_via_eth_bytecode_db":false,"is_fully_verified":false,"license_type":"none","is_blueprint":false,"name":"NAVOracle","creation_bytecode":"0x610140604052346105c75760405161270e38819003601f8101601f191683016001600160401b0381118482101761048a5783928291604052833981010361018081126105c75781516001600160a01b03811691908290036105c75761012090601f1901126105c75760405161012081016001600160401b0381118282101761048a576040526020830151815260408301519060208101918252606084015191604082019283526080850151926060830193845260a08601516080840190815260c08701519460a0850195865260e08801519260c086019384526101008901519460e087019586526101208a01519661010081019788526101606101408c01519b0151998060018060a01b03195f5416175f557f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad6020604051838152a16001600255600160ff196011541617601155156105b8578051156105a957815164e8d4a51000811090811561059d575b5061058e5782516001600160c01b031061058e5783518015908115610582575b5061056757845184518110908115610576575b506105675788518451811090811561055b575b5061054057855162015180811090811561054e575b50610540578751620151808110908115610533575b506105245786518015908115610517575b506105085781518b1080156104fe575b6104eb5789156104dc57428a116104c55786518a01808b1161049e5742116104b257516080525160a0525160035551600455516005558351610100525160e0525160c052516101205281600b5551670de0b6b3a7640000810290808204670de0b6b3a7640000149015171561049e57600855600982905542600a556007546001600160501b0380821690811461049e576001600160501b036001909101166001600160501b0319919091168117600755604080519081018181106001600160401b0382111761048a5760409081526001600160c01b038581168352426001600160401b031660208085019182525f868152600682528481209551925160c01b6001600160c01b031916929093169190911790935560078054600160501b600160901b031916605087901b71ffffffffffffffff000000000000000000001617905581518681529283018590529082015281907f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb90606090a2604051428152817f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a3827f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a360405191825260208201527f84e8faa36a886357853e34c7f583182c9e571bf2c801707dec9aa976936e0c4360403392a260405161214290816105cc8239608051818181610edf0152818161163901528181611779015281816117f20152611848015260a05181611109015260c051818181610cd6015261151a015260e0518181816110cf01526116ae015261010051818181610534015281816112e901526115540152610120518181816108e70152818161118801526114110152f35b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b896327cc4d2560e01b5f5260045260245ffd5b896312d0e98160e31b5f526004524260245260445ffd5b635d6c47b960e11b5f5260045ffd5b8a635f7644f960e01b5f5260045260245ffd5b5082518b116101fc565b636351541960e01b5f5260045ffd5b62093a809150115f6101ec565b631fd6d59f60e31b5f5260045ffd5b62278d009150115f6101db565b62d4160f60e61b5f5260045ffd5b62278d009150115f6101c6565b6127109150115f6101b1565b634626bc5360e01b5f5260045ffd5b6127109150115f61019e565b6113889150115f61018b565b63a883435760e01b5f5260045ffd5b9050835111155f61016b565b632a94114160e21b5f5260045ffd5b63d92e233d60e01b5f5260045ffd5b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c908163073a6dff1461134f575080630974f97e146113255780630e7071b71461127657806313d4d98b146111cd5780631448327d146111ab578063144b761e14611171578063164a0dcd1461114957806319cf2a021461112c5780631a8d07f8146110f25780632075e01e146110b8578063237c7e9314610bee57806324a343fa14611050578063259e5cd8146110355780632f759d921461101357806333925b7914610ff65780634245621314610f0257806347660a4114610ddd5780634a64349914610ec85780634c73051414610eab5780634f3813f714610de2578063543095b814610ddd5780635470cc1514610dc05780635477107214610da557806354e4d19a14610d8957806365a4059e14610bee578063668a0f0214610d63578063693de59214610d165780636d20051214610cf957806370b69acb14610cbf578063710450ce14610ca05780637a9e5e4b14610bf35780637fc0d4b914610bee5780638c77cd711461087b5780638cf307161461085e5780638fb3603714610803578063911273531461073b5780639b32d38f146106bc578063a0cc3f641461069f578063a77cc36414610682578063bdd88f5814610665578063bf7e214f14610640578063c7d7f3a814610624578063c901500c14610607578063d5f1b16b146105a0578063dfa8cc6614610557578063e2c7a79d1461051d578063e35fbc1f146103e1578063e407de761461037a578063f317a3a4146102f6578063f5746e50146102bd578063f8dc8fd1146102a0578063f9a372d8146102835763fd967f4714610263575f80fd5b3461027f575f36600319011261027f5760206040516127108152f35b5f80fd5b3461027f575f36600319011261027f576020600b54604051908152f35b3461027f575f36600319011261027f576020600d54604051908152f35b3461027f57602036600319011261027f576004356001600160a01b038116810361027f576102f4906102ef363361198c565b61189a565b005b3461027f57602036600319011261027f57600435610314363361198c565b60035480821180159061036a575b61035b5760407fcd8aa970cae8115c4d31873d575101c79dc5e68b0ff5e4caa909cb571b3fcaa1918151908152836020820152a1600355005b63a883435760e01b5f5260045ffd5b506001600160c01b038211610322565b3461027f575f36600319011261027f57610394363361198c565b60ff600e54166103d257600160ff196011541617601155337f04c75ce851f69bc8560934c5fb0b1b235499894cd26ceff86be8ab6c69b77a8c5f80a2005b6364a0622b60e11b5f5260045ffd5b3461027f57602036600319011261027f576004356001600160a01b0381169081810361027f57610411363361198c565b811561050e57803b156104fb576001549060088210156104ec575f5b8281106104b257506801000000000000000082101561049e57610459826001610478940160015561186e565b9091906001600160a01b038084549260031b9316831b921b1916179055565b7ff785f9bb7b7198ebb04ce272223e3b28ea051c0e063850f926b3895a77a2c6835f80a2005b634e487b7160e01b5f52604160045260245ffd5b836001600160a01b036104c48361186e565b90549060031b1c16146104d95760010161042d565b83634faa810b60e11b5f5260045260245ffd5b632a4282b360e01b5f5260045ffd5b5063cabb125960e01b5f5260045260245ffd5b634a94420360e01b5f5260045ffd5b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f57604036600319011261027f57610572363361198c565b61057a611adf565b602061058a6024356004356114f8565b60016002556040519061059c816113d1565b8152f35b3461027f575f36600319011261027f576105ba363361198c565b600e5460ff8116156105f85760ff1916600e555f600f55337f6977cf3ab0aaccc6ceeb77ddaf93b2e1f1b9e6c7e39c7fb08314efbbea3657415f80a2005b632e69b98360e21b5f5260045ffd5b3461027f575f36600319011261027f576020600354604051908152f35b3461027f575f36600319011261027f5760206040516113888152f35b3461027f575f36600319011261027f5760206001600160a01b035f5416604051908152f35b3461027f575f36600319011261027f576020600a54604051908152f35b3461027f575f36600319011261027f576020600954604051908152f35b3461027f575f36600319011261027f576020600854604051908152f35b3461027f57602036600319011261027f576004356106da363361198c565b60045481108015610730575b610721577f3ee4ddb2b11b8e2630f0abc45b147655b578f102f419e55290feee480702096560406005548151908152836020820152a1600555005b634626bc5360e01b5f5260045ffd5b5061271081116106e6565b3461027f575f36600319011261027f576040518060206001549283815201809260015f527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6905f5b8181106107e457505050816107999103826114d6565b604051918291602083019060208452518091526040830191905f5b8181106107c2575050500390f35b82516001600160a01b03168452859450602093840193909201916001016107b4565b82546001600160a01b0316845260209093019260019283019201610783565b3461027f575f36600319011261027f575f5460a01c60ff1615610856576020638fb3603760e01b5b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152f35b60205f61082b565b3461027f575f36600319011261027f576020600c54604051908152f35b3461027f57606036600319011261027f5760043560243560443567ffffffffffffffff811161027f576108b2903690600401611386565b9290916108bf363361198c565b6108c7611adf565b60ff600e5416156105f85760105490818103610bd957505061090c600f547f0000000000000000000000000000000000000000000000000000000000000000906113db565b804210610bc35750600d5461092181426113e8565b90151580610bb7575b610b9e57506109566001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b80821015610b885764e8d4a510008210610b6c57600982905542600d5560019242600b55600754936001600160501b0385166001600160501b038114610b58576001016001600160501b03811680966001600160501b031916176007556040516109bf816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152875f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b4260501b169067ffffffffffffffff60501b191617600755604051858152426020820152600460031015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb606082600360408b950152a2604051428152867f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a385857f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a3506001545f5b818110610b19575050507f8e62721e67f7afc05c2b11b45f0debcdd11c4e548a576d95615f84451005b8f49394610b0f916040519485948561149b565b0390a26001600255005b80610b3d876001600160a01b03610b30879561186e565b90549060031b1c16611b53565b5001610ad2565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b50631ebc7e6360e11b5f5260045264e8d4a5100060245260445ffd5b90634c4c860560e01b5f5260045260245260445ffd5b63d7ef2fd360e01b5f526004526201518060245260445ffd5b5062015180811061092a565b63fe84284d60e01b5f526004524260245260445ffd5b6329c6abe760e11b5f5260045260245260445ffd5b611369565b3461027f57602036600319011261027f576004356001600160a01b0381169081810361027f575f54906001600160a01b0382163303610c8e573b15610c7b5773ffffffffffffffffffffffffffffffffffffffff191681175f556040519081527f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad90602090a1005b506361798f2f60e11b5f5260045260245ffd5b62d1953b60e31b5f523360045260245ffd5b3461027f575f36600319011261027f57602060405164e8d4a510008152f35b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f575f36600319011261027f576020600f54604051908152f35b3461027f575f36600319011261027f5760406007546001600160501b0381165f52600660205267ffffffffffffffff6001600160c01b03835f20541691835192835260501c166020820152f35b3461027f575f36600319011261027f5760206001600160501b0360075416604051908152f35b3461027f575f36600319011261027f5760206040516138408152f35b3461027f575f36600319011261027f57602060405160128152f35b3461027f575f36600319011261027f5760206040516207a1208152f35b6113b4565b3461027f57602036600319011261027f5760043567ffffffffffffffff811161027f57610e13903690600401611386565b610e1d363361198c565b600e5460ff81166103d2576011549060ff821615610e9c5760ff1991821660115516600117600e5542600f556010545f198114610b5857610e9760017f8309a510ad281c38d91b499b3383fae0128c40c9ab0075531f35221f8dc89c1f92019384601055604051918291602083523395602084019161147b565b0390a3005b633944643f60e01b5f5260045ffd5b3461027f575f36600319011261027f576020600454604051908152f35b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f57604036600319011261027f5760043560243567ffffffffffffffff811161027f57610f36903690600401611386565b610f43929192363361198c565b610f4b611adf565b60ff600e54166103d257600c5492610f6384426113e8565b93151580610feb575b610fd257907fb70dc4416ead44171172d6e9effa363a3eef666a2a2e117270cda1e30857a31391610f9f60055485611bef565b508403610fc9575b42600c55610fb54285611ca7565b50610b0f604051928392339642908561149b565b83600955610fa7565b836329108fcd60e01b5f5260045261384060245260445ffd5b506138408410610f6c565b3461027f575f36600319011261027f57602060405162093a808152f35b3461027f575f36600319011261027f57602060ff601154166040519015158152f35b3461027f575f36600319011261027f57602060405160088152f35b3461027f57602036600319011261027f576004356001600160501b03811680910361027f57805f52600660205260405f20548060c01c80156110a557604092506001600160c01b038351921682526020820152f35b8263d17cddb760e01b5f5260045260245ffd5b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f575f36600319011261027f576020601054604051908152f35b3461027f57602036600319011261027f5760206111676004356113f5565b6040519015158152f35b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461027f575f36600319011261027f57602060ff600e54166040519015158152f35b3461027f57602036600319011261027f576004356001600160a01b03811680820361027f576111fc363361198c565b611204611adf565b61120d82611afd565b156112645761124361123c6001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b8093611b53565b1561124f576001600255005b63d7e4f28f60e01b5f5260045260245260445ffd5b630148df3360e21b5f5260045260245ffd5b3461027f57602036600319011261027f57600435611294363361198c565b8015801561131a575b801561130f575b80156112e6575b610721577f95e5cfdd0cca9c70916d639815020b9271f1544f8c393bd745951f20113d5be360406004548151908152836020820152a1600455005b507f000000000000000000000000000000000000000000000000000000000000000081116112ab565b5060055481116112a4565b50611388811161129d565b3461027f575f36600319011261027f57602067ffffffffffffffff60075460501c16604051908152f35b3461027f575f36600319011261027f576020906005548152f35b3461027f575f36600319011261027f576020604051620151808152f35b9181601f8401121561027f5782359167ffffffffffffffff831161027f576020838186019501011161027f57565b3461027f575f36600319011261027f57602060405162278d008152f35b60041115610b4457565b91908201809211610b5857565b91908203918211610b5857565b60ff600e54161590811561146e575b5061145357611436600f547f0000000000000000000000000000000000000000000000000000000000000000906113db565b421061145357600d548015159081611457575b5061145357600190565b5f90565b62015180915061146790426113e8565b105f611449565b905060105414155f611404565b908060209392818452848401375f828201840152601f01601f1916010190565b6114b7949260609282526020820152816040820152019161147b565b90565b6040810190811067ffffffffffffffff82111761049e57604052565b90601f8019910116810190811067ffffffffffffffff82111761049e57604052565b9060ff600e541661181857600b548111156117b55742811161179f574261153f7f0000000000000000000000000000000000000000000000000000000000000000836113db565b1061173c5761155060045483611bef565b91907f000000000000000000000000000000000000000000000000000000000000000090670de0b6b3a7640000820291808304670de0b6b3a76400001490151715610b5857600854906009549081938084145f146116a0578290915b80820361168a5750506115d25f5b6115cd846115c8818c6113e8565b611fb5565b6113e8565b9080821161167057906115e4916113e8565b928103611667575b50810361165e575b5042600a556116038184611e2c565b50604051928352602083015260408201527f7b44f6c699efb5305c3f715cb1d19207cb916dfe7d291815637a16a1086e4ca260607f000000000000000000000000000000000000000000000000000000000000000092a25f90565b6008555f6115f4565b6009555f6115ec565b908763619938f160e01b5f5260045260245260445260645ffd5b816115c86115d29361169b936113e8565b6115ba565b90916116ac84836113e8565b7f0000000000000000000000000000000000000000000000000000000000000000906116d984838361206e565b84156117285784836116ee93091515906113db565b6116fa600a54426113e8565b90811061170c575050508180926115ac565b6117229161171c9184969561206e565b856113db565b916115ac565b634e487b7160e01b5f52601260045260245ffd5b60405191825260208201526327cc4d2560e01b60408201527face739b1b5ea6eeb3fc556782bacfbfea62fa30c14f73db57f892bd1a7bcafaa60607f000000000000000000000000000000000000000000000000000000000000000092a2600390565b6312d0e98160e31b5f526004524260245260445ffd5b6040519182526020820152631336de3960e21b60408201527face739b1b5ea6eeb3fc556782bacfbfea62fa30c14f73db57f892bd1a7bcafaa60607f000000000000000000000000000000000000000000000000000000000000000092a2600290565b60405191825260208201527fe04bc76530140fe79125100b82d714b0cf3ce05dc404f99cf6fc94c386c3f4cb60407f000000000000000000000000000000000000000000000000000000000000000092a2600190565b6001548110156118865760015f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b6001545f5b8181106118c2576001600160a01b0383630148df3360e21b5f521660045260245ffd5b6001600160a01b036118d38261186e565b90549060031b1c166001600160a01b0384168091146118f5575060010161189f565b92505f198201918211610b58576104596001600160a01b036119196119279461186e565b90549060031b1c169161186e565b6001548015611978575f190161193c8161186e565b6001600160a01b0382549160031b1b191690556001557f8e4f69096d1bfe0e5365848d86b29c4ee26b6aab65e9fa11361c45133f896c9b5f80a2565b634e487b7160e01b5f52603160045260245ffd5b905f915f54916001600160a01b038316928160041161027f575f5f9060405f8151966001600160a01b03602089019163b700961360e01b8352169788602482015230604482015263ffffffff60e01b8335166064820152606481526119f26084826114d6565b828052826020525190895afa611acc575b15611a11575b505050505050565b63ffffffff1615611aba5760ff60a01b1916600160a01b175f55823b1561027f576020925f9283604051809681958294634a63ebf760e11b845260048401526040602484015260448301908082528085848401378181018301859052601f01601f1916010103925af18015611aaf57611a9c575b50805460ff60a01b191690555f8080808080611a09565b611aa891505f906114d6565b5f5f611a85565b6040513d5f823e3d90fd5b8262d1953b60e31b5f5260045260245ffd5b50505f516020518060201c150290611a03565b6002805414611aee5760028055565b633ee5aeb560e01b5f5260045ffd5b600154905f5b828110611b11575050505f90565b6001600160a01b03611b228261186e565b90549060031b1c166001600160a01b03831614611b4157600101611b03565b505050600190565b8115611728570490565b91906207d3a85a10611bd3575f8060405160208101906316b6024960e01b825284602482015260248152611b886044826114d6565b519082876207a120f1928315611b9c575050565b60206001600160a01b037fff7bbcb289f45fc5be914edee99f22261f5666682918f011241c3aed779522f5926040519485521692a2565b6001600160a01b038363f94d5ceb60e01b5f521660045260245ffd5b916003548311611c9457611c206001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b92838110611c7d57611c3284826113e8565b611c3f856127108361206e565b85156117285785612710611c5693091515906113db565b9081938211611c63575050565b8490637403977b60e01b5f5260045260245260445260645ffd5b83906353af0aa360e11b5f5260045260245260445ffd5b82635f7644f960e01b5f5260045260245ffd5b91906007546001600160501b0381166001600160501b038114610b5857600101916001600160501b03831680926001600160501b03191617600755604051611cee816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152835f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b8260501b169067ffffffffffffffff60501b191617600755604051908582526020820152600460021015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb6060826002604086950152a2604051428152817f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a3837f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a391600154905f5b828110611e0d57505050565b80611e25836001600160a01b03610b3060019561186e565b5001611e01565b919080600b556007546001600160501b0381166001600160501b038114610b5857600101916001600160501b03831680926001600160501b03191617600755604051611e77816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152835f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b8260501b169067ffffffffffffffff60501b191617600755604051908582526020820152600460011015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb6060826001604086950152a2604051428152817f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a3837f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a391600154905f5b828110611f9657505050565b80611fae836001600160a01b03610b3060019561186e565b5001611f8a565b5f1969021e19e0c9bab240000082099169021e19e0c9bab2400000820291828085109403938085039414612062578382111561204a5769021e19e0c9bab2400000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b50634e487b715f52156003026011186020526024601cfd5b50906114b79250611b49565b90915f1983830992808302928380861095039480860395146120ff57848311156120e75790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906114b79250611b4956fea264697066735822122052d6c9a23c8b81b21781764946d7c7ec5bf7eb96c418d065b2122c3f54a21ad164736f6c634300081e00330000000000000000000000003f0da1c363e34802c6f12f9c27276dc0e6696fd84dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af0000000000000000000000000000000000000000000000000efcee47256c00000000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000009600000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000127500000000000000000000000000000000000000000000000000000000000001fa4000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000f2522e5b43c6a00000000000000000000000000000000000000000000000000000000006a669ca3","external_libraries":[],"proxy_type":null,"implementations":[],"verified_at":"2026-07-27T20:27:13.129246Z","is_verified_via_verifier_alliance":false,"compiler_version":"v0.8.30+commit.73712a01","decoded_constructor_args":[["0x3f0DA1C363e34802C6f12F9C27276dC0e6696FD8",{"internalType":"address","name":"initialAuthority","type":"address"}],[["0x4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af","1080000000000000000","2000000000000000000","50","150","200","1209600","129600","86400"],{"components":[{"internalType":"bytes32","name":"feedId","type":"bytes32"},{"internalType":"uint256","name":"bootstrapMinNAV","type":"uint256"},{"internalType":"uint256","name":"maxNAV","type":"uint256"},{"internalType":"uint256","name":"normalBandBps","type":"uint256"},{"internalType":"uint256","name":"forceBandBps","type":"uint256"},{"internalType":"uint256","name":"maxCumulativeBps","type":"uint256"},{"internalType":"uint256","name":"velocityWindow","type":"uint256"},{"internalType":"uint256","name":"stalenessWindow","type":"uint256"},{"internalType":"uint256","name":"markdownDelay","type":"uint256"}],"internalType":"struct NAVOracle.InitParams","name":"p","type":"tuple"}],["1091316854673926656",{"internalType":"uint256","name":"initialNAV","type":"uint256"}],["1785109667",{"internalType":"uint256","name":"initialDataTimestamp","type":"uint256"}]],"sourcify_repo_url":null,"optimization_runs":500,"compiler_settings":{"evmVersion":"shanghai","libraries":{},"metadata":{"appendCBOR":true,"bytecodeHash":"ipfs","useLiteralContent":false},"optimizer":{"enabled":true,"runs":500},"outputSelection":{"*":{"":["*"],"*":["*"]}},"remappings":["@openzeppelin/contracts/=../vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/","@chainlink/contracts-ccip/contracts/=../vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-ccip/chains/evm/contracts/","@chainlink/contracts-ccip/interfaces/=../vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-ccip/chains/evm/contracts/interfaces/","@chainlink/contracts-ccip/libraries/=../vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-ccip/chains/evm/contracts/libraries/","@chainlink/contracts-ccip/applications/=../vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-ccip/chains/evm/contracts/applications/","forge-std/=../vendor/smart-contracts-oracle/lib/forge-std/src/","oracle-src/=../vendor/smart-contracts-oracle/src/","oracle-script/=../vendor/smart-contracts-oracle/script/","src/=../vendor/smart-contracts-oracle/src/","@chainlink/contracts/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-evm/contracts/","@chainlink/local/src/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/src/","@openzeppelin/contracts-upgradeable/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts@4.7.3/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/src/vendor/openzeppelin-solidity/v4.7.3/contracts/","@openzeppelin/contracts@4.8.3/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/src/vendor/openzeppelin-solidity/v4.8.3/contracts/","@openzeppelin/contracts@5.0.2/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/src/vendor/openzeppelin-solidity/v5.0.2/contracts/","chainlink-ccip/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/lib/chainlink-ccip/chains/evm/contracts/vendor/optimism/interop-lib/v0/src/","chainlink-local/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/chainlink-local/src/","chainlink/=../vendor/smart-contracts-oracle/lib/chainlink/","erc4626-tests/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","halmos-cheatcodes/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/","openzeppelin-contracts-upgradeable/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-contracts-upgradeable/contracts/","openzeppelin-contracts/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-contracts/contracts/","openzeppelin-foundry-upgrades/=/private/tmp/codex-nav-http-reconciliation/vendor/smart-contracts-oracle/lib/openzeppelin-foundry-upgrades/src/"],"viaIR":true},"is_verified":true,"verified_twin_address_hash":null,"optimization_enabled":true,"deployed_bytecode":"0x6080806040526004361015610012575f80fd5b5f3560e01c908163073a6dff1461134f575080630974f97e146113255780630e7071b71461127657806313d4d98b146111cd5780631448327d146111ab578063144b761e14611171578063164a0dcd1461114957806319cf2a021461112c5780631a8d07f8146110f25780632075e01e146110b8578063237c7e9314610bee57806324a343fa14611050578063259e5cd8146110355780632f759d921461101357806333925b7914610ff65780634245621314610f0257806347660a4114610ddd5780634a64349914610ec85780634c73051414610eab5780634f3813f714610de2578063543095b814610ddd5780635470cc1514610dc05780635477107214610da557806354e4d19a14610d8957806365a4059e14610bee578063668a0f0214610d63578063693de59214610d165780636d20051214610cf957806370b69acb14610cbf578063710450ce14610ca05780637a9e5e4b14610bf35780637fc0d4b914610bee5780638c77cd711461087b5780638cf307161461085e5780638fb3603714610803578063911273531461073b5780639b32d38f146106bc578063a0cc3f641461069f578063a77cc36414610682578063bdd88f5814610665578063bf7e214f14610640578063c7d7f3a814610624578063c901500c14610607578063d5f1b16b146105a0578063dfa8cc6614610557578063e2c7a79d1461051d578063e35fbc1f146103e1578063e407de761461037a578063f317a3a4146102f6578063f5746e50146102bd578063f8dc8fd1146102a0578063f9a372d8146102835763fd967f4714610263575f80fd5b3461027f575f36600319011261027f5760206040516127108152f35b5f80fd5b3461027f575f36600319011261027f576020600b54604051908152f35b3461027f575f36600319011261027f576020600d54604051908152f35b3461027f57602036600319011261027f576004356001600160a01b038116810361027f576102f4906102ef363361198c565b61189a565b005b3461027f57602036600319011261027f57600435610314363361198c565b60035480821180159061036a575b61035b5760407fcd8aa970cae8115c4d31873d575101c79dc5e68b0ff5e4caa909cb571b3fcaa1918151908152836020820152a1600355005b63a883435760e01b5f5260045ffd5b506001600160c01b038211610322565b3461027f575f36600319011261027f57610394363361198c565b60ff600e54166103d257600160ff196011541617601155337f04c75ce851f69bc8560934c5fb0b1b235499894cd26ceff86be8ab6c69b77a8c5f80a2005b6364a0622b60e11b5f5260045ffd5b3461027f57602036600319011261027f576004356001600160a01b0381169081810361027f57610411363361198c565b811561050e57803b156104fb576001549060088210156104ec575f5b8281106104b257506801000000000000000082101561049e57610459826001610478940160015561186e565b9091906001600160a01b038084549260031b9316831b921b1916179055565b7ff785f9bb7b7198ebb04ce272223e3b28ea051c0e063850f926b3895a77a2c6835f80a2005b634e487b7160e01b5f52604160045260245ffd5b836001600160a01b036104c48361186e565b90549060031b1c16146104d95760010161042d565b83634faa810b60e11b5f5260045260245ffd5b632a4282b360e01b5f5260045ffd5b5063cabb125960e01b5f5260045260245ffd5b634a94420360e01b5f5260045ffd5b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000000c88152f35b3461027f57604036600319011261027f57610572363361198c565b61057a611adf565b602061058a6024356004356114f8565b60016002556040519061059c816113d1565b8152f35b3461027f575f36600319011261027f576105ba363361198c565b600e5460ff8116156105f85760ff1916600e555f600f55337f6977cf3ab0aaccc6ceeb77ddaf93b2e1f1b9e6c7e39c7fb08314efbbea3657415f80a2005b632e69b98360e21b5f5260045ffd5b3461027f575f36600319011261027f576020600354604051908152f35b3461027f575f36600319011261027f5760206040516113888152f35b3461027f575f36600319011261027f5760206001600160a01b035f5416604051908152f35b3461027f575f36600319011261027f576020600a54604051908152f35b3461027f575f36600319011261027f576020600954604051908152f35b3461027f575f36600319011261027f576020600854604051908152f35b3461027f57602036600319011261027f576004356106da363361198c565b60045481108015610730575b610721577f3ee4ddb2b11b8e2630f0abc45b147655b578f102f419e55290feee480702096560406005548151908152836020820152a1600555005b634626bc5360e01b5f5260045ffd5b5061271081116106e6565b3461027f575f36600319011261027f576040518060206001549283815201809260015f527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6905f5b8181106107e457505050816107999103826114d6565b604051918291602083019060208452518091526040830191905f5b8181106107c2575050500390f35b82516001600160a01b03168452859450602093840193909201916001016107b4565b82546001600160a01b0316845260209093019260019283019201610783565b3461027f575f36600319011261027f575f5460a01c60ff1615610856576020638fb3603760e01b5b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152f35b60205f61082b565b3461027f575f36600319011261027f576020600c54604051908152f35b3461027f57606036600319011261027f5760043560243560443567ffffffffffffffff811161027f576108b2903690600401611386565b9290916108bf363361198c565b6108c7611adf565b60ff600e5416156105f85760105490818103610bd957505061090c600f547f0000000000000000000000000000000000000000000000000000000000015180906113db565b804210610bc35750600d5461092181426113e8565b90151580610bb7575b610b9e57506109566001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b80821015610b885764e8d4a510008210610b6c57600982905542600d5560019242600b55600754936001600160501b0385166001600160501b038114610b58576001016001600160501b03811680966001600160501b031916176007556040516109bf816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152875f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b4260501b169067ffffffffffffffff60501b191617600755604051858152426020820152600460031015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb606082600360408b950152a2604051428152867f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a385857f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a3506001545f5b818110610b19575050507f8e62721e67f7afc05c2b11b45f0debcdd11c4e548a576d95615f84451005b8f49394610b0f916040519485948561149b565b0390a26001600255005b80610b3d876001600160a01b03610b30879561186e565b90549060031b1c16611b53565b5001610ad2565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b50631ebc7e6360e11b5f5260045264e8d4a5100060245260445ffd5b90634c4c860560e01b5f5260045260245260445ffd5b63d7ef2fd360e01b5f526004526201518060245260445ffd5b5062015180811061092a565b63fe84284d60e01b5f526004524260245260445ffd5b6329c6abe760e11b5f5260045260245260445ffd5b611369565b3461027f57602036600319011261027f576004356001600160a01b0381169081810361027f575f54906001600160a01b0382163303610c8e573b15610c7b5773ffffffffffffffffffffffffffffffffffffffff191681175f556040519081527f2f658b440c35314f52658ea8a740e05b284cdc84dc9ae01e891f21b8933e7cad90602090a1005b506361798f2f60e11b5f5260045260245ffd5b62d1953b60e31b5f523360045260245ffd5b3461027f575f36600319011261027f57602060405164e8d4a510008152f35b3461027f575f36600319011261027f5760206040517f000000000000000000000000000000000000000000000000000000000001fa408152f35b3461027f575f36600319011261027f576020600f54604051908152f35b3461027f575f36600319011261027f5760406007546001600160501b0381165f52600660205267ffffffffffffffff6001600160c01b03835f20541691835192835260501c166020820152f35b3461027f575f36600319011261027f5760206001600160501b0360075416604051908152f35b3461027f575f36600319011261027f5760206040516138408152f35b3461027f575f36600319011261027f57602060405160128152f35b3461027f575f36600319011261027f5760206040516207a1208152f35b6113b4565b3461027f57602036600319011261027f5760043567ffffffffffffffff811161027f57610e13903690600401611386565b610e1d363361198c565b600e5460ff81166103d2576011549060ff821615610e9c5760ff1991821660115516600117600e5542600f556010545f198114610b5857610e9760017f8309a510ad281c38d91b499b3383fae0128c40c9ab0075531f35221f8dc89c1f92019384601055604051918291602083523395602084019161147b565b0390a3005b633944643f60e01b5f5260045ffd5b3461027f575f36600319011261027f576020600454604051908152f35b3461027f575f36600319011261027f5760206040517f4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af8152f35b3461027f57604036600319011261027f5760043560243567ffffffffffffffff811161027f57610f36903690600401611386565b610f43929192363361198c565b610f4b611adf565b60ff600e54166103d257600c5492610f6384426113e8565b93151580610feb575b610fd257907fb70dc4416ead44171172d6e9effa363a3eef666a2a2e117270cda1e30857a31391610f9f60055485611bef565b508403610fc9575b42600c55610fb54285611ca7565b50610b0f604051928392339642908561149b565b83600955610fa7565b836329108fcd60e01b5f5260045261384060245260445ffd5b506138408410610f6c565b3461027f575f36600319011261027f57602060405162093a808152f35b3461027f575f36600319011261027f57602060ff601154166040519015158152f35b3461027f575f36600319011261027f57602060405160088152f35b3461027f57602036600319011261027f576004356001600160501b03811680910361027f57805f52600660205260405f20548060c01c80156110a557604092506001600160c01b038351921682526020820152f35b8263d17cddb760e01b5f5260045260245ffd5b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000001275008152f35b3461027f575f36600319011261027f5760206040517f0000000000000000000000000000000000000000000000000efcee47256c00008152f35b3461027f575f36600319011261027f576020601054604051908152f35b3461027f57602036600319011261027f5760206111676004356113f5565b6040519015158152f35b3461027f575f36600319011261027f5760206040517f00000000000000000000000000000000000000000000000000000000000151808152f35b3461027f575f36600319011261027f57602060ff600e54166040519015158152f35b3461027f57602036600319011261027f576004356001600160a01b03811680820361027f576111fc363361198c565b611204611adf565b61120d82611afd565b156112645761124361123c6001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b8093611b53565b1561124f576001600255005b63d7e4f28f60e01b5f5260045260245260445ffd5b630148df3360e21b5f5260045260245ffd5b3461027f57602036600319011261027f57600435611294363361198c565b8015801561131a575b801561130f575b80156112e6575b610721577f95e5cfdd0cca9c70916d639815020b9271f1544f8c393bd745951f20113d5be360406004548151908152836020820152a1600455005b507f00000000000000000000000000000000000000000000000000000000000000c881116112ab565b5060055481116112a4565b50611388811161129d565b3461027f575f36600319011261027f57602067ffffffffffffffff60075460501c16604051908152f35b3461027f575f36600319011261027f576020906005548152f35b3461027f575f36600319011261027f576020604051620151808152f35b9181601f8401121561027f5782359167ffffffffffffffff831161027f576020838186019501011161027f57565b3461027f575f36600319011261027f57602060405162278d008152f35b60041115610b4457565b91908201809211610b5857565b91908203918211610b5857565b60ff600e54161590811561146e575b5061145357611436600f547f0000000000000000000000000000000000000000000000000000000000015180906113db565b421061145357600d548015159081611457575b5061145357600190565b5f90565b62015180915061146790426113e8565b105f611449565b905060105414155f611404565b908060209392818452848401375f828201840152601f01601f1916010190565b6114b7949260609282526020820152816040820152019161147b565b90565b6040810190811067ffffffffffffffff82111761049e57604052565b90601f8019910116810190811067ffffffffffffffff82111761049e57604052565b9060ff600e541661181857600b548111156117b55742811161179f574261153f7f000000000000000000000000000000000000000000000000000000000001fa40836113db565b1061173c5761155060045483611bef565b91907f00000000000000000000000000000000000000000000000000000000000000c890670de0b6b3a7640000820291808304670de0b6b3a76400001490151715610b5857600854906009549081938084145f146116a0578290915b80820361168a5750506115d25f5b6115cd846115c8818c6113e8565b611fb5565b6113e8565b9080821161167057906115e4916113e8565b928103611667575b50810361165e575b5042600a556116038184611e2c565b50604051928352602083015260408201527f7b44f6c699efb5305c3f715cb1d19207cb916dfe7d291815637a16a1086e4ca260607f4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af92a25f90565b6008555f6115f4565b6009555f6115ec565b908763619938f160e01b5f5260045260245260445260645ffd5b816115c86115d29361169b936113e8565b6115ba565b90916116ac84836113e8565b7f0000000000000000000000000000000000000000000000000000000000127500906116d984838361206e565b84156117285784836116ee93091515906113db565b6116fa600a54426113e8565b90811061170c575050508180926115ac565b6117229161171c9184969561206e565b856113db565b916115ac565b634e487b7160e01b5f52601260045260245ffd5b60405191825260208201526327cc4d2560e01b60408201527face739b1b5ea6eeb3fc556782bacfbfea62fa30c14f73db57f892bd1a7bcafaa60607f4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af92a2600390565b6312d0e98160e31b5f526004524260245260445ffd5b6040519182526020820152631336de3960e21b60408201527face739b1b5ea6eeb3fc556782bacfbfea62fa30c14f73db57f892bd1a7bcafaa60607f4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af92a2600290565b60405191825260208201527fe04bc76530140fe79125100b82d714b0cf3ce05dc404f99cf6fc94c386c3f4cb60407f4dce664a295f989e03df04a40bc8f62a21ff9872a43f972be9c95c3c409556af92a2600190565b6001548110156118865760015f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b6001545f5b8181106118c2576001600160a01b0383630148df3360e21b5f521660045260245ffd5b6001600160a01b036118d38261186e565b90549060031b1c166001600160a01b0384168091146118f5575060010161189f565b92505f198201918211610b58576104596001600160a01b036119196119279461186e565b90549060031b1c169161186e565b6001548015611978575f190161193c8161186e565b6001600160a01b0382549160031b1b191690556001557f8e4f69096d1bfe0e5365848d86b29c4ee26b6aab65e9fa11361c45133f896c9b5f80a2565b634e487b7160e01b5f52603160045260245ffd5b905f915f54916001600160a01b038316928160041161027f575f5f9060405f8151966001600160a01b03602089019163b700961360e01b8352169788602482015230604482015263ffffffff60e01b8335166064820152606481526119f26084826114d6565b828052826020525190895afa611acc575b15611a11575b505050505050565b63ffffffff1615611aba5760ff60a01b1916600160a01b175f55823b1561027f576020925f9283604051809681958294634a63ebf760e11b845260048401526040602484015260448301908082528085848401378181018301859052601f01601f1916010103925af18015611aaf57611a9c575b50805460ff60a01b191690555f8080808080611a09565b611aa891505f906114d6565b5f5f611a85565b6040513d5f823e3d90fd5b8262d1953b60e31b5f5260045260245ffd5b50505f516020518060201c150290611a03565b6002805414611aee5760028055565b633ee5aeb560e01b5f5260045ffd5b600154905f5b828110611b11575050505f90565b6001600160a01b03611b228261186e565b90549060031b1c166001600160a01b03831614611b4157600101611b03565b505050600190565b8115611728570490565b91906207d3a85a10611bd3575f8060405160208101906316b6024960e01b825284602482015260248152611b886044826114d6565b519082876207a120f1928315611b9c575050565b60206001600160a01b037fff7bbcb289f45fc5be914edee99f22261f5666682918f011241c3aed779522f5926040519485521692a2565b6001600160a01b038363f94d5ceb60e01b5f521660045260245ffd5b916003548311611c9457611c206001600160501b03600754165f5260066020526001600160c01b0360405f20541690565b92838110611c7d57611c3284826113e8565b611c3f856127108361206e565b85156117285785612710611c5693091515906113db565b9081938211611c63575050565b8490637403977b60e01b5f5260045260245260445260645ffd5b83906353af0aa360e11b5f5260045260245260445ffd5b82635f7644f960e01b5f5260045260245ffd5b91906007546001600160501b0381166001600160501b038114610b5857600101916001600160501b03831680926001600160501b03191617600755604051611cee816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152835f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b8260501b169067ffffffffffffffff60501b191617600755604051908582526020820152600460021015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb6060826002604086950152a2604051428152817f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a3837f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a391600154905f5b828110611e0d57505050565b80611e25836001600160a01b03610b3060019561186e565b5001611e01565b919080600b556007546001600160501b0381166001600160501b038114610b5857600101916001600160501b03831680926001600160501b03191617600755604051611e77816114ba565b6001600160c01b03861681526020810167ffffffffffffffff42168152835f5260066020526001600160c01b0360405f209251169067ffffffffffffffff60c01b905160c01b1617905560075467ffffffffffffffff60501b8260501b169067ffffffffffffffff60501b191617600755604051908582526020820152600460011015610b44577f4d6860df452d6651a43238d29e6b5682704dc141e668757248eae34956b03eeb6060826001604086950152a2604051428152817f0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac6027160203393a3837f0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f6020604051428152a391600154905f5b828110611f9657505050565b80611fae836001600160a01b03610b3060019561186e565b5001611f8a565b5f1969021e19e0c9bab240000082099169021e19e0c9bab2400000820291828085109403938085039414612062578382111561204a5769021e19e0c9bab2400000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b50634e487b715f52156003026011186020526024601cfd5b50906114b79250611b49565b90915f1983830992808302928380861095039480860395146120ff57848311156120e75790829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b82634e487b715f52156003026011186020526024601cfd5b5050906114b79250611b4956fea264697066735822122052d6c9a23c8b81b21781764946d7c7ec5bf7eb96c418d065b2122c3f54a21ad164736f6c634300081e0033","source_code":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.30;\n\nimport {AccessManaged} from \"@openzeppelin/contracts/access/manager/AccessManaged.sol\";\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/utils/ReentrancyGuard.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\n// solhint-disable-next-line no-global-import — pulls in the shared file-level events/errors too.\nimport \"../interfaces/INAVOracle.sol\";\nimport {NAVPushSinks} from \"../sinks/NAVPushSinks.sol\";\nimport {SinkNotFound, SinkSyncFailed} from \"../interfaces/NAVSinkTypes.sol\";\n\n/**\n * @title NAVOracle — provider-agnostic NAV oracle core (protocol surface only)\n * @notice One per (chain, token): value-safety rails + Protection Mode + timelocked markdown +\n *         round history + downstream sink fan-out. Deliberately carries neither the oracle-network\n *         transport nor the integrator view—both volatile edges are swappable around this stable\n *         core:\n *         - ingestion: a report-provider contract (e.g. {CREReportProvider}) authenticates its\n *           transport (forwarder, workflow identity, report ABI, chain/feed binding) and calls\n *           {submitReport}; swapping oracle networks means authorizing a replacement submitter;\n *         - reads: the integrator-facing view lives in {NAVFeed} behind the {NAVFeedProxy}.\n *\n * @dev NAV monotonicity invariant: no path decreases NAV except {applyMarkdown}, which requires\n *      Protection Mode and the entry-anchored {markdownDelay} timelock (minimum 24 hours).\n *      The automated report path is monotonic non-decreasing; {forceNAVUpdate} is up-or-flat only.\n *\n * @dev Protection Mode blocks automated reports and manual force updates while preserving the\n *      timelocked markdown path. Reports are acknowledged and ignored so the provider can ACK the\n *      transport without a retry storm; absent a markdown, the feed's `updatedAt` remains frozen\n *      and integrator staleness checks can react. Entry is one-shot per governance re-arm, limiting\n *      a compromised on-call key to one freeze before governance intervenes. Production wiring\n *      keeps re-arm and exit governance-only.\n *\n * @dev The velocity guard is a token bucket: budget refills linearly at maxCumulativeBps per\n *      velocityWindow (capped at one bucket). Within an epoch, each accepted report spends the\n *      difference between the cumulative WAD-bps movement from {velocityAnchorNAV} at the new and\n *      current NAV. Those differences telescope, so partitioning one endpoint move cannot reduce\n *      its debit. A new epoch starts only when a report observes a genuine below-cap to full-cap\n *      refill; NAV-changing force writes and markdowns also re-anchor without changing budget.\n *      This is not a hard per-window cap: the sustained rate is maxCumulativeBps per\n *      velocityWindow, the maximum instantaneous burst is one bucket, and the worst case over a\n *      single window (start full, refill, spend again) is up to ~2x maxCumulativeBps. Movement is\n *      accounted to WAD-bps precision instead of whole basis points.\n *\n * @dev All NAV amounts on this contract use 18 decimals.\n */\ncontract NAVOracle is INAVOracle, NAVPushSinks, ReentrancyGuard {\n    /// @notice Basis-point denominator: 100% = 10_000 bps (bands, velocity, and deviation math).\n    uint256 public constant MAX_BPS = 10_000;\n    /// @notice Maximum configurable normal band (50% in bps) so the value guard can't be disabled by config.\n    uint256 public constant MAX_NORMAL_BAND_BPS = 5000;\n    /// @notice Minimum time between manual force updates.\n    uint256 public constant MIN_FORCE_UPDATE_INTERVAL = 4 hours;\n    /// @notice Maximum accepted observation age configurable at deployment.\n    uint256 public constant MAX_STALENESS_WINDOW = 7 days;\n    /// @notice Maximum velocity-bucket refill period configurable at deployment.\n    uint256 public constant MAX_VELOCITY_WINDOW = 30 days;\n    /// @notice Minimum velocity-bucket refill period. A shorter period could refill the bucket\n    ///         every block and make the cumulative-movement guard ineffective.\n    uint256 public constant MIN_VELOCITY_WINDOW = 1 days;\n    /// @notice Fixed-point scale for internal velocity accounting. Budget and spend retain up to\n    ///         18 decimal places of fractional basis points; smaller amounts round down.\n    uint256 private constant BPS_WAD = 1e18;\n    /// @notice Minimum interval between markdown executions. This remains enforced after the\n    ///         entry review delay, so multiple pre-scheduled markdowns cannot execute together.\n    uint256 public constant MIN_MARKDOWN_INTERVAL = 1 days;\n    /// @notice Hard floor on the configurable, entry-anchored markdown delay.\n    uint256 public constant MIN_MARKDOWN_DELAY_FLOOR = 24 hours;\n    /// @notice Ceiling on {markdownDelay}; prevents a deployment value that would make markdowns\n    ///         operationally unreachable.\n    uint256 public constant MAX_MARKDOWN_DELAY = 30 days;\n    /// @notice Floor for markdown targets. It keeps incremental recovery possible under the\n    ///         per-write band and remains positive when scaled from 18 to 8 decimals.\n    uint256 public constant MIN_MARKDOWN_NAV = 1e12;\n\n    // ----- Immutable configuration -----\n    bytes32 public immutable feedId;\n    /// @notice Floor applied only to the constructor seed. The report and force paths\n    ///         enforce maxNAV + non-decrease + band. Reapplying this floor after a deep markdown\n    ///         could block gradual recovery because the first value above the floor may exceed the\n    ///         permitted per-write band.\n    uint256 public immutable bootstrapMinNAV;\n    /// @notice Maximum accepted age of report observations and the constructor seed.\n    uint256 public immutable stalenessWindow;\n    /// @notice Refill period of the velocity token bucket (one full bucket per window).\n    uint256 public immutable velocityWindow;\n    /// @notice Automated-report velocity-bucket capacity and refill amount per {velocityWindow}.\n    /// @dev Fixed at deployment so elapsed refill always uses one reviewed policy.\n    uint256 public immutable maxCumulativeBps;\n    /// @notice In-contract markdown timelock anchored to Protection Mode entry. A markdown cannot\n    ///         execute until this long after the current episode begins, so a markdown\n    ///         pre-scheduled against a predicted future episode id (the AccessManager delay having\n    ///         elapsed before the incident) still cannot fire instantly on entry. Makes the review\n    ///         window independent of AccessManager configuration; the manager delay may add more\n    ///         time but cannot shorten this delay.\n    uint256 public immutable markdownDelay;\n\n    // ----- Mutable, governance-tuned value params -----\n    /// @notice Absolute upper NAV bound. It is increase-only so governance can raise the ceiling\n    ///         without introducing a setter that could block upward reports by lowering it.\n    /// @dev This mutable value is a reviewed policy setting, not a bound on root-governance\n    ///      authority: an authorized setter can raise it through {setMaxNAV} up to `uint192`.\n    uint256 public maxNAV;\n    /// @notice Per-write deviation band for the automated report path (bps).\n    uint256 public normalBandBps;\n    /// @notice Per-write band for the manual force path (bps; >= normalBandBps).\n    /// @dev Deployment defaults are policy choices. Root governance can raise this mutable band to\n    ///      {MAX_BPS}, permitting a 2x force step while the then-current {maxNAV} still applies.\n    uint256 public forceBandBps;\n\n    // ----- Rounds -----\n    struct Round {\n        uint192 answer; // 18-decimal NAV\n        uint64 updatedAt; // block.timestamp when accepted\n    }\n    mapping(uint80 => Round) private _rounds;\n    /// @inheritdoc INAVOracle\n    uint80 public latestRound;\n    /// @dev Source-data timestamp associated with the current NAV, packed with {latestRound}.\n    ///      This is not a monotonic watermark: force writes set it to block time without advancing\n    ///      {lastObservationTs}, so a later accepted pre-force observation can move it backward.\n    ///      All write paths constrain it to block time or earlier; each stored round's `updatedAt`\n    ///      separately records acceptance time.\n    uint64 private _currentDataTimestamp;\n\n    // ----- Rails / policy state -----\n    /// @notice Remaining velocity budget in WAD-scaled bps (bps × 1e18) as of {velocityLastAccrual}.\n    ///         Divide by 1e18 for the human-readable bps figure.\n    uint256 public velocityBudgetWad;\n    /// @notice Fixed NAV denominator for cumulative automated-report movement in the current\n    ///         velocity epoch. Report debits telescope as D(newNAV) - D(currentNAV), where\n    ///         D(N) = floor((N - anchor) * 10_000 * 1e18 / anchor).\n    /// @dev Initialized to the constructor NAV. It changes only when a report observes a genuine\n    ///      below-cap to full-cap refill, a NAV-changing force write succeeds, or a markdown\n    ///      succeeds. Re-anchoring does not itself change the stored budget or accrual clock.\n    uint256 public velocityAnchorNAV;\n    /// @notice Timestamp of the last budget accrual/spend.\n    uint256 public velocityLastAccrual;\n    /// @notice Automated-report replay watermark. The constructor initializes it from the seed's\n    ///         source timestamp; reports advance it strictly; markdowns set it to block.timestamp;\n    ///         force writes leave it unchanged. Non-decreasing during this oracle's live operation\n    ///         and intentionally distinct from {currentDataTimestamp}.\n    uint256 public lastObservationTs;\n    /// @notice Timestamp of the last {forceNAVUpdate} (rate-limited by MIN_FORCE_UPDATE_INTERVAL).\n    uint256 public lastForceUpdateTs;\n    /// @notice Timestamp of the last executed markdown (rate-limited by MIN_MARKDOWN_INTERVAL).\n    uint256 public lastMarkdownTs;\n    /// @inheritdoc INAVOracle\n    bool public protectionMode;\n    /// @notice When the current Protection Mode episode began (0 when not active). Anchors the\n    ///         entry-relative markdown timelock (readyAt = protectionEnteredAt + markdownDelay; see\n    ///         {applyMarkdown}/{isMarkdownExecutable}). NOTE: the markdown *episode-identity* binding\n    ///         uses the {protectionEpisodeId} counter, NOT this timestamp — a same-block\n    ///         [exit, rearm, enter] governance batch reuses block.timestamp, which would otherwise\n    ///         let a stale scheduled markdown from the previous episode execute under the new one.\n    uint256 public protectionEnteredAt;\n    /// @notice Monotonic Protection Mode episode counter (increments on every entry; never reused).\n    ///         The episode id that {applyMarkdown} must be bound to.\n    uint256 public protectionEpisodeId;\n    /// @notice One-shot arming for Protection Mode entry, consumed by every entry. Production\n    ///         wiring restricts re-arming to governance, bounding a compromised on-call key to one\n    ///         freeze per re-arm.\n    bool public protectionEntryArmed = true;\n\n    struct InitParams {\n        bytes32 feedId;\n        uint256 bootstrapMinNAV;\n        uint256 maxNAV;\n        uint256 normalBandBps;\n        uint256 forceBandBps;\n        uint256 maxCumulativeBps;\n        uint256 velocityWindow;\n        uint256 stalenessWindow;\n        uint256 markdownDelay;\n    }\n\n    constructor(\n        address initialAuthority,\n        InitParams memory p,\n        uint256 initialNAV,\n        uint256 initialDataTimestamp\n    ) AccessManaged(initialAuthority) {\n        if (initialAuthority == address(0)) revert ZeroAddress();\n        if (p.feedId == bytes32(0)) revert ZeroFeedId();\n        // A lower constructor-seed floor could adopt a NAV that truncates to zero on an 8-decimal feed\n        // and conflicts with the markdown floor's scaling guarantee.\n        if (p.bootstrapMinNAV < MIN_MARKDOWN_NAV || p.bootstrapMinNAV >= p.maxNAV) {\n            revert InvalidBounds();\n        }\n        // Rounds pack the answer into uint192, so every in-bounds value must fit.\n        if (p.maxNAV > type(uint192).max) revert InvalidBounds();\n        if (p.normalBandBps == 0 || p.normalBandBps > MAX_NORMAL_BAND_BPS) revert InvalidBand();\n        if (p.forceBandBps < p.normalBandBps || p.forceBandBps > MAX_BPS) revert InvalidBand();\n        // A single band-max report must fit in a full bucket.\n        if (p.maxCumulativeBps < p.normalBandBps || p.maxCumulativeBps > MAX_BPS) {\n            revert InvalidVelocity();\n        }\n        if (p.velocityWindow < MIN_VELOCITY_WINDOW || p.velocityWindow > MAX_VELOCITY_WINDOW) {\n            revert InvalidVelocity();\n        }\n        if (p.markdownDelay < MIN_MARKDOWN_DELAY_FLOOR || p.markdownDelay > MAX_MARKDOWN_DELAY) {\n            revert InvalidMarkdownDelay();\n        }\n        if (p.stalenessWindow == 0 || p.stalenessWindow > MAX_STALENESS_WINDOW) {\n            revert InvalidStaleness();\n        }\n        if (initialNAV < p.bootstrapMinNAV || initialNAV > p.maxNAV) {\n            revert OutOfBounds(initialNAV);\n        }\n        if (initialDataTimestamp == 0) revert ZeroObservationTimestamp();\n        if (initialDataTimestamp > block.timestamp) {\n            revert FutureObservation(initialDataTimestamp, block.timestamp);\n        }\n        if (initialDataTimestamp + p.stalenessWindow < block.timestamp) {\n            revert StaleObservation(initialDataTimestamp);\n        }\n\n        feedId = p.feedId;\n        bootstrapMinNAV = p.bootstrapMinNAV;\n        maxNAV = p.maxNAV;\n        normalBandBps = p.normalBandBps;\n        forceBandBps = p.forceBandBps;\n        maxCumulativeBps = p.maxCumulativeBps;\n        velocityWindow = p.velocityWindow;\n        stalenessWindow = p.stalenessWindow;\n        markdownDelay = p.markdownDelay;\n\n        lastObservationTs = initialDataTimestamp;\n        velocityBudgetWad = p.maxCumulativeBps * BPS_WAD;\n        velocityAnchorNAV = initialNAV;\n        velocityLastAccrual = block.timestamp;\n        _record(initialNAV, initialDataTimestamp, UpdateKind.Bootstrap);\n        emit Bootstrapped(msg.sender, initialNAV, initialDataTimestamp);\n    }\n\n    // =========================================================================\n    // Report ingestion (automated path — monotonic non-decreasing; provider-agnostic)\n    // =========================================================================\n\n    /// @inheritdoc INAVOracle\n    /// @dev `restricted` — wire to the SUBMITTER role, granted to the active report-provider\n    ///      contract (e.g. {CREReportProvider}). Swapping oracle networks means deploying and\n    ///      authorizing a replacement provider, then revoking the old provider.\n    ///\n    ///      Value and ordering rails are enforced here. The provider remains responsible for\n    ///      authenticating the report and binding the supplied NAV and timestamp to the underlying\n    ///      observation.\n    ///\n    ///      Providers should treat a returned status as acknowledged (no retry for policy freezes\n    ///      or permanently unusable observations). A revert remains retryable and should surface\n    ///      in monitoring.\n    function submitReport(uint256 navValue, uint256 observationTimestamp)\n        external\n        restricted\n        nonReentrant\n        returns (SubmitStatus)\n    {\n        // Policy freeze: acknowledge this report without advancing the feed. If no markdown lands,\n        // the unchanged `updatedAt` is the integrator-facing staleness signal.\n        if (protectionMode) {\n            emit ReportIgnoredInProtection(feedId, navValue, observationTimestamp);\n            return SubmitStatus.IgnoredInProtection;\n        }\n\n        // Permanently unusable → discard without retry (obsTs monotonicity is also the same-chain\n        // replay guard). A future-dated observation may become valid later, so it REVERTS instead.\n        if (observationTimestamp <= lastObservationTs) {\n            emit ReportDiscarded(\n                feedId, navValue, observationTimestamp, NonMonotonicObservation.selector\n            );\n            return SubmitStatus.DiscardedNonMonotonic;\n        }\n        if (observationTimestamp > block.timestamp) {\n            revert FutureObservation(observationTimestamp, block.timestamp);\n        }\n        if (observationTimestamp + stalenessWindow < block.timestamp) {\n            emit ReportDiscarded(feedId, navValue, observationTimestamp, StaleObservation.selector);\n            return SubmitStatus.DiscardedStale;\n        }\n\n        (uint256 current, uint256 dev) = _validateUpOrFlat(navValue, normalBandBps);\n        _spendVelocity(navValue, current);\n        _commit(navValue, observationTimestamp, UpdateKind.Report);\n        emit ReportAccepted(feedId, navValue, observationTimestamp, dev);\n        return SubmitStatus.Accepted;\n    }\n\n    // =========================================================================\n    // Manual writes\n    // =========================================================================\n\n    /// @notice Restricted manual write for provider outages or recovery upticks. Up-or-flat only.\n    /// @dev The observation timestamp is always block.timestamp — the manual path writes \"the value\n    ///      as of now\"; callers cannot supply a separate timestamp.\n    ///      This write does not materialize velocity refill or change stored report-path budget. A\n    ///      NAV-changing force write re-anchors future cumulative report debit to the written NAV;\n    ///      a flat force write leaves the anchor unchanged.\n    ///      The force band, maximum NAV, and four-hour cooldown constrain the current configuration,\n    ///      but do not contain a compromised governance root that can widen the mutable settings.\n    function forceNAVUpdate(uint256 navValue, string calldata reason)\n        external\n        restricted\n        nonReentrant\n    {\n        if (protectionMode) revert ProtectionModeActive();\n        uint256 elapsed = block.timestamp - lastForceUpdateTs;\n        if (lastForceUpdateTs > 0 && elapsed < MIN_FORCE_UPDATE_INTERVAL) {\n            revert ForceUpdateTooFrequent(elapsed, MIN_FORCE_UPDATE_INTERVAL);\n        }\n        (uint256 current,) = _validateUpOrFlat(navValue, forceBandBps);\n        if (navValue != current) velocityAnchorNAV = navValue;\n        lastForceUpdateTs = block.timestamp;\n        _commit(navValue, block.timestamp, UpdateKind.Force);\n        emit NAVForceUpdated(msg.sender, navValue, block.timestamp, reason);\n    }\n\n    /// @notice Execute a write-down—the only decrease path. `restricted`; gated by the\n    ///         entry-anchored {markdownDelay}. Production wiring should add an AccessManager\n    ///         execution delay for the markdown selector as defense in depth.\n    /// @param protectionEpisode Must equal the current {protectionEpisodeId}. This binds the\n    ///        markdown to the specific protection episode it was scheduled under: a scheduled-but-\n    ///        unexecuted markdown from a stood-down incident stays live in the AccessManager and\n    ///        would otherwise become executable again the moment a later, unrelated incident enters\n    ///        Protection Mode — firing a stale impairment with no fresh review window. With the\n    ///        binding, exit + re-entry changes the episode and the stale op reverts. (Still cancel\n    ///        retired markdowns via AccessManager.cancel as hygiene.)\n    /// @dev When an AccessManager delay is configured and elapsed, prefer calling this function\n    ///      directly. AccessManaged consumes the scheduled operation while preserving the signer\n    ///      as `msg.sender` and `NewRound.startedBy`; routing through AccessManager.execute records\n    ///      the manager as the caller instead.\n    function applyMarkdown(uint256 navValue, uint256 protectionEpisode, string calldata reason)\n        external\n        restricted\n        nonReentrant\n    {\n        if (!protectionMode) revert ProtectionModeNotActive();\n        if (protectionEpisode != protectionEpisodeId) {\n            revert MarkdownEpisodeMismatch(protectionEpisode, protectionEpisodeId);\n        }\n        // markdownDelay must pass from this episode's entry, so a\n        // markdown pre-scheduled (manager delay pre-elapsed) against a predicted episode cannot fire\n        // the instant protection is entered. protectionEnteredAt is the current episode's entry time.\n        uint256 readyAt = protectionEnteredAt + markdownDelay;\n        if (block.timestamp < readyAt) revert MarkdownDelayNotElapsed(readyAt, block.timestamp);\n        uint256 sinceLast = block.timestamp - lastMarkdownTs;\n        if (lastMarkdownTs > 0 && sinceLast < MIN_MARKDOWN_INTERVAL) {\n            revert MarkdownTooFrequent(sinceLast, MIN_MARKDOWN_INTERVAL);\n        }\n        uint256 current = _currentNav();\n        if (navValue >= current) revert MarkdownMustDecrease(navValue, current);\n        // Keep the scaled feed answer nonzero and recovery increments practical.\n        if (navValue < MIN_MARKDOWN_NAV) revert MarkdownBelowFloor(navValue, MIN_MARKDOWN_NAV);\n        // Markdown preserves the stored report-path budget and accrual clock while re-anchoring\n        // future cumulative report debit to the impaired NAV.\n        velocityAnchorNAV = navValue;\n        lastMarkdownTs = block.timestamp;\n        uint80 roundId = _commit(navValue, block.timestamp, UpdateKind.Markdown);\n        emit MarkdownApplied(roundId, current, navValue, reason);\n    }\n\n    // =========================================================================\n    // Protection Mode\n    // =========================================================================\n\n    /// @notice Enter Protection Mode. Configure this selector for governance and approved on-call\n    ///         keys with zero delay. Every entry consumes the one-shot arming; production wiring\n    ///         keeps re-arming governance-only.\n    function enterProtectionMode(string calldata reason) external restricted {\n        if (protectionMode) revert ProtectionModeActive();\n        if (!protectionEntryArmed) revert ProtectionEntryNotArmed();\n        protectionEntryArmed = false;\n        protectionMode = true;\n        protectionEnteredAt = block.timestamp;\n        ++protectionEpisodeId; // A counter gives same-block re-entry a distinct episode id.\n        emit ProtectionModeEntered(msg.sender, protectionEpisodeId, reason);\n    }\n\n    /// @notice Exit Protection Mode. Production wiring should keep this governance-only because\n    ///         incident exits require sign-off.\n    function exitProtectionMode() external restricted {\n        if (!protectionMode) revert ProtectionModeNotActive();\n        protectionMode = false;\n        protectionEnteredAt = 0;\n        emit ProtectionModeExited(msg.sender);\n    }\n\n    /// @notice Re-arm the protection-entry trigger. Production wiring should keep this\n    ///         governance-only. Refused while protection is active so a live freeze cannot be\n    ///         immediately re-armed.\n    function rearmProtectionEntry() external restricted {\n        if (protectionMode) revert ProtectionModeActive();\n        protectionEntryArmed = true;\n        emit ProtectionEntryRearmed(msg.sender);\n    }\n\n    // =========================================================================\n    // Internal write machinery\n    // =========================================================================\n\n    /// @dev maxNAV bound + up-or-flat (non-decrease) + per-write band vs current NAV. Returns\n    ///      the current NAV and deviation (bps) so callers do not need to reload the same round.\n    function _validateUpOrFlat(uint256 navValue, uint256 bandBps)\n        private\n        view\n        returns (uint256 current, uint256 deviationBps)\n    {\n        // Only maxNAV applies here; see {bootstrapMinNAV} for why report/force paths have no floor.\n        if (navValue > maxNAV) revert OutOfBounds(navValue);\n        current = _currentNav();\n        if (navValue < current) revert NAVMustNotDecrease(navValue, current);\n        // Round upward so a sub-basis-point remainder cannot slip past the configured band.\n        deviationBps = Math.mulDiv(navValue - current, MAX_BPS, current, Math.Rounding.Ceil);\n        if (deviationBps > bandBps) revert DeviationExceeded(navValue, current, deviationBps);\n    }\n\n    /// @dev Accrue and spend automated-report movement in one token-bucket operation. Under a fixed\n    ///      anchor A, charge D(new) - D(current), where\n    ///      D(N) = floor((N - A) * MAX_BPS * BPS_WAD / A). The cumulative floors make report\n    ///      debits telescope exactly within an epoch instead of leaking one rounding remainder per\n    ///      report. A report starts a new epoch at the pre-report current NAV only when stored\n    ///      budget was below capacity and elapsed refill has filled the exact deficit. Merely\n    ///      remaining at full capacity does not re-anchor.\n    function _spendVelocity(uint256 navValue, uint256 current) private {\n        uint256 capWad = maxCumulativeBps * BPS_WAD;\n        uint256 storedWad = velocityBudgetWad;\n        uint256 storedAnchor = velocityAnchorNAV;\n        uint256 anchor = storedAnchor;\n        uint256 availableWad;\n\n        if (storedWad == capWad) {\n            // Already full is still the same epoch. Re-anchoring here would let zero-debit reports\n            // repeatedly move the denominator while retaining the full bucket.\n            availableWad = capWad;\n        } else {\n            uint256 missingWad = capWad - storedWad;\n            uint256 secondsToFull =\n                Math.mulDiv(missingWad, velocityWindow, capWad, Math.Rounding.Ceil);\n            uint256 elapsed = block.timestamp - velocityLastAccrual;\n\n            if (elapsed >= secondsToFull) {\n                availableWad = capWad;\n                anchor = current;\n            } else {\n                uint256 refillWad = Math.mulDiv(capWad, elapsed, velocityWindow);\n                // elapsed < ceil(missing * window / cap) implies refillWad < missingWad.\n                availableWad = storedWad + refillWad;\n            }\n        }\n\n        // The report path has already enforced anchor <= current <= navValue. Math.mulDiv avoids\n        // intermediate overflow and rounds each cumulative value down to WAD-bps precision.\n        uint256 scale = MAX_BPS * BPS_WAD;\n        uint256 cumulativeCurrentWad =\n            current == anchor ? 0 : Math.mulDiv(current - anchor, scale, anchor);\n        uint256 cumulativeNewWad = Math.mulDiv(navValue - anchor, scale, anchor);\n        uint256 moveWad = cumulativeNewWad - cumulativeCurrentWad;\n        if (moveWad > availableWad) {\n            revert VelocityExceeded(navValue, moveWad, availableWad);\n        }\n        uint256 remainingWad = availableWad - moveWad;\n        if (anchor != storedAnchor) velocityAnchorNAV = anchor;\n        if (remainingWad != storedWad) velocityBudgetWad = remainingWad;\n        velocityLastAccrual = block.timestamp;\n    }\n\n    /// @dev Store a round and emit the canonical event triple: NAVUpdated plus the\n    ///      Chainlink-canonical NewRound/AnswerUpdated for indexer tooling (18-dec answer — emitted\n    ///      here because the view-only NAVFeed cannot emit; see the interface note). The single\n    ///      source of truth for round recording, shared by _commit and the constructor seed.\n    function _record(uint256 navValue, uint256 dataTimestamp, UpdateKind kind)\n        private\n        returns (uint80 roundId)\n    {\n        roundId = ++latestRound;\n        _rounds[roundId] = Round(uint192(navValue), uint64(block.timestamp));\n        _currentDataTimestamp = uint64(dataTimestamp);\n        emit NAVUpdated(roundId, navValue, dataTimestamp, kind);\n        emit NewRound(roundId, msg.sender, block.timestamp);\n        emit AnswerUpdated(int256(navValue), roundId, block.timestamp);\n    }\n\n    /// @dev Full write commit: advance the observation clock (report AND markdown only — see\n    ///      below), record the round, then fan out to sinks LAST (checks-effects-interactions).\n    function _commit(uint256 navValue, uint256 dataTimestamp, UpdateKind kind)\n        private\n        returns (uint80 roundId)\n    {\n        // Reports and markdowns advance the observation clock; force writes do not.\n        //  - report: preserves ordering and replay protection for automated observations.\n        //  - markdown: sets the clock to block.timestamp so a stale pre-incident report\n        //    (higher, still within a long stalenessWindow) cannot be accepted after exit and\n        //    reverse the write-down. A genuine post-incident report is observed later, so it still\n        //    lands.\n        //  - force: must not advance it, or a real report observed just before an outage-recovery\n        //    force write would be wrongly discarded on resume.\n        if (kind == UpdateKind.Report || kind == UpdateKind.Markdown) {\n            lastObservationTs = dataTimestamp;\n        }\n        roundId = _record(navValue, dataTimestamp, kind);\n        _pushSinks(navValue);\n    }\n\n    function _currentNav() private view returns (uint256) {\n        return _rounds[latestRound].answer;\n    }\n\n    // =========================================================================\n    // Governance config\n    // =========================================================================\n\n    /// @notice Raise the absolute NAV ceiling. The setter is increase-only because lowering the\n    ///         ceiling to or below the current NAV could block future upward reports.\n    function setMaxNAV(uint256 newMaxNAV) external restricted {\n        if (newMaxNAV <= maxNAV || newMaxNAV > type(uint192).max) revert InvalidBounds();\n        emit MaxNAVUpdated(maxNAV, newMaxNAV);\n        maxNAV = newMaxNAV;\n    }\n\n    function setNormalBandBps(uint256 bps) external restricted {\n        if (bps == 0 || bps > MAX_NORMAL_BAND_BPS || bps > forceBandBps || bps > maxCumulativeBps) {\n            revert InvalidBand();\n        }\n        emit NormalBandUpdated(normalBandBps, bps);\n        normalBandBps = bps;\n    }\n\n    function setForceBandBps(uint256 bps) external restricted {\n        if (bps < normalBandBps || bps > MAX_BPS) revert InvalidBand();\n        emit ForceBandUpdated(forceBandBps, bps);\n        forceBandBps = bps;\n    }\n\n    // =========================================================================\n    // Views — protocol surface (18 decimals)\n    // =========================================================================\n\n    /// @notice Return the current NAV and the source-data timestamp associated with that value.\n    /// @dev Round 1 is created by the constructor, so every deployed instance has current data.\n    function getCurrentNAV() external view returns (uint256 nav, uint256 timestamp) {\n        Round storage r = _rounds[latestRound];\n        return (r.answer, _currentDataTimestamp);\n    }\n\n    /// @inheritdoc INAVOracle\n    function navDecimals() external pure returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc INAVOracle\n    function currentDataTimestamp() external view returns (uint256) {\n        return _currentDataTimestamp;\n    }\n\n    /// @notice Restricted retry intended for governance: push the current NAV to one registered\n    ///         sink after a revoked role, pause, or outage caused {SinkPushFailed}.\n    ///         Unlike ordinary best-effort fan-out, this explicit catch-up reverts if delivery\n    ///         fails so automation cannot record an unsuccessful recovery as complete. The caller\n    ///         must still supply enough gas for the configured sink-call budget. This exact replay\n    ///         cannot bypass receiver-specific authorization or validation. Recovery beyond exact\n    ///         replay is target-specific; use only the procedure approved for that sink family.\n    function syncSink(address target) external restricted nonReentrant {\n        if (!_hasSink(target)) revert SinkNotFound(target);\n        uint256 nav = _currentNav();\n        if (!_pushOne(target, nav)) revert SinkSyncFailed(target, nav);\n    }\n\n    /// @notice Whether all oracle-local episode and timing gates pass for `episode`. This does not\n    ///         check AccessManager authorization or scheduling, nor proposal-specific target\n    ///         constraints such as decrease and floor requirements.\n    function isMarkdownExecutable(uint256 episode) external view returns (bool) {\n        if (!protectionMode || episode != protectionEpisodeId) return false;\n        if (block.timestamp < protectionEnteredAt + markdownDelay) return false;\n        if (lastMarkdownTs != 0 && block.timestamp - lastMarkdownTs < MIN_MARKDOWN_INTERVAL) {\n            return false;\n        }\n        return true;\n    }\n\n    /// @inheritdoc INAVOracle\n    function getRound(uint80 roundId) external view returns (uint256 answer, uint256 updatedAt) {\n        Round storage r = _rounds[roundId];\n        if (r.updatedAt == 0) revert NoData(roundId);\n        return (r.answer, r.updatedAt);\n    }\n}\n","creation_status":"success","file_path":"../vendor/smart-contracts-oracle/src/nav/core/NAVOracle.sol"}