Description:
Smart contract deployed on Ethereum with Factory, Oracle features.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{"EzEthToEthExchangeRateAdapter.sol.sol":{"content":"// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity ^0.8.20;\r
\r
import {IRenzoOracle} from "./IRenzoOracle.sol";\r
import {IERC20} from "./IERC20.sol";\r
import {IMinimalAggregatorV3Interface} from "./IMinimalAggregatorV3Interface.sol";\r
import {IRenzoRestakeManager} from "./IRenzoRestakeManager.sol";\r
\r
\r
/// @title EzEthToEthExchangeRateAdapter\r
/// @author kpk\r
/// @custom:contact\r
/// @notice ezETH/ETH exchange rate price feed.\r
/// @dev This contract should only be deployed on Ethereum.\r
contract EzEthToEthExchangeRateAdapter 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 = "ezETH/ETH exchange rate";\r
\r
/// @notice The address of the Renzo restake manager in Ethereum.\r
IRenzoRestakeManager public constant RENZO_RESTAKE_MANAGER =\r
IRenzoRestakeManager(0x74a09653A083691711cF8215a6ab074BB4e99ef5);\r
\r
/// @notice The address of the Renzo ezETH token in Ethereum\r
IERC20 public constant EZ_ETH = IERC20(0xbf5495Efe5DB9ce00f80364C8B423567e58d2110);\r
\r
/// @inheritdoc IMinimalAggregatorV3Interface\r
/// @dev Returns zero for roundId, startedAt and answeredInRound.\r
/// @dev Returns timestamp for updatedAt\r
/// @dev Silently overflows if `calculateRedeemAmount`\u0027s return value is greater than `type(int256).max`.\r
function latestRoundData() external view override returns (uint80, int256, uint256, uint256, uint80) {\r
(,, uint256 _currentValueInProtocol) = RENZO_RESTAKE_MANAGER.calculateTVLs();\r
\r
// This returns the percentage of TVL that matches the percentage of ezETH being burned\r
// baseAsset is safely assumed to be the ezETH ERC20\r
uint256 rate = IRenzoOracle(RENZO_RESTAKE_MANAGER.renzoOracle()).calculateRedeemAmount(\r
1 ether, EZ_ETH.totalSupply(), _currentValueInProtocol\r
);\r
\r
return (0, int256(rate), 0, block.timestamp, 0);\r
}\r
}\r
"},"IERC20.sol":{"content":"// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity \u003e=0.5.0;\r
\r
interface IERC20 {\r
function totalSupply() external view returns (uint256);\r
}"},"IMinimalAggregatorV3Interface.sol":{"content":"// SPDX-License-Identifier: MIT\r
pragma solidity \u003e=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\u0027s `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
}"},"IRenzoOracle.sol":{"content":"// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity \u003e=0.5.0;\r
\r
interface IRenzoOracle {\r
function calculateRedeemAmount(\r
uint256 _ezETHBeingBurned,\r
uint256 _existingEzETHSupply,\r
uint256 _currentValueInProtocol\r
)\r
external\r
pure\r
returns (uint256);\r
}"},"IRenzoRestakeManager.sol":{"content":"// SPDX-License-Identifier: GPL-2.0-or-later\r
pragma solidity \u003e=0.5.0;\r
\r
interface IRenzoRestakeManager {\r
function calculateTVLs() external view returns (uint256[][] memory, uint256[] memory, uint256);\r
function renzoOracle() external view returns (address);\r
}"}}
Submitted on: 2025-10-31 18:24:06
Comments
Log in to comment.
No comments yet.