πŸ“„ ErrorLibrary.sol
D-OPEN SOVEREIGN

Documentation & Insights

@title ErrorLibrary
@dev CentralizeᎠ Library for all revert error codes used across the smart contracts
This library consolidates all custom errors to ensure consistency and reduce code duplication
@dev The vote casted on the project is called with a lang not supported by the project
@dev The caller account is not authorized to perform an operation.
@dev Too many adjectives have been defined.
@dev Too many verbs have been defined.
@dev Username is not defined in the system.
@dev Username is already taken by another user.
@dev No definitions available for username generation.
@dev Account doesn't have the required role.
@dev Access control confirmation is bad.
@dev Caller is forbidden from performing this action.
@dev Invalid project ID provided.
@dev Invalid fund amount provided.
@dev Not enough balance to perform the operation.
@dev User doesn't have an account.
@dev User is already registered.
@dev Minimum donation amount not met.
@dev ETH transfer failed.
@dev Account is not authorized as owner.
@dev Invalid owner address provided.
@dev Number of months since deployment calculation overflow.
@dev Object ID overflow error.
@dev Referenced PublicLibrary id does not exist in PublicLibraryStorage.
1/*
2 * Copyright (c) 2026 DataPond D-Library Pty Ltd. ("The Sanctuary")
3 * Non-Profit Public Library β€” The World Library
4 * 
5 * D-SAFE Certification issued by POND Enterprise.
6 * Published under the D-Open Code Sovereign Licence v1.0 framework
7 * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.
8 * https://registry.world.bibliotech.com/licence
9 * Source code donated to DataPond D-Library by it's author: data pond.
10 * 
11 * Technical Guardian ("The Shield"): Pond Enterprise Pty Ltd. (ACN 694 747 987)
12 * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.
13 * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.
14 */
15
16// SPDX-License-Identifier: Apache-2.0
17pragma solidity ^0.8.24;
18
19/**
20 * @title ErrorLibrary
21 * @dev CentralizeᎠ Library for all revert error codes used across the smart contracts
22 * This library consolidates all custom errors to ensure consistency and reduce code duplication
23 */
24library ErrorLibrary {
25    
26    // ========================== IDENTITY ERRORS ==========================
27
28    /**
29     * @dev The vote casted on the project is called with a lang not supported by the project
30     */
31    error InvalidLangVote();
32
33    /**
34     * @dev The caller account is not authorized to perform an operation.
35     */
36    error IdentityUnauthorizedAccount(address account);
37    
38    /**
39     * @dev Too many adjectives have been defined.
40     */
41    error TooManyAdjectiveDefined();
42    
43    /**
44     * @dev Too many verbs have been defined.
45     */
46    error TooManyVerbsDefined();
47    
48    /**
49     * @dev Username is not defined in the system.
50     */
51    error UsernameNotDefined();
52    
53    /**
54     * @dev Username is already taken by another user.
55     */
56    error UserNameAlreadyTaken();
57
58    error NotABouncer();
59
60    error InvalidUserId();
61
62    error LevelNotDefinedForUser();
63    /**
64     * @dev No definitions available for username generation.
65     */
66    error noDefinitionErr();
67    
68    // ========================== ACCESS CONTROL ERRORS ==========================
69    
70    /**
71     * @dev Account doesn't have the required role.
72     */
73    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
74    
75    /**
76     * @dev Access control confirmation is bad.
77     */
78    error AccessControlBadConfirmation();
79    
80    // ========================== PROJECT MANAGER ERRORS ==========================
81    
82    /**
83     * @dev Caller is forbidden from performing this action.
84     */
85    error Forbidden(address caller);
86    
87    /**
88     * @dev Invalid project ID provided.
89     */
90    error InvalidProjectId();
91    
92    /**
93     * @dev Invalid fund amount provided.
94     */
95    error InvalidFundAmount();
96    
97    /**
98     * @dev Not enough balance to perform the operation.
99     */
100    error NotEnoughOnBalance();
101    
102    // ========================== BOUNCER ERRORS ==========================
103
104    error EmptyAddress();
105
106    /**
107     * @dev User doesn't have an account.
108     */
109    error ErrNoAccount();
110
111    error NoProjectsDefined();
112    
113    /**
114     * @dev User is already registered.
115     */
116    error ErrAlreadyRegistered();
117    
118    // ========================== ACCOUNTANT ERRORS ==========================
119    
120    /**
121     * @dev Minimum donation amount not met.
122     */
123    error MinDonationNotMet();
124    
125    /**
126     * @dev ETH transfer failed.
127     */
128    error ETHTransferFailed();
129    
130    // ========================== OWNABLE ERRORS ==========================
131    
132    /**
133     * @dev Account is not authorized as owner.
134     */
135    error OwnableUnauthorizedAccount(address account);
136    
137    /**
138     * @dev Invalid owner address provided.
139     */
140    error OwnableInvalidOwner(address owner);
141    
142    // ========================== SCIENTIST ERRORS ==========================
143    
144    /**
145     * @dev Number of months since deployment calculation overflow.
146     */
147    error NbMonthsSinceOverflow();
148    
149    /**
150     * @dev Object ID overflow error.
151     */
152    error ObjectIdOverflow();
153
154    // ========================== LIBRARY REGISTRY ERRORS ==========================
155
156    /**
157     * @dev Referenced PublicLibrary id does not exist in PublicLibraryStorage.
158     */
159    error InvalidPublicLibraryId();
160}