EOPendlePTFeedTWAP

Description:

Proxy contract enabling upgradeable smart contract patterns. Delegates calls to an implementation contract.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "src/EOPendlePTFeedTWAP.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import { IPTOracle } from "./interfaces/pendle/IPTOracle.sol";
import { IPendleMarketV3 } from "./interfaces/pendle/IPendleMarketV3.sol";
import { IPendleSY } from "./interfaces/pendle/IPendleSY.sol";
import { EOBase } from "./EOBase.sol";
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

import { IDecimals } from "./interfaces/IDecimals.sol";
import { IEOPendlePTFeedTWAP } from "./interfaces/IEOPendlePTFeedTWAP.sol";

/**
 * @title EOPendlePTFeedTWAP
 * @author EO
 * @notice Pendle PT TWAP feed oracle, based on selected TWAPType: PT_TO_SY or PT_TO_ASSET.
 */
contract EOPendlePTFeedTWAP is IEOPendlePTFeedTWAP, EOBase, Initializable {
    /**
     * @notice The minimum duration of the TWAP
     */
    uint32 internal constant _MIN_TWAP_DURATION = 300;

    /**
     * @notice The decimals precision of the price feed.
     */
    // solhint-disable-next-line const-name-snakecase
    uint8 public constant decimals = 18;

    /**
     * @notice The address of Pendle PT oracle
     */
    address public ptOracle;

    /**
     * @notice The address of the Pendle PT market
     */
    address public ptMarket;

    /**
     * @notice The duration of the TWAP
     */
    uint32 public twapDuration;

    /**
     * @notice The type of the TWAP: PT_TO_SY(0) or PT_TO_ASSET(1)
     */
    TWAPType public twapType;

    /**
     * @notice The multiplier for the denominator
     */
    uint256 public denominatorMultiplier;

    /**
     * @notice The multiplier for the numerator
     */
    uint256 public numeratorMultiplier;

    /**
     * @notice The description of the price feed.
     */
    string public description;

    /**
     * @notice Function to get the rate based on TWAP type
     */
    function(address, uint32) view returns (uint256) internal _getRate;

    /**
     * @notice The gap for the upgradeable contract.
     */
    uint256[50] private _gap;

    /**
     * @custom:oz-upgrades-unsafe-allow constructor
     */
    constructor() {
        _disableInitializers();
    }

    /**
     * @notice Initializes the contract with the required parameters
     * @param ptOracle_ The address of Pendle PT oracle
     * @param ptMarket_ The address of the Pendle PT market
     * @param description_ The description of the price feed
     * @param twapDuration_ The duration of the TWAP
     * @param twapType_ The type of the TWAP
     */
    // solhint-disable-next-line code-complexity
    function initialize(
        address ptOracle_,
        address ptMarket_,
        string memory description_,
        uint32 twapDuration_,
        TWAPType twapType_
    )
        external
        initializer
    {
        if (ptOracle_ == address(0)) revert PTOracleAddressIsZero();
        if (ptMarket_ == address(0)) revert PTMarketAddressIsZero();
        if (twapDuration_ == 0) revert TwapDurationIsZero();
        if (twapDuration_ < _MIN_TWAP_DURATION) revert TwapDurationIsLessThanMin();

        ptOracle = ptOracle_;
        ptMarket = ptMarket_;
        twapDuration = twapDuration_;
        twapType = twapType_;
        description = description_;

        (bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied) =
            IPTOracle(ptOracle).getOracleState(ptMarket, twapDuration);
        if (!oldestObservationSatisfied) revert PendleMarketOldestObservationIsNotSatisfied();
        if (increaseCardinalityRequired) revert PendleMarketCardinalityIsLow(cardinalityRequired);

        (address syToken, address ptToken,) = IPendleMarketV3(ptMarket).readTokens();

        uint8 decimalsFrom = IDecimals(ptToken).decimals();
        // there is no path to have this variable uninitialized
        // slither-disable-next-line uninitialized-local
        uint8 decimalsTo;

        if (twapType == TWAPType.PT_TO_SY) {
            if (IPTOracle(ptOracle).getPtToSyRate(ptMarket, twapDuration) == 0) {
                revert PendleMarketPTToSYRateIsZero();
            }
            _getRate = _getPTToSYRate;
            decimalsTo = IDecimals(syToken).decimals();
        } else if (twapType == TWAPType.PT_TO_ASSET) {
            if (IPTOracle(ptOracle).getPtToAssetRate(ptMarket, twapDuration) == 0) {
                revert PendleMarketPTToAssetRateIsZero();
            }

            _getRate = _getPTToAssetRate;
            (,, uint8 assetDecimals) = IPendleSY(syToken).assetInfo();
            decimalsTo = assetDecimals;
        } else {
            revert InvalidTWAPType();
        }

        if (decimalsTo > decimalsFrom) {
            numeratorMultiplier = 1;
            denominatorMultiplier = 10 ** (decimalsTo - decimalsFrom);
        } else {
            numeratorMultiplier = 10 ** (decimalsFrom - decimalsTo);
            denominatorMultiplier = 1;
        }
    }

    /**
     * @notice Returns latest round data
     * @dev Returns zero for roundId, startedAt and answeredInRound.
     * @return roundId The round id, returns 0
     * @return answer The answer, returns the TWAP rate according to the twapType
     * @return startedAt The started at, returns 0
     * @return updatedAt The updated at, returns current block timestamp
     * @return answeredInRound The answered in round, returns 0
     */
    function latestRoundData() public view override returns (uint80, int256, uint256, uint256, uint80) {
        uint256 rate;
        rate = _getRate(ptMarket, twapDuration);
        rate = rate * numeratorMultiplier / denominatorMultiplier;

        return (0, int256(rate), 0, block.timestamp, 0);
    }

    /**
     * @notice Internal wrapper for getPTToSYRate
     * @param market The address of the Pendle PT market
     * @param duration The duration of the TWAP
     * @return The rate
     */
    function _getPTToSYRate(address market, uint32 duration) internal view returns (uint256) {
        return IPTOracle(ptOracle).getPtToSyRate(market, duration);
    }

    /**
     * @notice Internal wrapper for getPTToAssetRate
     * @param market The address of the Pendle PT market
     * @param duration The duration of the TWAP
     * @return The rate
     */
    function _getPTToAssetRate(address market, uint32 duration) internal view returns (uint256) {
        return IPTOracle(ptOracle).getPtToAssetRate(market, duration);
    }
}
"
    },
    "src/interfaces/pendle/IPTOracle.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

interface IPTOracle {
    function getLpToSyRate(address market, uint32 duration) external view returns (uint256);

    function getPtToAssetRate(address market, uint32 duration) external view returns (uint256);

    function getPtToSyRate(address market, uint32 duration) external view returns (uint256);

    function getOracleState(
        address market,
        uint32 duration
    )
        external
        view
        returns (bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied);
}
"
    },
    "src/interfaces/pendle/IPendleMarketV3.sol": {
      "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.25;

interface IPendleMarketV3 {
    struct MarketStorage {
        int128 totalPt;
        int128 totalSy;
        uint96 lastLnImpliedRate;
        uint16 observationIndex;
        uint16 observationCardinality;
        uint16 observationCardinalityNext;
    }

    /**
     * @notice Returns the storage of the market
     * @return The storage of the market
     */
    function _storage() external view returns (MarketStorage memory);

    /**
     * @notice Returns the address of the SY token, PT token, and YT token
     * @return syToken The address of the SY token
     * @return ptToken The address of the PT token
     * @return ytToken The address of the YT token
     */
    function readTokens() external view returns (address, address, address);

    /**
     * @notice Returns the total supply of the market
     * @return The total supply of the market
     */
    function totalSupply() external view returns (uint256);
}
"
    },
    "src/interfaces/pendle/IPendleSY.sol": {
      "content": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.25;

interface IPendleSY {
    /// @dev check `assetInfo()` for more information
    enum AssetType {
        TOKEN,
        LIQUIDITY
    }

    function assetInfo() external view returns (AssetType assetType, address assetAddress, uint8 assetDecimals);
}
"
    },
    "src/EOBase.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import { AggregatorV2V3Interface } from "./interfaces/AggregatorV2V3Interface.sol";

/**
 * @title EOBase
 * @author EO
 * @notice Base contract for EO contracts
 */
abstract contract EOBase is AggregatorV2V3Interface {
    /**
     * @notice Returns the latest answer
     * @return The latest answer
     */
    function latestAnswer() external view returns (int256) {
        (, int256 answer,,,) = latestRoundData();
        return answer;
    }

    /**
     * @notice Returns the latest update timestamp
     * @return The latest update timestamp
     */
    function latestTimestamp() external view returns (uint256) {
        (,,, uint256 updatedAt,) = latestRoundData();
        return updatedAt;
    }

    /**
     * @notice Returns the latest round ID
     * @return The latest round ID
     */
    function latestRound() external view returns (uint256) {
        (uint80 roundId,,,,) = latestRoundData();
        return uint256(roundId);
    }

    /**
     * @notice Returns the answer of the latest round
     * @param roundId The round ID (ignored)
     * @return The answer of the latest round
     */
    function getAnswer(uint256 roundId) external view returns (int256) {
        (, int256 answer,,,) = getRoundData(uint80(roundId));
        return answer;
    }

    /**
     * @notice Returns the update timestamp of the latest round
     * @param roundId The round ID (ignored)
     * @return The update timestamp of the latest round
     */
    function getTimestamp(uint256 roundId) external view returns (uint256) {
        (,,, uint256 updatedAt,) = getRoundData(uint80(roundId));
        return updatedAt;
    }

    /**
     * @notice Returns the minimum updated at, default to updatedAt in latestRoundData
     * @dev This method is valuable for complex feeds, where other feeds rates are involved into computation
     * and since updatedAt in latestRoundData is the latest updatedAt among the feeds, it may not reflect the data
     * freshness, so this method shows the earliest updatedAt among the feeds, and reflects the data freshness
     * @return The minimum updated at among the feeds used to compute the final rate
     */
    function minUpdatedAt() external view virtual returns (uint256) {
        (,,, uint256 updatedAt,) = latestRoundData();
        return updatedAt;
    }

    /**
     * @notice Returns the latest round data
     * @return roundId The latest round ID, optional
     * @return answer The latest answer
     * @return startedAt The timestamp when the round started, optional
     * @return updatedAt The timestamp of the latest update
     * @return answeredInRound The round ID in which the answer was computed, optional
     */
    function latestRoundData()
        public
        view
        virtual
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    /**
     * @notice Returns the latest round data
     * @param roundId The round ID, is ignored
     * @return roundId The round ID of   the latest round data
     * @return answer The answer of the latest round data
     * @return startedAt The started at of the latest round data
     * @return updatedAt The updated at of the latest round data
     * @return answeredInRound The round ID in which the answer was computed of the latest round data
     */
    function getRoundData(uint80)
        public
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        return latestRoundData();
    }
}
"
    },
    "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol": {
      "content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reinitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.
     *
     * NOTE: Consider following the ERC-7201 formula to derive storage locations.
     */
    function _initializableStorageSlot() internal pure virtual returns (bytes32) {
        return INITIALIZABLE_STORAGE;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        bytes32 slot = _initializableStorageSlot();
        assembly {
            $.slot := slot
        }
    }
}
"
    },
    "src/interfaces/IDecimals.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**
 * @title IDecimals
 * @author EO
 * @notice Interface for the contract with decimals method.
 */
interface IDecimals {
    /**
     * @notice The function to get the decimals.
     * @return The decimals.
     */
    function decimals() external view returns (uint8);
}
"
    },
    "src/interfaces/IEOPendlePTFeedTWAP.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**
 * @title IEOPendlePTFeedTWAP
 * @author EO
 * @notice Interface for Pendle PT TWAP feed oracle
 */
interface IEOPendlePTFeedTWAP {
    /**
     * @notice The type of the TWAP
     * @dev PT_TO_SY: 0
     * @dev PT_TO_ASSET: 1
     */
    enum TWAPType {
        PT_TO_SY,
        PT_TO_ASSET
    }

    /**
     * @notice Error thrown when the PT market address is zero.
     */
    error PTMarketAddressIsZero();

    /**
     * @notice Error thrown when the PT oracle address is zero.
     */
    error PTOracleAddressIsZero();

    /**
     * @notice Error thrown when the TWAP duration is zero.
     */
    error TwapDurationIsZero();

    /**
     * @notice Error thrown when the TWAP duration is less than the minimum duration.
     */
    error TwapDurationIsLessThanMin();

    /**
     * @notice Error thrown when the Pendle market oldest observation is not satisfied.
     */
    error PendleMarketOldestObservationIsNotSatisfied();

    /**
     * @notice Error thrown when the Pendle market cardinality is low and needs to be increased.
     * @param cardinalityRequired The required cardinality
     */
    error PendleMarketCardinalityIsLow(uint16 cardinalityRequired);

    /**
     * @notice Error thrown when the Pendle market PT to SY rate returns 0.
     */
    error PendleMarketPTToSYRateIsZero();

    /**
     * @notice Error thrown when the Pendle market PT to Asset rate returns 0.
     */
    error PendleMarketPTToAssetRateIsZero();

    /**
     * @notice Error thrown when the TWAP type is invalid.
     */
    error InvalidTWAPType();

    function initialize(
        address ptOracle_,
        address ptMarket_,
        string memory description_,
        uint32 twapDuration_,
        TWAPType twapType_
    )
        external;
}
"
    },
    "src/interfaces/AggregatorV2V3Interface.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

import { MinimalAggregatorV3Interface } from "./MinimalAggregatorV3Interface.sol";

/**
 * @title AggregatorV2V3Interface
 * @author EO
 * @notice Interface for the AggregatorV2V3 contract
 */
interface AggregatorV2V3Interface is MinimalAggregatorV3Interface {
    /**
     * @notice Returns the latest answer
     * @return The latest answer
     */
    function latestAnswer() external view returns (int256);

    /**
     * @notice Returns the latest update timestamp
     * @return The latest update timestamp
     */
    function latestTimestamp() external view returns (uint256);

    /**
     * @notice Returns the latest round ID
     * @return The latest round ID
     */
    function latestRound() external view returns (uint256);

    /**
     * @notice Returns the answer of the latest round
     * @param roundId The round ID (ignored)
     * @return The answer of the latest round
     */
    function getAnswer(uint256 roundId) external view returns (int256);

    /**
     * @notice Returns the update timestamp of the latest round
     * @param roundId The round ID (ignored)
     * @return The update timestamp of the latest round
     */
    function getTimestamp(uint256 roundId) external view returns (uint256);

    /**
     * @notice Returns the latest round data
     * @return roundId The latest round ID, optional
     * @return answer The latest answer
     * @return startedAt The timestamp when the round started, optional
     * @return updatedAt The timestamp of the latest update
     * @return answeredInRound The round ID in which the answer was computed, optional
     */
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    /**
     * @notice Returns the latest round data
     * @param roundId The round ID, is ignored
     * @return roundId The round ID of   the latest round data
     * @return answer The answer of the latest round data
     * @return startedAt The started at of the latest round data
     * @return updatedAt The updated at of the latest round data
     * @return answeredInRound The round ID in which the answer was computed of the latest round data
     */
    function getRoundData(uint80)
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
"
    },
    "src/interfaces/MinimalAggregatorV3Interface.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

/**
 * @title MinimalAggregatorV3Interface
 * @author EO
 * @notice Interface for price feed oracle
 */
interface MinimalAggregatorV3Interface {
    /**
     * @notice Returns feed decimals
     * @return The decimals of the feed.
     */
    function decimals() external view returns (uint8);

    /**
     * @notice Returns the latest round data
     * @return roundId The latest round ID, optional
     * @return answer The latest answer
     * @return startedAt The timestamp when the round started, optional
     * @return updatedAt The timestamp of the latest update
     * @return answeredInRound The round ID in which the answer was computed, optional
     */
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
"
    }
  },
  "settings": {
    "remappings": [
      "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
      "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
      "@openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
      "@maverick/v2-common/=lib/maverickprotocol-v2-common/",
      "forge-std/=lib/forge-std/src/",
      "@eoracle/=lib/target-contracts/src/",
      "@spectra-core/=lib/spectra-core/",
      "lib/spectra-core/:openzeppelin-contracts-upgradeable/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/",
      "lib/spectra-core/:openzeppelin-contracts/=lib/spectra-core/lib/openzeppelin-contracts/contracts/",
      "ds-test/=lib/spectra-core/lib/forge-std/lib/ds-test/src/",
      "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
      "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
      "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
      "openzeppelin-contracts/=lib/openzeppelin-contracts/",
      "openzeppelin-erc20-basic/=lib/spectra-core/lib/openzeppelin-contracts/contracts/token/ERC20/",
      "openzeppelin-erc20-extensions/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/",
      "openzeppelin-erc20/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/",
      "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
      "openzeppelin-math/=lib/spectra-core/lib/openzeppelin-contracts/contracts/utils/math/",
      "openzeppelin-proxy/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/",
      "openzeppelin-utils/=lib/spectra-core/lib/openzeppelin-contracts/contracts/utils/",
      "spectra-core/=lib/spectra-core/"
    ],
    "optimizer": {
      "enabled": true,
      "runs": 100
    },
    "metadata": {
      "useLiteralContent": false,
      "bytecodeHash": "none",
      "appendCBOR": true
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "evmVersion": "cancun",
    "viaIR": true
  }
}}

Tags:
Proxy, Upgradeable, Factory, Oracle|addr:0x5c1287a9ddf55763f985c60638b51395738a98ff|verified:true|block:23675700|tx:0xa7bd013e202dc12e6c4525be7aa638d7ba50fa448b3736fd39acbf546496f011|first_check:1761657915

Submitted on: 2025-10-28 14:25:17

Comments

Log in to comment.

No comments yet.