Contract
0x6cb7d5bd21664e0201347bd93d66ce18bc48a807
1
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x5207f95fded4498e88a9448a675d3cd020dbabaa4e789a3bdb6fad3ab331f714 | 0x60806040 | 4844428 | 608 days 4 hrs ago | 0xde485812e28824e542b9c2270b6b8ed9232b7d0b | IN | Create: GohmPriceOracle | 0 ETH | 0.005628263054 ETH |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
GohmPriceOracle
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface IChainlinkV3Aggregator { function decimals() external view returns (uint8); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; // Interfaces import {IChainlinkV3Aggregator} from '../external/interfaces/IChainlinkV3Aggregator.sol'; contract GohmPriceOracle { /*==== PUBLIC VARS ====*/ address public constant OHMv2_CHAINLINK_AGGREGATOR = 0x761aaeBf021F19F198D325D7979965D0c7C9e53b; address public constant OHM_INDEX_CHAINLINK_AGGREGATOR = 0x48C4721354A3B29D80EF03C65E6644A37338a0B1; /*==== VIEWS ====*/ /// @notice Gets the price of gOHM in USD /// @return price of gOHM in USD in 1e8 precision function getPriceInUSD() external view returns (uint256) { return (getOHMv2PriceInUSD() * getOHMIndex()) / 1e9; } /// @notice Gets the price of OHM (v2) in USD /// @return the price of OHM (v2) in USD in 1e8 precision function getOHMv2PriceInUSD() public view returns (uint256) { (, int256 price, , , ) = IChainlinkV3Aggregator( OHMv2_CHAINLINK_AGGREGATOR ).latestRoundData(); return uint256(price); } /// @notice Gets the current index of OHM /// @return the current index of OHM in 1e9 precision function getOHMIndex() public view returns (uint256) { (, int256 index, , , ) = IChainlinkV3Aggregator( OHM_INDEX_CHAINLINK_AGGREGATOR ).latestRoundData(); return uint256(index); } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"inputs":[],"name":"OHM_INDEX_CHAINLINK_AGGREGATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OHMv2_CHAINLINK_AGGREGATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOHMIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOHMv2PriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceInUSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506102dc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630bb32b021461005c5780635b3eb0d9146100775780639baa6040146100aa578063d6d7551d146100c5578063e1aa6036146100cd575b600080fd5b6100646100d5565b6040519081526020015b60405180910390f35b6100927348c4721354a3b29d80ef03c65e6644a37338a0b181565b6040516001600160a01b03909116815260200161006e565b61009273761aaebf021f19f198d325d7979965d0c7c9e53b81565b610064610168565b6100646101b8565b60008073761aaebf021f19f198d325d7979965d0c7c9e53b6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561012557600080fd5b505afa158015610139573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061015d9190610207565b509195945050505050565b6000807348c4721354a3b29d80ef03c65e6644a37338a0b16001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561012557600080fd5b6000633b9aca006101c7610168565b6101cf6100d5565b6101d99190610257565b6101e39190610284565b905090565b805169ffffffffffffffffffff8116811461020257600080fd5b919050565b600080600080600060a0868803121561021f57600080fd5b610228866101e8565b945060208601519350604086015192506060860151915061024b608087016101e8565b90509295509295909350565b600081600019048311821515161561027f57634e487b7160e01b600052601160045260246000fd5b500290565b6000826102a157634e487b7160e01b600052601260045260246000fd5b50049056fea264697066735822122068a56b5bb018a31e9ca00934ffd480ffb502491c94d2e94e519ae5712ff1ed2a64736f6c63430008090033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.