-
Notifications
You must be signed in to change notification settings - Fork 17
/
contracts_errors.go
99 lines (94 loc) · 2.65 KB
/
contracts_errors.go
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
package abi
// Code autogenerated. DO NOT EDIT.
import ()
var contractErrors = map[ContractInterface]map[int32]string{
MultisigOrderV2: {104: "Unauthorized init",
105: "Already inited",
106: "Unauthorized sign",
107: "Already approved",
111: "Expired",
112: "Already executed",
65535: "Unknown op",
},
MultisigV2: {100: "Not enough ton",
101: "Unauthorized execute",
102: "Signers outdated",
103: "Invalid dictionary sequence",
108: "Inconsistent data",
109: "Invalid threshold",
110: "Invalid signers",
111: "Expired",
1007: "Unauthorized proposer",
1008: "Invalid new order",
},
NftAuctionGetgemsV3: {403: "Unauthorized address",
1000: "Low bid",
1001: "Already initiated",
1002: "Invalid op, expect ownership_assigned",
1003: "Invalid op, expect ownership_assigned",
1005: "Already executed",
1006: "Already activated",
1008: "Not enough TONs",
1009: "Already has bid",
1010: "Auction in progress",
65535: "Unknown operation",
},
NftSaleGetgemsV2: {404: "Already sold or cancelled",
450: "Not enough TONs for sale",
457: "Not enough TONs for cancellation",
458: "Unauthorized cancellation",
500: "Unauthorized initiation",
501: "Invalid op, expected ownership_assigned",
65535: "Unknown operation",
},
NftSaleGetgemsV3: {404: "Already sold or cancelled",
405: "Mode 32 not allowed",
406: "Can't execute command at this time",
408: "Inconsistent price and fees",
409: "Inconsistent price and fees",
410: "Inconsistent price and fees",
450: "Not enough TONs for sale",
457: "Not enough TONs for cancellation",
458: "Unauthorized cancellation",
500: "Unauthorized initiation",
501: "Invalid op, expected ownership_assigned",
65535: "Unknown operation",
},
WalletV4R2: {33: "Invalid seqno",
34: "Invalid subwallet ID",
35: "Invalid signature",
36: "Expired message",
39: "Plugin not found",
80: "Not enough ton",
},
}
var defaultExitCodes = map[int32]string{
0: "Ok",
1: "Ok",
2: "Stack underflow",
3: "Stack overflow",
4: "Integer overflow or division by zero",
5: "Integer out of expected range",
6: "Invalid opcode",
7: "Type check error",
8: "Cell overflow",
9: "Cell underflow",
10: "Dictionary error",
11: "Unknown error",
12: "Impossible situation error",
13: "Out of gas error",
-14: "Out of gas error",
}
func GetContractError(interfaces []ContractInterface, code int32) *string {
for _, i := range interfaces {
if errors, ok := contractErrors[i]; ok {
if msg, ok := errors[code]; ok {
return &msg
}
}
}
if msg, ok := defaultExitCodes[code]; ok {
return &msg
}
return nil
}