@poa-box/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +201 -0
- package/dist/abis/DirectDemocracyVotingNew.d.ts +749 -0
- package/dist/abis/DirectDemocracyVotingNew.js +961 -0
- package/dist/abis/ERC20.d.ts +90 -0
- package/dist/abis/ERC20.js +125 -0
- package/dist/abis/EducationHubNew.d.ts +590 -0
- package/dist/abis/EducationHubNew.js +762 -0
- package/dist/abis/EligibilityModuleNew.d.ts +1615 -0
- package/dist/abis/EligibilityModuleNew.js +2082 -0
- package/dist/abis/Executor.d.ts +619 -0
- package/dist/abis/Executor.js +796 -0
- package/dist/abis/HybridVotingNew.d.ts +898 -0
- package/dist/abis/HybridVotingNew.js +1149 -0
- package/dist/abis/ImplementationRegistry.d.ts +270 -0
- package/dist/abis/ImplementationRegistry.js +355 -0
- package/dist/abis/OrgDeployerNew.d.ts +1275 -0
- package/dist/abis/OrgDeployerNew.js +1630 -0
- package/dist/abis/OrgRegistry.d.ts +670 -0
- package/dist/abis/OrgRegistry.js +868 -0
- package/dist/abis/ParticipationToken.d.ts +1086 -0
- package/dist/abis/ParticipationToken.js +1415 -0
- package/dist/abis/PasskeyAccount.d.ts +788 -0
- package/dist/abis/PasskeyAccount.js +1019 -0
- package/dist/abis/PasskeyAccountFactory.d.ts +344 -0
- package/dist/abis/PasskeyAccountFactory.js +449 -0
- package/dist/abis/PaymasterHub.d.ts +1603 -0
- package/dist/abis/PaymasterHub.js +2048 -0
- package/dist/abis/PaymentManager.d.ts +520 -0
- package/dist/abis/PaymentManager.js +671 -0
- package/dist/abis/PoaManager.d.ts +344 -0
- package/dist/abis/PoaManager.js +449 -0
- package/dist/abis/QuickJoinNew.d.ts +855 -0
- package/dist/abis/QuickJoinNew.js +1098 -0
- package/dist/abis/TaskManagerNew.d.ts +1236 -0
- package/dist/abis/TaskManagerNew.js +1573 -0
- package/dist/abis/ToggleModule.d.ts +193 -0
- package/dist/abis/ToggleModule.js +255 -0
- package/dist/abis/UniversalAccountRegistry.d.ts +577 -0
- package/dist/abis/UniversalAccountRegistry.js +750 -0
- package/dist/abis/ZkEmailInvites.d.ts +823 -0
- package/dist/abis/ZkEmailInvites.js +1060 -0
- package/dist/abis/external/AaveGovernanceV2.d.ts +128 -0
- package/dist/abis/external/AaveGovernanceV2.js +177 -0
- package/dist/abis/external/AaveGovernanceV3.d.ts +160 -0
- package/dist/abis/external/AaveGovernanceV3.js +220 -0
- package/dist/abis/external/AragonVoting.d.ts +107 -0
- package/dist/abis/external/AragonVoting.js +150 -0
- package/dist/abis/external/CurveGaugeController.d.ts +95 -0
- package/dist/abis/external/CurveGaugeController.js +130 -0
- package/dist/abis/external/CurveVotingEscrow.d.ts +86 -0
- package/dist/abis/external/CurveVotingEscrow.js +116 -0
- package/dist/abis/external/GovernorAlpha.d.ts +172 -0
- package/dist/abis/external/GovernorAlpha.js +228 -0
- package/dist/abis/external/MakerDAOChief.d.ts +92 -0
- package/dist/abis/external/MakerDAOChief.js +129 -0
- package/dist/abis/external/OZGovernor.d.ts +227 -0
- package/dist/abis/external/OZGovernor.js +317 -0
- package/dist/abis/external/SolidlyVotingEscrow.d.ts +196 -0
- package/dist/abis/external/SolidlyVotingEscrow.js +260 -0
- package/dist/abis/index.d.ts +62 -0
- package/dist/abis/index.js +98 -0
- package/dist/chains.d.ts +150 -0
- package/dist/chains.js +320 -0
- package/dist/context.d.ts +48 -0
- package/dist/context.js +38 -0
- package/dist/contracts.d.ts +24 -0
- package/dist/contracts.js +41 -0
- package/dist/encoding.d.ts +58 -0
- package/dist/encoding.js +243 -0
- package/dist/env.d.ts +10 -0
- package/dist/env.js +4 -0
- package/dist/error-catalog.d.ts +41 -0
- package/dist/error-catalog.js +941 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.js +60 -0
- package/dist/execute/ethers.d.ts +93 -0
- package/dist/execute/ethers.js +323 -0
- package/dist/execute/index.d.ts +7 -0
- package/dist/execute/index.js +23 -0
- package/dist/execute/sponsored.d.ts +68 -0
- package/dist/execute/sponsored.js +277 -0
- package/dist/exit-codes.d.ts +18 -0
- package/dist/exit-codes.js +21 -0
- package/dist/format.d.ts +21 -0
- package/dist/format.js +89 -0
- package/dist/graph/client.d.ts +298 -0
- package/dist/graph/client.js +702 -0
- package/dist/graph/documents/activity.d.ts +9 -0
- package/dist/graph/documents/activity.js +164 -0
- package/dist/graph/documents/beacons.d.ts +172 -0
- package/dist/graph/documents/beacons.js +345 -0
- package/dist/graph/documents/index.d.ts +21 -0
- package/dist/graph/documents/index.js +57 -0
- package/dist/graph/documents/infrastructure.d.ts +30 -0
- package/dist/graph/documents/infrastructure.js +34 -0
- package/dist/graph/documents/org.d.ts +15 -0
- package/dist/graph/documents/org.js +249 -0
- package/dist/graph/documents/paymaster.d.ts +95 -0
- package/dist/graph/documents/paymaster.js +101 -0
- package/dist/graph/documents/role.d.ts +6 -0
- package/dist/graph/documents/role.js +41 -0
- package/dist/graph/documents/roles.d.ts +50 -0
- package/dist/graph/documents/roles.js +112 -0
- package/dist/graph/documents/task.d.ts +84 -0
- package/dist/graph/documents/task.js +236 -0
- package/dist/graph/documents/token.d.ts +13 -0
- package/dist/graph/documents/token.js +126 -0
- package/dist/graph/documents/treasury.d.ts +39 -0
- package/dist/graph/documents/treasury.js +136 -0
- package/dist/graph/documents/user.d.ts +120 -0
- package/dist/graph/documents/user.js +302 -0
- package/dist/graph/documents/voting-classes.d.ts +69 -0
- package/dist/graph/documents/voting-classes.js +149 -0
- package/dist/graph/documents/voting.d.ts +28 -0
- package/dist/graph/documents/voting.js +163 -0
- package/dist/graph/documents/vouch.d.ts +79 -0
- package/dist/graph/documents/vouch.js +171 -0
- package/dist/graph/documents/zkemail.d.ts +63 -0
- package/dist/graph/documents/zkemail.js +188 -0
- package/dist/graph/index.d.ts +2 -0
- package/dist/graph/index.js +41 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +92 -0
- package/dist/ipfs.d.ts +39 -0
- package/dist/ipfs.js +214 -0
- package/dist/label-aliases.d.ts +31 -0
- package/dist/label-aliases.js +70 -0
- package/dist/metadata/education.d.ts +30 -0
- package/dist/metadata/education.js +31 -0
- package/dist/metadata/index.d.ts +12 -0
- package/dist/metadata/index.js +48 -0
- package/dist/metadata/org.d.ts +92 -0
- package/dist/metadata/org.js +93 -0
- package/dist/metadata/proposal.d.ts +44 -0
- package/dist/metadata/proposal.js +45 -0
- package/dist/metadata/role.d.ts +38 -0
- package/dist/metadata/role.js +35 -0
- package/dist/metadata/task.d.ts +108 -0
- package/dist/metadata/task.js +81 -0
- package/dist/metadata/token.d.ts +32 -0
- package/dist/metadata/token.js +36 -0
- package/dist/metadata/user.d.ts +63 -0
- package/dist/metadata/user.js +70 -0
- package/dist/multicall.d.ts +32 -0
- package/dist/multicall.js +96 -0
- package/dist/payout.d.ts +59 -0
- package/dist/payout.js +96 -0
- package/dist/perms.d.ts +47 -0
- package/dist/perms.js +120 -0
- package/dist/preflight.d.ts +72 -0
- package/dist/preflight.js +269 -0
- package/dist/reads/education.d.ts +79 -0
- package/dist/reads/education.js +122 -0
- package/dist/reads/eligibility.d.ts +377 -0
- package/dist/reads/eligibility.js +687 -0
- package/dist/reads/index.d.ts +16 -0
- package/dist/reads/index.js +55 -0
- package/dist/reads/org.d.ts +258 -0
- package/dist/reads/org.js +220 -0
- package/dist/reads/paymaster.d.ts +147 -0
- package/dist/reads/paymaster.js +235 -0
- package/dist/reads/project.d.ts +33 -0
- package/dist/reads/project.js +62 -0
- package/dist/reads/resolve.d.ts +34 -0
- package/dist/reads/resolve.js +64 -0
- package/dist/reads/task.d.ts +286 -0
- package/dist/reads/task.js +280 -0
- package/dist/reads/token.d.ts +94 -0
- package/dist/reads/token.js +75 -0
- package/dist/reads/treasury.d.ts +222 -0
- package/dist/reads/treasury.js +241 -0
- package/dist/reads/user.d.ts +229 -0
- package/dist/reads/user.js +155 -0
- package/dist/reads/vote.d.ts +296 -0
- package/dist/reads/vote.js +392 -0
- package/dist/reads/zkemail.d.ts +117 -0
- package/dist/reads/zkemail.js +217 -0
- package/dist/similarity.d.ts +36 -0
- package/dist/similarity.js +67 -0
- package/dist/sponsorship-config.d.ts +47 -0
- package/dist/sponsorship-config.js +41 -0
- package/dist/stats.d.ts +11 -0
- package/dist/stats.js +27 -0
- package/dist/task-lens.d.ts +113 -0
- package/dist/task-lens.js +210 -0
- package/dist/tx/education.d.ts +169 -0
- package/dist/tx/education.js +344 -0
- package/dist/tx/eligibility.d.ts +511 -0
- package/dist/tx/eligibility.js +818 -0
- package/dist/tx/governance.d.ts +85 -0
- package/dist/tx/governance.js +87 -0
- package/dist/tx/index.d.ts +17 -0
- package/dist/tx/index.js +56 -0
- package/dist/tx/intent.d.ts +67 -0
- package/dist/tx/intent.js +48 -0
- package/dist/tx/org.d.ts +321 -0
- package/dist/tx/org.js +544 -0
- package/dist/tx/paymaster.d.ts +140 -0
- package/dist/tx/paymaster.js +251 -0
- package/dist/tx/project.d.ts +146 -0
- package/dist/tx/project.js +217 -0
- package/dist/tx/task.d.ts +480 -0
- package/dist/tx/task.js +1149 -0
- package/dist/tx/token.d.ts +96 -0
- package/dist/tx/token.js +165 -0
- package/dist/tx/treasury.d.ts +474 -0
- package/dist/tx/treasury.js +911 -0
- package/dist/tx/user.d.ts +177 -0
- package/dist/tx/user.js +292 -0
- package/dist/tx/vote.d.ts +332 -0
- package/dist/tx/vote.js +762 -0
- package/dist/tx/zkemail.d.ts +90 -0
- package/dist/tx/zkemail.js +210 -0
- package/dist/validation.d.ts +8 -0
- package/dist/validation.js +39 -0
- package/dist/version.d.ts +142 -0
- package/dist/version.js +257 -0
- package/dist/zkemail.d.ts +161 -0
- package/dist/zkemail.js +299 -0
- package/package.json +130 -0
|
@@ -0,0 +1,941 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Contract Error Catalog
|
|
4
|
+
* Decodes custom contract errors (4-byte selector + ABI-encoded args) from
|
|
5
|
+
* revert data into human-readable messages with actionable suggestions.
|
|
6
|
+
* Covers every custom error declared across the generated abis/ registry
|
|
7
|
+
* via a lazily-built selector registry. test/lib/error-catalog.test.ts
|
|
8
|
+
* enforces that ERROR_MESSAGES stays in sync with the ABIs.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ERROR_MESSAGES = void 0;
|
|
12
|
+
exports.decodeContractError = decodeContractError;
|
|
13
|
+
exports.getErrorHint = getErrorHint;
|
|
14
|
+
const ethers_1 = require("ethers");
|
|
15
|
+
const abis_1 = require("./abis");
|
|
16
|
+
/** Solidity built-in Error(string) selector — surfaced by ethers as error.reason */
|
|
17
|
+
const ERROR_STRING_SELECTOR = '0x08c379a0';
|
|
18
|
+
/** Solidity built-in Panic(uint256) selector — surfaced by ethers as a panic code */
|
|
19
|
+
const PANIC_SELECTOR = '0x4e487b71';
|
|
20
|
+
let errorRegistry = null;
|
|
21
|
+
/**
|
|
22
|
+
* Build the global selector → error-fragment registry from every first-party
|
|
23
|
+
* ABI in the generated registry (ALL_ABIS only; EXTERNAL_ABIS carry no errors,
|
|
24
|
+
* matching the CLI's historical "top-level src/abi/*.json only" behavior).
|
|
25
|
+
*/
|
|
26
|
+
function buildErrorRegistry() {
|
|
27
|
+
const registry = new Map();
|
|
28
|
+
for (const [name, abi] of Object.entries(abis_1.ALL_ABIS)) {
|
|
29
|
+
if (!Array.isArray(abi))
|
|
30
|
+
continue;
|
|
31
|
+
for (const fragment of abi) {
|
|
32
|
+
if (!fragment || fragment.type !== 'error' || !fragment.name)
|
|
33
|
+
continue;
|
|
34
|
+
try {
|
|
35
|
+
const errorFragment = ethers_1.ethers.utils.ErrorFragment.from(fragment);
|
|
36
|
+
const selector = ethers_1.ethers.utils.id(errorFragment.format()).slice(0, 10);
|
|
37
|
+
if (!registry.has(selector)) {
|
|
38
|
+
registry.set(selector, {
|
|
39
|
+
name: errorFragment.name,
|
|
40
|
+
inputs: errorFragment.inputs,
|
|
41
|
+
sourceAbi: name,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Malformed fragment — skip
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return registry;
|
|
51
|
+
}
|
|
52
|
+
function getErrorRegistry() {
|
|
53
|
+
if (!errorRegistry) {
|
|
54
|
+
errorRegistry = buildErrorRegistry();
|
|
55
|
+
}
|
|
56
|
+
return errorRegistry;
|
|
57
|
+
}
|
|
58
|
+
/** Accept a hex revert-data string, or an object carrying one in a .data field. */
|
|
59
|
+
function normalizeHexData(value) {
|
|
60
|
+
if (typeof value === 'string' && value.startsWith('0x') && value.length >= 10) {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
if (value &&
|
|
64
|
+
typeof value === 'object' &&
|
|
65
|
+
typeof value.data === 'string' &&
|
|
66
|
+
value.data.startsWith('0x') &&
|
|
67
|
+
value.data.length >= 10) {
|
|
68
|
+
return value.data;
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Walk the nesting shapes ethers v5 providers produce for revert data:
|
|
74
|
+
* error.data, error.error.data, error.error.error.data — where any .data
|
|
75
|
+
* may itself be an object carrying a .data hex field.
|
|
76
|
+
*/
|
|
77
|
+
function extractRevertData(error) {
|
|
78
|
+
const candidates = [error?.data, error?.error?.data, error?.error?.error?.data];
|
|
79
|
+
for (const candidate of candidates) {
|
|
80
|
+
const hex = normalizeHexData(candidate);
|
|
81
|
+
if (hex)
|
|
82
|
+
return hex;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
function withHint(name, args) {
|
|
87
|
+
const hint = getErrorHint(name);
|
|
88
|
+
return {
|
|
89
|
+
name,
|
|
90
|
+
args,
|
|
91
|
+
human: hint ? hint.human : `Contract reverted with custom error ${name}`,
|
|
92
|
+
suggestion: hint?.suggestion,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Decode custom-error revert data from an ethers v5 error object.
|
|
97
|
+
* Tries the caller-supplied interface first (most specific), then the global
|
|
98
|
+
* registry built from all generated ABI error fragments.
|
|
99
|
+
*
|
|
100
|
+
* Returns null when no revert data is present, or for plain Error(string) /
|
|
101
|
+
* Panic(uint256) reverts — those already surface via error.reason. Unknown
|
|
102
|
+
* selectors return a generic UnknownCustomError(<selector>) result.
|
|
103
|
+
*/
|
|
104
|
+
function decodeContractError(error, iface) {
|
|
105
|
+
const data = extractRevertData(error);
|
|
106
|
+
if (!data)
|
|
107
|
+
return null;
|
|
108
|
+
const selector = data.slice(0, 10).toLowerCase();
|
|
109
|
+
if (selector === ERROR_STRING_SELECTOR || selector === PANIC_SELECTOR) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
if (iface) {
|
|
113
|
+
try {
|
|
114
|
+
const parsed = iface.parseError(data);
|
|
115
|
+
return withHint(parsed.name, Array.from(parsed.args));
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Not in this interface — fall through to the global registry
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const entry = getErrorRegistry().get(selector);
|
|
122
|
+
if (entry) {
|
|
123
|
+
let args = [];
|
|
124
|
+
try {
|
|
125
|
+
args = Array.from(ethers_1.ethers.utils.defaultAbiCoder.decode(entry.inputs, '0x' + data.slice(10)));
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// Selector matched but payload was malformed — still report the name
|
|
129
|
+
}
|
|
130
|
+
return withHint(entry.name, args);
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
name: `UnknownCustomError(${selector})`,
|
|
134
|
+
args: [],
|
|
135
|
+
human: 'Contract reverted with an unrecognized custom error',
|
|
136
|
+
suggestion: undefined,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Human messages + suggestions for every distinct custom error name across
|
|
141
|
+
* all generated ABIs. The drift guard in test/lib/error-catalog.test.ts
|
|
142
|
+
* fails if an ABI regeneration introduces a name without an entry here.
|
|
143
|
+
*/
|
|
144
|
+
exports.ERROR_MESSAGES = {
|
|
145
|
+
// --- Accounts / usernames (UniversalAccountRegistry, QuickJoin, PasskeyAccountFactory) ---
|
|
146
|
+
AccountExists: {
|
|
147
|
+
human: 'An account is already registered for this address.',
|
|
148
|
+
suggestion: 'Use the existing account, or a different wallet to register a new one.',
|
|
149
|
+
},
|
|
150
|
+
AccountUnknown: {
|
|
151
|
+
human: 'No registered account exists for this address.',
|
|
152
|
+
suggestion: 'Register a username first: pop user register --username <name>',
|
|
153
|
+
},
|
|
154
|
+
NoUsername: {
|
|
155
|
+
human: 'This address has no registered username.',
|
|
156
|
+
suggestion: 'Register a username first: pop user register --username <name>',
|
|
157
|
+
},
|
|
158
|
+
UsernameEmpty: {
|
|
159
|
+
human: 'Username must not be empty.',
|
|
160
|
+
},
|
|
161
|
+
UsernameTaken: {
|
|
162
|
+
human: 'That username is already registered by another address.',
|
|
163
|
+
suggestion: 'Pick a different username.',
|
|
164
|
+
},
|
|
165
|
+
UsernameTooLong: {
|
|
166
|
+
human: 'Username exceeds the maximum allowed length.',
|
|
167
|
+
suggestion: 'Pick a shorter username.',
|
|
168
|
+
},
|
|
169
|
+
InvalidChars: {
|
|
170
|
+
human: 'Username contains characters that are not allowed.',
|
|
171
|
+
suggestion: 'Use only the permitted character set (alphanumeric).',
|
|
172
|
+
},
|
|
173
|
+
ZeroUser: {
|
|
174
|
+
human: 'User address must not be the zero address.',
|
|
175
|
+
},
|
|
176
|
+
PasskeyFactoryNotSet: {
|
|
177
|
+
human: 'The passkey account factory is not configured on this contract.',
|
|
178
|
+
},
|
|
179
|
+
OnlyMasterDeploy: {
|
|
180
|
+
human: 'Only the master deploy address may call this QuickJoin function.',
|
|
181
|
+
},
|
|
182
|
+
// --- Task manager ---
|
|
183
|
+
BadStatus: {
|
|
184
|
+
human: 'Task is not in a status that allows this action.',
|
|
185
|
+
suggestion: 'Check the current task status with: pop task view <id>',
|
|
186
|
+
},
|
|
187
|
+
NotClaimer: {
|
|
188
|
+
human: 'Only the address that claimed this task may perform this action.',
|
|
189
|
+
},
|
|
190
|
+
NotCreator: {
|
|
191
|
+
human: 'Only the creator of this task/module may perform this action.',
|
|
192
|
+
},
|
|
193
|
+
NotFound: {
|
|
194
|
+
human: 'No task exists with that ID.',
|
|
195
|
+
suggestion: 'Check the ID with: pop task list',
|
|
196
|
+
},
|
|
197
|
+
NotApplicant: {
|
|
198
|
+
human: 'That address has not applied for this task.',
|
|
199
|
+
suggestion: 'Apply first: pop task apply --task <id>',
|
|
200
|
+
},
|
|
201
|
+
AlreadyApplied: {
|
|
202
|
+
human: 'You have already applied for this task.',
|
|
203
|
+
suggestion: 'Check the application status with: pop task view <id>',
|
|
204
|
+
},
|
|
205
|
+
RequiresApplication: {
|
|
206
|
+
human: 'This task requires an application before it can be claimed or assigned.',
|
|
207
|
+
suggestion: 'Apply first: pop task apply --task <id>',
|
|
208
|
+
},
|
|
209
|
+
NoApplicationRequired: {
|
|
210
|
+
human: 'This task does not use applications — claim it directly.',
|
|
211
|
+
suggestion: 'Run: pop task claim --task <id>',
|
|
212
|
+
},
|
|
213
|
+
SelfReviewNotAllowed: {
|
|
214
|
+
human: 'You cannot review your own submission without the SELF_REVIEW permission.',
|
|
215
|
+
suggestion: 'Ask another reviewer, or check permissions with: pop task perms show',
|
|
216
|
+
},
|
|
217
|
+
InvalidDeadline: {
|
|
218
|
+
human: 'Deadline is in the past or the completion window is invalid.',
|
|
219
|
+
suggestion: '--deadline must be a future timestamp; check the completion-window value.',
|
|
220
|
+
},
|
|
221
|
+
FoldersRootStale: {
|
|
222
|
+
human: 'Folder tree changed since it was read (compare-and-swap root mismatch).',
|
|
223
|
+
suggestion: 'Re-read the folder tree and retry the update.',
|
|
224
|
+
},
|
|
225
|
+
BudgetExceeded: {
|
|
226
|
+
human: 'Payout exceeds the project budget cap (or paymaster gas budget).',
|
|
227
|
+
suggestion: 'Check the project budget and permissions with: pop task perms show',
|
|
228
|
+
},
|
|
229
|
+
SpentUnderflow: {
|
|
230
|
+
human: 'Budget accounting underflow — refund exceeds the recorded spend (internal).',
|
|
231
|
+
},
|
|
232
|
+
NotOrganizer: {
|
|
233
|
+
human: 'Caller does not hold organizer rights for this project/task.',
|
|
234
|
+
suggestion: 'Check role permissions with: pop org roles',
|
|
235
|
+
},
|
|
236
|
+
NotDeployer: {
|
|
237
|
+
human: 'Only the org deployer may call this function.',
|
|
238
|
+
},
|
|
239
|
+
// --- Shared permission / role errors ---
|
|
240
|
+
// Declared by TaskManager, HybridVoting, DirectDemocracyVoting, ParticipationToken,
|
|
241
|
+
// QuickJoin, PasskeyAccountFactory and ZkEmailInvites, so this message must stay
|
|
242
|
+
// contract-neutral — it previously named only the TaskManager permission bits, which
|
|
243
|
+
// sent people to `pop task perms` for a voting or token failure.
|
|
244
|
+
Unauthorized: {
|
|
245
|
+
human: 'Your wallet\'s hats do not carry the permission this action requires.',
|
|
246
|
+
suggestion: 'See which hats you hold with: pop user whoami. For task actions the required bit is '
|
|
247
|
+
+ 'one of CREATE/CLAIM/REVIEW/ASSIGN/SELF_REVIEW/BUDGET/EDIT_META/EDIT_FULL — inspect with '
|
|
248
|
+
+ 'pop task perms show. For proposals, you need a creator hat: pop org roles.',
|
|
249
|
+
},
|
|
250
|
+
UnauthorizedCaller: {
|
|
251
|
+
human: 'Caller is not authorized for this executor operation.',
|
|
252
|
+
},
|
|
253
|
+
NotExecutor: {
|
|
254
|
+
human: 'Only the org executor (governance) may call this.',
|
|
255
|
+
suggestion: 'Route this change through a governance proposal instead.',
|
|
256
|
+
},
|
|
257
|
+
NotMember: {
|
|
258
|
+
human: 'You are not a member of this organization.',
|
|
259
|
+
suggestion: 'Join the org first: pop user join',
|
|
260
|
+
},
|
|
261
|
+
RoleNotAllowed: {
|
|
262
|
+
human: 'Your role is not allowed to perform this voting action.',
|
|
263
|
+
suggestion: 'Check which roles may create proposals/vote: pop org roles',
|
|
264
|
+
},
|
|
265
|
+
NotSuperAdmin: {
|
|
266
|
+
human: 'Requires the org superAdmin (EligibilityModule).',
|
|
267
|
+
},
|
|
268
|
+
NotToggleAdmin: {
|
|
269
|
+
human: 'Only the toggle admin may enable/disable hats.',
|
|
270
|
+
},
|
|
271
|
+
NotOrgExecutor: {
|
|
272
|
+
human: 'Caller is not the executor registered for this org.',
|
|
273
|
+
},
|
|
274
|
+
NotOrgMetadataAdmin: {
|
|
275
|
+
human: 'Caller lacks metadata-admin rights for this org.',
|
|
276
|
+
},
|
|
277
|
+
NotPoaManager: {
|
|
278
|
+
human: 'Only the PoaManager contract may call this.',
|
|
279
|
+
},
|
|
280
|
+
OwnerOnlyDuringBootstrap: {
|
|
281
|
+
human: 'This owner-only call is permitted only during the bootstrap phase.',
|
|
282
|
+
},
|
|
283
|
+
// --- Voting (DirectDemocracy + Hybrid) ---
|
|
284
|
+
AlreadyVoted: {
|
|
285
|
+
human: 'You have already voted on this proposal.',
|
|
286
|
+
suggestion: 'Find proposals you have not voted on: pop vote list --unvoted',
|
|
287
|
+
},
|
|
288
|
+
AlreadyExecuted: {
|
|
289
|
+
human: 'This proposal has already been executed.',
|
|
290
|
+
},
|
|
291
|
+
VotingOpen: {
|
|
292
|
+
human: 'Voting is still open — this action requires the voting period to have ended.',
|
|
293
|
+
suggestion: 'Wait until the proposal end time, then retry (e.g. pop vote announce).',
|
|
294
|
+
},
|
|
295
|
+
VotingExpired: {
|
|
296
|
+
human: 'The voting period for this proposal has ended.',
|
|
297
|
+
suggestion: 'Announce the result: pop vote announce',
|
|
298
|
+
},
|
|
299
|
+
InvalidProposal: {
|
|
300
|
+
human: 'No proposal exists with that ID.',
|
|
301
|
+
suggestion: 'List proposals: pop vote list',
|
|
302
|
+
},
|
|
303
|
+
DurationOutOfRange: {
|
|
304
|
+
human: 'Voting duration is outside the allowed minimum/maximum range.',
|
|
305
|
+
suggestion: 'Adjust --duration to fit the org limits.',
|
|
306
|
+
},
|
|
307
|
+
WeightSumNot100: {
|
|
308
|
+
human: 'Vote weights must sum to exactly 100.',
|
|
309
|
+
},
|
|
310
|
+
InvalidWeight: {
|
|
311
|
+
human: 'A vote weight is out of range.',
|
|
312
|
+
},
|
|
313
|
+
InvalidSliceSum: {
|
|
314
|
+
human: 'Hybrid voting class slices must sum to 100.',
|
|
315
|
+
},
|
|
316
|
+
InvalidClassCount: {
|
|
317
|
+
human: 'Voting class count is out of the supported range.',
|
|
318
|
+
},
|
|
319
|
+
TooManyClasses: {
|
|
320
|
+
human: 'Too many voting classes configured.',
|
|
321
|
+
},
|
|
322
|
+
TooManyOptions: {
|
|
323
|
+
human: 'Proposal has too many options.',
|
|
324
|
+
},
|
|
325
|
+
TooManyCalls: {
|
|
326
|
+
human: 'Too many execution calls in this proposal batch.',
|
|
327
|
+
},
|
|
328
|
+
DuplicateIndex: {
|
|
329
|
+
human: 'Duplicate option index in the vote — each option may appear only once.',
|
|
330
|
+
},
|
|
331
|
+
InvalidIndex: {
|
|
332
|
+
human: 'Index is out of range.',
|
|
333
|
+
},
|
|
334
|
+
TargetNotAllowed: {
|
|
335
|
+
human: 'A proposal call target is not on the allowed-targets list.',
|
|
336
|
+
suggestion: 'Only allowlisted contracts can be called by governance; check org config.',
|
|
337
|
+
},
|
|
338
|
+
TargetSelf: {
|
|
339
|
+
human: 'A proposal/executor call may not target the governance contract itself.',
|
|
340
|
+
},
|
|
341
|
+
HatNotAllowed: {
|
|
342
|
+
human: 'That hat is not allowed for this voting action.',
|
|
343
|
+
},
|
|
344
|
+
InvalidQuorum: {
|
|
345
|
+
human: 'Quorum percentage is out of range (must be 1-100).',
|
|
346
|
+
},
|
|
347
|
+
InvalidThreshold: {
|
|
348
|
+
human: 'Threshold percentage is out of range.',
|
|
349
|
+
},
|
|
350
|
+
VotesExpiredSignature: {
|
|
351
|
+
human: 'The vote delegation signature has expired.',
|
|
352
|
+
suggestion: 'Generate a fresh signature and retry.',
|
|
353
|
+
},
|
|
354
|
+
// --- Vouching / eligibility ---
|
|
355
|
+
AlreadyVouched: {
|
|
356
|
+
human: 'You have already vouched for this member for this role.',
|
|
357
|
+
},
|
|
358
|
+
HasNotVouched: {
|
|
359
|
+
human: 'You have not vouched for this member — nothing to revoke.',
|
|
360
|
+
},
|
|
361
|
+
CannotVouchForSelf: {
|
|
362
|
+
human: 'You cannot vouch for yourself.',
|
|
363
|
+
},
|
|
364
|
+
VouchingRateLimitExceeded: {
|
|
365
|
+
human: 'Daily vouch limit reached (default 3 per day).',
|
|
366
|
+
suggestion: 'Try again tomorrow; check remaining quota with: pop vouch status',
|
|
367
|
+
},
|
|
368
|
+
NewUserVouchingRestricted: {
|
|
369
|
+
human: 'This account is inside the new-member grace period (about 2 days) and cannot vouch yet.',
|
|
370
|
+
suggestion: 'Wait out the grace period, then retry.',
|
|
371
|
+
},
|
|
372
|
+
VouchingNotEnabled: {
|
|
373
|
+
human: 'Vouching is not enabled for this role/hat.',
|
|
374
|
+
},
|
|
375
|
+
NotAuthorizedToVouch: {
|
|
376
|
+
human: 'Your role is not authorized to vouch for this hat.',
|
|
377
|
+
suggestion: 'Check the vouching configuration: pop vouch status',
|
|
378
|
+
},
|
|
379
|
+
InvalidMaxDailyVouches: {
|
|
380
|
+
human: 'The max-daily-vouches configuration value is out of range.',
|
|
381
|
+
},
|
|
382
|
+
InvalidMembershipHat: {
|
|
383
|
+
human: 'That hat is not a valid membership hat for vouching configuration.',
|
|
384
|
+
},
|
|
385
|
+
InvalidHatId: {
|
|
386
|
+
human: 'Hat ID is invalid or unknown.',
|
|
387
|
+
},
|
|
388
|
+
InvalidJoinTime: {
|
|
389
|
+
human: 'Member join timestamp is invalid.',
|
|
390
|
+
},
|
|
391
|
+
InvalidUser: {
|
|
392
|
+
human: 'User address is invalid for this operation.',
|
|
393
|
+
},
|
|
394
|
+
NoActiveApplication: {
|
|
395
|
+
human: 'No active application exists for that role.',
|
|
396
|
+
suggestion: 'Apply first: pop role apply',
|
|
397
|
+
},
|
|
398
|
+
ApplicationAlreadyExists: {
|
|
399
|
+
human: 'An application for this role already exists.',
|
|
400
|
+
suggestion: 'Check its status before re-applying.',
|
|
401
|
+
},
|
|
402
|
+
InvalidApplicationHash: {
|
|
403
|
+
human: 'The application metadata hash is invalid or does not match.',
|
|
404
|
+
},
|
|
405
|
+
// ── Protocol security audit (contracts PR #185) ──
|
|
406
|
+
DefaultEligibilityConflictsWithVouch: {
|
|
407
|
+
human: 'This hat is set to make everyone eligible by default, so vouching for it would be meaningless.',
|
|
408
|
+
suggestion: 'Turn off default eligibility for the hat before enabling a vouch requirement on it.',
|
|
409
|
+
},
|
|
410
|
+
TokenNotWired: {
|
|
411
|
+
human: 'That ParticipationToken does not point back at this EducationHub, so module rewards would silently fail.',
|
|
412
|
+
suggestion: 'Wire the token\'s educationHub to this module first, then re-run setToken.',
|
|
413
|
+
},
|
|
414
|
+
UnregisteredRole: {
|
|
415
|
+
human: 'The proposal references a role index that has no hat registered for this org.',
|
|
416
|
+
suggestion: 'List the org\'s registered roles with: pop org roles',
|
|
417
|
+
},
|
|
418
|
+
SweepFailed: {
|
|
419
|
+
human: 'The native-token sweep failed — the recipient rejected the transfer.',
|
|
420
|
+
suggestion: 'A contract recipient must accept plain value transfers. Try an EOA, or a wallet whose receive() succeeds.',
|
|
421
|
+
},
|
|
422
|
+
TooManyHats: {
|
|
423
|
+
human: 'Too many hat IDs in one mint — the executor caps the batch to bound gas.',
|
|
424
|
+
suggestion: 'Split the mint into smaller batches (see Executor.MAX_HATS_PER_MINT).',
|
|
425
|
+
},
|
|
426
|
+
TooManyPollHats: {
|
|
427
|
+
human: 'Too many restricted hats on this proposal — the limit is 100.',
|
|
428
|
+
suggestion: 'Reduce the hat-restriction list, or leave it empty to let every eligible member vote.',
|
|
429
|
+
},
|
|
430
|
+
// ── Passkey M-of-N account recovery (audit H-04) ──
|
|
431
|
+
NotAGuardian: {
|
|
432
|
+
human: 'Your address is not a registered recovery guardian for this account.',
|
|
433
|
+
},
|
|
434
|
+
GuardianAlreadyExists: {
|
|
435
|
+
human: 'That address is already a guardian on this account.',
|
|
436
|
+
},
|
|
437
|
+
GuardianDoesNotExist: {
|
|
438
|
+
human: 'That address is not a guardian on this account.',
|
|
439
|
+
},
|
|
440
|
+
ThresholdExceedsGuardianCount: {
|
|
441
|
+
human: 'The recovery threshold cannot be higher than the number of guardians.',
|
|
442
|
+
suggestion: 'Add more guardians first, or set a lower threshold.',
|
|
443
|
+
},
|
|
444
|
+
RecoveryDisabled: {
|
|
445
|
+
human: 'Recovery is disabled on this account — its threshold is zero.',
|
|
446
|
+
suggestion: 'The account owner must add guardians and set a non-zero recovery threshold.',
|
|
447
|
+
},
|
|
448
|
+
InvalidPublicKey: {
|
|
449
|
+
human: 'The proposed recovery key is not a valid P-256 point.',
|
|
450
|
+
suggestion: 'Re-generate the passkey — the staged public key must be on-curve.',
|
|
451
|
+
},
|
|
452
|
+
// ── ZkEmailInvites (ZK Email role invites) ──
|
|
453
|
+
AllowlistNotActive: {
|
|
454
|
+
human: 'This org\'s ZK Email invite module has no active allowlist, so no one can claim yet.',
|
|
455
|
+
suggestion: 'Publish one: pop zkemail build-allowlist --file entries.json --pin, then pop zkemail propose-allowlist.',
|
|
456
|
+
},
|
|
457
|
+
NotInAllowlist: {
|
|
458
|
+
human: 'The merkle proof does not match the active allowlist root — this domain/address is not invited, or the proof was built from a stale allowlist.',
|
|
459
|
+
suggestion: 'Check with: pop zkemail check <domain-or-email>',
|
|
460
|
+
},
|
|
461
|
+
NullifierAlreadyUsed: {
|
|
462
|
+
human: 'That exact email has already been used for a claim (the nullifier is per message).',
|
|
463
|
+
suggestion: 'Claim again from a different email message.',
|
|
464
|
+
},
|
|
465
|
+
EmailAlreadyRegistered: {
|
|
466
|
+
human: 'That email address has already claimed via its specific-address allowlist entry (one registration per address).',
|
|
467
|
+
suggestion: 'Governance can reset it, or claim via a domain entry instead if the domain is allowlisted.',
|
|
468
|
+
},
|
|
469
|
+
InvalidDKIMKey: {
|
|
470
|
+
human: 'No valid DKIM key is registered for the sending domain, so the email signature cannot be checked on-chain.',
|
|
471
|
+
suggestion: 'The domain\'s DKIM key hash must be seeded in the PoaDKIMRegistry before claims from it can succeed.',
|
|
472
|
+
},
|
|
473
|
+
ClaimerNotEligible: {
|
|
474
|
+
human: 'The claimer is not eligible for one of the requested role hats, even after email verification.',
|
|
475
|
+
suggestion: 'The hat\'s eligibility module may be gating it separately — check pop role eligibility.',
|
|
476
|
+
},
|
|
477
|
+
HatOpenlyClaimable: {
|
|
478
|
+
human: 'One of the requested hats is claimable by anyone, so granting it through a ZK Email invite is refused.',
|
|
479
|
+
suggestion: 'Tighten the hat\'s eligibility module before including it in an invite allowlist.',
|
|
480
|
+
},
|
|
481
|
+
ZeroClaimer: {
|
|
482
|
+
human: 'The claimer address is the zero address.',
|
|
483
|
+
},
|
|
484
|
+
EmptyHats: {
|
|
485
|
+
human: 'The claim requested no role hats.',
|
|
486
|
+
suggestion: 'The allowlist entry must grant at least one hat ID.',
|
|
487
|
+
},
|
|
488
|
+
NotAuthorizedEmailVerifier: {
|
|
489
|
+
human: 'Only the org superAdmin or an authorized hat minter (normally the ZkEmailInvites module) may mark a wearer email-verified.',
|
|
490
|
+
suggestion: 'Route the call through governance, or authorize the caller as a hat minter on the Executor first.',
|
|
491
|
+
},
|
|
492
|
+
// --- Participation token ---
|
|
493
|
+
TransfersDisabled: {
|
|
494
|
+
human: 'Participation tokens are non-transferable by design.',
|
|
495
|
+
},
|
|
496
|
+
NotApprover: {
|
|
497
|
+
human: 'Caller is not an approver for participation-token requests.',
|
|
498
|
+
},
|
|
499
|
+
NotRequester: {
|
|
500
|
+
human: 'Only the original requester may modify or cancel this token request.',
|
|
501
|
+
},
|
|
502
|
+
RequestUnknown: {
|
|
503
|
+
human: 'No token request exists with that ID.',
|
|
504
|
+
},
|
|
505
|
+
// Declared by BOTH ParticipationToken (token requests) and, since the audit, PasskeyAccount
|
|
506
|
+
// (a guardian re-approving a recovery). Identical zero-arg signature means one selector and
|
|
507
|
+
// no way to tell them apart from revert data alone, so the message must cover both.
|
|
508
|
+
AlreadyApproved: {
|
|
509
|
+
human: 'Already approved — either this token request, or this recovery proposal by this guardian.',
|
|
510
|
+
suggestion: 'For recovery, quorum needs approvals from DISTINCT guardians; one cannot approve twice.',
|
|
511
|
+
},
|
|
512
|
+
NotTaskOrEdu: {
|
|
513
|
+
human: 'Only the TaskManager or EducationHub may mint participation tokens.',
|
|
514
|
+
},
|
|
515
|
+
AlreadySet: {
|
|
516
|
+
human: 'This value has already been set.',
|
|
517
|
+
},
|
|
518
|
+
// --- Education hub ---
|
|
519
|
+
ModuleExists: {
|
|
520
|
+
human: 'An education module with this ID already exists.',
|
|
521
|
+
},
|
|
522
|
+
ModuleUnknown: {
|
|
523
|
+
human: 'No education module exists with that ID.',
|
|
524
|
+
suggestion: 'List modules: pop education list',
|
|
525
|
+
},
|
|
526
|
+
AlreadyCompleted: {
|
|
527
|
+
human: 'You have already completed this education module.',
|
|
528
|
+
},
|
|
529
|
+
InvalidAnswer: {
|
|
530
|
+
human: 'Wrong answer submitted for the module quiz.',
|
|
531
|
+
suggestion: 'Review the module content and try again.',
|
|
532
|
+
},
|
|
533
|
+
// --- Payment manager / distributions ---
|
|
534
|
+
AlreadyClaimed: {
|
|
535
|
+
human: 'This distribution payout has already been claimed.',
|
|
536
|
+
},
|
|
537
|
+
OverClaimed: {
|
|
538
|
+
human: 'Claim amount exceeds the allocation for this address.',
|
|
539
|
+
},
|
|
540
|
+
InvalidProof: {
|
|
541
|
+
human: 'Merkle proof does not verify against the distribution root.',
|
|
542
|
+
suggestion: 'Check the claim index, amount, and proof data.',
|
|
543
|
+
},
|
|
544
|
+
InvalidMerkleRoot: {
|
|
545
|
+
human: 'Merkle root is zero or invalid.',
|
|
546
|
+
},
|
|
547
|
+
InvalidCheckpoint: {
|
|
548
|
+
human: 'Distribution checkpoint is invalid.',
|
|
549
|
+
},
|
|
550
|
+
DistributionNotFound: {
|
|
551
|
+
human: 'No distribution exists with that ID.',
|
|
552
|
+
},
|
|
553
|
+
DistributionAlreadyFinalized: {
|
|
554
|
+
human: 'This distribution has already been finalized.',
|
|
555
|
+
},
|
|
556
|
+
AlreadyFinalized: {
|
|
557
|
+
human: 'Already finalized — no further changes allowed.',
|
|
558
|
+
},
|
|
559
|
+
ClaimPeriodNotExpired: {
|
|
560
|
+
human: 'The claim period is still open; this action requires it to have expired.',
|
|
561
|
+
suggestion: 'Wait until the claim window closes, then retry.',
|
|
562
|
+
},
|
|
563
|
+
OptedOut: {
|
|
564
|
+
human: 'This recipient has opted out of distributions.',
|
|
565
|
+
suggestion: 'Opt back in first (pop treasury opt-out --disable) if this is your address.',
|
|
566
|
+
},
|
|
567
|
+
TransferFailed: {
|
|
568
|
+
human: 'Native token transfer failed.',
|
|
569
|
+
},
|
|
570
|
+
InsufficientFunds: {
|
|
571
|
+
human: 'Contract-side balance is too low for this operation.',
|
|
572
|
+
},
|
|
573
|
+
// --- Paymaster hub ---
|
|
574
|
+
NotAdmin: {
|
|
575
|
+
human: 'Caller is not the paymaster admin for this org.',
|
|
576
|
+
},
|
|
577
|
+
NotOperator: {
|
|
578
|
+
human: 'Caller is not a paymaster operator.',
|
|
579
|
+
},
|
|
580
|
+
EPOnly: {
|
|
581
|
+
human: 'Only the ERC-4337 EntryPoint may call this function.',
|
|
582
|
+
},
|
|
583
|
+
FeeTooHigh: {
|
|
584
|
+
human: 'UserOperation gas fees exceed the paymaster fee cap.',
|
|
585
|
+
suggestion: 'Lower the max fee, or ask an operator to raise the fee caps.',
|
|
586
|
+
},
|
|
587
|
+
GasTooHigh: {
|
|
588
|
+
human: 'UserOperation gas limits exceed the paymaster gas cap.',
|
|
589
|
+
},
|
|
590
|
+
Ineligible: {
|
|
591
|
+
human: 'This address is not eligible for gas sponsorship under the paymaster rules.',
|
|
592
|
+
},
|
|
593
|
+
RuleDenied: {
|
|
594
|
+
human: 'A paymaster rule denies sponsorship for this target/selector.',
|
|
595
|
+
},
|
|
596
|
+
InvalidRuleId: {
|
|
597
|
+
human: 'Unknown paymaster rule ID.',
|
|
598
|
+
},
|
|
599
|
+
InvalidSubjectType: {
|
|
600
|
+
human: 'Unknown paymaster rule subject type.',
|
|
601
|
+
},
|
|
602
|
+
InvalidEpochLength: {
|
|
603
|
+
human: 'Paymaster epoch length is out of range.',
|
|
604
|
+
},
|
|
605
|
+
InvalidOrgId: {
|
|
606
|
+
human: 'Org ID is zero or not known to the paymaster.',
|
|
607
|
+
},
|
|
608
|
+
InvalidPaymasterData: {
|
|
609
|
+
human: 'The paymasterAndData bytes are malformed.',
|
|
610
|
+
},
|
|
611
|
+
InvalidOnboardingRequest: {
|
|
612
|
+
human: 'The sponsored onboarding request is malformed.',
|
|
613
|
+
},
|
|
614
|
+
InvalidOrgDeployRequest: {
|
|
615
|
+
human: 'The sponsored org-deploy request is malformed.',
|
|
616
|
+
},
|
|
617
|
+
InvalidVersion: {
|
|
618
|
+
human: 'Unknown version.',
|
|
619
|
+
},
|
|
620
|
+
OrgAlreadyRegistered: {
|
|
621
|
+
human: 'This org is already registered with the paymaster.',
|
|
622
|
+
},
|
|
623
|
+
OrgNotRegistered: {
|
|
624
|
+
human: 'This org is not registered with the paymaster.',
|
|
625
|
+
suggestion: 'Register and fund it: pop paymaster deposit',
|
|
626
|
+
},
|
|
627
|
+
OrgIsBanned: {
|
|
628
|
+
human: 'This org is banned from paymaster sponsorship.',
|
|
629
|
+
},
|
|
630
|
+
InsufficientOrgBalance: {
|
|
631
|
+
human: 'The org gas-sponsorship balance is too low.',
|
|
632
|
+
suggestion: 'Top up: pop paymaster deposit',
|
|
633
|
+
},
|
|
634
|
+
InsufficientDepositForSolidarity: {
|
|
635
|
+
human: 'Paymaster deposit is below the solidarity-pool minimum.',
|
|
636
|
+
},
|
|
637
|
+
SolidarityDistributionIsPaused: {
|
|
638
|
+
human: 'Solidarity distribution is currently paused.',
|
|
639
|
+
},
|
|
640
|
+
SolidarityLimitExceeded: {
|
|
641
|
+
human: 'Solidarity funding limit exceeded.',
|
|
642
|
+
},
|
|
643
|
+
OnboardingDisabled: {
|
|
644
|
+
human: 'Sponsored onboarding is disabled.',
|
|
645
|
+
},
|
|
646
|
+
OnboardingLimitExceeded: {
|
|
647
|
+
human: 'Sponsored onboarding limit reached for this account.',
|
|
648
|
+
},
|
|
649
|
+
OnboardingDailyLimitExceeded: {
|
|
650
|
+
human: 'The daily sponsored-onboarding limit has been reached.',
|
|
651
|
+
suggestion: 'Try again tomorrow.',
|
|
652
|
+
},
|
|
653
|
+
OrgDeployDisabled: {
|
|
654
|
+
human: 'Sponsored org deployment is disabled.',
|
|
655
|
+
},
|
|
656
|
+
OrgDeployLimitExceeded: {
|
|
657
|
+
human: 'Sponsored org-deploy limit reached.',
|
|
658
|
+
},
|
|
659
|
+
OrgDeployDailyLimitExceeded: {
|
|
660
|
+
human: 'The daily sponsored org-deploy limit has been reached.',
|
|
661
|
+
suggestion: 'Try again tomorrow.',
|
|
662
|
+
},
|
|
663
|
+
GracePeriodSpendLimitReached: {
|
|
664
|
+
human: 'The new-account grace-period sponsorship spend limit has been reached.',
|
|
665
|
+
suggestion: 'Fund the wallet directly or wait for the grace period to reset.',
|
|
666
|
+
},
|
|
667
|
+
ContractNotDeployed: {
|
|
668
|
+
human: 'The referenced contract is not deployed.',
|
|
669
|
+
},
|
|
670
|
+
// --- Org registry / deployer / implementation registry / PoaManager ---
|
|
671
|
+
OrgExists: {
|
|
672
|
+
human: 'An org with this ID already exists.',
|
|
673
|
+
},
|
|
674
|
+
OrgUnknown: {
|
|
675
|
+
human: 'No org found with that ID in the registry.',
|
|
676
|
+
suggestion: 'Check the --org value (name or hex ID).',
|
|
677
|
+
},
|
|
678
|
+
OrgExistsMismatch: {
|
|
679
|
+
human: 'Org existence state does not match what the deployer expected (possible partial deploy).',
|
|
680
|
+
},
|
|
681
|
+
ContractUnknown: {
|
|
682
|
+
human: 'That contract is not registered in the OrgRegistry for this org.',
|
|
683
|
+
},
|
|
684
|
+
TypeTaken: {
|
|
685
|
+
human: 'That contract-type slot is already registered for this org.',
|
|
686
|
+
},
|
|
687
|
+
TypeExists: {
|
|
688
|
+
human: 'That contract type is already registered.',
|
|
689
|
+
},
|
|
690
|
+
TypeUnknown: {
|
|
691
|
+
human: 'Unknown contract type.',
|
|
692
|
+
},
|
|
693
|
+
VersionExists: {
|
|
694
|
+
human: 'That version is already registered.',
|
|
695
|
+
},
|
|
696
|
+
VersionUnknown: {
|
|
697
|
+
human: 'That version is not registered.',
|
|
698
|
+
},
|
|
699
|
+
AutoUpgradeRequired: {
|
|
700
|
+
human: 'This operation requires the org to have auto-upgrade enabled.',
|
|
701
|
+
},
|
|
702
|
+
ImplZero: {
|
|
703
|
+
human: 'Implementation address must not be zero.',
|
|
704
|
+
},
|
|
705
|
+
SameImplementation: {
|
|
706
|
+
human: 'New implementation is the same as the current one.',
|
|
707
|
+
},
|
|
708
|
+
EmptyInit: {
|
|
709
|
+
human: 'Deploy initialization payload is empty.',
|
|
710
|
+
},
|
|
711
|
+
InitFailed: {
|
|
712
|
+
human: 'Module initialization failed during org deployment.',
|
|
713
|
+
},
|
|
714
|
+
UnsupportedType: {
|
|
715
|
+
human: 'The deploy request includes an unsupported contract type.',
|
|
716
|
+
},
|
|
717
|
+
InvalidRoleConfiguration: {
|
|
718
|
+
human: 'Role configuration arrays are inconsistent in the deploy request.',
|
|
719
|
+
},
|
|
720
|
+
Reentrant: {
|
|
721
|
+
human: 'Reentrant deploy call blocked.',
|
|
722
|
+
},
|
|
723
|
+
InvalidParam: {
|
|
724
|
+
human: 'A parameter is out of the allowed range.',
|
|
725
|
+
},
|
|
726
|
+
// --- Passkey account / factory ---
|
|
727
|
+
OnlyEntryPoint: {
|
|
728
|
+
human: 'Only the ERC-4337 EntryPoint may call this account function.',
|
|
729
|
+
},
|
|
730
|
+
OnlyGuardian: {
|
|
731
|
+
human: 'Only the account guardian may call this.',
|
|
732
|
+
},
|
|
733
|
+
OnlyGuardianOrSelf: {
|
|
734
|
+
human: 'Only the guardian or the account itself may call this.',
|
|
735
|
+
},
|
|
736
|
+
OnlySelf: {
|
|
737
|
+
human: 'The account may only call this function on itself.',
|
|
738
|
+
},
|
|
739
|
+
CredentialExists: {
|
|
740
|
+
human: 'This passkey credential is already registered.',
|
|
741
|
+
},
|
|
742
|
+
CredentialNotFound: {
|
|
743
|
+
human: 'Passkey credential not found.',
|
|
744
|
+
},
|
|
745
|
+
CredentialNotActive: {
|
|
746
|
+
human: 'Passkey credential is not active.',
|
|
747
|
+
},
|
|
748
|
+
CannotRemoveLastCredential: {
|
|
749
|
+
human: 'A passkey account must retain at least one active credential.',
|
|
750
|
+
},
|
|
751
|
+
MaxCredentialsReached: {
|
|
752
|
+
human: 'This passkey account has reached its credential limit.',
|
|
753
|
+
},
|
|
754
|
+
RecoveryAlreadyPending: {
|
|
755
|
+
human: 'An account recovery is already pending.',
|
|
756
|
+
},
|
|
757
|
+
RecoveryNotPending: {
|
|
758
|
+
human: 'No account recovery is pending.',
|
|
759
|
+
},
|
|
760
|
+
RecoveryDelayNotPassed: {
|
|
761
|
+
human: 'The recovery delay has not elapsed yet.',
|
|
762
|
+
suggestion: 'Wait for the recovery delay to pass, then finalize.',
|
|
763
|
+
},
|
|
764
|
+
ExecutionFailed: {
|
|
765
|
+
human: 'The passkey account call execution failed.',
|
|
766
|
+
},
|
|
767
|
+
InvalidSignature: {
|
|
768
|
+
human: 'Signature verification failed.',
|
|
769
|
+
},
|
|
770
|
+
BeaconNotSet: {
|
|
771
|
+
human: 'The passkey account beacon is not configured.',
|
|
772
|
+
},
|
|
773
|
+
// --- Executor ---
|
|
774
|
+
CallFailed: {
|
|
775
|
+
human: 'A call in the executor batch failed (call index and revert data are in the error args).',
|
|
776
|
+
},
|
|
777
|
+
TimelockNotExpired: {
|
|
778
|
+
human: 'The executor timelock has not expired yet.',
|
|
779
|
+
suggestion: 'Wait for the timelock to elapse, then execute.',
|
|
780
|
+
},
|
|
781
|
+
// --- Signatures / nonces (shared) ---
|
|
782
|
+
InvalidSigner: {
|
|
783
|
+
human: 'Recovered signer does not match the expected address.',
|
|
784
|
+
},
|
|
785
|
+
SignatureExpired: {
|
|
786
|
+
human: 'The signature deadline has passed.',
|
|
787
|
+
suggestion: 'Generate a fresh signature and retry.',
|
|
788
|
+
},
|
|
789
|
+
InvalidNonce: {
|
|
790
|
+
human: 'Nonce does not match the expected value.',
|
|
791
|
+
},
|
|
792
|
+
InvalidAccountNonce: {
|
|
793
|
+
human: 'Wrong account nonce for this signed operation.',
|
|
794
|
+
},
|
|
795
|
+
ECDSAInvalidSignature: {
|
|
796
|
+
human: 'Invalid ECDSA signature.',
|
|
797
|
+
},
|
|
798
|
+
ECDSAInvalidSignatureLength: {
|
|
799
|
+
human: 'ECDSA signature has the wrong byte length.',
|
|
800
|
+
},
|
|
801
|
+
ECDSAInvalidSignatureS: {
|
|
802
|
+
human: 'ECDSA signature s-value is out of range (malleable signature rejected).',
|
|
803
|
+
},
|
|
804
|
+
// --- Shared validation errors ---
|
|
805
|
+
ZeroAddress: {
|
|
806
|
+
human: 'Address argument must not be the zero address.',
|
|
807
|
+
},
|
|
808
|
+
ZeroAmount: {
|
|
809
|
+
human: 'Amount must be greater than zero.',
|
|
810
|
+
},
|
|
811
|
+
InvalidAddress: {
|
|
812
|
+
human: 'Address argument is invalid or zero.',
|
|
813
|
+
},
|
|
814
|
+
InvalidPayout: {
|
|
815
|
+
human: 'Payout amount is zero or out of range.',
|
|
816
|
+
},
|
|
817
|
+
InvalidString: {
|
|
818
|
+
human: 'A string argument is empty or too long.',
|
|
819
|
+
},
|
|
820
|
+
EmptyString: {
|
|
821
|
+
human: 'A required string argument is empty.',
|
|
822
|
+
},
|
|
823
|
+
EmptyTitle: {
|
|
824
|
+
human: 'Title must not be empty.',
|
|
825
|
+
},
|
|
826
|
+
TitleTooLong: {
|
|
827
|
+
human: 'Title exceeds the maximum length.',
|
|
828
|
+
},
|
|
829
|
+
StringTooLong: {
|
|
830
|
+
human: 'A string argument exceeds the maximum length.',
|
|
831
|
+
},
|
|
832
|
+
EmptyBatch: {
|
|
833
|
+
human: 'Batch must contain at least one item.',
|
|
834
|
+
},
|
|
835
|
+
LengthMismatch: {
|
|
836
|
+
human: 'Array arguments must have the same length.',
|
|
837
|
+
},
|
|
838
|
+
ArrayLengthMismatch: {
|
|
839
|
+
human: 'Array arguments must have the same length.',
|
|
840
|
+
},
|
|
841
|
+
ArrayLenMismatch: {
|
|
842
|
+
human: 'Array arguments must have the same length.',
|
|
843
|
+
},
|
|
844
|
+
CapBelowCommitted: {
|
|
845
|
+
human: 'New cap is below the amount already committed or spent.',
|
|
846
|
+
},
|
|
847
|
+
Overflow: {
|
|
848
|
+
human: 'Arithmetic overflow guard triggered.',
|
|
849
|
+
},
|
|
850
|
+
// --- Pausing / reentrancy / init guards (OpenZeppelin) ---
|
|
851
|
+
Paused: {
|
|
852
|
+
human: 'The contract is paused.',
|
|
853
|
+
suggestion: 'Try again later or contact the org admins.',
|
|
854
|
+
},
|
|
855
|
+
EnforcedPause: {
|
|
856
|
+
human: 'The contract is paused — this action is blocked until it is unpaused.',
|
|
857
|
+
suggestion: 'Try again later or contact the org admins.',
|
|
858
|
+
},
|
|
859
|
+
ExpectedPause: {
|
|
860
|
+
human: 'This operation requires the contract to be paused first.',
|
|
861
|
+
},
|
|
862
|
+
ReentrancyGuardReentrantCall: {
|
|
863
|
+
human: 'Reentrant call blocked by the reentrancy guard.',
|
|
864
|
+
},
|
|
865
|
+
InvalidInitialization: {
|
|
866
|
+
human: 'The contract is already initialized (initializer replay blocked).',
|
|
867
|
+
},
|
|
868
|
+
NotInitializing: {
|
|
869
|
+
human: 'This function may only run during contract initialization.',
|
|
870
|
+
},
|
|
871
|
+
// --- OpenZeppelin ERC20 / votes / ownable / proxy / utils ---
|
|
872
|
+
ERC20InsufficientBalance: {
|
|
873
|
+
human: 'Token balance is too low for this transfer or burn.',
|
|
874
|
+
},
|
|
875
|
+
ERC20InsufficientAllowance: {
|
|
876
|
+
human: 'Spender allowance is too low.',
|
|
877
|
+
suggestion: 'Approve a larger allowance first.',
|
|
878
|
+
},
|
|
879
|
+
ERC20InvalidSender: {
|
|
880
|
+
human: 'Token transfer from the zero address is not allowed.',
|
|
881
|
+
},
|
|
882
|
+
ERC20InvalidReceiver: {
|
|
883
|
+
human: 'Token transfer to the zero address is not allowed.',
|
|
884
|
+
},
|
|
885
|
+
ERC20InvalidApprover: {
|
|
886
|
+
human: 'Token approval from the zero address is not allowed.',
|
|
887
|
+
},
|
|
888
|
+
ERC20InvalidSpender: {
|
|
889
|
+
human: 'Token approval to the zero address is not allowed.',
|
|
890
|
+
},
|
|
891
|
+
ERC20ExceededSafeSupply: {
|
|
892
|
+
human: 'Mint would exceed the token safe-supply cap.',
|
|
893
|
+
},
|
|
894
|
+
ERC5805FutureLookup: {
|
|
895
|
+
human: 'Votes lookup requested for a future timepoint.',
|
|
896
|
+
suggestion: 'Wait for the block to finalize, then retry.',
|
|
897
|
+
},
|
|
898
|
+
ERC6372InconsistentClock: {
|
|
899
|
+
human: 'Token clock is misconfigured (EIP-6372 inconsistency).',
|
|
900
|
+
},
|
|
901
|
+
CheckpointUnorderedInsertion: {
|
|
902
|
+
human: 'Internal checkpoint written out of order (token accounting bug).',
|
|
903
|
+
},
|
|
904
|
+
SafeCastOverflowedUintDowncast: {
|
|
905
|
+
human: 'Value is too large for the target integer type (internal downcast overflow).',
|
|
906
|
+
},
|
|
907
|
+
SafeERC20FailedOperation: {
|
|
908
|
+
human: 'ERC20 token operation failed (non-standard or reverting token).',
|
|
909
|
+
},
|
|
910
|
+
OwnableInvalidOwner: {
|
|
911
|
+
human: 'New owner must not be the zero address.',
|
|
912
|
+
},
|
|
913
|
+
OwnableUnauthorizedAccount: {
|
|
914
|
+
human: 'Caller is not the contract owner.',
|
|
915
|
+
},
|
|
916
|
+
AddressEmptyCode: {
|
|
917
|
+
human: 'Target address has no contract code.',
|
|
918
|
+
suggestion: 'Check that the address points to a deployed contract on this chain.',
|
|
919
|
+
},
|
|
920
|
+
FailedCall: {
|
|
921
|
+
human: 'A low-level call failed.',
|
|
922
|
+
},
|
|
923
|
+
ERC1967InvalidImplementation: {
|
|
924
|
+
human: 'New implementation address is not a valid contract.',
|
|
925
|
+
},
|
|
926
|
+
ERC1967NonPayable: {
|
|
927
|
+
human: 'Proxy upgrade call must not send value.',
|
|
928
|
+
},
|
|
929
|
+
UUPSUnauthorizedCallContext: {
|
|
930
|
+
human: 'UUPS upgrade called from the wrong context (must go through the proxy).',
|
|
931
|
+
},
|
|
932
|
+
UUPSUnsupportedProxiableUUID: {
|
|
933
|
+
human: 'New implementation has an incompatible UUPS storage slot.',
|
|
934
|
+
},
|
|
935
|
+
};
|
|
936
|
+
/**
|
|
937
|
+
* Look up the human message + suggestion for a custom error name.
|
|
938
|
+
*/
|
|
939
|
+
function getErrorHint(name) {
|
|
940
|
+
return exports.ERROR_MESSAGES[name];
|
|
941
|
+
}
|