Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
UniETHOracle
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.4;
import {IOracle} from "../interfaces/IOracle.sol";
import {IRockXStaking} from "../interfaces/IRockXStaking.sol";
/**
* @title uniETH Oracle
*
* @notice Provides a uniETH:ETH rate for a button wrapper to use
*/
contract UniETHOracle is IOracle {
/// @dev The output price has a 18 decimal point precision.
uint256 public constant PRICE_DECIMALS = 18;
// The address of the source Bedrock contract to validate ETH staked
IRockXStaking public immutable rockXStaking;
constructor(IRockXStaking rockXStaking_) {
rockXStaking = rockXStaking_;
}
/**
* @notice Fetches the decimal precision used in the market price from RockXStaking contract
* @return priceDecimals_: Number of decimals in the price
*/
function priceDecimals() external pure override returns (uint256) {
return PRICE_DECIMALS;
}
/**
* @notice Fetches the latest uniETH:ETH exchange rate from uniETH contract.
* The returned value is specifically how much ETH is represented by 1e18 raw units of uniETH.
* @dev The returned value is considered to be always valid since it is derived directly from
* the source token.
* @return Value: Latest market price as an `priceDecimals` decimal fixed point number.
* valid: Boolean indicating an value was fetched successfully.
*/
function getData() external view override returns (uint256, bool) {
return (rockXStaking.exchangeRatio(), true);
}
}// SPDX-License-Identifier: GPL-3.0-or-later
interface IOracle {
function priceDecimals() external view returns (uint256);
function getData() external view returns (uint256, bool);
}// SPDX-License-Identifier: GPL-3.0
/// @dev https://github.com/Bedrock-Technology/stake/blob/main/src/contracts/rockx_staking.sol
interface IRockXStaking {
/**
* @dev Exchange Ratio of xETH to ETH, normally >= 1.0
* @dev return exchange ratio of , multiplied by 1e18
*/
function exchangeRatio() external view returns (uint256);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IRockXStaking","name":"rockXStaking_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"PRICE_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getData","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"rockXStaking","outputs":[{"internalType":"contract IRockXStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a060405234801561001057600080fd5b5060405161024b38038061024b83398101604081905261002f91610044565b60601b6001600160601b031916608052610072565b600060208284031215610055578081fd5b81516001600160a01b038116811461006b578182fd5b9392505050565b60805160601c6101b661009560003960008181606c015260d001526101b66000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806305300b28146100515780632e6063d8146100675780633bc5de30146100a6578063f1a640f8146100c3575b600080fd5b60125b6040519081526020015b60405180910390f35b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161005e565b6100ae6100cb565b6040805192835290151560208301520161005e565b610054601281565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634006ccc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561012757600080fd5b505afa15801561013b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015f9190610168565b92600192509050565b600060208284031215610179578081fd5b505191905056fea264697066735822122036ba50042a41f61c6138c7dbea5ac123c51d77e1b6848b01d81fb9b4e450d6e864736f6c634300080400330000000000000000000000004befa2aa9c305238aa3e0b5d17eb20c045269e9d
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806305300b28146100515780632e6063d8146100675780633bc5de30146100a6578063f1a640f8146100c3575b600080fd5b60125b6040519081526020015b60405180910390f35b61008e7f0000000000000000000000004befa2aa9c305238aa3e0b5d17eb20c045269e9d81565b6040516001600160a01b03909116815260200161005e565b6100ae6100cb565b6040805192835290151560208301520161005e565b610054601281565b6000807f0000000000000000000000004befa2aa9c305238aa3e0b5d17eb20c045269e9d6001600160a01b0316634006ccc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561012757600080fd5b505afa15801561013b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015f9190610168565b92600192509050565b600060208284031215610179578081fd5b505191905056fea264697066735822122036ba50042a41f61c6138c7dbea5ac123c51d77e1b6848b01d81fb9b4e450d6e864736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004befa2aa9c305238aa3e0b5d17eb20c045269e9d
-----Decoded View---------------
Arg [0] : rockXStaking_ (address): 0x4beFa2aA9c305238AA3E0b5D17eB20C045269E9d
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000004befa2aa9c305238aa3e0b5d17eb20c045269e9d
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
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.