forked from compound-finance/comet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCometExtInterface.sol
68 lines (56 loc) · 3.11 KB
/
CometExtInterface.sol
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
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.15;
import "./CometCore.sol";
/**
* @title Compound's Comet Ext Interface
* @notice An efficient monolithic money market protocol
* @author Compound
*/
abstract contract CometExtInterface is CometCore {
error BadAmount();
error BadNonce();
error BadSignatory();
error InvalidValueS();
error InvalidValueV();
error SignatureExpired();
function allow(address manager, bool isAllowed) virtual external;
function allowBySig(address owner, address manager, bool isAllowed, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) virtual external;
function collateralBalanceOf(address account, address asset) virtual external view returns (uint128);
function baseTrackingAccrued(address account) virtual external view returns (uint64);
function baseAccrualScale() virtual external view returns (uint64);
function baseIndexScale() virtual external view returns (uint64);
function factorScale() virtual external view returns (uint64);
function priceScale() virtual external view returns (uint64);
function maxAssets() virtual external view returns (uint8);
function totalsBasic() virtual external view returns (TotalsBasic memory);
function version() virtual external view returns (string memory);
/**
* ===== ERC20 interfaces =====
* Does not include the following functions/events, which are defined in `CometMainInterface` instead:
* - function decimals() virtual external view returns (uint8)
* - function totalSupply() virtual external view returns (uint256)
* - function transfer(address dst, uint amount) virtual external returns (bool)
* - function transferFrom(address src, address dst, uint amount) virtual external returns (bool)
* - function balanceOf(address owner) virtual external view returns (uint256)
* - event Transfer(address indexed from, address indexed to, uint256 amount)
*/
function name() virtual external view returns (string memory);
function symbol() virtual external view returns (string memory);
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number of tokens that are approved (-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint256 amount) virtual external returns (bool);
/**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent (-1 means infinite)
*/
function allowance(address owner, address spender) virtual external view returns (uint256);
event Approval(address indexed owner, address indexed spender, uint256 amount);
}