Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
OETHFixedOracle
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { OETHOracleRouter } from "./OETHOracleRouter.sol";// @notice Oracle Router that returns 1e18 for all prices// used solely for deployment to testnetscontract OETHFixedOracle is OETHOracleRouter {constructor(address _auraPriceFeed) OETHOracleRouter(_auraPriceFeed) {}/*** @dev The price feed contract to use for a particular asset along with* maximum data staleness* @param asset address of the asset* @return feedAddress address of the price feed for the asset* @return maxStaleness maximum acceptable data staleness duration*/// solhint-disable-next-line no-unused-varsfunction feedMetadata(address asset)internalviewvirtualoverridereturns (address feedAddress, uint256 maxStaleness)
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol)pragma solidity ^0.8.0;/*** @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow* checks.** Downcasting from uint256/int256 in Solidity does not revert on overflow. This can* easily result in undesired exploitation or bugs, since developers usually* assume that overflows raise errors. `SafeCast` restores this intuition by* reverting the transaction when such 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.** Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing* all math on `uint256` and `int256` and then downcasting.*/library SafeCast {/*** @dev Returns the downcasted uint224 from uint256, reverting on* overflow (when the input is greater than largest uint224).** Counterpart to Solidity's `uint224` operator.
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MIT// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)pragma solidity ^0.8.0;// CAUTION// This version of SafeMath should only be used with Solidity 0.8 or later,// because it relies on the compiler's built in overflow checks./*** @dev Wrappers over Solidity's arithmetic operations.** NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler* now has built in overflow checking.*/library SafeMath {/*** @dev Returns the addition of two unsigned integers, with an overflow flag.** _Available since v3.4._*/function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {unchecked {uint256 c = a + b;if (c < a) return (false, 0);return (true, c);
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma 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)externalviewreturns (uint80 roundId,int256 answer,uint256 startedAt,uint256 updatedAt,uint80 answeredInRound);function latestRoundData()external
12345678// SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface IBasicToken {function symbol() external view returns (string memory);function decimals() external view returns (uint8);}
1234567891011// SPDX-License-Identifier: MITpragma solidity ^0.8.0;interface IOracle {/*** @dev returns the asset price in USD, in 8 decimal digits.** The version of priceProvider deployed for OETH has 18 decimal digits*/function price(address asset) external view returns (uint256);}
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import "../interfaces/chainlink/AggregatorV3Interface.sol";import { IOracle } from "../interfaces/IOracle.sol";import { Helpers } from "../utils/Helpers.sol";import { StableMath } from "../utils/StableMath.sol";import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";// @notice Abstract functionality that is shared between various Oracle Routersabstract contract AbstractOracleRouter is IOracle {using StableMath for uint256;using SafeCast for int256;uint256 internal constant MIN_DRIFT = 0.7e18;uint256 internal constant MAX_DRIFT = 1.3e18;address internal constant FIXED_PRICE =0x0000000000000000000000000000000000000001;// Maximum allowed staleness buffer above normal Oracle maximum stalenessuint256 internal constant STALENESS_BUFFER = 1 days;mapping(address => uint8) internal decimalsCache;/*** @dev The price feed contract to use for a particular asset along with* maximum data staleness* @param asset address of the asset
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import "../interfaces/chainlink/AggregatorV3Interface.sol";import { AbstractOracleRouter } from "./AbstractOracleRouter.sol";import { StableMath } from "../utils/StableMath.sol";// @notice Oracle Router that denominates all prices in ETHcontract OETHOracleRouter is AbstractOracleRouter {using StableMath for uint256;address public immutable auraPriceFeed;constructor(address _auraPriceFeed) {auraPriceFeed = _auraPriceFeed;}/*** @notice Returns the total price in 18 digit units for a given asset.* This implementation does not (!) do range checks as the* parent OracleRouter does.* @param asset address of the asset* @return uint256 unit price for 1 asset unit, in 18 decimal fixed*/function price(address asset)external
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { IBasicToken } from "../interfaces/IBasicToken.sol";library Helpers {/*** @notice Fetch the `symbol()` from an ERC20 token* @dev Grabs the `symbol()` from a contract* @param _token Address of the ERC20 token* @return string Symbol of the ERC20 token*/function getSymbol(address _token) internal view returns (string memory) {string memory symbol = IBasicToken(_token).symbol();return symbol;}/*** @notice Fetch the `decimals()` from an ERC20 token* @dev Grabs the `decimals()` from a contract and fails if* the decimal value does not live within a certain range* @param _token Address of the ERC20 token* @return uint256 Decimals of the ERC20 token*/function getDecimals(address _token) internal view returns (uint256) {uint256 decimals = IBasicToken(_token).decimals();
1234567891011121314151617181920212223242526// SPDX-License-Identifier: MITpragma solidity ^0.8.0;import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol";// Based on StableMath from Stability Labs Pty. Ltd.// https://github.com/mstable/mStable-contracts/blob/master/contracts/shared/StableMath.sollibrary StableMath {using SafeMath for uint256;/*** @dev Scaling unit for use in specific calculations,* where 1 * 10**18, or 1e18 represents a unit '1'*/uint256 private constant FULL_SCALE = 1e18;/***************************************Helpers****************************************//*** @dev Adjust the scale of an integer* @param to Decimals to scale to* @param from Decimals to scale from*/
1234567891011121314151617181920212223{"optimizer": {"enabled": true,"runs": 200},"evmVersion": "paris","outputSelection": {"*": {"*": ["evm.bytecode","evm.deployedBytecode","devdoc","userdoc","metadata","abi"]}},"metadata": {"useLiteralContent": true},"libraries": {}}
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_auraPriceFeed","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"auraPriceFeed","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"cacheDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60a0604052348015600f57600080fd5b50604051610338380380610338833981016040819052602c91603c565b6001600160a01b0316608052606a565b600060208284031215604d57600080fd5b81516001600160a01b0381168114606357600080fd5b9392505050565b6080516102b46100846000396000604b01526102b46000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806323e2c52f1461004657806336b6d9441461008a578063aea91078146100af575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61009d6100983660046101dd565b6100d8565b60405160ff9091168152602001610081565b6100ca6100bd3660046101dd565b50670de0b6b3a764000090565b604051908152602001610081565b600060016100ea565b60405180910390fd5b6000196001600160a01b038216016101445760405162461bcd60e51b815260206004820152601f60248201527f4669786564207072696365206665656473206e6f7420737570706f727465640060448201526064016100e1565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a89190610206565b6001600160a01b03929092166000908152602081905260409020805460ff191660ff84161790555092915050565b9392505050565b6000602082840312156101ef57600080fd5b81356001600160a01b03811681146101d657600080fd5b60006020828403121561021857600080fd5b815160ff811681146101d657600080fd5b634e487b7160e01b600052601160045260246000fd5b60018411156102765780850481111561025a5761025a610229565b600184161561026857908102905b60019390931c92800261023f565b93509391505056fea264697066735822122097ee5016cae6845084a3a415a1c49ce34616ceb1fd9a8332a6e17bcbbfae693d64736f6c634300081c00330000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806323e2c52f1461004657806336b6d9441461008a578063aea91078146100af575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b61009d6100983660046101dd565b6100d8565b60405160ff9091168152602001610081565b6100ca6100bd3660046101dd565b50670de0b6b3a764000090565b604051908152602001610081565b600060016100ea565b60405180910390fd5b6000196001600160a01b038216016101445760405162461bcd60e51b815260206004820152601f60248201527f4669786564207072696365206665656473206e6f7420737570706f727465640060448201526064016100e1565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610184573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a89190610206565b6001600160a01b03929092166000908152602081905260409020805460ff191660ff84161790555092915050565b9392505050565b6000602082840312156101ef57600080fd5b81356001600160a01b03811681146101d657600080fd5b60006020828403121561021857600080fd5b815160ff811681146101d657600080fd5b634e487b7160e01b600052601160045260246000fd5b60018411156102765780850481111561025a5761025a610229565b600184161561026857908102905b60019390931c92800261023f565b93509391505056fea264697066735822122097ee5016cae6845084a3a415a1c49ce34616ceb1fd9a8332a6e17bcbbfae693d64736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _auraPriceFeed (address): 0x0000000000000000000000000000000000000000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
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.