-
Notifications
You must be signed in to change notification settings - Fork 9
/
IErrors.sol
80 lines (64 loc) · 3.21 KB
/
IErrors.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
69
70
71
72
73
74
75
76
77
78
79
80
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
/// @dev Errors.
interface IErrors {
/// @dev Only `owner` has a privilege, but the `sender` was provided.
/// @param sender Sender address.
/// @param owner Required sender address as an owner.
error OwnerOnly(address sender, address owner);
/// @dev Provided zero address.
error ZeroAddress();
/// @dev Zero value when it has to be different from zero.
error ZeroValue();
/// @dev Non-zero value when it has to be zero.
error NonZeroValue();
/// @dev Wrong length of two arrays.
/// @param numValues1 Number of values in a first array.
/// @param numValues2 Numberf of values in a second array.
error WrongArrayLength(uint256 numValues1, uint256 numValues2);
/// @dev Value overflow.
/// @param provided Overflow value.
/// @param max Maximum possible value.
error Overflow(uint256 provided, uint256 max);
/// @dev Token is non-transferable.
/// @param account Token address.
error NonTransferable(address account);
/// @dev Token is non-delegatable.
/// @param account Token address.
error NonDelegatable(address account);
/// @dev Insufficient token allowance.
/// @param provided Provided amount.
/// @param expected Minimum expected amount.
error InsufficientAllowance(uint256 provided, uint256 expected);
/// @dev No existing lock value is found.
/// @param account Address that is checked for the locked value.
error NoValueLocked(address account);
/// @dev Locked value is not zero.
/// @param account Address that is checked for the locked value.
/// @param amount Locked amount.
error LockedValueNotZero(address account, uint256 amount);
/// @dev Value lock is expired.
/// @param account Address that is checked for the locked value.
/// @param deadline The lock expiration deadline.
/// @param curTime Current timestamp.
error LockExpired(address account, uint256 deadline, uint256 curTime);
/// @dev Value lock is not expired.
/// @param account Address that is checked for the locked value.
/// @param deadline The lock expiration deadline.
/// @param curTime Current timestamp.
error LockNotExpired(address account, uint256 deadline, uint256 curTime);
/// @dev Provided unlock time is incorrect.
/// @param account Address that is checked for the locked value.
/// @param minUnlockTime Minimal unlock time that can be set.
/// @param providedUnlockTime Provided unlock time.
error UnlockTimeIncorrect(address account, uint256 minUnlockTime, uint256 providedUnlockTime);
/// @dev Provided unlock time is bigger than the maximum allowed.
/// @param account Address that is checked for the locked value.
/// @param maxUnlockTime Max unlock time that can be set.
/// @param providedUnlockTime Provided unlock time.
error MaxUnlockTimeReached(address account, uint256 maxUnlockTime, uint256 providedUnlockTime);
/// @dev Provided block number is incorrect (has not been processed yet).
/// @param providedBlockNumber Provided block number.
/// @param actualBlockNumber Actual block number.
error WrongBlockNumber(uint256 providedBlockNumber, uint256 actualBlockNumber);
}