-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
82 lines (43 loc) · 2.88 KB
/
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
package arwen
import (
"errors"
"fmt"
)
var ErrFunctionRunError = errors.New("function run error")
var ErrReturnCodeNotOk = errors.New("return not is not ok")
var ErrInvalidCallOnReadOnlyMode = errors.New("operation not permitted in read only mode")
var ErrNotEnoughGas = errors.New("not enough gas")
var ErrUnhandledRuntimeBreakpoint = errors.New("unhandled runtime breakpoint")
var ErrSignalError = errors.New("error signalled by smartcontract")
var ErrExecutionFailed = errors.New("execution failed")
var ErrInvalidAPICall = errors.New("invalid API call")
var ErrBadBounds = errors.New("bad bounds")
var ErrBadLowerBounds = fmt.Errorf("%w (lower)", ErrBadBounds)
var ErrBadUpperBounds = fmt.Errorf("%w (upper)", ErrBadBounds)
var ErrNegativeLength = errors.New("negative length")
var ErrFailedTransfer = errors.New("failed transfer")
var ErrTransferInsufficientFunds = fmt.Errorf("%w (insufficient funds)", ErrFailedTransfer)
var ErrFailedTransferDuringAsyncCall = fmt.Errorf("%w (failed during async call)", ErrFailedTransfer)
var ErrTransferNegativeValue = fmt.Errorf("%w (negative value)", ErrFailedTransfer)
var ErrUpgradeFailed = errors.New("upgrade failed")
var ErrInvalidUpgradeArguments = fmt.Errorf("%w (invalid arguments)", ErrUpgradeFailed)
var ErrInvalidFunction = errors.New("invalid function")
var ErrInitFuncCalledInRun = fmt.Errorf("%w (calling init() directly is forbidden)", ErrInvalidFunction)
var ErrCallBackFuncCalledInRun = fmt.Errorf("%w (calling callBack() directly is forbidden)", ErrInvalidFunction)
var ErrCallBackFuncNotExpected = fmt.Errorf("%w (unexpected callback was received)", ErrInvalidFunction)
var ErrFuncNotFound = fmt.Errorf("%w (not found)", ErrInvalidFunction)
var ErrInvalidFunctionName = fmt.Errorf("%w (invalid name)", ErrInvalidFunction)
var ErrFunctionNonvoidSignature = fmt.Errorf("%w (nonvoid signature)", ErrInvalidFunction)
var ErrContractInvalid = fmt.Errorf("invalid contract code")
var ErrContractNotFound = fmt.Errorf("%w (not found)", ErrContractInvalid)
var ErrMemoryDeclarationMissing = fmt.Errorf("%w (missing memory declaration)", ErrContractInvalid)
var ErrMaxInstancesReached = fmt.Errorf("%w (max instances reached)", ErrExecutionFailed)
var ErrStoreKalyan3104ReservedKey = errors.New("cannot write to storage under Kalyan3104 reserved key")
var ErrArgIndexOutOfRange = errors.New("argument index out of range")
var ErrArgOutOfRange = errors.New("argument out of range")
var ErrDivZero = errors.New("division by 0")
var ErrBitwiseNegative = errors.New("bitwise operations only allowed on positive integers")
var ErrShiftNegative = errors.New("bitwise shift operations only allowed on positive integers and by a positive amount")
var ErrAsyncContextDoesNotExist = errors.New("async context was not created yet")
var ErrAsync = errors.New("invalid gas percentage provided for async call")
var ErrInvalidAccount = errors.New("account does not exist")