mirror of
https://github.com/Instadapp/fluid-contracts-public.git
synced 2024-07-29 21:57:37 +00:00
21 lines
1003 B
Solidity
21 lines
1003 B
Solidity
// SPDX-License-Identifier: BUSL-1.1
|
|
pragma solidity 0.8.21;
|
|
|
|
import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";
|
|
import { FluidOracle } from "../fluidOracle.sol";
|
|
import { SUSDeOracleImpl } from "../implementations/sUSDeOracleImpl.sol";
|
|
|
|
/// @title SUSDeOracle
|
|
/// @notice Gets the exchange rate between sUSDe and USDe directly from the sUSDe contract, adjusted for decimals
|
|
/// of a debt token (get amount of debt token for 1 sUSDe).
|
|
contract SUSDeOracle is FluidOracle, SUSDeOracleImpl {
|
|
/// @notice constructor sets the sUSDe `sUSDe_` token address and calculates scaling for exchange rate based on
|
|
/// `debtTokenDecimals_` (token decimals of debt token, e.g. of USDC / USDT = 6)
|
|
constructor(IERC4626 sUSDe_, uint8 debtTokenDecimals_) SUSDeOracleImpl(sUSDe_, debtTokenDecimals_) {}
|
|
|
|
/// @inheritdoc FluidOracle
|
|
function getExchangeRate() external view override returns (uint256 exchangeRate_) {
|
|
return _getSUSDeExchangeRate();
|
|
}
|
|
}
|