all files / plugins/assets/compoundv3/vendor/ CometMainInterface.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.17;
 
struct AssetInfo {
    uint8 offset;
    address asset;
    address priceFeed;
    uint64 scale;
    uint64 borrowCollateralFactor;
    uint64 liquidateCollateralFactor;
    uint64 liquidationFactor;
    uint128 supplyCap;
}
 
/**
 * @title Compound's Comet Main Interface (without Ext)
 * @notice An efficient monolithic money market protocol
 * @author Compound
 */
abstract contract CometMainInterface {
    error Absurd();
    error AlreadyInitialized();
    error BadAsset();
    error BadDecimals();
    error BadDiscount();
    error BadMinimum();
    error BadPrice();
    error BorrowTooSmall();
    error BorrowCFTooLarge();
    error InsufficientReserves();
    error LiquidateCFTooLarge();
    error NoSelfTransfer();
    error NotCollateralized();
    error NotForSale();
    error NotLiquidatable();
    error Paused();
    error SupplyCapExceeded();
    error TimestampTooLarge();
    error TooManyAssets();
    error TooMuchSlippage();
    error TransferInFailed();
    error TransferOutFailed();
    error Unauthorized();
 
    event Supply(address indexed from, address indexed dst, uint256 amount);
    event Transfer(address indexed from, address indexed to, uint256 amount);
    event Withdraw(address indexed src, address indexed to, uint256 amount);
 
    event SupplyCollateral(
        address indexed from,
        address indexed dst,
        address indexed asset,
        uint256 amount
    );
    event TransferCollateral(
        address indexed from,
        address indexed to,
        address indexed asset,
        uint256 amount
    );
    event WithdrawCollateral(
        address indexed src,
        address indexed to,
        address indexed asset,
        uint256 amount
    );
 
    /// @notice Event emitted when a borrow position is absorbed by the protocol
    event AbsorbDebt(
        address indexed absorber,
        address indexed borrower,
        uint256 basePaidOut,
        uint256 usdValue
    );
 
    /// @notice Event emitted when a user's collateral is absorbed by the protocol
    event AbsorbCollateral(
        address indexed absorber,
        address indexed borrower,
        address indexed asset,
        uint256 collateralAbsorbed,
        uint256 usdValue
    );
 
    /// @notice Event emitted when a collateral asset is purchased from the protocol
    event BuyCollateral(
        address indexed buyer,
        address indexed asset,
        uint256 baseAmount,
        uint256 collateralAmount
    );
 
    /// @notice Event emitted when an action is paused/unpaused
    event PauseAction(
        bool supplyPaused,
        bool transferPaused,
        bool withdrawPaused,
        bool absorbPaused,
        bool buyPaused
    );
 
    /// @notice Event emitted when reserves are withdrawn by the governor
    event WithdrawReserves(address indexed to, uint256 amount);
 
    function supply(address asset, uint256 amount) external virtual;
 
    function supplyTo(
        address dst,
        address asset,
        uint256 amount
    ) external virtual;
 
    function supplyFrom(
        address from,
        address dst,
        address asset,
        uint256 amount
    ) external virtual;
 
    function transfer(address dst, uint256 amount) external virtual returns (bool);
 
    function transferFrom(
        address src,
        address dst,
        uint256 amount
    ) external virtual returns (bool);
 
    function transferAsset(
        address dst,
        address asset,
        uint256 amount
    ) external virtual;
 
    function transferAssetFrom(
        address src,
        address dst,
        address asset,
        uint256 amount
    ) external virtual;
 
    function withdraw(address asset, uint256 amount) external virtual;
 
    function withdrawTo(
        address to,
        address asset,
        uint256 amount
    ) external virtual;
 
    function withdrawFrom(
        address src,
        address to,
        address asset,
        uint256 amount
    ) external virtual;
 
    function approveThis(
        address manager,
        address asset,
        uint256 amount
    ) external virtual;
 
    function withdrawReserves(address to, uint256 amount) external virtual;
 
    function absorb(address absorber, address[] calldata accounts) external virtual;
 
    function buyCollateral(
        address asset,
        uint256 minAmount,
        uint256 baseAmount,
        address recipient
    ) external virtual;
 
    function quoteCollateral(address asset, uint256 baseAmount)
        public
        view
        virtual
        returns (uint256);
 
    function getAssetInfo(uint8 i) public view virtual returns (AssetInfo memory);
 
    function getAssetInfoByAddress(address asset) public view virtual returns (AssetInfo memory);
 
    function getReserves() public view virtual returns (int256);
 
    function getPrice(address priceFeed) public view virtual returns (uint256);
 
    function isBorrowCollateralized(address account) public view virtual returns (bool);
 
    function isLiquidatable(address account) public view virtual returns (bool);
 
    function totalSupply() external view virtual returns (uint256);
 
    function totalBorrow() external view virtual returns (uint256);
 
    function balanceOf(address owner) public view virtual returns (uint256);
 
    function borrowBalanceOf(address account) public view virtual returns (uint256);
 
    function pause(
        bool supplyPaused,
        bool transferPaused,
        bool withdrawPaused,
        bool absorbPaused,
        bool buyPaused
    ) external virtual;
 
    function isSupplyPaused() public view virtual returns (bool);
 
    function isTransferPaused() public view virtual returns (bool);
 
    function isWithdrawPaused() public view virtual returns (bool);
 
    function isAbsorbPaused() public view virtual returns (bool);
 
    function isBuyPaused() public view virtual returns (bool);
 
    function accrueAccount(address account) external virtual;
 
    function getSupplyRate(uint256 utilization) public view virtual returns (uint64);
 
    function getBorrowRate(uint256 utilization) public view virtual returns (uint64);
 
    function getUtilization() public view virtual returns (uint256);
 
    function governor() external view virtual returns (address);
 
    function pauseGuardian() external view virtual returns (address);
 
    function baseToken() external view virtual returns (address);
 
    function baseTokenPriceFeed() external view virtual returns (address);
 
    function extensionDelegate() external view virtual returns (address);
 
    /// @dev uint64
    function supplyKink() external view virtual returns (uint256);
 
    /// @dev uint64
    function supplyPerSecondInterestRateSlopeLow() external view virtual returns (uint256);
 
    /// @dev uint64
    function supplyPerSecondInterestRateSlopeHigh() external view virtual returns (uint256);
 
    /// @dev uint64
    function supplyPerSecondInterestRateBase() external view virtual returns (uint256);
 
    /// @dev uint64
    function borrowKink() external view virtual returns (uint256);
 
    /// @dev uint64
    function borrowPerSecondInterestRateSlopeLow() external view virtual returns (uint256);
 
    /// @dev uint64
    function borrowPerSecondInterestRateSlopeHigh() external view virtual returns (uint256);
 
    /// @dev uint64
    function borrowPerSecondInterestRateBase() external view virtual returns (uint256);
 
    /// @dev uint64
    function storeFrontPriceFactor() external view virtual returns (uint256);
 
    /// @dev uint64
    function baseScale() external view virtual returns (uint256);
 
    /// @dev uint64
    function trackingIndexScale() external view virtual returns (uint256);
 
    /// @dev uint64
    function baseTrackingSupplySpeed() external view virtual returns (uint256);
 
    /// @dev uint64
    function baseTrackingBorrowSpeed() external view virtual returns (uint256);
 
    /// @dev uint104
    function baseMinForRewards() external view virtual returns (uint256);
 
    /// @dev uint104
    function baseBorrowMin() external view virtual returns (uint256);
 
    /// @dev uint104
    function targetReserves() external view virtual returns (uint256);
 
    function numAssets() external view virtual returns (uint8);
 
    function decimals() external view virtual returns (uint8);
 
    function initializeStorage() external virtual;
}