Source Code
Overview
HYPE Balance
HYPE Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
UnvalidatedChainlinkAdapter
Compiler Version
v0.8.27+commit.40a35a09
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
import {AggregatorV3Interface} from "../../../interfaces/AggregatorV3Interface.sol";
import {BaseChainlinkAdapter} from "./BaseChainlinkAdapter.sol";
/// @title ChainlinkAdapter Contract
/// @author Prime
contract UnvalidatedChainlinkAdapter is BaseChainlinkAdapter {
constructor(address _chainlinkFeed, uint256 _heartbeat) BaseChainlinkAdapter(_chainlinkFeed, _heartbeat) {}
/**
* @notice Returns USD price in quote token.
* @dev supports 18 decimal token
* @return price of token in decimal 8
*/
function latestAnswer() external view override returns (uint256 price) {
(, int256 answer, , , ) = chainlinkFeed.latestRoundData();
return uint256(answer);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
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
)
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);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;
import {AggregatorV3Interface} from "../../../interfaces/AggregatorV3Interface.sol";
/// @title ChainlinkAdapter Contract
/// @author Prime
contract BaseChainlinkAdapter is AggregatorV3Interface {
/// @notice Token price feed
AggregatorV3Interface public chainlinkFeed;
uint256 public immutable heartbeat;
/// @notice How late since heartbeat before a price reverts
uint256 public constant HEART_BEAT_TOLERANCE = 300;
error AddressZero();
error RoundNotComplete();
error StalePrice();
error InvalidPrice();
/**
* @notice constructor
* @param _chainlinkFeed Chainlink price feed for token.
* @param _heartbeat heartbeat for feed
*/
constructor(address _chainlinkFeed, uint256 _heartbeat) {
require(_chainlinkFeed != address(0), AddressZero());
chainlinkFeed = AggregatorV3Interface(_chainlinkFeed);
heartbeat = _heartbeat;
}
/**
* @notice Returns USD price in quote token.
* @dev supports 18 decimal token
* @return price of token in decimal 8
*/
function latestAnswer() external view virtual returns (uint256 price) {}
function validate(int256 _answer, uint256 _updatedAt) public view {
if (_updatedAt == 0) revert RoundNotComplete();
if (heartbeat > 0 && block.timestamp - _updatedAt >= heartbeat + HEART_BEAT_TOLERANCE) revert StalePrice();
if (_answer <= 0) revert InvalidPrice();
}
/**
* @notice Returns version of chainlink price feed for token
*/
function version() external view returns (uint256) {
return chainlinkFeed.version();
}
/**
* @notice Returns decimals of chainlink price feed for token
*/
function decimals() external view returns (uint8) {
return chainlinkFeed.decimals();
}
/**
* @notice Returns description of chainlink price feed for token
*/
function description() external view returns (string memory) {
return chainlinkFeed.description();
}
/**
* @notice Get data about a round
* @param _roundId the requested round ID
* @return roundId is the round ID from the aggregator for which the data was retrieved.
* @return answer is the answer for the given round
* @return startedAt is the timestamp when the round was started.
* @return updatedAt is the timestamp when the round last was updated.
* @return answeredInRound is the round ID of the round in which the answer was computed.
*/
function getRoundData(
uint80 _roundId
)
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
(roundId, answer, startedAt, updatedAt, answeredInRound) = chainlinkFeed.getRoundData(_roundId);
}
/**
* @notice Returns data of latest round
* @return roundId is the round ID from the aggregator for which the data was retrieved.
* @return answer is the answer for the given round
* @return startedAt is the timestamp when the round was started.
* @return updatedAt is the timestamp when the round last was updated.
* @return answeredInRound is the round ID of the round in which the answer was computed.
*/
function latestRoundData()
public
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
(roundId, answer, startedAt, updatedAt, answeredInRound) = chainlinkFeed.latestRoundData();
}
}{
"evmVersion": "shanghai",
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"remappings": [],
"viaIR": true,
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_chainlinkFeed","type":"address"},{"internalType":"uint256","name":"_heartbeat","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"RoundNotComplete","type":"error"},{"inputs":[],"name":"StalePrice","type":"error"},{"inputs":[],"name":"HEART_BEAT_TOLERANCE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainlinkFeed","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"heartbeat","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"_answer","type":"int256"},{"internalType":"uint256","name":"_updatedAt","type":"uint256"}],"name":"validate","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a034609c57601f6107ba38819003918201601f19168301916001600160401b0383118484101760a0578084926040948552833981010312609c5780516001600160a01b0381169190829003609c5760200151908015608d575f80546001600160a01b03191691909117905560805260405161070590816100b5823960805181818161016a015261057f0152f35b639fabe1c160e01b5f5260045ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe6080806040526004361015610012575f80fd5b5f3560e01c908163313ce567146105a2575080633defb9621461056857806350d25bcd146104f957806354fd4d50146104635780637284e4161461033c5780637dbdf1f5146103175780638d176086146102fb5780639a6fc8f514610251578063bb33f0851461014e5763feaf968c1461008a575f80fd5b3461014a575f36600319011261014a57600460a06001600160a01b035f541660405192838092633fabe5a360e21b82525afa801561013f575f5f915f5f905f92610103575b6040805169ffffffffffffffffffff9586168152602081019690965285015260608401521660808201528060a081015b0390f35b505050505061012c6100ff9160a03d60a011610138575b6101248183610661565b81019061069a565b929450849392916100cf565b503d61011a565b6040513d5f823e3d90fd5b5f80fd5b3461014a57604036600319011261014a576024358015610229577f000000000000000000000000000000000000000000000000000000000000000080151591826101f4575b50506101cc575f60043513156101a557005b7ebfc921000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f19abf40e000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915042034281116102155761012c82018092116102155710158180610193565b634e487b7160e01b5f52601160045260245ffd5b7f159c98a0000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461014a57602036600319011261014a5760043569ffffffffffffffffffff811680910361014a5760a06001600160a01b035f5416916024604051809481937f9a6fc8f500000000000000000000000000000000000000000000000000000000835260048301525afa801561013f575f5f915f5f905f92610103576040805169ffffffffffffffffffff95861681526020810196909652850152606084015216608082015260a090f35b3461014a575f36600319011261014a57602060405161012c8152f35b3461014a575f36600319011261014a5760206001600160a01b035f5416604051908152f35b3461014a575f36600319011261014a5760045f6001600160a01b03815416604051928380927f7284e4160000000000000000000000000000000000000000000000000000000082525afa90811561013f575f916103c6575b50604080518092602082526103b88151809281602086015260208686019101610640565b601f01601f19168101030190f35b90503d805f833e6103d78183610661565b81019060208183031261014a5780519067ffffffffffffffff821161014a570181601f8201121561014a57805167ffffffffffffffff811161044f576040519261042b601f8301601f191660200185610661565b8184526020828401011161014a576104499160208085019101610640565b81610394565b634e487b7160e01b5f52604160045260245ffd5b3461014a575f36600319011261014a57600460206001600160a01b035f5416604051928380927f54fd4d500000000000000000000000000000000000000000000000000000000082525afa801561013f575f906104c6575b602090604051908152f35b506020813d6020116104f1575b816104e060209383610661565b8101031261014a57602090516104bb565b3d91506104d3565b3461014a575f36600319011261014a57600460a06001600160a01b035f541660405192838092633fabe5a360e21b82525afa801561013f576020915f91610544575b50604051908152f35b61055d915060a03d60a011610138576101248183610661565b50505090508261053b565b3461014a575f36600319011261014a5760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461014a575f36600319011261014a576020816004816001600160a01b035f54167f313ce5670000000000000000000000000000000000000000000000000000000082525afa801561013f575f90610603575b60209060ff60405191168152f35b506020813d602011610638575b8161061d60209383610661565b8101031261014a575160ff8116810361014a576020906105f5565b3d9150610610565b5f5b8381106106515750505f910152565b8181015183820152602001610642565b90601f8019910116810190811067ffffffffffffffff82111761044f57604052565b519069ffffffffffffffffffff8216820361014a57565b908160a091031261014a576106ae81610683565b916020820151916040810151916106cc608060608401519301610683565b9056fea2646970667358221220266b3352b202860ca46d7b106b31caf7c79b9985f9a85aed4b42ae0baf3950c364736f6c634300081b00330000000000000000000000000e44c312abff852a37e6dcdab1d6b32bde199e7f0000000000000000000000000000000000000000000000000000000000000384
Deployed Bytecode
0x6080806040526004361015610012575f80fd5b5f3560e01c908163313ce567146105a2575080633defb9621461056857806350d25bcd146104f957806354fd4d50146104635780637284e4161461033c5780637dbdf1f5146103175780638d176086146102fb5780639a6fc8f514610251578063bb33f0851461014e5763feaf968c1461008a575f80fd5b3461014a575f36600319011261014a57600460a06001600160a01b035f541660405192838092633fabe5a360e21b82525afa801561013f575f5f915f5f905f92610103575b6040805169ffffffffffffffffffff9586168152602081019690965285015260608401521660808201528060a081015b0390f35b505050505061012c6100ff9160a03d60a011610138575b6101248183610661565b81019061069a565b929450849392916100cf565b503d61011a565b6040513d5f823e3d90fd5b5f80fd5b3461014a57604036600319011261014a576024358015610229577f000000000000000000000000000000000000000000000000000000000000038480151591826101f4575b50506101cc575f60043513156101a557005b7ebfc921000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f19abf40e000000000000000000000000000000000000000000000000000000005f5260045ffd5b90915042034281116102155761012c82018092116102155710158180610193565b634e487b7160e01b5f52601160045260245ffd5b7f159c98a0000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461014a57602036600319011261014a5760043569ffffffffffffffffffff811680910361014a5760a06001600160a01b035f5416916024604051809481937f9a6fc8f500000000000000000000000000000000000000000000000000000000835260048301525afa801561013f575f5f915f5f905f92610103576040805169ffffffffffffffffffff95861681526020810196909652850152606084015216608082015260a090f35b3461014a575f36600319011261014a57602060405161012c8152f35b3461014a575f36600319011261014a5760206001600160a01b035f5416604051908152f35b3461014a575f36600319011261014a5760045f6001600160a01b03815416604051928380927f7284e4160000000000000000000000000000000000000000000000000000000082525afa90811561013f575f916103c6575b50604080518092602082526103b88151809281602086015260208686019101610640565b601f01601f19168101030190f35b90503d805f833e6103d78183610661565b81019060208183031261014a5780519067ffffffffffffffff821161014a570181601f8201121561014a57805167ffffffffffffffff811161044f576040519261042b601f8301601f191660200185610661565b8184526020828401011161014a576104499160208085019101610640565b81610394565b634e487b7160e01b5f52604160045260245ffd5b3461014a575f36600319011261014a57600460206001600160a01b035f5416604051928380927f54fd4d500000000000000000000000000000000000000000000000000000000082525afa801561013f575f906104c6575b602090604051908152f35b506020813d6020116104f1575b816104e060209383610661565b8101031261014a57602090516104bb565b3d91506104d3565b3461014a575f36600319011261014a57600460a06001600160a01b035f541660405192838092633fabe5a360e21b82525afa801561013f576020915f91610544575b50604051908152f35b61055d915060a03d60a011610138576101248183610661565b50505090508261053b565b3461014a575f36600319011261014a5760206040517f00000000000000000000000000000000000000000000000000000000000003848152f35b3461014a575f36600319011261014a576020816004816001600160a01b035f54167f313ce5670000000000000000000000000000000000000000000000000000000082525afa801561013f575f90610603575b60209060ff60405191168152f35b506020813d602011610638575b8161061d60209383610661565b8101031261014a575160ff8116810361014a576020906105f5565b3d9150610610565b5f5b8381106106515750505f910152565b8181015183820152602001610642565b90601f8019910116810190811067ffffffffffffffff82111761044f57604052565b519069ffffffffffffffffffff8216820361014a57565b908160a091031261014a576106ae81610683565b916020820151916040810151916106cc608060608401519301610683565b9056fea2646970667358221220266b3352b202860ca46d7b106b31caf7c79b9985f9a85aed4b42ae0baf3950c364736f6c634300081b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000e44c312abff852a37e6dcdab1d6b32bde199e7f0000000000000000000000000000000000000000000000000000000000000384
-----Decoded View---------------
Arg [0] : _chainlinkFeed (address): 0x0E44C312aBfF852a37e6dcdAb1D6B32bdE199E7f
Arg [1] : _heartbeat (uint256): 900
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e44c312abff852a37e6dcdab1d6b32bde199e7f
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000384
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in HYPE
Multichain Portfolio | 35 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.