Description:
Smart contract deployed on Ethereum with Factory, Oracle features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"RsEthToEthExchangeRateAdapter.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity ^0.8.20;\r
\r
import { IKelpLRTConfig } from "./IKelpLRTConfig.sol";\r
import { IKelpLRTOracle } from "./IKelpLRTOracle.sol";\r
import { IMinimalAggregatorV3Interface } from "./IMinimalAggregatorV3Interface.sol";\r
\r
/// @title RsEthToEthExchangeRateAdapter\r
/// @author kpk\r
/// @custom:contac\r
/// @notice rsETH/ETH exchange rate price feed.\r
/// @dev This contract should only be deployed on Ethereum.\r
contract RsEthToEthExchangeRateAdapter is IMinimalAggregatorV3Interface {\r
/// @inheritdoc IMinimalAggregatorV3Interface\r
// @dev The calculated price has 18 decimals precision, whatever the value of `decimals`.\r
uint8 public constant override decimals = 18;\r
\r
/// @notice The description of the price feed.\r
string public constant description = "rsETH/ETH exchange rate";\r
\r
/// @notice The address of the Kelp LRT Config contract in Ethereum.\r
IKelpLRTConfig public constant KELP_LRT_CONFIG = IKelpLRTConfig(0x947Cb49334e6571ccBFEF1f1f1178d8469D65ec7);\r
\r
bytes32 public constant LRT_ORACLE = keccak256("LRT_ORACLE");\r
\r
/// @inheritdoc IMinimalAggregatorV3Interface\r
/// @dev Returns zero for roundId, startedAt and answeredInRound.\r
/// @dev Returns timestamp for updatedAt\r
/// @dev Silently overflows if `rsETHPrice`'s return value is greater than `type(int256).max`.\r
function latestRoundData() external view override returns (uint80, int256, uint256, uint256, uint80) {\r
IKelpLRTOracle lrtOracle = IKelpLRTOracle(KELP_LRT_CONFIG.getContract(LRT_ORACLE));\r
uint256 rate = lrtOracle.rsETHPrice();\r
return (0, int256(rate), 0, block.timestamp, 0);\r
}\r
}"
},
"IMinimalAggregatorV3Interface.sol": {
"content": "// SPDX-License-Identifier: MIT\r
pragma solidity >=0.5.0;\r
\r
/// @dev Inspired by\r
/// https://github.com/smartcontractkit/chainlink/blob/master/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol\r
/// @dev This is the minimal feed interface required by `MorphoChainlinkOracleV2`.\r
interface IMinimalAggregatorV3Interface {\r
/// @notice Returns the precision of the feed.\r
function decimals() external view returns (uint8);\r
\r
/// @notice Returns Chainlink's `latestRoundData` return values.\r
/// @notice Only the `answer` field is used by `MorphoChainlinkOracleV2`.\r
function latestRoundData()\r
external\r
view\r
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\r
}"
},
"IKelpLRTOracle.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity >=0.5.0;\r
\r
interface IKelpLRTOracle {\r
function rsETHPrice() external view returns (uint256);\r
}"
},
"IKelpLRTConfig.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity >=0.5.0;\r
\r
interface IKelpLRTConfig {\r
function getContract(bytes32 contractId) external view returns (address);\r
}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-31 18:35:00
Comments
Log in to comment.
No comments yet.