-
Notifications
You must be signed in to change notification settings - Fork 3
/
contract-errors.ts
99 lines (69 loc) · 2.89 KB
/
contract-errors.ts
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
/**
* Errors that can be received from contracts in the Kolibri system.
*
* IMPORTANT: Keep this file in sync with /smart_contracts/helpers/errors.py.
*/
enum ContractErrors {
// An unknown error occurred. This error code is never propagated from the contracts
// and only exists in the SDK.
Unknown = -1,
// The sender of a contract invocation was required to be a oven.
NotOven = 1,
// The sender of a contract invocation was required to be the Oven Proxy contract.
NotOvenProxy = 2,
// The sender of a contract invocation was required to be the Oracle contract.
NotOracle = 3,
// The sender of a contract invocation was required to be the Governor contract.
NotGovernor = 4,
// The sender of the contract invocation was required to be the Minter contract.
NotMinter = 5,
// The sender of an operation was required to be the owner of the Oven contract.
NotOwner = 6,
// The sender of an operation was required to be the Oven Factory contract.
NotOvenFactory = 7,
// The sender of an operation was required to be the Administrator of the contract.
NotAdmin = 8,
// The sender of an operation was required to be the Pause Guardian.
NotPauseGuardian = 9,
// The operation required the oven to be under collateralized.
NotUnderCollateralized = 10,
// The operation caused the oven to become under collateralized.
OvenUnderCollateralized = 11,
// The state machine of the contract was not in the expected state.
BadState = 12,
// The destination message was routed to the wrong smart contract.
BadDestination = 13,
// The result contained data for an unexpected asset.
WrongAsset = 14,
// The request was not allowed to send an amount.
AmountNotAllowed = 15,
// The operation could not be completed because the oven was liquidated.
Liquidated = 16,
// The data provided was too old.
StaleData = 17,
// The system is paused.
Paused = 18,
// Cannot receive funds.
CannotReceiveFunds = 19,
// The debt ceiling would be exceeded if the operation were completed.
DebtCeiling = 20,
// The Oven was past the maximum allowed value.
OvenMaximumExceeded = 21,
// The user was not allowed to perform a token transfer.
TokenNoTransferPermission = 22,
// The user did not have a sufficient token balance to complete the operation.
TokenInsufficientBalance = 23,
// The allowance change was unsafe. Please reset the allowance to zero before trying to operation again.
TokenUnsafeAllowanceChange = 23,
// The operation was not performed by the token administrator.
TokenNotAdministrator = 24,
// The splits given did not sum to one.
BadSplits = 25,
// The sender was not allowed to liquidate, even though the oven was undercollateralized
NotAllowedToLiquidate = 26,
// The caller was not the savings account.
NotSavingsAccount = 27,
// The sender was not the expected contract
BadSender = 28,
}
export default ContractErrors