-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathErrors.sol
More file actions
189 lines (125 loc) · 5.97 KB
/
Copy pathErrors.sol
File metadata and controls
189 lines (125 loc) · 5.97 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.27;
/// @title Errors
/// @notice Library containing all custom errors the protocol may revert with
library Errors {
/* ----- Generic ----- */
/// @notice Reverts if the address is zero
error ZeroAddress();
/* ----- IdFactory ----- */
/// @notice Reverts if the factory is already registered
error AlreadyAFactory(address factory);
/// @notice Reverts when the recovered signer does not match the wallet being registered
error InvalidSignature();
/// @notice Reverts when the provided signature has expired
error SignatureExpired(uint256 expiry);
/// @notice Reverts when the wallet does not hold a management key on the identity
error MissingManagementKey();
/// @notice Reverts when the wallet is not linked to msg.sender during removal
error WalletNotLinked();
/// @notice Reverts if the function is called on the sender address
error CannotBeCalledOnSenderAddress();
/// @notice Reverts if the list of keys is empty
error EmptyListOfKeys();
/// @notice Reverts if the string is empty
error EmptyString();
/// @notice Reverts if the address is not a factory
error NotAFactory(address factory);
/// @notice Reverts if the maximum number of wallets per identity is exceeded
error MaxWalletsPerIdentityExceeded();
/// @notice Reverts if the only linked wallet tries to unlink
error OnlyLinkedWalletCanUnlink();
/// @notice Reverts if the account is not authorized to call the function
error OwnableUnauthorizedAccount(address account); // TODO: OZ
/// @notice Reverts if the salt is taken
error SaltTaken(string salt);
/// @notice Reverts if the token is already linked
error TokenAlreadyLinked(address token);
/// @notice Reverts if the wallet is already linked to an identity
error WalletAlreadyLinkedToIdentity(address wallet);
/// @notice Reverts if the wallet is also listed in management keys
error WalletAlsoListedInManagementKeys(address wallet);
/// @notice Reverts if the wallet is not linked to an identity
error WalletNotLinkedToIdentity(address wallet);
/* ----- Gateway ----- */
/// @notice The maximum number of signers was reached at deployment.
error TooManySigners();
/// @notice The signed attempted to add was already approved.
error SignerAlreadyApproved(address signer);
/// @notice The signed attempted to remove was not approved.
error SignerAlreadyNotApproved(address signer);
/// @notice A requested ONCHAINID deployment was requested and signer by a non approved signer.
error UnapprovedSigner(address signer);
/// @notice A requested ONCHAINID deployment was requested with a signature revoked.
error RevokedSignature(bytes signature);
/// @notice A requested ONCHAINID deployment was requested with a signature that expired.
error ExpiredSignature(bytes signature);
/// @notice Attempted to revoke a signature that was already revoked.
error SignatureAlreadyRevoked(bytes signature);
/// @notice Attempted to approve a signature that was not revoked.
error SignatureNotRevoked(bytes signature);
/// @notice A call to the factory failed.
error CallToFactoryFailed();
/* ----- IdentityProxy ----- */
/// @notice The initialization failed.
error InitializationFailed();
/* ----- Verifier ----- */
/// @notice The claim topic already exists.
error ClaimTopicAlreadyExists(uint256 claimTopic);
/// @notice The maximum number of claim topics is exceeded.
error MaxClaimTopicsExceeded();
/// @notice The maximum number of trusted issuers is exceeded.
error MaxTrustedIssuersExceeded();
/// @notice The trusted issuer already exists.
error TrustedIssuerAlreadyExists(address trustedIssuer);
/// @notice The trusted claim topics cannot be empty.
error TrustedClaimTopicsCannotBeEmpty();
/// @notice The trusted issuer does not exist.
error NotATrustedIssuer(address trustedIssuer);
/* ----- ClaimIssuer ----- */
/// @notice The claim already exists.
error ClaimAlreadyRevoked();
/* ----- Identity ----- */
/// @notice Interacting with the library contract is forbidden.
error InteractingWithLibraryContractForbidden();
/// @notice The sender does not have the management key.
error SenderDoesNotHaveManagementKey();
/// @notice The sender does not have the claim signer key.
error SenderDoesNotHaveClaimSignerKey();
/// @notice The sender does not have the action key.
error SenderDoesNotHaveActionKey();
/// @notice The initial key was already setup.
error InitialKeyAlreadySetup();
/// @notice The key is not registered.
error KeyNotRegistered(bytes32 key);
/// @notice The key already has the purpose.
error KeyAlreadyHasPurpose(bytes32 key, uint256 purpose);
/// @notice The key does not have the purpose.
error KeyDoesNotHavePurpose(bytes32 key, uint256 purpose);
/// @notice The claim is not registered.
error ClaimNotRegistered(bytes32 claimId);
/// @notice The request is not valid.
error InvalidRequestId();
/// @notice The request is already executed.
error RequestAlreadyExecuted();
/// @notice The claim is invalid.
error InvalidClaim();
/* ----- IdentityUtilities ----- */
/// @notice 0 is not a valid topic.
error EmptyTopic();
/// @notice 0 is not a valid Format.
error EmptyFormat();
/// @notice Name cannot be left empty.
error EmptyName();
/// @notice Use update function for existing topics.
error TopicAlreadyExists(uint256 topic);
/// @notice Topic is not registered yet.
error TopicNotFound(uint256 topic);
/* ----- ClaimIssuerFactory ----- */
/// @notice The claim issuer already exists.
error ClaimIssuerAlreadyDeployed(address managementKey);
/// @notice The address is blacklisted.
error Blacklisted(address addr);
/// @notice The call failed.
error CallFailed();
}