Проверенный контрактТочноеMIT
StablecoinRateProvider
Адрес0xec90d3f01ea53d4e99b1ee758f160521c2968c12
- Баланс
0 ETH
- Транзакций
1
- Компилятор
solc 0.8.24
- Тот же код
Только этот контракт
Подробности
- Компилятор
- solc 0.8.24+commit.e11b9ed9
- Язык
- solidity
- Оптимизация
- Да, 200 прогонов
- Версия EVM
- cancun
- Лицензия
- MIT
- Совпадение
- Точноекод создания: да, код в сети: да
- Проверен на Sourcify
- Создан в блоке
- 24 573 772
- Транзакция создания
- 0xa44be1ff0e…5a66515613
2 файла
src/StablecoinRateProvider.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {IConversionRateProvider} from "./interfaces/IConversionRateProvider.sol";
/// @title StablecoinRateProvider
/// @notice Returns a fixed 1:1 conversion rate between two stablecoins.
/// Decimal normalization is handled by the consumer (FlexStrategyLeverageKeeper._debtToAsset).
contract StablecoinRateProvider is IConversionRateProvider {
address public immutable BASE_ASSET;
constructor(address _baseAsset) {
BASE_ASSET = _baseAsset;
}
/// @notice Returns 1e18, representing a 1:1 peg between BASE_ASSET and QUOTE_ASSET.
function getRate(address) external pure override returns (uint256) {
return 1e18;
}
}
src/interfaces/IConversionRateProvider.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IConversionRateProvider {
/// @notice Returns the conversion rate for a given asset to debt denomination.
/// @dev The rate should be expressed as: 1 unit of asset = rate units of debt (scaled by 1e18).
/// @param asset The asset to get the rate for.
function getRate(address asset) external view returns (uint256);
}
Настройки компилятораПоказать
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"forge-std/=lib/forge-std/src/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
]
}Исходный код и метаданные: Sourcify.
Исходный код принадлежит авторам контракта.