Verified contractExactMIT
StablecoinRateProvider
Address0xec90d3f01ea53d4e99b1ee758f160521c2968c12
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.24
- Same code
Only this contract
Details
- Compiler
- solc 0.8.24+commit.e11b9ed9
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 24,573,772
- Creation transaction
- 0xa44be1ff0e…5a66515613
2 files
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);
}
Compiler settingsShow
{
"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/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.