// SPDX-License-Identifier: MIT pragma solidity >=0.7.6 <0.9; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; library CollateralType { enum Class { NONE, // unused POOL, // pool collateral type VAULT // usable as vault collateral } // Collateral token is uniquely identified by the pair (collateralClass, token). struct Data { // The kind of collateral for this token. CollateralType.Class collateralClass; // The ERC20 token contract for this collateral type. IERC20 token; // Same as token.decimals(), when that exists. uint256 decimals; // Token invalidation time. Must be 0 on creation. uint256 validUntil; // When `true`, the FTSO with symbol `assetFtsoSymbol` returns asset price relative to this token // (such FTSO's will probably exist for major stablecoins). // When `false`, the FTSOs with symbols `assetFtsoSymbol` and `tokenFtsoSymbol` give asset and token // price relative to the same reference currency and the asset/token price is calculated as their ratio. bool directPricePair; // FTSO symbol for the asset, relative to this token or a reference currency // (it depends on the value of `directPricePair`). string assetFtsoSymbol; // FTSO symbol for this token in reference currency. // Used for asset/token price calculation when `directPricePair` is `false`. // Otherwise it is irrelevant to asset/token price calculation, but if it is nonempty, // it is still used in calculation of challenger and confirmation rewards // (otherwise we assume it approximates the value of USD and pay directly the USD amount in vault collateral). string tokenFtsoSymbol; // Minimum collateral ratio for healthy agents. uint256 minCollateralRatioBIPS; // Minimum collateral ratio for agent in CCB (Collateral call band). // If the agent's collateral ratio is less than this, skip the CCB and go straight to liquidation. // A bit smaller than minCollateralRatioBIPS. uint256 ccbMinCollateralRatioBIPS; // Minimum collateral ratio required to get agent out of liquidation. // Will always be greater than minCollateralRatioBIPS. uint256 safetyMinCollateralRatioBIPS; } }