-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathErrors.sol
More file actions
140 lines (93 loc) · 4.42 KB
/
Errors.sol
File metadata and controls
140 lines (93 loc) · 4.42 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
// 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 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 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();
/* ----- 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();
/* ----- 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();
}