Contract 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77

Contract Overview

Balance:
0 DEV
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x54babb57d8525a89cd8b3f558b9689b810c03c40165afa7b71096ad741a47d24Set Asset Feed28634412022-09-19 5:36:0079 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x5394c597666ad3f795add77dba162eec33aeb93ca8449461d7ec2bb71ac6742bSet Asset Feed28634272022-09-19 5:32:4879 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x33d349074cdf6305d3c3a5915b065a19c94048b86de45f5661ec9391483d6b3fSet Asset Feed28634142022-09-19 5:30:0679 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x2c96fea6e63cbd7846213411fe61aa158b09aea742f1aa45b7efa022d5e34537Set Asset Feed28634032022-09-19 5:27:1279 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xc8deb6435105157ed5a02648da6ca3d266413294f3ade185666ad987f66600c6Set Asset Feed28633912022-09-19 5:24:2479 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xd5170a07eeb4a2e005ce7b9c14a5c77b396083983b094352431e5dd4c1c93030Set Asset Feed28633802022-09-19 5:21:3079 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x169e9ebf400af48a9060631022125d420ade744dd8c6c0cd56ba344402c49455Set Asset Feed28633662022-09-19 5:18:3079 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x22677afbf114d86d0425a77d0d4d31723b17c4c4df4b535bca15e99f3584eaa7Set Asset Feed28633462022-09-19 5:14:0679 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x8e8ca2bf18b3253666030c0635c249e5d809bf3b40e6508c3ae028f5793ec47dSet Asset Feed28633332022-09-19 5:11:1879 days 22 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xa6c8b5fc0f28fd548c7306985251c12ac09414a9cde1e86747f250fcde8158acSet Asset Feed28633202022-09-19 5:08:0679 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x315943864064790a8b384d11f4aa8d4fb6ca24957f0efbe25679f2157920de51Set Asset Feed28633092022-09-19 5:05:1879 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xd902f0e23a198538884397c21b08bc7aafc369348dc69d00775d3b1667c52e9eSet Asset Feed28632992022-09-19 5:02:5479 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xefc0bdacf10abd594a9a73578195ac0d88d294e61dccd67b69bbf8ef1434e3a6Set Asset Feed28632872022-09-19 5:00:1279 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xdd34965e7282ced005f34a752320bfe5e919f02b726e311fe5a66e5747201809Set Asset Feed28632772022-09-19 4:57:3079 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xa12159af033cb2ddd67940fdb917b2e5fd2a13f976b258dd2a58c50ca70334deSet Asset Feed28632642022-09-19 4:54:1879 days 23 hrs ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x44ae0ffd83e639a824cb2f6a32ba55974dbf1e14bd71b473ff91afac84aa23f1Set Asset Feed28630522022-09-19 4:03:4880 days 4 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003244676
0xbf47a407d720ccc71a6e2b730533d204b48a89c9aeb91fd84e2bfc812821ca85Set Asset Feed28630312022-09-19 3:59:0680 days 9 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x53133338f329fa6ae4afba78a63b7852ce66db8c03eb35d996621d7ac363fc45Set Asset Feed28630172022-09-19 3:55:3680 days 13 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xe2a0883c3979f831d952b604f77650ab153463eabc7b08bef655e5e7e81986c0Set Asset Feed28630042022-09-19 3:52:4880 days 15 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x5f9d09c9ffa8022d09c2d4ac828e2354bd4df6fd0c7edd8099e1af0e88b89503Set Asset Feed28629902022-09-19 3:50:0080 days 18 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x09143cc16626a02c6d536798e59048ce66741ae62c2f458909d42f9db435ea8dSet Asset Feed28629782022-09-19 3:47:1280 days 21 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x8e929f0866a356ef321d356a583b0ea22b61a348c8102367726463683c670a7eSet Asset Feed28629642022-09-19 3:44:1880 days 24 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x8acbc0fd8ed9b4819723d9f240ac6fdaf6ac79c6ed85b19d39a5b506f7be9a16Set Asset Feed28629512022-09-19 3:41:2480 days 27 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0xe690f877d16f83ec52a71a05620d2d2bc7b479ce1e80db5e5c844f61d248ac55Set Asset Feed28629382022-09-19 3:38:3680 days 30 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
0x331784a790848bc4b4c33dd68de5b3a4f9cdc9667af4962dbf79558edb8e7b9eSet Asset Feed28629252022-09-19 3:35:4880 days 32 mins ago0xb6ca26b953a0c5bf5180efb57e7685668a4a6a18 IN 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV0.003260756
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x9ae398912c6d3e9629744add6b0273d07b17446ceaf0545d379f16f154f471e730975422022-10-31 9:54:0037 days 18 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770xa356990bcded8cc6865be606d64e7381bfe00b720 DEV
0x9ae398912c6d3e9629744add6b0273d07b17446ceaf0545d379f16f154f471e730975422022-10-31 9:54:0037 days 18 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770xa356990bcded8cc6865be606d64e7381bfe00b720 DEV
0x9ae398912c6d3e9629744add6b0273d07b17446ceaf0545d379f16f154f471e730975422022-10-31 9:54:0037 days 18 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0xf7d1199abaafae4ac003863d9e6c3cb13166290539f287e86f20ced03e13570f30625472022-10-24 12:42:1844 days 15 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xa873f6b30ad79fcaf9b03a0a883d6d1f18d661d70 DEV
0xf7d1199abaafae4ac003863d9e6c3cb13166290539f287e86f20ced03e13570f30625472022-10-24 12:42:1844 days 15 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xa873f6b30ad79fcaf9b03a0a883d6d1f18d661d70 DEV
0xf7d1199abaafae4ac003863d9e6c3cb13166290539f287e86f20ced03e13570f30625472022-10-24 12:42:1844 days 15 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0xb81e432a331bf1a311f3cdb92a9ea9fd459d484e67106c564db838a4e48b1abc30625422022-10-24 12:38:3044 days 15 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xcf88a8d7fc1a687895fc8ffaad567f303926b0940 DEV
0xb81e432a331bf1a311f3cdb92a9ea9fd459d484e67106c564db838a4e48b1abc30625422022-10-24 12:38:3044 days 15 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xcf88a8d7fc1a687895fc8ffaad567f303926b0940 DEV
0xb81e432a331bf1a311f3cdb92a9ea9fd459d484e67106c564db838a4e48b1abc30625422022-10-24 12:38:3044 days 15 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0x3669da30c33d27a6a579548fcfc345fe5dedda6e0 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0x3669da30c33d27a6a579548fcfc345fe5dedda6e0 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xcf88a8d7fc1a687895fc8ffaad567f303926b0940 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0xcf88a8d7fc1a687895fc8ffaad567f303926b0940 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770x141ec95db9298cb4bb20cbac422a42a047a764b10 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770x141ec95db9298cb4bb20cbac422a42a047a764b10 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0x3669da30c33d27a6a579548fcfc345fe5dedda6e0 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b77 0x3669da30c33d27a6a579548fcfc345fe5dedda6e0 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770x05d0cb7b9a51a63bcd4c41a63f38986ad12b90710 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770x05d0cb7b9a51a63bcd4c41a63f38986ad12b90710 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x71a86567593c2ca476662eeeaa79b937932a2f610x65cc27ae59714d14ac7d9878d9150ca3f2760b770 DEV
0x966dc6b22d2edaaf426ea3724ae11e4b788883118e027fe631901b486948562930385162022-10-19 22:12:4849 days 5 hrs ago 0x65cc27ae59714d14ac7d9878d9150ca3f2760b770x05d0cb7b9a51a63bcd4c41a63f38986ad12b90710 DEV
[ Download CSV Export 
Loading

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xa9a53ff468A502DC63fd54AB040fC84506D54094

Contract Name:
ChainlinkFeedGetter

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 6 : ChainlinkFeedGetter.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

import "../oracle/interfaces/IPrimeOracle.sol";
import "../oracle/interfaces/IPrimeOracleGetter.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "../../util/CommonErrors.sol";

contract ChainlinkFeedGetter is IPrimeOracleGetter, CommonErrors {

    // Map of asset price feeds (asset => priceSource)
    mapping(uint256 => mapping(address => AggregatorV3Interface)) private assetFeeds;

    //TODO: allow transfer of admin
    address public admin;

    uint8 public constant RATIO_DECIMALS = 18;

    /**
    * @dev Only the admin can call functions marked by this modifier.
    **/
    modifier onlyAdmin {
        if(msg.sender != admin) revert OnlyAdmin();
        _;
    }

    constructor() {
        admin = msg.sender;
    }

    /// @inheritdoc IPrimeOracleGetter

    function getAssetPrice(
        uint256 chainId,
        address asset,
        address /* denomToken */
    ) external view override returns (uint256 price, uint8 decimals) {
        AggregatorV3Interface feed = assetFeeds[chainId][asset];
        if (address(feed) != address(0)) {
            (
                /* uint80 roundId */,
                int256 answer,
                /* uint256 startedAt */,
                /* uint256 updatedAt */,
                /* uint80 answeredInRound */
            ) = feed.latestRoundData();

            if (answer < 0) return (0,0);

            price = uint256(answer);
            decimals = feed.decimals();
        }
    }

    function getAssetRatio(
        address overlyingAsset,
        address underlyingAsset,
        uint256 underlyingChainId
    ) external view override returns (uint256 ratio, uint8 decimals) {
        AggregatorV3Interface numFeed = assetFeeds[block.chainid][overlyingAsset];
        AggregatorV3Interface denFeed = assetFeeds[underlyingChainId][underlyingAsset];

        if (address(numFeed) != address(0) && address(denFeed) != address(0)) {
            (
                /* uint80 roundId */,
                int256 numAnswer,
                /* uint256 startedAt */,
                /* uint256 updatedAt */,
                /* uint80 answeredInRound */
            ) = numFeed.latestRoundData();

            (
                /* uint80 roundId */,
                int256 denAnswer,
                /* uint256 startedAt */,
                /* uint256 updatedAt */,
                /* uint80 answeredInRound */
            ) = denFeed.latestRoundData();

            if (numAnswer >= 0 && denAnswer >= 0) {
                ratio = uint256(numAnswer) * 10**(denFeed.decimals() + RATIO_DECIMALS) / uint256(denAnswer) / 10**numFeed.decimals();
                decimals = RATIO_DECIMALS;
            }
        }
    }

    function getPriceDecimals(uint256 chainId, address asset) external view override returns (uint256) {
        if (asset == address(0)) revert AddressExpected();

        AggregatorV3Interface feed = assetFeeds[chainId][asset];
        if (address(feed) != address(0)) {
            return feed.decimals();
        }
        return 0;
    }

    function _getAssetFeed(uint256 chainId, address asset) internal view returns (address) {
        if (asset == address(0)) revert AddressExpected();

        return address(assetFeeds[chainId][asset]);
    }

    function getAssetFeed(uint256 chainId, address asset) external view override returns (address) {
        if (asset == address(0)) revert AddressExpected();

        return _getAssetFeed(chainId, asset);
    }

    /// @inheritdoc IPrimeOracleGetter
    function setAssetFeed(
        uint256 chainId,
        address asset,
        address feed
    ) external override onlyAdmin() {
        assetFeeds[chainId][asset] = AggregatorV3Interface(feed);
        emit AssetFeedUpdated(chainId, asset, feed);
    }

}

File 2 of 6 : IPrimeOracle.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

import "./IPrimeOracleGetter.sol";
import "./PrimeOracleStorage.sol";

/**
 * @title IPrimeOracle
 * @author Prime
 * @notice The core interface for the Prime Oracle
 */
abstract contract IPrimeOracle is PrimeOracleStorage {

    /**
     * @dev Emitted after the price data feed of an asset is set/updated
     * @param asset The address of the asset
     * @param chainId The chainId of the asset
     * @param feed The price feed of the asset
     */
    event SetPrimaryFeed(uint256 chainId, address indexed asset, address indexed feed);

    /**
     * @dev Emitted after the price data feed of an asset is set/updated
     * @param asset The address of the asset
     * @param feed The price feed of the asset
     */
    event SetSecondaryFeed(uint256 chainId, address indexed asset, address indexed feed);

    /**
     * @dev Emitted after the exchange rate data feed of a loan market asset is set/updated
     * @param asset The address of the asset
     * @param chainId The chainId of the asset
     * @param feed The price feed of the asset
     */
    event SetExchangRatePrimaryFeed(uint256 chainId, address indexed asset, address indexed feed);

    /**
     * @dev Emitted after the exchange rate data feed of a loan market asset is set/updated
     * @param asset The address of the asset
     * @param feed The price feed of the asset
     */
    event SetExchangeRateSecondaryFeed(uint256 chainId, address indexed asset, address indexed feed);

    /**
     * @notice Get the underlying price of a cToken asset
     * @param collateralMarketUnderlying The PToken collateral to get the sasset price of
     * @param chainId the chainId to get an asset price for
     * @return The underlying asset price.
     *  Zero means the price is unavailable.
     */
    function getUnderlyingPrice(uint256 chainId, address collateralMarketUnderlying) external view virtual returns (uint256, uint8);

    /**
     * @notice Get the underlying borrow price of loanMarketAsset
     * @return The underlying borrow price
     *  Zero means the price is unavailable.
     */
    function getUnderlyingPriceBorrow(
        uint256 chainId,
        address loanMarketUnderlying
    ) external view virtual returns (uint256, uint8);

    /**
     * @notice Get the exchange rate of loanMarketAsset to basis
     * @return The underlying exchange rate of loanMarketAsset to basis
     *  Zero means the price is unavailable.
     */
    function getBorrowAssetExchangeRate(
        address loanMarketOverlying,
        uint256 loanMarketUnderlyingChainId,
        address loanMarketUnderlying
    ) external view virtual returns (uint256 /* ratio */, uint8 /* decimals */);

    /*** Admin Functions ***/

    /**
     * @notice Sets or replaces price feeds of assets
     * @param asset The addresses of the assets
     * @param feed The addresses of the price feeds
     */
    function setPrimaryFeed(uint256 chainId, address asset, IPrimeOracleGetter feed) external virtual;

    /**
     * @notice Sets or replaces price feeds of assets
     * @param asset The addresses of the assets
     * @param feed The addresses of the price feeds
     */
    function setSecondaryFeed(uint256 chainId, address asset, IPrimeOracleGetter feed) external virtual;
}

File 3 of 6 : IPrimeOracleGetter.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

/**
 * @title IPrimeOracleGetter
 * @author Prime
 * @notice Interface for the Prime price oracle.
 **/
interface IPrimeOracleGetter {

    /**
     * @dev Emitted after the price data feed of an asset is updated
     * @param asset The address of the asset
     * @param feed The price feed of the asset
     */
    event AssetFeedUpdated(uint256 chainId, address indexed asset, address indexed feed);

    /**
     * @notice Gets the price feed of an asset
     * @param asset The addresses of the asset
     * @return address of asset feed
     */
    function getAssetFeed(uint256 chainId, address asset) external view returns (address);

    /**
     * @notice Sets or replaces price feeds of assets
     * @param asset The addresses of the assets
     * @param feed The addresses of the price feeds
     */
    function setAssetFeed(uint256 chainId, address asset, address feed) external;

    /**
     * @notice Returns the price data in the denom currency
     * @param quoteToken A token to return price data for
     * @param denomToken A token to price quoteToken against
     * @param price of the asset from the oracle
     * @param decimals of the asset from the oracle
     **/
    function getAssetPrice(
        uint256 chainId,
        address quoteToken,
        address denomToken
    ) external view returns (uint256 price, uint8 decimals);

    function getAssetRatio(
        address overlyingAsset,
        address underlyingAsset,
        uint256 underlyingChainId
    ) external view returns (uint256 ratio, uint8 decimals);

    /**
     * @notice Returns the price data in the denom currency
     * @param quoteToken A token to return price data for
     * @return return price of the asset from the oracle
     **/
    function getPriceDecimals(
        uint256 chainId,
        address quoteToken
    ) external view returns (uint256);

}

File 4 of 6 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface AggregatorV3Interface {
  function decimals() external view returns (uint8);

  function description() external view returns (string memory);

  function version() external view returns (uint256);

  // getRoundData and latestRoundData should both raise "No data present"
  // if they do not have data to report, instead of returning unset values
  // which could be misinterpreted as actual reported values.
  function getRoundData(uint80 _roundId)
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );

  function latestRoundData()
    external
    view
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    );
}

File 5 of 6 : CommonErrors.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

abstract contract CommonErrors {
    error AccountNoAssets(address account);
    error AddressExpected();
    error AlreadyInitialized();
    error EccMessageAlreadyProcessed();
    error EccFailedToValidate();
    error ExpectedMintAmount();
    error ExpectedBridgeAmount();
    error ExpectedBorrowAmount();
    error ExpectedWithdrawAmount();
    error ExpectedRepayAmount();
    error ExpectedTradeAmount();
    error ExpectedDepositAmount();
    error ExpectedTransferAmount();
    error InsufficientReserves();
    error InvalidPayload();
    error InvalidPrice();
    error InvalidPrecision();
    error InvalidSelector();
    error MarketExists();
    error LoanMarketIsListed(bool status);
    error MarketIsPaused();
    error MarketNotListed();
    error MsgDataExpected();
    error NameExpected();
    error NothingToWithdraw();
    error NotInMarket(uint256 chainId, address token);
    error OnlyAdmin();
    error OnlyAuth();
    error OnlyGateway();
    error OnlyMiddleLayer();
    error OnlyMintAuth();
    error OnlyRoute();
    error OnlyRouter();
    error OnlyMasterState();
    error ParamOutOfBounds();
    error RouteExists();
    error Reentrancy();
    error EnterLoanMarketFailed();
    error EnterCollMarketFailed();
    error ExitLoanMarketFailed();
    error ExitCollMarketFailed();
    error RepayTooMuch(uint256 repayAmount, uint256 maxAmount);
    error WithdrawTooMuch();
    error NotEnoughBalance(address token, address who);
    error LiquidateDisallowed();
    error SeizeTooMuch();
    error SymbolExpected();
    error RouteNotSupported(address route);
    error MiddleLayerPaused();
    error PairNotSupported(address loanAsset, address tradeAsset);
    error TransferFailed(address from, address dest);
    error TransferPaused();
    error UnknownRevert();
    error UnexpectedValueDelta();
    error ExpectedValue();
    error UnexpectedDelta();
}

File 6 of 6 : PrimeOracleStorage.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.4;

import "./IPrimeOracleGetter.sol";

/**
 * @title PrimeOracleStorage
 * @author Prime
 * @notice The core interface for the Prime Oracle storage variables
 */
abstract contract PrimeOracleStorage {
    address public pusdAddress;
    //TODO: allow transfer of ownership
    address public admin;
    // Map of asset price feeds (chainasset => priceSource)
    mapping(uint256 => mapping(address => IPrimeOracleGetter)) public primaryFeeds;
    mapping(uint256 => mapping(address => IPrimeOracleGetter)) public secondaryFeeds;
    mapping(uint256 => mapping(address => IPrimeOracleGetter)) public exchangeRatePrimaryFeeds;
    mapping(uint256 => mapping(address => IPrimeOracleGetter)) public exchangeRateSecondaryFeeds;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AccountNoAssets","type":"error"},{"inputs":[],"name":"AddressExpected","type":"error"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"EccFailedToValidate","type":"error"},{"inputs":[],"name":"EccMessageAlreadyProcessed","type":"error"},{"inputs":[],"name":"EnterCollMarketFailed","type":"error"},{"inputs":[],"name":"EnterLoanMarketFailed","type":"error"},{"inputs":[],"name":"ExitCollMarketFailed","type":"error"},{"inputs":[],"name":"ExitLoanMarketFailed","type":"error"},{"inputs":[],"name":"ExpectedBorrowAmount","type":"error"},{"inputs":[],"name":"ExpectedBridgeAmount","type":"error"},{"inputs":[],"name":"ExpectedDepositAmount","type":"error"},{"inputs":[],"name":"ExpectedMintAmount","type":"error"},{"inputs":[],"name":"ExpectedRepayAmount","type":"error"},{"inputs":[],"name":"ExpectedTradeAmount","type":"error"},{"inputs":[],"name":"ExpectedTransferAmount","type":"error"},{"inputs":[],"name":"ExpectedValue","type":"error"},{"inputs":[],"name":"ExpectedWithdrawAmount","type":"error"},{"inputs":[],"name":"InsufficientReserves","type":"error"},{"inputs":[],"name":"InvalidPayload","type":"error"},{"inputs":[],"name":"InvalidPrecision","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"InvalidSelector","type":"error"},{"inputs":[],"name":"LiquidateDisallowed","type":"error"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"LoanMarketIsListed","type":"error"},{"inputs":[],"name":"MarketExists","type":"error"},{"inputs":[],"name":"MarketIsPaused","type":"error"},{"inputs":[],"name":"MarketNotListed","type":"error"},{"inputs":[],"name":"MiddleLayerPaused","type":"error"},{"inputs":[],"name":"MsgDataExpected","type":"error"},{"inputs":[],"name":"NameExpected","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"who","type":"address"}],"name":"NotEnoughBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"name":"NotInMarket","type":"error"},{"inputs":[],"name":"NothingToWithdraw","type":"error"},{"inputs":[],"name":"OnlyAdmin","type":"error"},{"inputs":[],"name":"OnlyAuth","type":"error"},{"inputs":[],"name":"OnlyGateway","type":"error"},{"inputs":[],"name":"OnlyMasterState","type":"error"},{"inputs":[],"name":"OnlyMiddleLayer","type":"error"},{"inputs":[],"name":"OnlyMintAuth","type":"error"},{"inputs":[],"name":"OnlyRoute","type":"error"},{"inputs":[],"name":"OnlyRouter","type":"error"},{"inputs":[{"internalType":"address","name":"loanAsset","type":"address"},{"internalType":"address","name":"tradeAsset","type":"address"}],"name":"PairNotSupported","type":"error"},{"inputs":[],"name":"ParamOutOfBounds","type":"error"},{"inputs":[],"name":"Reentrancy","type":"error"},{"inputs":[{"internalType":"uint256","name":"repayAmount","type":"uint256"},{"internalType":"uint256","name":"maxAmount","type":"uint256"}],"name":"RepayTooMuch","type":"error"},{"inputs":[],"name":"RouteExists","type":"error"},{"inputs":[{"internalType":"address","name":"route","type":"address"}],"name":"RouteNotSupported","type":"error"},{"inputs":[],"name":"SeizeTooMuch","type":"error"},{"inputs":[],"name":"SymbolExpected","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"dest","type":"address"}],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"TransferPaused","type":"error"},{"inputs":[],"name":"UnexpectedDelta","type":"error"},{"inputs":[],"name":"UnexpectedValueDelta","type":"error"},{"inputs":[],"name":"UnknownRevert","type":"error"},{"inputs":[],"name":"WithdrawTooMuch","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"feed","type":"address"}],"name":"AssetFeedUpdated","type":"event"},{"inputs":[],"name":"RATIO_DECIMALS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"asset","type":"address"}],"name":"getAssetFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"getAssetPrice","outputs":[{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"overlyingAsset","type":"address"},{"internalType":"address","name":"underlyingAsset","type":"address"},{"internalType":"uint256","name":"underlyingChainId","type":"uint256"}],"name":"getAssetRatio","outputs":[{"internalType":"uint256","name":"ratio","type":"uint256"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"asset","type":"address"}],"name":"getPriceDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"feed","type":"address"}],"name":"setAssetFeed","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50600180546001600160a01b03191633179055610a21806100326000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a83622e01161005b578063a83622e0146100d9578063c8aea946146100f3578063eaa3d1ae1461011e578063f851a4401461013f57600080fd5b806318417130146100825780637263a89a146100b157806391bba016146100c6575b600080fd5b610095610090366004610744565b610152565b6040805192835260ff9091166020830152015b60405180910390f35b6100c46100bf366004610780565b6103ed565b005b6100956100d4366004610780565b610487565b6100e1601281565b60405160ff90911681526020016100a8565b6101066101013660046107bc565b6105c3565b6040516001600160a01b0390911681526020016100a8565b61013161012c3660046107bc565b6105ff565b6040519081526020016100a8565b600154610106906001600160a01b031681565b466000908152602081815260408083206001600160a01b0380881685529083528184205485855284845282852087831686529093529083205483928216911681158015906101a857506001600160a01b03811615155b156103e3576000826001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156101e857600080fd5b505afa1580156101fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102209190610802565b5050509150506000826001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561026157600080fd5b505afa158015610275573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102999190610802565b505050915050600082121580156102b1575060008112155b156103e057836001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ef57600080fd5b505afa158015610303573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103279190610852565b61033290600a610976565b816012856001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561036e57600080fd5b505afa158015610382573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a69190610852565b6103b09190610985565b6103bb90600a610976565b6103c590856109aa565b6103cf91906109c9565b6103d991906109c9565b9550601294505b50505b5050935093915050565b6001546001600160a01b0316331461041857604051634755657960e01b815260040160405180910390fd5b6000838152602081815260408083206001600160a01b038681168086529184529382902080546001600160a01b0319169486169485179055905186815290917fc709360c31221c0b6eec90fcfc36e335ea5ddfe4fb85722d70d0e54b12f66a32910160405180910390a3505050565b6000838152602081815260408083206001600160a01b038087168552925282205482911680156105b9576000816001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104ec57600080fd5b505afa158015610500573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105249190610802565b5050509150506000811215610541576000809350935050506105bb565b809350816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561057d57600080fd5b505afa158015610591573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b59190610852565b9250505b505b935093915050565b60006001600160a01b0382166105ec57604051635f3ee81760e01b815260040160405180910390fd5b6105f683836106d7565b90505b92915050565b60006001600160a01b03821661062857604051635f3ee81760e01b815260040160405180910390fd5b6000838152602081815260408083206001600160a01b0380871685529252909120541680156106cd57806001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561068a57600080fd5b505afa15801561069e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c29190610852565b60ff169150506105f9565b5060009392505050565b60006001600160a01b03821661070057604051635f3ee81760e01b815260040160405180910390fd5b506000918252602082815260408084206001600160a01b039384168552909152909120541690565b80356001600160a01b038116811461073f57600080fd5b919050565b60008060006060848603121561075957600080fd5b61076284610728565b925061077060208501610728565b9150604084013590509250925092565b60008060006060848603121561079557600080fd5b833592506107a560208501610728565b91506107b360408501610728565b90509250925092565b600080604083850312156107cf57600080fd5b823591506107df60208401610728565b90509250929050565b805169ffffffffffffffffffff8116811461073f57600080fd5b600080600080600060a0868803121561081a57600080fd5b610823866107e8565b9450602086015193506040860151925060608601519150610846608087016107e8565b90509295509295909350565b60006020828403121561086457600080fd5b815160ff8116811461087557600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156108cd5781600019048211156108b3576108b361087c565b808516156108c057918102915b93841c9390800290610897565b509250929050565b6000826108e4575060016105f9565b816108f1575060006105f9565b816001811461090757600281146109115761092d565b60019150506105f9565b60ff8411156109225761092261087c565b50506001821b6105f9565b5060208310610133831016604e8410600b8410161715610950575081810a6105f9565b61095a8383610892565b806000190482111561096e5761096e61087c565b029392505050565b60006105f660ff8416836108d5565b600060ff821660ff84168060ff038211156109a2576109a261087c565b019392505050565b60008160001904831182151516156109c4576109c461087c565b500290565b6000826109e657634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220d1380b240bd4ba76e2c1235c24732a04b3e2ae138900da43cc61ed5e40c501b164736f6c63430008090033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading