Verified contractPartialGPL-3.0-or-later
PendleLinearDiscountOracleWrapper
Address0x10e698bf481b59d5011e7c972b6ea55bf0540107
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.30
- Same code
19 more contracts
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 999,999 runs
- EVM version
- prague
- Via IR
- yes
- License
- GPL-3.0-or-later
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 23,975,924
- Creation transaction
- 0x176c44842d…d06b835f73
2 files
src/PendleLinearDiscountOracleWrapper.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.19;
import {IPChainlinkOracleEssential} from "./IPChainlinkOracleEssential.sol";
/**
* Oracle wrapper that updates the `updatedAt` field to the current block timestamp.
* Intended to use with the Chainlink-compatible oracles that are stateless but with updatedAt field equal to 0.
*/
contract PendleLinearDiscountOracleWrapper is IPChainlinkOracleEssential {
IPChainlinkOracleEssential public immutable innerOracle;
constructor(address _innerOracle) {
innerOracle = IPChainlinkOracleEssential(_innerOracle);
}
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
{
(roundId, answer, startedAt, updatedAt, answeredInRound) = innerOracle.latestRoundData();
updatedAt = block.timestamp;
}
function decimals() external view returns (uint8) {
return innerOracle.decimals();
}
}
src/IPChainlinkOracleEssential.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IPChainlinkOracleEssential {
function decimals() external view returns (uint8);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 999999,
"enabled": true
},
"evmVersion": "prague"
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.