@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,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vote domain tx builders — ports of the `pop vote *` write commands.
|
|
3
|
+
*
|
|
4
|
+
* Level 1 (pure, sync): buildVote, buildAnnounceWinner — plus
|
|
5
|
+
* buildGovernanceProposal in ./governance (the Level-1 builder for
|
|
6
|
+
* createProposal itself).
|
|
7
|
+
*
|
|
8
|
+
* Level 2 (resolved, async): createProposalIntent, castVoteIntent,
|
|
9
|
+
* announceWinnerIntent, executeProposalIntent, and the three governance-wrap
|
|
10
|
+
* consumers proposeQuorumIntent / proposeConfigIntent / proposeClassesIntent.
|
|
11
|
+
*
|
|
12
|
+
* Receipt parsing (parseProposalCreatedLogs lives in ./governance;
|
|
13
|
+
* parseAnnounceReceiptLogs here) and the callStatic announce probe are
|
|
14
|
+
* exported because "tx mined" is NOT success for announceWinner — the
|
|
15
|
+
* Executor swallows failed sub-calls.
|
|
16
|
+
*/
|
|
17
|
+
import { ethers } from 'ethers';
|
|
18
|
+
import type { TxIntent } from './intent';
|
|
19
|
+
import type { PopContext } from '../context';
|
|
20
|
+
import { OrgModules } from '../reads/resolve';
|
|
21
|
+
export type VotingType = 'hybrid' | 'dd';
|
|
22
|
+
export type VotingAbiName = 'HybridVotingNew' | 'DirectDemocracyVotingNew';
|
|
23
|
+
export interface VoteArgs {
|
|
24
|
+
votingAddress: string;
|
|
25
|
+
votingAbiName: VotingAbiName;
|
|
26
|
+
proposalId: ethers.BigNumberish;
|
|
27
|
+
/** Option indices voted for (must pair with weights). */
|
|
28
|
+
optionIndices: number[];
|
|
29
|
+
/** Percentage weights — the contract requires them to sum to exactly 100. */
|
|
30
|
+
weights: number[];
|
|
31
|
+
orgId?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Port of `pop vote cast` — src/commands/vote/cast.ts:
|
|
35
|
+
* HybridVotingNew|DirectDemocracyVotingNew.vote(proposalId, optionIndices, weights).
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildVote(a: VoteArgs): TxIntent;
|
|
38
|
+
export interface AnnounceWinnerArgs {
|
|
39
|
+
votingAddress: string;
|
|
40
|
+
votingAbiName: VotingAbiName;
|
|
41
|
+
proposalId: ethers.BigNumberish;
|
|
42
|
+
orgId?: string;
|
|
43
|
+
/** meta.action override — 'announce' (default) | 'execute' | 'announce-all'. */
|
|
44
|
+
action?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Port of `pop vote announce` / `pop vote announce-all` / `pop vote execute`
|
|
48
|
+
* — src/commands/vote/announce.ts, announce-all.ts, execute.ts:
|
|
49
|
+
* HybridVotingNew|DirectDemocracyVotingNew.announceWinner(proposalId).
|
|
50
|
+
*
|
|
51
|
+
* DESTRUCTIVE: irreversibly finalizes the vote and executes the winning
|
|
52
|
+
* option's calls through the Executor. Hosts should (a) callStatic-probe
|
|
53
|
+
* first (announceWinnerProbe) and (b) scan the receipt with
|
|
54
|
+
* parseAnnounceReceiptLogs — the outer tx can succeed while the proposal's
|
|
55
|
+
* calls reverted.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildAnnounceWinner(a: AnnounceWinnerArgs): TxIntent;
|
|
58
|
+
/**
|
|
59
|
+
* Port of `parseAnnounceReceipt` (src/commands/vote/helpers.ts), decoupled
|
|
60
|
+
* from TxResult: takes the parsed receipt logs. The Executor catches failed
|
|
61
|
+
* sub-calls and emits CallFailed / ProposalExecutionFailed while the OUTER tx
|
|
62
|
+
* still succeeds — callers MUST treat innerFailure as an execution failure
|
|
63
|
+
* even though the transaction mined successfully.
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseAnnounceReceiptLogs(logs: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
args?: any;
|
|
68
|
+
}> | undefined | null): {
|
|
69
|
+
winningOption?: string;
|
|
70
|
+
valid?: boolean;
|
|
71
|
+
executed: boolean;
|
|
72
|
+
innerFailure: boolean;
|
|
73
|
+
failedCalls: Array<{
|
|
74
|
+
index?: string;
|
|
75
|
+
data?: string;
|
|
76
|
+
}>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Port of `announceWinnerProbe` (src/commands/vote/helpers.ts): callStatic
|
|
80
|
+
* probe shared by announce/execute pre-flights — would announceWinner(id)
|
|
81
|
+
* revert right now (voting still open, already executed, quorum edge...)?
|
|
82
|
+
* Returns the decoded reason on failure. This is an RPC revert predictor:
|
|
83
|
+
* per the architecture rules it must stay RPC, never subgraph.
|
|
84
|
+
*/
|
|
85
|
+
export declare function announceWinnerProbe(contract: ethers.Contract, proposalId: number | string): Promise<{
|
|
86
|
+
ok: true;
|
|
87
|
+
} | {
|
|
88
|
+
ok: false;
|
|
89
|
+
reason: string;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Org-module address → human name map for decoding proposal execution
|
|
93
|
+
* targets (src/commands/vote/helpers.ts MODULE_LABELS). Order matters only
|
|
94
|
+
* for display; keys come from resolveOrgModules.
|
|
95
|
+
*/
|
|
96
|
+
export declare const MODULE_LABELS: Array<{
|
|
97
|
+
key: keyof OrgModules;
|
|
98
|
+
label: string;
|
|
99
|
+
abi: string;
|
|
100
|
+
}>;
|
|
101
|
+
/** Raw execution-call input as the CLI accepts it in --calls JSON. */
|
|
102
|
+
export interface ExecutionCallInput {
|
|
103
|
+
target: string;
|
|
104
|
+
value?: string | number | ethers.BigNumber;
|
|
105
|
+
data?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Port of `describeExecutionCalls` (src/commands/vote/helpers.ts) —
|
|
109
|
+
* governance-safety decode of proposal execution calls for confirm UIs:
|
|
110
|
+
* each call's target is resolved against the org's known module addresses
|
|
111
|
+
* (named when recognized) and its calldata selector is decoded to a function
|
|
112
|
+
* signature via the known ABIs. Never throws — undecodable calls degrade to
|
|
113
|
+
* the raw selector so the human still sees SOMETHING.
|
|
114
|
+
*/
|
|
115
|
+
export declare function describeExecutionCalls(calls: ExecutionCallInput[], modules: Partial<OrgModules> | null | undefined): string[];
|
|
116
|
+
export interface CreateProposalParams {
|
|
117
|
+
org: string;
|
|
118
|
+
type: VotingType;
|
|
119
|
+
/** Proposal title. */
|
|
120
|
+
name: string;
|
|
121
|
+
description: string;
|
|
122
|
+
durationMinutes: number;
|
|
123
|
+
optionNames: string[];
|
|
124
|
+
/**
|
|
125
|
+
* Restricted-voting hat IDs, as raw strings/BigNumbers. Hat IDs are uint256
|
|
126
|
+
* with high bits set — Number loses precision above 2^53, so entries are
|
|
127
|
+
* parsed as BigNumbers from the raw values.
|
|
128
|
+
*/
|
|
129
|
+
hatIds?: Array<string | ethers.BigNumberish>;
|
|
130
|
+
/** Execution calls for option 0 ({target, value, data} — the --calls shape). */
|
|
131
|
+
calls?: ExecutionCallInput[];
|
|
132
|
+
/** Metadata createdAt override (default Date.now()). */
|
|
133
|
+
createdAt?: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Port of `pop vote create` — src/commands/vote/create.ts.
|
|
137
|
+
*
|
|
138
|
+
* Resolves the org's voting module, validates the option count, parses hat
|
|
139
|
+
* IDs as BigNumbers, applies the MAX_POLL_HATS cap check (only when
|
|
140
|
+
* ctx.provider is supplied — best-effort, exactly like the CLI: an older
|
|
141
|
+
* contract has no getter and no cap, so a failing read means the check does
|
|
142
|
+
* not apply), builds the option-0 execution batch, pins the proposal
|
|
143
|
+
* metadata {description, optionNames, createdAt}, and delegates to
|
|
144
|
+
* buildGovernanceProposal.
|
|
145
|
+
*
|
|
146
|
+
* Batch quirk preserved: with calls OMITTED the batches argument is the
|
|
147
|
+
* EMPTY array [], while calls GIVEN (even as an empty list) build per-option
|
|
148
|
+
* batches [[…], [], …] — matching the CLI's `if (argv.calls)` branch exactly.
|
|
149
|
+
*/
|
|
150
|
+
export declare function createProposalIntent(ctx: PopContext, params: CreateProposalParams): Promise<TxIntent>;
|
|
151
|
+
export interface CastVoteParams {
|
|
152
|
+
org: string;
|
|
153
|
+
type: VotingType;
|
|
154
|
+
/** Proposal ID (number) or fuzzy title query. */
|
|
155
|
+
proposal: string | number;
|
|
156
|
+
optionIndices: number[];
|
|
157
|
+
weights: number[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Port of `pop vote cast` — src/commands/vote/cast.ts.
|
|
161
|
+
*
|
|
162
|
+
* Input safety kept from the CLI: option/weight counts must match, weights
|
|
163
|
+
* must be non-negative and sum to exactly 100 (the contract's invariant) —
|
|
164
|
+
* all validated before any network traffic. The proposal argument accepts a
|
|
165
|
+
* numeric ID or fuzzy title query (resolved with preferActive: an ended
|
|
166
|
+
* homonym never shadows the one still-open match).
|
|
167
|
+
*/
|
|
168
|
+
export declare function castVoteIntent(ctx: PopContext, params: CastVoteParams): Promise<TxIntent>;
|
|
169
|
+
export interface AnnounceWinnerParams {
|
|
170
|
+
org: string;
|
|
171
|
+
type: VotingType;
|
|
172
|
+
/** Proposal ID (number) or fuzzy title query. */
|
|
173
|
+
proposal: string | number;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Port of `pop vote announce` — src/commands/vote/announce.ts (also the
|
|
177
|
+
* per-proposal intent of `pop vote announce-all`).
|
|
178
|
+
*
|
|
179
|
+
* DESTRUCTIVE. This builder only resolves and encodes; the CLI's safety
|
|
180
|
+
* layers stay host-side: (1) announceWinnerProbe before broadcasting,
|
|
181
|
+
* (2) parseAnnounceReceiptLogs after — outer success + innerFailure means
|
|
182
|
+
* the proposal finalized but its execution reverted.
|
|
183
|
+
*/
|
|
184
|
+
export declare function announceWinnerIntent(ctx: PopContext, params: AnnounceWinnerParams): Promise<TxIntent>;
|
|
185
|
+
export interface ExecuteProposalParams {
|
|
186
|
+
org: string;
|
|
187
|
+
/** Proposal ID (number) or fuzzy title query. */
|
|
188
|
+
proposal: string | number;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Port of `pop vote execute` — src/commands/vote/execute.ts. Hybrid-only:
|
|
192
|
+
* announceWinner is the one canonical finalize path (the Executor is
|
|
193
|
+
* allowedCaller-gated, so proposal calls cannot be executed directly).
|
|
194
|
+
*
|
|
195
|
+
* The CLI's subgraph state gate is NOT run here — hosts replicate it with
|
|
196
|
+
* reads/vote fetchProposalExecutionState + evaluateExecuteGate, then probe
|
|
197
|
+
* with announceWinnerProbe, then scan the receipt with
|
|
198
|
+
* parseAnnounceReceiptLogs (executionFailed proposals are retryable since
|
|
199
|
+
* audit H-05; the callStatic probe is the arbiter on older deployments).
|
|
200
|
+
*/
|
|
201
|
+
export declare function executeProposalIntent(ctx: PopContext, params: ExecuteProposalParams): Promise<TxIntent>;
|
|
202
|
+
/**
|
|
203
|
+
* setConfig keys for quorum (contracts origin/main, v6):
|
|
204
|
+
* HybridVoting: key 3 (QUORUM)
|
|
205
|
+
* DirectDemocracyVoting: key 4 (QUORUM)
|
|
206
|
+
*
|
|
207
|
+
* The voting contracts use setConfig(uint8, bytes) instead of a direct
|
|
208
|
+
* setter, and decode the value as uint32. Since PR #119 quorum is a minimum
|
|
209
|
+
* voter COUNT (0 disables), not a percentage.
|
|
210
|
+
*/
|
|
211
|
+
export declare const HYBRID_QUORUM_KEY = 3;
|
|
212
|
+
export declare const DD_QUORUM_KEY = 4;
|
|
213
|
+
export interface ProposeQuorumParams {
|
|
214
|
+
org: string;
|
|
215
|
+
/** New quorum value (minimum voter COUNT, not a percentage). */
|
|
216
|
+
quorum: number;
|
|
217
|
+
/** Vote duration in minutes (CLI default 60). */
|
|
218
|
+
durationMinutes?: number;
|
|
219
|
+
/** Metadata createdAt override (default Date.now()). */
|
|
220
|
+
createdAt?: number;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Port of `pop vote propose-quorum` — src/commands/vote/propose-quorum.ts.
|
|
224
|
+
*
|
|
225
|
+
* Governance wrap: createProposal on HybridVoting with an option-0 batch of
|
|
226
|
+
* setConfig(3, abi.encode(uint32 quorum)) on HybridVoting plus
|
|
227
|
+
* setConfig(4, same) on DD when the org has one; option 1 (keep current) has
|
|
228
|
+
* no calls; hatIds [].
|
|
229
|
+
*/
|
|
230
|
+
export declare function proposeQuorumIntent(ctx: PopContext, params: ProposeQuorumParams): Promise<TxIntent>;
|
|
231
|
+
/**
|
|
232
|
+
* ConfigKey mapping for HybridVoting (contracts origin/main, v6):
|
|
233
|
+
* 0: THRESHOLD (uint8 — support threshold percentage, 1-100)
|
|
234
|
+
* 1: TARGET_ALLOWED (deprecated — setConfig silently ignores this branch)
|
|
235
|
+
* 2: EXECUTOR (address — change the executor contract)
|
|
236
|
+
* 3: QUORUM (uint32 — minimum voter count for validity, 0 disables)
|
|
237
|
+
*
|
|
238
|
+
* ConfigKey mapping for DirectDemocracyVoting (v6):
|
|
239
|
+
* 0: THRESHOLD (uint8 — support threshold percentage, 1-100)
|
|
240
|
+
* 1: EXECUTOR (address)
|
|
241
|
+
* 2: TARGET_ALLOWED (address, bool — whitelist execution targets)
|
|
242
|
+
* 3: HAT_ALLOWED (uint256, bool — restrict voting to specific hats)
|
|
243
|
+
* 4: QUORUM (uint32 — minimum voter count for validity, 0 disables)
|
|
244
|
+
*
|
|
245
|
+
* Note: since PR #119 quorum is a voter COUNT, not a percentage.
|
|
246
|
+
*/
|
|
247
|
+
export interface ConfigParam {
|
|
248
|
+
name: string;
|
|
249
|
+
hybridKey: number;
|
|
250
|
+
ddKey: number | null;
|
|
251
|
+
valueType: string;
|
|
252
|
+
description: string;
|
|
253
|
+
encode: (value: string) => string;
|
|
254
|
+
validate: (value: string) => void;
|
|
255
|
+
hybridUnavailableReason?: string;
|
|
256
|
+
}
|
|
257
|
+
/** Port of CONFIG_PARAMS (src/commands/vote/propose-config.ts) — verbatim. */
|
|
258
|
+
export declare const CONFIG_PARAMS: Record<string, ConfigParam>;
|
|
259
|
+
export interface ProposeConfigParams {
|
|
260
|
+
org: string;
|
|
261
|
+
/** Configuration parameter name (a CONFIG_PARAMS key). */
|
|
262
|
+
key: string;
|
|
263
|
+
/** New value, in the key's string format. */
|
|
264
|
+
value: string;
|
|
265
|
+
/** Vote duration in minutes (CLI default 60). */
|
|
266
|
+
durationMinutes?: number;
|
|
267
|
+
/** Metadata createdAt override (default Date.now()). */
|
|
268
|
+
createdAt?: number;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Port of `pop vote propose-config` — src/commands/vote/propose-config.ts.
|
|
272
|
+
*
|
|
273
|
+
* Governance wrap: createProposal on HybridVoting whose option-0 batch calls
|
|
274
|
+
* setConfig(key, encodedValue) on the applicable voting contract(s) per the
|
|
275
|
+
* CONFIG_PARAMS table. Validation errors are the CLI's own (plain Error,
|
|
276
|
+
* verbatim messages).
|
|
277
|
+
*/
|
|
278
|
+
export declare function proposeConfigIntent(ctx: PopContext, params: ProposeConfigParams): Promise<TxIntent>;
|
|
279
|
+
/** ClassStrategy enum — verified origin/main src/HybridVoting.sol. */
|
|
280
|
+
export declare const CLASS_STRATEGY: {
|
|
281
|
+
readonly DIRECT: 0;
|
|
282
|
+
readonly ERC20_BAL: 1;
|
|
283
|
+
};
|
|
284
|
+
/** Contract constant MAX_CLASSES (origin/main src/HybridVoting.sol). */
|
|
285
|
+
export declare const MAX_CLASSES = 8;
|
|
286
|
+
export interface ParsedClassConfig {
|
|
287
|
+
strategy: number;
|
|
288
|
+
slicePct: number;
|
|
289
|
+
quadratic: boolean;
|
|
290
|
+
minBalance: ethers.BigNumber;
|
|
291
|
+
asset: string;
|
|
292
|
+
hatIds: ethers.BigNumber[];
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Port of `parseClassConfigs` (src/commands/vote/classes.ts): validate +
|
|
296
|
+
* normalize a ClassConfig[] JSON document. Mirrors HybridVotingConfig
|
|
297
|
+
* setClasses validation so bad configs fail locally with a pointer to the
|
|
298
|
+
* offending class instead of a generic on-chain revert: 1..MAX_CLASSES(8)
|
|
299
|
+
* classes, each slicePct 1..100 and summing to exactly 100, ERC20_BAL needs a
|
|
300
|
+
* non-zero asset. Hat IDs are parsed as BigNumbers straight from their raw
|
|
301
|
+
* strings — real Hats IDs exceed 2^53 and would be mangled by Number.
|
|
302
|
+
*/
|
|
303
|
+
export declare function parseClassConfigs(doc: any): ParsedClassConfig[];
|
|
304
|
+
/**
|
|
305
|
+
* Port of `describeClass` (src/commands/vote/classes.ts): one-line human
|
|
306
|
+
* description of a class (confirm summary + metadata description).
|
|
307
|
+
*/
|
|
308
|
+
export declare function describeClass(c: ParsedClassConfig): string;
|
|
309
|
+
export interface ProposeClassesParams {
|
|
310
|
+
org: string;
|
|
311
|
+
/**
|
|
312
|
+
* The ClassConfig[] document — either the raw parsed-JSON array (host reads
|
|
313
|
+
* the file; core validates via parseClassConfigs) or an already-parsed
|
|
314
|
+
* ParsedClassConfig[].
|
|
315
|
+
*/
|
|
316
|
+
classes: unknown | ParsedClassConfig[];
|
|
317
|
+
/** Vote duration in minutes (CLI default 60). */
|
|
318
|
+
durationMinutes?: number;
|
|
319
|
+
/** Metadata createdAt override (default Date.now()). */
|
|
320
|
+
createdAt?: number;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Port of `pop vote classes propose` — src/commands/vote/classes.ts
|
|
324
|
+
* (classesProposeHandler).
|
|
325
|
+
*
|
|
326
|
+
* setClasses(ClassConfig[]) is executor-gated on HybridVoting (verified:
|
|
327
|
+
* `function setClasses(ClassConfig[] calldata) external onlyExecutor`), so it
|
|
328
|
+
* ships as a governance proposal whose option-0 execution batch calls the
|
|
329
|
+
* voting contract through the Executor (propose-config pattern). ClassConfig
|
|
330
|
+
* tuple order: [strategy, slicePct, quadratic, minBalance, asset, hatIds].
|
|
331
|
+
*/
|
|
332
|
+
export declare function proposeClassesIntent(ctx: PopContext, params: ProposeClassesParams): Promise<TxIntent>;
|