fluid-contracts-public/deployments/mainnet/dump/0x72DB9B7Bd2b0BC282708E85E16123023b32de6A9.json
2024-07-11 13:05:09 +00:00

152 lines
40 KiB
JSON

{
"address": "0x72DB9B7Bd2b0BC282708E85E16123023b32de6A9",
"abi": [
{
"inputs": [
{
"internalType": "contract IERC4626",
"name": "sUSDe_",
"type": "address"
},
{
"internalType": "uint8",
"name": "debtTokenDecimals_",
"type": "uint8"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "errorId_",
"type": "uint256"
}
],
"name": "FluidOracleError",
"type": "error"
},
{
"inputs": [],
"name": "getExchangeRate",
"outputs": [
{
"internalType": "uint256",
"name": "exchangeRate_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getExchangeRateLiquidate",
"outputs": [
{
"internalType": "uint256",
"name": "exchangeRate_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getExchangeRateOperate",
"outputs": [
{
"internalType": "uint256",
"name": "exchangeRate_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "sUSDeOracleData",
"outputs": [
{
"internalType": "uint256",
"name": "sUSDeExchangeRate_",
"type": "uint256"
},
{
"internalType": "contract IERC4626",
"name": "sUSDe_",
"type": "address"
},
{
"internalType": "uint256",
"name": "debtTokenDecimals_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xaee65664618f2258bfb4ab15ae702d44ade59abc679fc22c3e20e6bc8dcb7d2d",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
"contractAddress": null,
"transactionIndex": 102,
"gasUsed": "201127",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x020041b421eeca47f39b83d5d56df29a8be3100db622248a61a182f76120b80a",
"transactionHash": "0xaee65664618f2258bfb4ab15ae702d44ade59abc679fc22c3e20e6bc8dcb7d2d",
"logs": [],
"blockNumber": 20024435,
"cumulativeGasUsed": "8764431",
"status": 1,
"byzantium": true
},
"args": [
"0x9D39A5DE30e57443BfF2A8307A4256c8797A3497",
6
],
"numDeployments": 1,
"solcInputHash": "1989963ad64c4704dbe1170530c79d20",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC4626\",\"name\":\"sUSDe_\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"debtTokenDecimals_\",\"type\":\"uint8\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidOracleError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"getExchangeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExchangeRateLiquidate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getExchangeRateOperate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"exchangeRate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sUSDeOracleData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sUSDeExchangeRate_\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC4626\",\"name\":\"sUSDe_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"debtTokenDecimals_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"getExchangeRate()\":{\"details\":\"Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility.\"}},\"title\":\"SUSDeOracle\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"constructor\":{\"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)\"},\"getExchangeRateLiquidate()\":{\"notice\":\"Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations\"},\"getExchangeRateOperate()\":{\"notice\":\"Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates\"},\"sUSDeOracleData()\":{\"notice\":\"returns all sUSDe oracle related data as utility for easy off-chain use / block explorer in a single view method\"}},\"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).\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracle/oracles/sUSDeOracle.sol\":\"SUSDeOracle\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC4626.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (interfaces/IERC4626.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../token/ERC20/IERC20.sol\\\";\\nimport \\\"../token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\n/**\\n * @dev Interface of the ERC4626 \\\"Tokenized Vault Standard\\\", as defined in\\n * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626].\\n *\\n * _Available since v4.7._\\n */\\ninterface IERC4626 is IERC20, IERC20Metadata {\\n event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares);\\n\\n event Withdraw(\\n address indexed sender,\\n address indexed receiver,\\n address indexed owner,\\n uint256 assets,\\n uint256 shares\\n );\\n\\n /**\\n * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing.\\n *\\n * - MUST be an ERC-20 token contract.\\n * - MUST NOT revert.\\n */\\n function asset() external view returns (address assetTokenAddress);\\n\\n /**\\n * @dev Returns the total amount of the underlying asset that is \\u201cmanaged\\u201d by Vault.\\n *\\n * - SHOULD include any compounding that occurs from yield.\\n * - MUST be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT revert.\\n */\\n function totalAssets() external view returns (uint256 totalManagedAssets);\\n\\n /**\\n * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToShares(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal\\n * scenario where all the conditions are met.\\n *\\n * - MUST NOT be inclusive of any fees that are charged against assets in the Vault.\\n * - MUST NOT show any variations depending on the caller.\\n * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange.\\n * - MUST NOT revert.\\n *\\n * NOTE: This calculation MAY NOT reflect the \\u201cper-user\\u201d price-per-share, and instead should reflect the\\n * \\u201caverage-user\\u2019s\\u201d price-per-share, meaning what the average user should expect to see when exchanging to and\\n * from.\\n */\\n function convertToAssets(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver,\\n * through a deposit call.\\n *\\n * - MUST return a limited value if receiver is subject to some deposit limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited.\\n * - MUST NOT revert.\\n */\\n function maxDeposit(address receiver) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit\\n * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called\\n * in the same transaction.\\n * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the\\n * deposit would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewDeposit(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * deposit execution, and are accounted for during deposit.\\n * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function deposit(uint256 assets, address receiver) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call.\\n * - MUST return a limited value if receiver is subject to some mint limit.\\n * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted.\\n * - MUST NOT revert.\\n */\\n function maxMint(address receiver) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given\\n * current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call\\n * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the\\n * same transaction.\\n * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint\\n * would be accepted, regardless if the user has enough tokens approved, etc.\\n * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by minting.\\n */\\n function previewMint(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.\\n *\\n * - MUST emit the Deposit event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint\\n * execution, and are accounted for during mint.\\n * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not\\n * approving enough underlying tokens to the Vault contract, etc).\\n *\\n * NOTE: most implementations will require pre-approval of the Vault with the Vault\\u2019s underlying asset token.\\n */\\n function mint(uint256 shares, address receiver) external returns (uint256 assets);\\n\\n /**\\n * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the\\n * Vault, through a withdraw call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxWithdraw(address owner) external view returns (uint256 maxAssets);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw\\n * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if\\n * called\\n * in the same transaction.\\n * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though\\n * the withdrawal would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by depositing.\\n */\\n function previewWithdraw(uint256 assets) external view returns (uint256 shares);\\n\\n /**\\n * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * withdraw execution, and are accounted for during withdraw.\\n * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function withdraw(\\n uint256 assets,\\n address receiver,\\n address owner\\n ) external returns (uint256 shares);\\n\\n /**\\n * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault,\\n * through a redeem call.\\n *\\n * - MUST return a limited value if owner is subject to some withdrawal limit or timelock.\\n * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock.\\n * - MUST NOT revert.\\n */\\n function maxRedeem(address owner) external view returns (uint256 maxShares);\\n\\n /**\\n * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block,\\n * given current on-chain conditions.\\n *\\n * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call\\n * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the\\n * same transaction.\\n * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the\\n * redemption would be accepted, regardless if the user has enough shares, etc.\\n * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.\\n * - MUST NOT revert.\\n *\\n * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in\\n * share price or some other type of condition, meaning the depositor will lose assets by redeeming.\\n */\\n function previewRedeem(uint256 shares) external view returns (uint256 assets);\\n\\n /**\\n * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver.\\n *\\n * - MUST emit the Withdraw event.\\n * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the\\n * redeem execution, and are accounted for during redeem.\\n * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner\\n * not having enough shares, etc).\\n *\\n * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed.\\n * Those methods should be performed separately.\\n */\\n function redeem(\\n uint256 shares,\\n address receiver,\\n address owner\\n ) external returns (uint256 assets);\\n}\\n\",\"keccak256\":\"0xd82776ed6975a5939668e068f995acb1394c2f60a12a9ef3f14cacb91b5a8fd4\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"contracts/oracle/error.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\ncontract Error {\\n error FluidOracleError(uint256 errorId_);\\n}\\n\",\"keccak256\":\"0xc7b7e945238168d216c480e9dd4fbaaf8780645d58c47f9abdaa4f29910568fe\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/errorTypes.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nlibrary ErrorTypes {\\n /***********************************|\\n | UniV3CheckCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the delta between main price source and check rate source is exceeding the allowed delta\\n uint256 internal constant UniV3CheckCLRSOracle__InvalidPrice = 60001;\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant UniV3CheckCLRSOracle__InvalidParams = 60002;\\n\\n /// @notice thrown when the exchange rate is zero, even after all possible fallbacks depending on config\\n uint256 internal constant UniV3CheckCLRSOracle__ExchangeRateZero = 60003;\\n\\n /***********************************|\\n | sUSDe Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant SUSDeOracle__InvalidParams = 60102;\\n\\n /***********************************|\\n | Chainlink Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant ChainlinkOracle__InvalidParams = 61001;\\n\\n /***********************************|\\n | UniswapV3 Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant UniV3Oracle__InvalidParams = 62001;\\n\\n /// @notice thrown when constructor is called with invalid ordered seconds agos values\\n uint256 internal constant UniV3Oracle__InvalidSecondsAgos = 62002;\\n\\n /// @notice thrown when constructor is called with invalid delta values > 100%\\n uint256 internal constant UniV3Oracle__InvalidDeltas = 62003;\\n\\n /***********************************|\\n | WstETh Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant WstETHOracle__InvalidParams = 63001;\\n\\n /***********************************|\\n | Redstone Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant RedstoneOracle__InvalidParams = 64001;\\n\\n /***********************************|\\n | Fallback Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant FallbackOracle__InvalidParams = 65001;\\n\\n /***********************************|\\n | FallbackCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the fallback oracle source (if enabled)\\n uint256 internal constant FallbackCLRSOracle__ExchangeRateZero = 66001;\\n\\n /***********************************|\\n | WstETHCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the fallback oracle source (if enabled)\\n uint256 internal constant WstETHCLRSOracle__ExchangeRateZero = 67001;\\n\\n /***********************************|\\n | CLFallbackUniV3Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the uniV3 rate\\n uint256 internal constant CLFallbackUniV3Oracle__ExchangeRateZero = 68001;\\n\\n /***********************************|\\n | WstETHCLRS2UniV3CheckCLRSOracle | \\n |__________________________________*/\\n\\n /// @notice thrown when the exchange rate is zero, even for the uniV3 rate\\n uint256 internal constant WstETHCLRS2UniV3CheckCLRSOracle__ExchangeRateZero = 69001;\\n\\n /***********************************|\\n | WeETh Oracle | \\n |__________________________________*/\\n\\n /// @notice thrown when an invalid parameter is passed to a method\\n uint256 internal constant WeETHOracle__InvalidParams = 70001;\\n}\\n\",\"keccak256\":\"0x8c742fefdf4acbdb11e4ca21572969d58e513a805a61e19e6d90a8a0bf094c4c\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/fluidOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidOracle } from \\\"./interfaces/iFluidOracle.sol\\\";\\n\\n/// @title FluidOracle\\n/// @notice Base contract that any Fluid Oracle must implement\\nabstract contract FluidOracle is IFluidOracle {\\n /// @inheritdoc IFluidOracle\\n function getExchangeRate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateOperate() external view virtual returns (uint256 exchangeRate_);\\n\\n /// @inheritdoc IFluidOracle\\n function getExchangeRateLiquidate() external view virtual returns (uint256 exchangeRate_);\\n}\\n\",\"keccak256\":\"0xd275b5b0ada86c81a4dc6c79a24b1cb8bcfc374f4856e08917bf1bae83574b37\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/implementations/sUSDeOracleImpl.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IERC4626 } from \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\n\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { Error as OracleError } from \\\"../error.sol\\\";\\nimport { OracleUtils } from \\\"../libraries/oracleUtils.sol\\\";\\n\\n/// @title sUSDe Oracle Implementation\\n/// @notice This contract is used to get the exchange rate between sUSDe and USDe, adjusted for token decimals\\n/// of a debt token (e.g. USDC / USDT)\\nabstract contract SUSDeOracleImpl is OracleError {\\n /// @notice constant value for price scaling to reduce gas usage\\n uint256 internal immutable _SUSDE_PRICE_SCALER_MULTIPLIER;\\n\\n /// @notice SUSDE contract, e.g. on mainnet 0x9d39a5de30e57443bff2a8307a4256c8797a3497\\n IERC4626 internal immutable _SUSDE;\\n\\n uint8 internal immutable _DEBT_TOKEN_DECIMALS;\\n\\n /// @notice constructor sets the sUSDe `sUSDe_` token address.\\n constructor(IERC4626 sUSDe_, uint8 debtTokenDecimals_) {\\n if (address(sUSDe_) == address(0) || debtTokenDecimals_ < 6) {\\n revert FluidOracleError(ErrorTypes.SUSDeOracle__InvalidParams);\\n }\\n\\n _SUSDE = sUSDe_;\\n\\n // debt token decimals is used to make sure the returned exchange rate is scaled correctly e.g.\\n // for an exchange rate between sUSDe and USDC (this Oracle returning amount of USDC for 1e18 sUSDe).\\n _DEBT_TOKEN_DECIMALS = debtTokenDecimals_;\\n\\n _SUSDE_PRICE_SCALER_MULTIPLIER = 10 ** (debtTokenDecimals_ - 6);\\n // e.g. when:\\n // - debtTokenDecimals_ = 6 -> scaler multiplier is 1\\n // - debtTokenDecimals_ = 7 -> scaler multiplier is 10\\n // - debtTokenDecimals_ = 18 -> scaler multiplier is 1e12\\n // -> gets 1e15 returned exchange rate to 1e27\\n }\\n\\n /// @notice Get the exchange rate from sUSDe contract (amount of USDe for 1 sUSDe)\\n /// @return rate_ The exchange rate in `OracleUtils.RATE_OUTPUT_DECIMALS`\\n function _getSUSDeExchangeRate() internal view returns (uint256 rate_) {\\n return _SUSDE.convertToAssets(1e15) * _SUSDE_PRICE_SCALER_MULTIPLIER;\\n }\\n\\n /// @notice returns all sUSDe oracle related data as utility for easy off-chain use / block explorer in a single view method\\n function sUSDeOracleData()\\n public\\n view\\n returns (uint256 sUSDeExchangeRate_, IERC4626 sUSDe_, uint256 debtTokenDecimals_)\\n {\\n return (_getSUSDeExchangeRate(), _SUSDE, _DEBT_TOKEN_DECIMALS);\\n }\\n}\\n\",\"keccak256\":\"0xef36bb2b4479e79cc9d24ced015a6c65862582dd804be16e32dc1c531665d1ed\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/interfaces/iFluidOracle.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IFluidOracle {\\n /// @dev Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for\\n /// backwards compatibility.\\n function getExchangeRate() external view returns (uint256 exchangeRate_);\\n\\n /// @notice Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates\\n function getExchangeRateOperate() external view returns (uint256 exchangeRate_);\\n\\n /// @notice Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations\\n function getExchangeRateLiquidate() external view returns (uint256 exchangeRate_);\\n}\\n\",\"keccak256\":\"0x410b5f85b64414df35131bbf322261e2a11956d58af3800d8b71b5befb9907d4\",\"license\":\"MIT\"},\"contracts/oracle/libraries/oracleUtils.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\n/// @title Oracle utils library\\n/// @notice implements common utility methods for Fluid Oracles\\nlibrary OracleUtils {\\n /// @dev The scaler for max delta point math (100%)\\n uint256 internal constant HUNDRED_PERCENT_DELTA_SCALER = 10_000;\\n /// @dev output precision of rates\\n uint256 internal constant RATE_OUTPUT_DECIMALS = 27;\\n\\n /// @dev checks if `mainSourceRate_` is within a `maxDeltaPercent_` of `checkSourceRate_`. Returns true if so.\\n function isRateOutsideDelta(\\n uint256 mainSourceRate_,\\n uint256 checkSourceRate_,\\n uint256 maxDeltaPercent_\\n ) internal pure returns (bool) {\\n uint256 offset_ = (checkSourceRate_ * maxDeltaPercent_) / HUNDRED_PERCENT_DELTA_SCALER;\\n return (mainSourceRate_ > (checkSourceRate_ + offset_) || mainSourceRate_ < (checkSourceRate_ - offset_));\\n }\\n}\\n\",\"keccak256\":\"0x968b1a0606875abd523895c5075cf6c34c296919e77b0da7dd952374398e2a4c\",\"license\":\"BUSL-1.1\"},\"contracts/oracle/oracles/sUSDeOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IERC4626 } from \\\"@openzeppelin/contracts/interfaces/IERC4626.sol\\\";\\nimport { FluidOracle } from \\\"../fluidOracle.sol\\\";\\nimport { SUSDeOracleImpl } from \\\"../implementations/sUSDeOracleImpl.sol\\\";\\n\\n/// @title SUSDeOracle\\n/// @notice Gets the exchange rate between sUSDe and USDe directly from the sUSDe contract, adjusted for decimals\\n/// of a debt token (get amount of debt token for 1 sUSDe).\\ncontract SUSDeOracle is FluidOracle, SUSDeOracleImpl {\\n /// @notice constructor sets the sUSDe `sUSDe_` token address and calculates scaling for exchange rate based on\\n /// `debtTokenDecimals_` (token decimals of debt token, e.g. of USDC / USDT = 6)\\n constructor(IERC4626 sUSDe_, uint8 debtTokenDecimals_) SUSDeOracleImpl(sUSDe_, debtTokenDecimals_) {}\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateOperate() public view override returns (uint256 exchangeRate_) {\\n return _getSUSDeExchangeRate();\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRateLiquidate() external view override returns (uint256 exchangeRate_) {\\n return _getSUSDeExchangeRate();\\n }\\n\\n /// @inheritdoc FluidOracle\\n function getExchangeRate() external view override returns (uint256 exchangeRate_) {\\n return _getSUSDeExchangeRate();\\n }\\n}\\n\",\"keccak256\":\"0x2e8129ab5d25acfa0c5af70b0e615e1f707487a2196844c243a51f6257861ce4\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
"bytecode": "0x60e060405234801561001057600080fd5b506040516104db3803806104db83398101604081905261002f916100a7565b81816001600160a01b038216158061004a575060068160ff16105b156100705760405163c82fc46560e01b815261eac6600482015260240160405180910390fd5b6001600160a01b03821660a05260ff811660c05261008f600682610109565b61009a90600a61020c565b6080525061022292505050565b600080604083850312156100ba57600080fd5b82516001600160a01b03811681146100d157600080fd5b602084015190925060ff811681146100e857600080fd5b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b60ff8281168282160390811115610122576101226100f3565b92915050565b600181815b80851115610163578160001904821115610149576101496100f3565b8085161561015657918102915b93841c939080029061012d565b509250929050565b60008261017a57506001610122565b8161018757506000610122565b816001811461019d57600281146101a7576101c3565b6001915050610122565b60ff8411156101b8576101b86100f3565b50506001821b610122565b5060208310610133831016604e8410600b84101617156101e6575081810a610122565b6101f08383610128565b8060001904821115610204576102046100f3565b029392505050565b600061021b60ff84168361016b565b9392505050565b60805160a05160c051610285610256600039600060d901526000818160b4015261017d0152600061014601526102856000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806330f42b66146100515780638e7bfbc01461008e578063e6aa216c1461008e578063f3190c891461008e575b600080fd5b6100596100a4565b6040805193845273ffffffffffffffffffffffffffffffffffffffff9092166020840152908201526060015b60405180910390f35b6100966100ff565b604051908152602001610085565b60008060006100b161010e565b937f0000000000000000000000000000000000000000000000000000000000000000935060ff7f00000000000000000000000000000000000000000000000000000000000000001692509050565b600061010961010e565b905090565b6040517f07a2d13a00000000000000000000000000000000000000000000000000000000815266038d7ea4c6800060048201526000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906307a2d13a90602401602060405180830381865afa1580156101c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e891906101f2565b610109919061020b565b60006020828403121561020457600080fd5b5051919050565b8082028115828204841417610249577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea264697066735822122064c6e9368aa580c6b174f1942d0fbe8234188f6b2bff8a1bf16f2353b0ca5a3d64736f6c63430008150033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806330f42b66146100515780638e7bfbc01461008e578063e6aa216c1461008e578063f3190c891461008e575b600080fd5b6100596100a4565b6040805193845273ffffffffffffffffffffffffffffffffffffffff9092166020840152908201526060015b60405180910390f35b6100966100ff565b604051908152602001610085565b60008060006100b161010e565b937f0000000000000000000000000000000000000000000000000000000000000000935060ff7f00000000000000000000000000000000000000000000000000000000000000001692509050565b600061010961010e565b905090565b6040517f07a2d13a00000000000000000000000000000000000000000000000000000000815266038d7ea4c6800060048201526000907f00000000000000000000000000000000000000000000000000000000000000009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906307a2d13a90602401602060405180830381865afa1580156101c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e891906101f2565b610109919061020b565b60006020828403121561020457600080fd5b5051919050565b8082028115828204841417610249577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b9291505056fea264697066735822122064c6e9368aa580c6b174f1942d0fbe8234188f6b2bff8a1bf16f2353b0ca5a3d64736f6c63430008150033",
"devdoc": {
"kind": "dev",
"methods": {
"getExchangeRate()": {
"details": "Deprecated. Use `getExchangeRateOperate()` and `getExchangeRateLiquidate()` instead. Only implemented for backwards compatibility."
}
},
"title": "SUSDeOracle",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"constructor": {
"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)"
},
"getExchangeRateLiquidate()": {
"notice": "Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for liquidations"
},
"getExchangeRateOperate()": {
"notice": "Get the `exchangeRate_` between the underlying asset and the peg asset in 1e27 for operates"
},
"sUSDeOracleData()": {
"notice": "returns all sUSDe oracle related data as utility for easy off-chain use / block explorer in a single view method"
}
},
"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).",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}