ErrorReporter.sol
↘ Derived Contracts: CarefulMath, Exponential, Liquidator, SafeToken
Enums

Error

1
enum Error {
2
NO_ERROR,
3
OPAQUE_ERROR,
4
UNAUTHORIZED,
5
INTEGER_OVERFLOW,
6
INTEGER_UNDERFLOW,
7
DIVISION_BY_ZERO,
8
BAD_INPUT,
9
TOKEN_INSUFFICIENT_ALLOWANCE,
10
TOKEN_INSUFFICIENT_BALANCE,
11
TOKEN_TRANSFER_FAILED,
12
MARKET_NOT_SUPPORTED,
13
SUPPLY_RATE_CALCULATION_FAILED,
14
BORROW_RATE_CALCULATION_FAILED,
15
TOKEN_INSUFFICIENT_CASH,
16
TOKEN_TRANSFER_OUT_FAILED,
17
INSUFFICIENT_LIQUIDITY,
18
INSUFFICIENT_BALANCE,
19
INVALID_COLLATERAL_RATIO,
20
MISSING_ASSET_PRICE,
21
EQUITY_INSUFFICIENT_BALANCE,
22
INVALID_CLOSE_AMOUNT_REQUESTED,
23
ASSET_NOT_PRICED,
24
INVALID_LIQUIDATION_DISCOUNT,
25
INVALID_COMBINED_RISK_PARAMETERS,
26
ZERO_ORACLE_ADDRESS,
27
CONTRACT_PAUSED,
28
KYC_ADMIN_CHECK_FAILED,
29
KYC_ADMIN_ADD_OR_DELETE_ADMIN_CHECK_FAILED,
30
KYC_CUSTOMER_VERIFICATION_CHECK_FAILED,
31
LIQUIDATOR_CHECK_FAILED,
32
LIQUIDATOR_ADD_OR_DELETE_ADMIN_CHECK_FAILED,
33
SET_WETH_ADDRESS_ADMIN_CHECK_FAILED,
34
WETH_ADDRESS_NOT_SET_ERROR,
35
ETHER_AMOUNT_MISMATCH_ERROR
36
}
Copied!

FailureInfo

1
enum FailureInfo {
2
ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
3
BORROW_ACCOUNT_LIQUIDITY_CALCULATION_FAILED,
4
BORROW_ACCOUNT_SHORTFALL_PRESENT,
5
BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
6
BORROW_AMOUNT_LIQUIDITY_SHORTFALL,
7
BORROW_AMOUNT_VALUE_CALCULATION_FAILED,
8
BORROW_CONTRACT_PAUSED,
9
BORROW_MARKET_NOT_SUPPORTED,
10
BORROW_NEW_BORROW_INDEX_CALCULATION_FAILED,
11
BORROW_NEW_BORROW_RATE_CALCULATION_FAILED,
12
BORROW_NEW_SUPPLY_INDEX_CALCULATION_FAILED,
13
BORROW_NEW_SUPPLY_RATE_CALCULATION_FAILED,
14
BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
15
BORROW_NEW_TOTAL_BORROW_CALCULATION_FAILED,
16
BORROW_NEW_TOTAL_CASH_CALCULATION_FAILED,
17
BORROW_ORIGINATION_FEE_CALCULATION_FAILED,
18
BORROW_TRANSFER_OUT_FAILED,
19
EQUITY_WITHDRAWAL_AMOUNT_VALIDATION,
20
EQUITY_WITHDRAWAL_CALCULATE_EQUITY,
21
EQUITY_WITHDRAWAL_MODEL_OWNER_CHECK,
22
EQUITY_WITHDRAWAL_TRANSFER_OUT_FAILED,
23
LIQUIDATE_ACCUMULATED_BORROW_BALANCE_CALCULATION_FAILED,
24
LIQUIDATE_ACCUMULATED_SUPPLY_BALANCE_CALCULATION_FAILED_BORROWER_COLLATERAL_ASSET,
25
LIQUIDATE_ACCUMULATED_SUPPLY_BALANCE_CALCULATION_FAILED_LIQUIDATOR_COLLATERAL_ASSET,
26
LIQUIDATE_AMOUNT_SEIZE_CALCULATION_FAILED,
27
LIQUIDATE_BORROW_DENOMINATED_COLLATERAL_CALCULATION_FAILED,
28
LIQUIDATE_CLOSE_AMOUNT_TOO_HIGH,
29
LIQUIDATE_CONTRACT_PAUSED,
30
LIQUIDATE_DISCOUNTED_REPAY_TO_EVEN_AMOUNT_CALCULATION_FAILED,
31
LIQUIDATE_NEW_BORROW_INDEX_CALCULATION_FAILED_BORROWED_ASSET,
32
LIQUIDATE_NEW_BORROW_INDEX_CALCULATION_FAILED_COLLATERAL_ASSET,
33
LIQUIDATE_NEW_BORROW_RATE_CALCULATION_FAILED_BORROWED_ASSET,
34
LIQUIDATE_NEW_SUPPLY_INDEX_CALCULATION_FAILED_BORROWED_ASSET,
35
LIQUIDATE_NEW_SUPPLY_INDEX_CALCULATION_FAILED_COLLATERAL_ASSET,
36
LIQUIDATE_NEW_SUPPLY_RATE_CALCULATION_FAILED_BORROWED_ASSET,
37
LIQUIDATE_NEW_TOTAL_BORROW_CALCULATION_FAILED_BORROWED_ASSET,
38
LIQUIDATE_NEW_TOTAL_CASH_CALCULATION_FAILED_BORROWED_ASSET,
39
LIQUIDATE_NEW_TOTAL_SUPPLY_BALANCE_CALCULATION_FAILED_BORROWER_COLLATERAL_ASSET,
40
LIQUIDATE_NEW_TOTAL_SUPPLY_BALANCE_CALCULATION_FAILED_LIQUIDATOR_COLLATERAL_ASSET,
41
LIQUIDATE_FETCH_ASSET_PRICE_FAILED,
42
LIQUIDATE_TRANSFER_IN_FAILED,
43
LIQUIDATE_TRANSFER_IN_NOT_POSSIBLE,
44
REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
45
REPAY_BORROW_CONTRACT_PAUSED,
46
REPAY_BORROW_NEW_BORROW_INDEX_CALCULATION_FAILED,
47
REPAY_BORROW_NEW_BORROW_RATE_CALCULATION_FAILED,
48
REPAY_BORROW_NEW_SUPPLY_INDEX_CALCULATION_FAILED,
49
REPAY_BORROW_NEW_SUPPLY_RATE_CALCULATION_FAILED,
50
REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
51
REPAY_BORROW_NEW_TOTAL_BORROW_CALCULATION_FAILED,
52
REPAY_BORROW_NEW_TOTAL_CASH_CALCULATION_FAILED,
53
REPAY_BORROW_TRANSFER_IN_FAILED,
54
REPAY_BORROW_TRANSFER_IN_NOT_POSSIBLE,
55
SET_ASSET_PRICE_CHECK_ORACLE,
56
SET_MARKET_INTEREST_RATE_MODEL_OWNER_CHECK,
57
SET_ORACLE_OWNER_CHECK,
58
SET_ORIGINATION_FEE_OWNER_CHECK,
59
SET_PAUSED_OWNER_CHECK,
60
SET_PENDING_ADMIN_OWNER_CHECK,
61
SET_RISK_PARAMETERS_OWNER_CHECK,
62
SET_RISK_PARAMETERS_VALIDATION,
63
SUPPLY_ACCUMULATED_BALANCE_CALCULATION_FAILED,
64
SUPPLY_CONTRACT_PAUSED,
65
SUPPLY_MARKET_NOT_SUPPORTED,
66
SUPPLY_NEW_BORROW_INDEX_CALCULATION_FAILED,
67
SUPPLY_NEW_BORROW_RATE_CALCULATION_FAILED,
68
SUPPLY_NEW_SUPPLY_INDEX_CALCULATION_FAILED,
69
SUPPLY_NEW_SUPPLY_RATE_CALCULATION_FAILED,
70
SUPPLY_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
71
SUPPLY_NEW_TOTAL_CASH_CALCULATION_FAILED,
72
SUPPLY_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
73
SUPPLY_TRANSFER_IN_FAILED,
74
SUPPLY_TRANSFER_IN_NOT_POSSIBLE,
75
SUPPORT_MARKET_FETCH_PRICE_FAILED,
76
SUPPORT_MARKET_OWNER_CHECK,
77
SUPPORT_MARKET_PRICE_CHECK,
78
SUSPEND_MARKET_OWNER_CHECK,
79
WITHDRAW_ACCOUNT_LIQUIDITY_CALCULATION_FAILED,
80
WITHDRAW_ACCOUNT_SHORTFALL_PRESENT,
81
WITHDRAW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
82
WITHDRAW_AMOUNT_LIQUIDITY_SHORTFALL,
83
WITHDRAW_AMOUNT_VALUE_CALCULATION_FAILED,
84
WITHDRAW_CAPACITY_CALCULATION_FAILED,
85
WITHDRAW_CONTRACT_PAUSED,
86
WITHDRAW_NEW_BORROW_INDEX_CALCULATION_FAILED,
87
WITHDRAW_NEW_BORROW_RATE_CALCULATION_FAILED,
88
WITHDRAW_NEW_SUPPLY_INDEX_CALCULATION_FAILED,
89
WITHDRAW_NEW_SUPPLY_RATE_CALCULATION_FAILED,
90
WITHDRAW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
91
WITHDRAW_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
92
WITHDRAW_TRANSFER_OUT_FAILED,
93
WITHDRAW_TRANSFER_OUT_NOT_POSSIBLE,
94
KYC_ADMIN_CHECK_FAILED,
95
KYC_ADMIN_ADD_OR_DELETE_ADMIN_CHECK_FAILED,
96
KYC_CUSTOMER_VERIFICATION_CHECK_FAILED,
97
LIQUIDATOR_CHECK_FAILED,
98
LIQUIDATOR_ADD_OR_DELETE_ADMIN_CHECK_FAILED,
99
SET_WETH_ADDRESS_ADMIN_CHECK_FAILED,
100
WETH_ADDRESS_NOT_SET_ERROR,
101
SEND_ETHER_ADMIN_CHECK_FAILED,
102
ETHER_AMOUNT_MISMATCH_ERROR
103
}
Copied!
Events
1
event Failure(uint256 error, uint256 info, uint256 detail);
Copied!

Functions

  • fail(enum ErrorReporter.Error err, enum ErrorReporter.FailureInfo info)
  • failOpaque(enum ErrorReporter.FailureInfo info, uint256 opaqueError)

fail

use this when reporting a known error from the Alkemi Earn Verified or a non-upgradeable collaborator
1
function fail(enum ErrorReporter.Error err, enum ErrorReporter.FailureInfo info) internal nonpayable
2
returns(uint256)
Copied!
Arguments
Name
Type
Description
err
enum ErrorReporter.Error
info
enum ErrorReporter.FailureInfo

failOpaque

use this when reporting an opaque error from an upgradeable collaborator contract
1
function failOpaque(enum ErrorReporter.FailureInfo info, uint256 opaqueError) internal nonpayable
2
returns(uint256)
Copied!
Arguments
Name
Type
Description
info
enum ErrorReporter.FailureInfo
opaqueError
uint256
Last modified 4mo ago
Copy link
Contents
Functions