ETH Price: $3,310.14 (-3.20%)
Gas: 14 Gwei

Contract

0x0890E86F880ED85cf821A448e707D47715Dd4378
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Expiry Price...199384292024-05-24 8:03:5940 days ago1716537839IN
0x0890E86F...715Dd4378
0 ETH0.0011437211
Set Expiry Price...198883802024-05-17 8:03:4747 days ago1715933027IN
0x0890E86F...715Dd4378
0 ETH0.0012478412
Set Expiry Price...198383182024-05-10 8:03:3554 days ago1715328215IN
0x0890E86F...715Dd4378
0 ETH0.000623856
Set Expiry Price...197882752024-05-03 8:03:4761 days ago1714723427IN
0x0890E86F...715Dd4378
0 ETH0.000831898
Set Expiry Price...197382242024-04-26 8:03:4768 days ago1714118627IN
0x0890E86F...715Dd4378
0 ETH0.000935779
Set Expiry Price...196881992024-04-19 8:09:1175 days ago1713514151IN
0x0890E86F...715Dd4378
0 ETH0.0013518313
Set Expiry Price...196382112024-04-12 8:03:4782 days ago1712909027IN
0x0890E86F...715Dd4378
0 ETH0.0021834721
Set Expiry Price...195882302024-04-05 8:03:4789 days ago1712304227IN
0x0890E86F...715Dd4378
0 ETH0.0028076427
Set Expiry Price...195383532024-03-29 8:03:4796 days ago1711699427IN
0x0890E86F...715Dd4378
0 ETH0.002911328
Set Expiry Price...194888532024-03-22 8:03:59103 days ago1711094639IN
0x0890E86F...715Dd4378
0 ETH0.0025996725
Set Expiry Price...194390322024-03-15 8:03:59110 days ago1710489839IN
0x0890E86F...715Dd4378
0 ETH0.0040545539
Set Expiry Price...193891342024-03-08 8:03:47117 days ago1709885027IN
0x0890E86F...715Dd4378
0 ETH0.0064471962
Set Expiry Price...193390102024-03-01 8:03:47124 days ago1709280227IN
0x0890E86F...715Dd4378
0 ETH0.0051987550
Set Expiry Price...192889782024-02-23 8:03:47131 days ago1708675427IN
0x0890E86F...715Dd4378
0 ETH0.0074870672
Set Expiry Price...192391582024-02-16 8:04:23138 days ago1708070663IN
0x0890E86F...715Dd4378
0 ETH0.002495424
Set Expiry Price...191892622024-02-09 8:03:47145 days ago1707465827IN
0x0890E86F...715Dd4378
0 ETH0.0051993550
Set Expiry Price...191394052024-02-02 8:03:47152 days ago1706861027IN
0x0890E86F...715Dd4378
0 ETH0.002495424
Set Expiry Price...190894682024-01-26 8:03:47159 days ago1706256227IN
0x0890E86F...715Dd4378
0 ETH0.0021834721
Set Expiry Price...190395942024-01-19 8:04:47166 days ago1705651487IN
0x0890E86F...715Dd4378
0 ETH0.0023914223
Set Expiry Price...189895082024-01-12 8:04:47173 days ago1705046687IN
0x0890E86F...715Dd4378
0 ETH0.0017677717
Set Expiry Price...189397942024-01-05 8:08:11180 days ago1704442091IN
0x0890E86F...715Dd4378
0 ETH0.001663616
Set Expiry Price...188899362023-12-29 8:04:47187 days ago1703837087IN
0x0890E86F...715Dd4378
0 ETH0.0045754244
Set Expiry Price...188400802023-12-22 8:04:47194 days ago1703232287IN
0x0890E86F...715Dd4378
0 ETH0.0038470737
Set Expiry Price...187902352023-12-15 8:09:47201 days ago1702627787IN
0x0890E86F...715Dd4378
0 ETH0.0076950374
Set Expiry Price...187402312023-12-08 8:04:47208 days ago1702022687IN
0x0890E86F...715Dd4378
0 ETH0.00415940
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x2d483f9a...E3Ec06F8c
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
ChainLinkPricer

Compiler Version
v0.6.10+commit.00c0fcaf

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 5 : ChainlinkPricer.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.10;

import {AggregatorInterface} from "../interfaces/AggregatorInterface.sol";
import {OracleInterface} from "../interfaces/OracleInterface.sol";
import {OpynPricerInterface} from "../interfaces/OpynPricerInterface.sol";
import {SafeMath} from "../packages/oz/SafeMath.sol";

/**
 * @notice A Pricer contract for one asset as reported by Chainlink
 */
contract ChainLinkPricer is OpynPricerInterface {
    using SafeMath for uint256;

    /// @dev base decimals
    uint256 internal constant BASE = 8;

    /// @notice chainlink response decimals
    uint256 public aggregatorDecimals;

    /// @notice the opyn oracle address
    OracleInterface public oracle;
    /// @notice the aggregator for an asset
    AggregatorInterface public aggregator;

    /// @notice asset that this pricer will a get price for
    address public asset;
    /// @notice bot address that is allowed to call setExpiryPriceInOracle
    address public bot;

    /**
     * @param _bot priveleged address that can call setExpiryPriceInOracle
     * @param _asset asset that this pricer will get a price for
     * @param _aggregator Chainlink aggregator contract for the asset
     * @param _oracle Opyn Oracle address
     */
    constructor(
        address _bot,
        address _asset,
        address _aggregator,
        address _oracle
    ) public {
        require(_bot != address(0), "ChainLinkPricer: Cannot set 0 address as bot");
        require(_oracle != address(0), "ChainLinkPricer: Cannot set 0 address as oracle");
        require(_aggregator != address(0), "ChainLinkPricer: Cannot set 0 address as aggregator");

        bot = _bot;
        oracle = OracleInterface(_oracle);
        aggregator = AggregatorInterface(_aggregator);
        asset = _asset;

        aggregatorDecimals = uint256(aggregator.decimals());
    }

    /**
     * @notice set the expiry price in the oracle, can only be called by Bot address
     * @dev a roundId must be provided to confirm price validity, which is the first Chainlink price provided after the expiryTimestamp
     * @param _expiryTimestamp expiry to set a price for
     * @param _roundId the first roundId after expiryTimestamp
     */
    function setExpiryPriceInOracle(uint256 _expiryTimestamp, uint80 _roundId) external {
        (, int256 price, , uint256 roundTimestamp, ) = aggregator.getRoundData(_roundId);

        require(_expiryTimestamp <= roundTimestamp, "ChainLinkPricer: roundId not first after expiry");
        require(price >= 0, "ChainLinkPricer: invalid price");

        if (msg.sender != bot) {
            bool isCorrectRoundId;
            uint80 previousRoundId = uint80(uint256(_roundId).sub(1));

            while (!isCorrectRoundId) {
                (, , , uint256 previousRoundTimestamp, ) = aggregator.getRoundData(previousRoundId);

                if (previousRoundTimestamp == 0) {
                    require(previousRoundId > 0, "ChainLinkPricer: Invalid previousRoundId");
                    previousRoundId = previousRoundId - 1;
                } else if (previousRoundTimestamp > _expiryTimestamp) {
                    revert("ChainLinkPricer: previousRoundId not last before expiry");
                } else {
                    isCorrectRoundId = true;
                }
            }
        }

        oracle.setExpiryPrice(asset, _expiryTimestamp, uint256(price));
    }

    /**
     * @notice get the live price for the asset
     * @dev overides the getPrice function in OpynPricerInterface
     * @return price of the asset in USD, scaled by 1e8
     */
    function getPrice() external view override returns (uint256) {
        (, int256 answer, , , ) = aggregator.latestRoundData();
        require(answer > 0, "ChainLinkPricer: price is lower than 0");
        // chainlink's answer is already 1e8
        return _scaleToBase(uint256(answer));
    }

    /**
     * @notice get historical chainlink price
     * @param _roundId chainlink round id
     * @return round price and timestamp
     */
    function getHistoricalPrice(uint80 _roundId) external view override returns (uint256, uint256) {
        (, int256 price, , uint256 roundTimestamp, ) = aggregator.getRoundData(_roundId);
        return (_scaleToBase(uint256(price)), roundTimestamp);
    }

    /**
     * @notice scale aggregator response to base decimals (1e8)
     * @param _price aggregator price
     * @return price scaled to 1e8
     */
    function _scaleToBase(uint256 _price) internal view returns (uint256) {
        if (aggregatorDecimals > BASE) {
            uint256 exp = aggregatorDecimals.sub(BASE);
            _price = _price.div(10**exp);
        } else if (aggregatorDecimals < BASE) {
            uint256 exp = BASE.sub(aggregatorDecimals);
            _price = _price.mul(10**exp);
        }

        return _price;
    }
}

File 2 of 5 : AggregatorInterface.sol
/**
 * SPDX-License-Identifier: UNLICENSED
 */
pragma solidity 0.6.10;

/**
 * @dev Interface of the Chainlink aggregator
 */
interface AggregatorInterface {
    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 3 of 5 : OpynPricerInterface.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.10;

interface OpynPricerInterface {
    function getPrice() external view returns (uint256);

    function getHistoricalPrice(uint80 _roundId) external view returns (uint256, uint256);
}

File 4 of 5 : OracleInterface.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.6.10;

interface OracleInterface {
    function isLockingPeriodOver(address _asset, uint256 _expiryTimestamp) external view returns (bool);

    function isDisputePeriodOver(address _asset, uint256 _expiryTimestamp) external view returns (bool);

    function getExpiryPrice(address _asset, uint256 _expiryTimestamp) external view returns (uint256, bool);

    function getDisputer() external view returns (address);

    function getPricer(address _asset) external view returns (address);

    function getPrice(address _asset) external view returns (uint256);

    function getPricerLockingPeriod(address _pricer) external view returns (uint256);

    function getPricerDisputePeriod(address _pricer) external view returns (uint256);

    function getChainlinkRoundData(address _asset, uint80 _roundId) external view returns (uint256, uint256);

    // Non-view function

    function setAssetPricer(address _asset, address _pricer) external;

    function setLockingPeriod(address _pricer, uint256 _lockingPeriod) external;

    function setDisputePeriod(address _pricer, uint256 _disputePeriod) external;

    function setExpiryPrice(
        address _asset,
        uint256 _expiryTimestamp,
        uint256 _price
    ) external;

    function disputeExpiryPrice(
        address _asset,
        uint256 _expiryTimestamp,
        uint256 _price
    ) external;

    function setDisputer(address _disputer) external;
}

File 5 of 5 : SafeMath.sol
// SPDX-License-Identifier: MIT
// openzeppelin-contracts v3.1.0

/* solhint-disable */
pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_bot","type":"address"},{"internalType":"address","name":"_asset","type":"address"},{"internalType":"address","name":"_aggregator","type":"address"},{"internalType":"address","name":"_oracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"aggregator","outputs":[{"internalType":"contract AggregatorInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aggregatorDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getHistoricalPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract OracleInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expiryTimestamp","type":"uint256"},{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"setExpiryPriceInOracle","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100885760003560e01c80637dc0d1d01161005b5780637dc0d1d0146100db57806398d5fdca146100e3578063b2b63d9f146100eb578063eec377c01461011957610088565b806310814c371461008d578063245a7bfc146100b157806331b46c8b146100b957806338d52e0f146100d3575b600080fd5b610095610158565b604080516001600160a01b039092168252519081900360200190f35b610095610167565b6100c1610176565b60408051918252519081900360200190f35b61009561017c565b61009561018b565b6100c161019a565b6101176004803603604081101561010157600080fd5b50803590602001356001600160501b031661026a565b005b61013f6004803603602081101561012f57600080fd5b50356001600160501b0316610571565b6040805192835260208301919091528051918290030190f35b6004546001600160a01b031681565b6002546001600160a01b031681565b60005481565b6003546001600160a01b031681565b6001546001600160a01b031681565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156101eb57600080fd5b505afa1580156101ff573d6000803e3d6000fd5b505050506040513d60a081101561021557600080fd5b506020015190506000811361025b5760405162461bcd60e51b815260040180806020018281038252602681526020018061087b6026913960400191505060405180910390fd5b61026481610619565b91505090565b60025460408051639a6fc8f560e01b81526001600160501b0384166004820152905160009283926001600160a01b0390911691639a6fc8f59160248082019260a092909190829003018186803b1580156102c357600080fd5b505afa1580156102d7573d6000803e3d6000fd5b505050506040513d60a08110156102ed57600080fd5b50602081015160609091015190925090508084111561033d5760405162461bcd60e51b815260040180806020018281038252602f8152602001806108c2602f913960400191505060405180910390fd5b6000821215610393576040805162461bcd60e51b815260206004820152601e60248201527f436861696e4c696e6b5072696365723a20696e76616c69642070726963650000604482015290519081900360640190fd5b6004546001600160a01b031633146104f4576000806103c26001600160501b038616600163ffffffff61069816565b90505b816104f15760025460408051639a6fc8f560e01b81526001600160501b038416600482015290516000926001600160a01b031691639a6fc8f59160248083019260a0929190829003018186803b15801561041e57600080fd5b505afa158015610432573d6000803e3d6000fd5b505050506040513d60a081101561044857600080fd5b50606001519050806104a7576000826001600160501b03161161049c5760405162461bcd60e51b81526004018080602001828103825260288152602001806109286028913960400191505060405180910390fd5b6001820391506104eb565b868111156104e65760405162461bcd60e51b81526004018080602001828103825260378152602001806108f16037913960400191505060405180910390fd5b600192505b506103c5565b50505b6001546003546040805163ee53140960e01b81526001600160a01b03928316600482015260248101889052604481018690529051919092169163ee53140991606480830192600092919082900301818387803b15801561055357600080fd5b505af1158015610567573d6000803e3d6000fd5b5050505050505050565b60025460408051639a6fc8f560e01b81526001600160501b038416600482015290516000928392839283926001600160a01b031691639a6fc8f59160248083019260a0929190829003018186803b1580156105cb57600080fd5b505afa1580156105df573d6000803e3d6000fd5b505050506040513d60a08110156105f557600080fd5b506020810151606090910151909250905061060f82610619565b9350915050915091565b600060086000541115610659576000805461063b90600863ffffffff61069816565b905061065183600a83900a63ffffffff6106e316565b925050610694565b60086000541015610694576000805461067a9060089063ffffffff61069816565b905061069083600a83900a63ffffffff61072516565b9250505b5090565b60006106da83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061077e565b90505b92915050565b60006106da83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610815565b600082610734575060006106dd565b8282028284828161074157fe5b04146106da5760405162461bcd60e51b81526004018080602001828103825260218152602001806108a16021913960400191505060405180910390fd5b6000818484111561080d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156107d25781810151838201526020016107ba565b50505050905090810190601f1680156107ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836108645760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156107d25781810151838201526020016107ba565b50600083858161087057fe5b049594505050505056fe436861696e4c696e6b5072696365723a207072696365206973206c6f776572207468616e2030536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77436861696e4c696e6b5072696365723a20726f756e644964206e6f7420666972737420616674657220657870697279436861696e4c696e6b5072696365723a2070726576696f7573526f756e644964206e6f74206c617374206265666f726520657870697279436861696e4c696e6b5072696365723a20496e76616c69642070726576696f7573526f756e644964a264697066735822122050969ffa0a7a4c49320fabf746883e45d4e2e866a3977ba6022c2e49c358c2c364736f6c634300060a0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.