Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PTOraclePriceAdapter
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.21; import {IPTOracle} from "interfaces/IPTOracle.sol"; import {MinimalAggregatorV3Interface} from "interfaces/MinimalAggregatorV3Interface.sol"; /// @title PTOraclePriceAdapter /// @author Mev Capital inspired by Morpho Labs /// @notice PT exchange rate price feed. /// @dev This contract should only be deployed on Ethereum and used as a price feed for Morpho oracles. contract PTOraclePriceAdapter is MinimalAggregatorV3Interface { /// @inheritdoc MinimalAggregatorV3Interface // @dev The calculated price has 18 decimals precision, whatever the value of `decimals`. uint8 public constant decimals = 18; /// @notice The description of the price feed. string public constant description = "PT Lombard LBTC 27MAR2025 PtToAssetRate adapter"; /// @notice The address of PTOracle on Ethereum. IPTOracle public constant oracle = IPTOracle(0x9a9Fa8338dd5E5B2188006f1Cd2Ef26d921650C2); /// @inheritdoc MinimalAggregatorV3Interface /// @dev Returns zero for roundId, startedAt, updatedAt and answeredInRound. /// @dev Silently overflows if `price`'s average is greater than `type(int256).max`. function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) { uint256 price = oracle.getPtToAssetRate( 0x70B70Ac0445C3eF04E314DFdA6caafd825428221, 900 // 15 mins twap duration ); return (0, int256(price), 0, 0, 0); } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; interface IPTOracle { function getPtToAssetRate( address market, uint32 duration ) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0; /// @dev Inspired by /// https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol /// @dev This is the minimal feed interface required by `MorphoChainlinkOracleV2`. interface MinimalAggregatorV3Interface { /// @notice Returns the precision of the feed. function decimals() external view returns (uint8); /// @notice Returns Chainlink's `latestRoundData` return values. /// @notice Only the `answer` field is used by `MorphoChainlinkOracleV2`. function latestRoundData() external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); }
{ "remappings": [ "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "ds-test/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/", "safe-smart-account/=lib/safe-smart-account/", "solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/", "surl/=lib/surl/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "shanghai", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"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":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"","type":"uint80"},{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IPTOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561000f575f80fd5b506102848061001d5f395ff3fe608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063313ce5671461004e5780637284e4161461006d5780637dc0d1d014610082578063feaf968c146100b5575b5f80fd5b610056601281565b60405160ff90911681526020015b60405180910390f35b6100756100f4565b60405161006491906101bc565b61009d739a9fa8338dd5e5b2188006f1cd2ef26d921650c281565b6040516001600160a01b039091168152602001610064565b6100bd610110565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610064565b6040518060600160405280602f8152602001610220602f913981565b60405163abca0eab60e01b81527370b70ac0445c3ef04e314dfda6caafd825428221600482015261038460248201525f9081908190819081908190739a9fa8338dd5e5b2188006f1cd2ef26d921650c29063abca0eab90604401602060405180830381865afa158015610185573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101a99190610208565b5f97909650879550859450849350915050565b5f602080835283518060208501525f5b818110156101e8578581018301518582016040015282016101cc565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610218575f80fd5b505191905056fe5054204c6f6d62617264204c4254432032374d415232303235205074546f4173736574526174652061646170746572a2646970667358221220ea98661a8bc21198d3d095c2764e39ab4fee288e940bf0f5f0fa1b171cf8e1d964736f6c63430008180033
Deployed Bytecode
0x608060405234801561000f575f80fd5b506004361061004a575f3560e01c8063313ce5671461004e5780637284e4161461006d5780637dc0d1d014610082578063feaf968c146100b5575b5f80fd5b610056601281565b60405160ff90911681526020015b60405180910390f35b6100756100f4565b60405161006491906101bc565b61009d739a9fa8338dd5e5b2188006f1cd2ef26d921650c281565b6040516001600160a01b039091168152602001610064565b6100bd610110565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a001610064565b6040518060600160405280602f8152602001610220602f913981565b60405163abca0eab60e01b81527370b70ac0445c3ef04e314dfda6caafd825428221600482015261038460248201525f9081908190819081908190739a9fa8338dd5e5b2188006f1cd2ef26d921650c29063abca0eab90604401602060405180830381865afa158015610185573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101a99190610208565b5f97909650879550859450849350915050565b5f602080835283518060208501525f5b818110156101e8578581018301518582016040015282016101cc565b505f604082860101526040601f19601f8301168501019250505092915050565b5f60208284031215610218575f80fd5b505191905056fe5054204c6f6d62617264204c4254432032374d415232303235205074546f4173736574526174652061646170746572a2646970667358221220ea98661a8bc21198d3d095c2764e39ab4fee288e940bf0f5f0fa1b171cf8e1d964736f6c63430008180033
Loading...
Loading
Loading...
Loading
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.