Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x600f888a50c66bC39Ac83523EBdbba20Da984173
Balance 0 ETH
Nonce 1
Code Size 1731 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1731 bytes
0x608080604052600436101561001357600080fd5b60003560e01c90816304ad597c146106515750806314bcec9f1461062d578063313ce5671461061157806354fd4d50146105f5578063558a729714610576578063715018a6146105115780637284e4161461045457806379ba5097146103cb5780638578005d1461029c5780638da5cb5b146102735780639a6fc8f514610238578063e30c39781461020f578063f2fde38b1461019b5763feaf968c146100b957600080fd5b34610196576000366003190112610196576001600160501b03600654168060005260056020526040600020906100ed610682565b825481526001830154926020820193845260028101546001600160501b036003604085019383855201541690606084019182521561015f579151935190519151604080516001600160501b0395861681526020810196909652850191909152606084019190915216608082015260a090f35b60405162461bcd60e51b815260206004820152600f60248201526e139bc819185d18481c1c995cd95b9d608a1b6044820152606490fd5b600080fd5b34610196576020366003190112610196576101b461066c565b6101bc6106a2565b60018060a01b0316806bffffffffffffffffffffffff60a01b600154161760015560018060a01b03600054167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700600080a3005b34610196576000366003190112610196576001546040516001600160a01b039091168152602090f35b34610196576020366003190112610196576004356001600160501b0381168082036101965760005260056020526040600020906100ed610682565b34610196576000366003190112610196576000546040516001600160a01b039091168152602090f35b346101965760203660031901126101965760043533600052600460205260ff60406000205416156103ba578060025563ffffffff421663ffffffff1960035416176003556006549060016001600160501b038316016001600160501b0381116103a4576001600160501b0391826003921680948419161760065561031e610682565b90815260208101428152604082019042825260608301958087526000526005602052604060002092518355516001830155516002820155019151166001600160501b03198254161790557f6a246b026a5fd48b881abb3342cc8ad598c6a9760423a445b2b73cf8d3537879604060025463ffffffff6003541682519182526020820152a1005b634e487b7160e01b600052601160045260246000fd5b631decfebb60e31b60005260046000fd5b3461019657600036600319011261019657600154336001600160a01b039091160361043f57600180546001600160a01b03199081169091556000805433928116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3005b63118cdaa760e01b6000523360045260246000fd5b34610196576000366003190112610196576040516040810181811067ffffffffffffffff8211176104fb57604052601781527f4165676973204f7261636c652059555344202f20555344000000000000000000602082015260405190602082528181519182602083015260005b8381106104e35750508160006040809484010152601f80199101168101030190f35b602082820181015160408784010152859350016104c1565b634e487b7160e01b600052604160045260246000fd5b346101965760003660031901126101965761052a6106a2565b600180546001600160a01b0319908116909155600080549182168155906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101965760403660031901126101965761058f61066c565b602435908115158092036101965760207f1618a22a3b00b9ac70fd5a82f1f5cdd8cb272bd0f1b740ddf7c26ab05881dd5b916105c96106a2565b60018060a01b0316928360005260048252604060002060ff1981541660ff8316179055604051908152a2005b3461019657600036600319011261019657602060405160018152f35b3461019657600036600319011261019657602060405160088152f35b3461019657600036600319011261019657602063ffffffff60035416604051908152f35b34610196576000366003190112610196576020906002548152f35b600435906001600160a01b038216820361019657565b604051906080820182811067ffffffffffffffff8211176104fb57604052565b6000546001600160a01b0316330361043f5756fea164736f6c634300081a000a

Verified Source Code Partial Match

Compiler: v0.8.26+commit.8a97fa7a EVM: paris Optimization: Yes (200 runs)
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
Ownable2Step.sol 59 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

    event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Returns the address of the pending owner.
     */
    function pendingOwner() public view virtual returns (address) {
        return _pendingOwner;
    }

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
AegisChainlinkOracleV3.sol 135 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/AggregatorV3Interface.sol";

contract AegisChainlinkOracleV3 is Ownable2Step, AggregatorV3Interface {
  struct YUSDUSDPriceData {
    int256 price;
    uint32 timestamp;
  }

  YUSDUSDPriceData private _priceData;

  mapping(address => bool) private _operators;

  struct RoundData {
    int256 answer;
    uint256 startedAt;
    uint256 updatedAt;
    uint80 answeredInRound;
  }

  mapping(uint80 => RoundData) private _rounds;
  uint80 private _latestRoundId;

  event UpdateYUSDPrice(int256 price, uint32 timestamp);
  event SetOperator(address indexed operator, bool allowed);

  error ZeroAddress();
  error AccessForbidden();

  modifier onlyOperator() {
    if (!_operators[_msgSender()]) {
      revert AccessForbidden();
    }
    _;
  }

  constructor(address[] memory _ops, address _initialOwner) Ownable(_initialOwner) {
    if (_initialOwner == address(0)) revert ZeroAddress();

    for (uint256 i = 0; i < _ops.length; i++) {
      _setOperator(_ops[i], true);
    }
  }

  function decimals() public pure override returns (uint8) {
    return 8;
  }

  function description() external pure override returns (string memory) {
    return "Aegis Oracle YUSD / USD";
  }

  function version() external pure override returns (uint256) {
    return 1;
  }

  /// @dev Returns current YUSD/USD price
  function yusdUSDPrice() public view returns (int256) {
    return _priceData.price;
  }

  /// @dev Returns timestamp of last price update
  function lastUpdateTimestamp() public view returns (uint32) {
    return _priceData.timestamp;
  }

  /**
   * @dev Updates YUSD/USD price.
   * @dev Price should have 8 decimals
   */
  function updateYUSDPrice(int256 price) external onlyOperator {
    _priceData.price = price;
    _priceData.timestamp = uint32(block.timestamp);

    // update aggregator round data
    uint80 newRoundId = _latestRoundId + 1;
    _latestRoundId = newRoundId;
    _rounds[newRoundId] = RoundData({
      answer: price,
      startedAt: block.timestamp,
      updatedAt: block.timestamp,
      answeredInRound: newRoundId
    });
    emit UpdateYUSDPrice(_priceData.price, _priceData.timestamp);
  }

  function getRoundData(uint80 _roundId)
    external
    view
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    RoundData memory r = _rounds[_roundId];
    if (r.updatedAt == 0) revert("No data present");
    return (_roundId, r.answer, r.startedAt, r.updatedAt, r.answeredInRound);
  }

  function latestRoundData()
    external
    view
    override
    returns (
      uint80 roundId,
      int256 answer,
      uint256 startedAt,
      uint256 updatedAt,
      uint80 answeredInRound
    )
  {
    uint80 id = _latestRoundId;
    RoundData memory r = _rounds[id];
    if (r.updatedAt == 0) revert("No data present");
    return (id, r.answer, r.startedAt, r.updatedAt, r.answeredInRound);
  }

  /// @dev Adds/removes operator
  function setOperator(address operator, bool allowed) external onlyOwner {
    _setOperator(operator, allowed);
  }

  function _setOperator(address operator, bool allowed) internal {
    _operators[operator] = allowed;
    emit SetOperator(operator, allowed);
  }
}
AggregatorV3Interface.sol 54 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title AggregatorV3Interface
/// @notice Interface for accessing detailed data from an aggregator contract, including round data and metadata.
/// @dev Provides methods to get the latest data, historical data for specific rounds, and metadata such as decimals and description.
interface AggregatorV3Interface {
    /**
     * @notice Gets the number of decimals used by the aggregator.
     * @return uint8 - The number of decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @notice Gets the description of the aggregator.
     * @return string memory - The description of the aggregator.
     */
    function description() external view returns (string memory);

    /**
     * @notice Gets the version of the aggregator.
     * @return uint256 - The version of the aggregator.
     */
    function version() external view returns (uint256);

    /**
     * @notice Gets the round data for a specific round ID.
     * @param _roundId - The round ID to get the data for.
     * @return roundId - The round ID.
     * @return answer - The answer for the round.
     * @return startedAt - The timestamp when the round started.
     * @return updatedAt - The timestamp when the round was updated.
     * @return answeredInRound - The round ID in which the answer was computed.
     * @dev This function should raise "No data present" if no data is available for the given round ID.
     */
    function getRoundData(uint80 _roundId)
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    /**
     * @notice Gets the latest round data.
     * @return roundId - The latest round ID.
     * @return answer - The latest answer.
     * @return startedAt - The timestamp when the latest round started.
     * @return updatedAt - The timestamp when the latest round was updated.
     * @return answeredInRound - The round ID in which the latest answer was computed.
     * @dev This function should raise "No data present" if no data is available.
     */
    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}

Read Contract

decimals 0x313ce567 → uint8
description 0x7284e416 → string
getRoundData 0x9a6fc8f5 → uint80, int256, uint256, uint256, uint80
lastUpdateTimestamp 0x14bcec9f → uint32
latestRoundData 0xfeaf968c → uint80, int256, uint256, uint256, uint80
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
version 0x54fd4d50 → uint256
yusdUSDPrice 0x04ad597c → int256

Write Contract 5 functions

These functions modify contract state and require a wallet transaction to execute.

acceptOwnership 0x79ba5097
No parameters
renounceOwnership 0x715018a6
No parameters
setOperator 0x558a7297
address operator
bool allowed
transferOwnership 0xf2fde38b
address newOwner
updateYUSDPrice 0x8578005d
int256 price

Recent Transactions

No transactions found for this address