@continuumdao/ctm-mpc-defi 0.2.52 → 0.2.54

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.
@@ -27,7 +27,7 @@ One contract: `ContinuumDAO.propose`. Bravo vs Delta is encoding, not a separate
27
27
  - **Delta vote:** `weights` must be **nOptions + 1**. The last slot is baked-in NOTA. Do not ship nOptions-only params.
28
28
  - **Queue is not implemented.** `queue()` reverts. Execute from `Succeeded`.
29
29
 
30
- After a propose multi-sign request is **mined**, call `ctm_continuum_dao_register_proposal` (`POST /proposals/create`) so [app.continuumdao.org/governance](https://app.continuumdao.org/governance) stays in sync. If the POST fails, retry — do not revert the chain tx. `onchainId` comes from `hashProposal` or `ProposalCreated`.
30
+ `build_propose_bravo_multisign` and `build_propose_delta_multisign` POST `/proposals/create` (Ed25519, `pendingOnChain`) **before** the multi-sign request is submitted. Pass `description` and `type` (0–4) so the catalog matches the forum section. If that POST fails, the sign request is not created. `ctm_continuum_dao_register_proposal` is only a retry of the same POST. Do not wait for the propose tx to be mined before the catalog write.
31
31
 
32
32
  `load_defi_protocol({ protocolId: "continuum-dao" })` loads escrow, attach, and governance together.
33
33
 
@@ -68,8 +68,8 @@ When a proposal has a `forumKey`, fetch that thread (`ctm_continuum_dao_forum_re
68
68
  2. If it is only an idea: `forum_create_idea`. Stop (no propose).
69
69
  3. If it is a proposal: `forum_create_topic` with the matching Governance `section` (proposal-threshold veCTM). Keep the returned `url`.
70
70
  4. Compose actions with `ctm_continuum_dao_compose_proposal_action` (prefer ABI from `etherscan__get_contract_abi` with chainid 59144/59141, type-check values, preview table). Then offer `ctm_continuum_dao_simulate_proposal` — pass `account` for another EOA, or `keyGenId` / omit `account` for the preferred KeyGen. Write `foundry.files` and run `foundry__forge_script` on a Linea fork with no `--broadcast`. Do **not** treat isolated `eth_call` as success. Do **not** submit if `ok` is false or a forge script reverts.
71
- 5. `build_propose_bravo_multisign` or `build_propose_delta_multisign` with that `url` as `forumKey` (KeyGen submit only). These builders refuse a reverting `propose()` or (when the RPC supports it) sequential `eth_simulateV1` execute. Sequential execute still requires the forge scripts above.
72
- 6. After the propose tx is mined, `register_proposal` with the same `forumKey`.
71
+ 5. `build_propose_bravo_multisign` or `build_propose_delta_multisign` with that `url` as `forumKey`, plus `description` and `type` (KeyGen submit only). The tool writes the governance catalog, then submits the multi-sign request. It refuses a reverting `propose()` or (when the RPC supports it) sequential `eth_simulateV1` execute. Sequential execute still requires the forge scripts above.
72
+ 6. If the catalog POST failed, retry with `register_proposal` and the same `forumKey`, `description`, `type`, and `onchainId`. Do not create a second propose.
73
73
 
74
74
  `forumKey` must match `/topic/:tid` or `/t/:tid` on forum.continuumdao.org. Builders and `register_proposal` throw otherwise.
75
75
 
@@ -77,7 +77,7 @@ Forum KeyGen sign-in is EIP-712 multi-sign (no EVM tx). The ticket is stored on
77
77
 
78
78
  1. `get_forum_session({ address })`. If `found` is true, `ctm_continuum_dao_forum_me({ ticket })`. If `loggedIn` is true, reuse that ticket. Do **not** compose a sign-in request.
79
79
  2. If there is no session or `loggedIn` is false: `ctm_continuum_dao_forum_sign_in_eligible({ address })` — current `balanceOfNFT` on an owned or attached veCTM vs `veCtmThresholdPower` (200 veCTM). Governor `getVotes` and month-start `balanceOfNFTAt` do not count. Read `votingPower`, `threshold`, and `tokenId` from the result. If `eligible` is false, stop. Do **not** compose a multi-sign request.
80
- 3. `ctm_continuum_dao_build_forum_sign_in_multisign` uses the same gate and refuses ineligible addresses so other nodes never enter the sign loop. Ask the operator for a custom username (2–16 letters, numbers, `.` `_` `-`) and pass `username`. A KeyGen may choose a username the same way a wallet does. If they decline, call again with `useNodeKeyUsername: true` and `nodeKey`; the forum assigns the first 16 characters of the node key. Do not invent a username and do not skip the question. After Execute, the node stores the ticket. Call `get_forum_session` again, then `forum_reply` / `forum_react` / `forum_create_topic` / `forum_create_idea`.
80
+ 3. `ctm_continuum_dao_build_forum_sign_in_multisign` uses the same gate and refuses ineligible addresses so other nodes never enter the sign loop. Always pass `nodeKey` from this node. A custom username does not omit it; `useNodeKeyUsername` only chooses the display name. Ask the operator for a custom username (2–16 letters, numbers, `.` `_` `-`) and pass `username` together with `nodeKey`. If they decline, call again with `useNodeKeyUsername: true` and the same `nodeKey`; the forum assigns the first 16 characters of the node key as the username. Do not invent a username and do not skip the question. After Execute, the node stores the ticket and the forum stores the verified node key on that user (new or existing), which is required for MPA Wallet Chat. Call `get_forum_session` again, then `forum_reply` / `forum_react` / `forum_create_topic` / `forum_create_idea`.
81
81
  4. `ctm_continuum_dao_forum_sign_out({ address, ticket })` deletes the node ticket (web chat and Telegram webhook turns share that row). `clear_forum_session({ address })` is the same delete. No multi-sign.
82
82
 
83
83
  Forum sign-in and sign-out are **agent/MCP only**. There is no Sign in / Sign out control in the node-app Compose header.
@@ -40,15 +40,6 @@ var init_chainIdParse = __esm({
40
40
  "src/chains/evm/chainIdParse.ts"() {
41
41
  }
42
42
  });
43
- function isContinuumDaoCommitteeProposer(addr2) {
44
- if (!addr2 || !isConfiguredAddress(addr2)) return false;
45
- try {
46
- const a = viem.getAddress(addr2);
47
- return exports.CONTINUUM_DAO_COMMITTEE_PROPOSERS.some((c) => c === a);
48
- } catch {
49
- return false;
50
- }
51
- }
52
43
  function isConfiguredAddress(addr2) {
53
44
  if (!addr2?.trim()) return false;
54
45
  try {
@@ -140,7 +131,7 @@ function listContinuumDaoDefaultAssets() {
140
131
  }
141
132
  return out;
142
133
  }
143
- exports.CONTINUUM_DAO_PROTOCOL_ID = void 0; exports.CONTINUUM_DAO_ETHEREUM_CHAIN_ID = void 0; exports.CONTINUUM_DAO_LINEA_CHAIN_ID = void 0; exports.CONTINUUM_DAO_LINEA_SEPOLIA_CHAIN_ID = void 0; exports.CTM_TOKEN_NAME = void 0; exports.CTM_TOKEN_SYMBOL = void 0; exports.VECTM_TOKEN_NAME = void 0; exports.VECTM_TOKEN_SYMBOL = void 0; exports.CTM_TOKEN_DECIMALS = void 0; exports.WEEK_SECONDS = void 0; exports.MAXTIME_SECONDS = void 0; exports.VECTM_MAX_LOCK_WEEKS = void 0; exports.VECTM_DEFAULT_MINIMUM_LOCK_WEI = void 0; exports.VECTM_LIQ_MIN_LOCKED_WEI = void 0; exports.VECTM_LIQ_PENALTY_NUM = void 0; exports.VECTM_LIQ_PENALTY_DEN = void 0; var UNSET; exports.CTM_TOKEN_ADDRESS = void 0; exports.VOTING_ESCROW_LINEA_ADDRESS = void 0; exports.MULTISIGN_AGENT_WALLET_LINEA_ADDRESS = void 0; exports.CTM_FEE_RATE_SCALE = void 0; exports.VOTING_ESCROW_MARKETPLACE_LINEA_ADDRESS = void 0; exports.VOTING_ESCROW_MARKETPLACE_START_BLOCK = void 0; exports.MARKETPLACE_WETH_LINEA_ADDRESS = void 0; exports.MARKETPLACE_USDC_LINEA_ADDRESS = void 0; exports.CONTINUUM_DAO_MARKETPLACE_PROTOCOL_ID = void 0; exports.CONTINUUM_DAO_LINEA_GOVERNOR_ADDRESS = void 0; exports.CONTINUUM_DAO_LINEA_GOVERNOR_LEGACY_ADDRESS = void 0; exports.CONTINUUM_DAO_COMMITTEE_PROPOSERS = void 0; exports.CONTINUUM_DAO_DEPLOYMENTS = void 0; exports.CONTINUUM_DAO_GOVERNANCE_API = void 0; exports.CONTINUUM_DAO_MARKETPLACE_API = void 0;
134
+ exports.CONTINUUM_DAO_PROTOCOL_ID = void 0; exports.CONTINUUM_DAO_ETHEREUM_CHAIN_ID = void 0; exports.CONTINUUM_DAO_LINEA_CHAIN_ID = void 0; exports.CONTINUUM_DAO_LINEA_SEPOLIA_CHAIN_ID = void 0; exports.CTM_TOKEN_NAME = void 0; exports.CTM_TOKEN_SYMBOL = void 0; exports.VECTM_TOKEN_NAME = void 0; exports.VECTM_TOKEN_SYMBOL = void 0; exports.CTM_TOKEN_DECIMALS = void 0; exports.WEEK_SECONDS = void 0; exports.MAXTIME_SECONDS = void 0; exports.VECTM_MAX_LOCK_WEEKS = void 0; exports.VECTM_DEFAULT_MINIMUM_LOCK_WEI = void 0; exports.VECTM_LIQ_MIN_LOCKED_WEI = void 0; exports.VECTM_LIQ_PENALTY_NUM = void 0; exports.VECTM_LIQ_PENALTY_DEN = void 0; var UNSET; exports.CTM_TOKEN_ADDRESS = void 0; exports.VOTING_ESCROW_LINEA_ADDRESS = void 0; exports.MULTISIGN_AGENT_WALLET_LINEA_ADDRESS = void 0; exports.CTM_FEE_RATE_SCALE = void 0; exports.VOTING_ESCROW_MARKETPLACE_LINEA_ADDRESS = void 0; exports.VOTING_ESCROW_MARKETPLACE_START_BLOCK = void 0; exports.MARKETPLACE_WETH_LINEA_ADDRESS = void 0; exports.MARKETPLACE_USDC_LINEA_ADDRESS = void 0; exports.CONTINUUM_DAO_MARKETPLACE_PROTOCOL_ID = void 0; exports.CONTINUUM_DAO_LINEA_GOVERNOR_ADDRESS = void 0; exports.CONTINUUM_DAO_LINEA_GOVERNOR_LEGACY_ADDRESS = void 0; exports.CONTINUUM_DAO_DEPLOYMENTS = void 0; exports.CONTINUUM_DAO_GOVERNANCE_API = void 0; exports.CONTINUUM_DAO_MARKETPLACE_API = void 0;
144
135
  var init_constants = __esm({
145
136
  "src/protocols/evm/continuum-dao/constants.ts"() {
146
137
  init_chainIdParse();
@@ -178,16 +169,12 @@ var init_constants = __esm({
178
169
  exports.CONTINUUM_DAO_MARKETPLACE_PROTOCOL_ID = "continuum-dao-marketplace";
179
170
  exports.CONTINUUM_DAO_LINEA_GOVERNOR_ADDRESS = viem.getAddress("0x76FF2CB03175900F1D83328C82D27EA9aeaF2355");
180
171
  exports.CONTINUUM_DAO_LINEA_GOVERNOR_LEGACY_ADDRESS = viem.getAddress("0x4800F9f1dC1b6daCA841B71E0531F547D374168E");
181
- exports.CONTINUUM_DAO_COMMITTEE_PROPOSERS = [
182
- viem.getAddress("0xd23eecBe0362F36b254F774C274823Cbfc482a10"),
183
- viem.getAddress("0x482cdCbdd72ef307997153Ee7eb627B7a2348d34"),
184
- viem.getAddress("0x14C189354702b7f2aC7b19e61522A41632226BD8")
185
- ];
186
172
  exports.CONTINUUM_DAO_DEPLOYMENTS = {
187
173
  [exports.CONTINUUM_DAO_LINEA_CHAIN_ID]: {
188
174
  ...UNSET,
189
175
  ctm: exports.CTM_TOKEN_ADDRESS,
190
- votingEscrow: exports.VOTING_ESCROW_LINEA_ADDRESS
176
+ votingEscrow: exports.VOTING_ESCROW_LINEA_ADDRESS,
177
+ governor: exports.CONTINUUM_DAO_LINEA_GOVERNOR_ADDRESS
191
178
  },
192
179
  [exports.CONTINUUM_DAO_LINEA_SEPOLIA_CHAIN_ID]: { ...UNSET },
193
180
  [exports.CONTINUUM_DAO_ETHEREUM_CHAIN_ID]: {
@@ -199,6 +186,159 @@ var init_constants = __esm({
199
186
  exports.CONTINUUM_DAO_MARKETPLACE_API = exports.CONTINUUM_DAO_GOVERNANCE_API;
200
187
  }
201
188
  });
189
+ function docsBaseUrl() {
190
+ const raw = (typeof process !== "undefined" ? process.env.CONTINUUM_DOCS_BASE_URL : "")?.trim() || DEFAULT_DOCS_BASE;
191
+ return raw.replace(/\/+$/, "");
192
+ }
193
+ function parseCommitteeAddressesFromConstitution(markdown) {
194
+ const text = String(markdown || "");
195
+ const start = text.search(/^### Committee List\s*$/m);
196
+ if (start < 0) return [];
197
+ const lines = text.slice(start).split("\n");
198
+ const addresses = [];
199
+ for (let i = 1; i < lines.length; i += 1) {
200
+ const line = lines[i] ?? "";
201
+ if (/^#{1,6}\s/.test(line)) break;
202
+ const trimmed = line.trim();
203
+ if (!trimmed.startsWith("|")) continue;
204
+ if (/^\|\s*[-:]+\s*\|/.test(trimmed)) continue;
205
+ if (/^\|\s*Name\s*\|/i.test(trimmed)) continue;
206
+ const match = trimmed.match(/0x[a-fA-F0-9]{40}/);
207
+ if (!match) continue;
208
+ try {
209
+ addresses.push(viem.getAddress(match[0]));
210
+ } catch {
211
+ }
212
+ }
213
+ return addresses;
214
+ }
215
+ function addressInCommitteeList(addr2, addresses) {
216
+ if (!addr2 || addresses.length === 0) return false;
217
+ try {
218
+ const checksummed = viem.getAddress(addr2);
219
+ return addresses.some((item) => viem.getAddress(item) === checksummed);
220
+ } catch {
221
+ return false;
222
+ }
223
+ }
224
+ async function fetchContinuumDaoCommitteeAddresses() {
225
+ const now = Date.now();
226
+ if (cache && cache.expires > now) return cache.addresses;
227
+ const url = `${docsBaseUrl()}/${CONSTITUTION_PATH}`;
228
+ try {
229
+ const res = await fetch(url, { cache: "no-store" });
230
+ if (!res.ok) throw new Error(`constitution: ${res.status}`);
231
+ const markdown = await res.text();
232
+ const addresses = parseCommitteeAddressesFromConstitution(markdown);
233
+ cache = { expires: now + CACHE_TTL_MS, addresses };
234
+ return addresses;
235
+ } catch {
236
+ return [];
237
+ }
238
+ }
239
+ function resetContinuumDaoCommitteeCache() {
240
+ cache = null;
241
+ }
242
+ var DEFAULT_DOCS_BASE, CONSTITUTION_PATH, CACHE_TTL_MS, cache;
243
+ var init_committeeList = __esm({
244
+ "src/protocols/evm/continuum-dao/committeeList.ts"() {
245
+ DEFAULT_DOCS_BASE = "https://docs.continuumdao.org";
246
+ CONSTITUTION_PATH = "ContinuumDAO/Governance/Constitution.md";
247
+ CACHE_TTL_MS = 5 * 60 * 1e3;
248
+ cache = null;
249
+ }
250
+ });
251
+ function stableJson(value) {
252
+ if (value === null || typeof value !== "object") return JSON.stringify(value);
253
+ if (Array.isArray(value)) return `[${value.map((item) => stableJson(item)).join(",")}]`;
254
+ const record = value;
255
+ const keys = Object.keys(record).sort();
256
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`).join(",")}}`;
257
+ }
258
+ function checksumOrEmpty(value) {
259
+ const raw = String(value || "").trim();
260
+ if (!raw) return "";
261
+ return viem.getAddress(raw);
262
+ }
263
+ function normalizeInput(inp) {
264
+ return {
265
+ name: String(inp?.name || ""),
266
+ type: String(inp?.type || ""),
267
+ value: String(inp?.value ?? "")
268
+ };
269
+ }
270
+ function normalizeAction(action) {
271
+ const network = action.network || {};
272
+ return {
273
+ network: {
274
+ name: String(network.name || ""),
275
+ label: String(network.label || ""),
276
+ chainId: String(network.chainId || ""),
277
+ c3governor: checksumOrEmpty(network.c3governor)
278
+ },
279
+ target: checksumOrEmpty(action.target),
280
+ value: String(action.value || "0"),
281
+ signature: String(action.signature || ""),
282
+ inputs: (action.inputs || []).map(normalizeInput)
283
+ };
284
+ }
285
+ function assertProposalCatalogConstants() {
286
+ if (!exports.CONTINUUM_DAO_GOVERNANCE_API.startsWith("https://")) {
287
+ throw new Error("CONTINUUM_DAO_GOVERNANCE_API is not configured.");
288
+ }
289
+ if (!isConfiguredAddress(exports.CONTINUUM_DAO_LINEA_GOVERNOR_ADDRESS)) {
290
+ throw new Error("Linea governor constant is not configured.");
291
+ }
292
+ const network = exports.CONTINUUM_DAO_LINEA_CATALOG_NETWORK;
293
+ if (!network.name || !network.label || !network.chainId || !isConfiguredAddress(network.c3governor)) {
294
+ throw new Error("Linea catalog network constant is not configured.");
295
+ }
296
+ }
297
+ function proposalCatalogDocument(body) {
298
+ const doc = {
299
+ onchainId: String(body.onchainId || ""),
300
+ title: String(body.title || ""),
301
+ description: String(body.description || ""),
302
+ proposer: checksumOrEmpty(body.proposer),
303
+ forumKey: String(body.forumKey || ""),
304
+ type: Number(body.type ?? 0),
305
+ configuration: body.configuration,
306
+ pendingOnChain: body.pendingOnChain === true
307
+ };
308
+ if (body.configuration === 1) {
309
+ doc.nWinners = Number(body.nWinners ?? 0);
310
+ doc.options = (body.options || []).map((option) => ({
311
+ label: String(option.label || ""),
312
+ actions: (option.actions || []).map(normalizeAction)
313
+ }));
314
+ } else {
315
+ doc.actions = (body.actions || []).map(normalizeAction);
316
+ }
317
+ return doc;
318
+ }
319
+ function proposalCatalogCanonical(body) {
320
+ return stableJson(proposalCatalogDocument(body));
321
+ }
322
+ function stampLineaCatalogActions(actions) {
323
+ return (actions || []).map(
324
+ (action) => normalizeAction({
325
+ ...action,
326
+ network: { ...exports.CONTINUUM_DAO_LINEA_CATALOG_NETWORK }
327
+ })
328
+ );
329
+ }
330
+ exports.CONTINUUM_DAO_LINEA_CATALOG_NETWORK = void 0;
331
+ var init_proposalCatalog = __esm({
332
+ "src/protocols/evm/continuum-dao/proposalCatalog.ts"() {
333
+ init_constants();
334
+ exports.CONTINUUM_DAO_LINEA_CATALOG_NETWORK = {
335
+ name: "linea",
336
+ label: "Linea",
337
+ chainId: "59144",
338
+ c3governor: viem.getAddress("0x58B610a359c870E0fc941139821a51F5aa23f14E")
339
+ };
340
+ }
341
+ });
202
342
  function defiEvmTransport(rpcUrl, opts) {
203
343
  const url = rpcUrl.trim();
204
344
  return viem.http(url, opts);
@@ -946,14 +1086,19 @@ async function continuumDaoForumSignInEligible(args) {
946
1086
  function assertForumSignInUsernameChoice(args) {
947
1087
  const nodeKey = args.nodeKey?.trim() || "";
948
1088
  const username = args.username?.trim() || "";
1089
+ if (!nodeKey) {
1090
+ throw new Error(
1091
+ "KeyGen forum sign-in requires nodeKey from this node, including when the operator chose a custom username. useNodeKeyUsername only selects the username."
1092
+ );
1093
+ }
949
1094
  if (username && !FORUM_USERNAME_RE.test(username)) {
950
1095
  throw new Error(
951
- "Ask the operator for a forum username of 2\u201316 letters, numbers, periods, underscores, or hyphens. If they want the node-key name, call again with useNodeKeyUsername true and nodeKey set."
1096
+ "Ask the operator for a forum username of 2\u201316 letters, numbers, periods, underscores, or hyphens. If they want the node-key name, call again with useNodeKeyUsername true and the same nodeKey."
952
1097
  );
953
1098
  }
954
- if (!username && !(args.useNodeKeyUsername && nodeKey)) {
1099
+ if (!username && !args.useNodeKeyUsername) {
955
1100
  throw new Error(
956
- "Ask the operator for a custom forum username (2\u201316 letters, numbers, . _ -). If they want the default, call again with useNodeKeyUsername true and nodeKey set. The username will be the first 16 characters of the node key."
1101
+ "Ask the operator for a custom forum username (2\u201316 letters, numbers, . _ -). If they decline, call again with useNodeKeyUsername true and the same nodeKey. The username will be the first 16 characters of the node key. Always pass nodeKey."
957
1102
  );
958
1103
  }
959
1104
  }
@@ -1104,7 +1249,7 @@ function typeLabel(type) {
1104
1249
  const n = Number(type);
1105
1250
  return Number.isFinite(n) && exports.PROPOSAL_TYPE_LABELS[n] ? exports.PROPOSAL_TYPE_LABELS[n] : str(type, "Unknown");
1106
1251
  }
1107
- function explainProposalRecord(raw) {
1252
+ function explainProposalRecord(raw, committeeAddresses) {
1108
1253
  const row = asRecord(raw);
1109
1254
  if (!row) throw new Error("explain_proposal: empty proposal");
1110
1255
  const onchainId = str(row.onchainId ?? row.onchain_id ?? row.proposalId);
@@ -1136,7 +1281,7 @@ function explainProposalRecord(raw) {
1136
1281
  risks.push("Empty description with on-chain actions.");
1137
1282
  }
1138
1283
  const proposer = str(row.proposer);
1139
- const committeeProposer = isContinuumDaoCommitteeProposer(proposer);
1284
+ const committeeProposer = addressInCommitteeList(proposer, committeeAddresses ?? []);
1140
1285
  const lines = [];
1141
1286
  lines.push(`#${row.id ?? "\u2014"} ${str(row.title, "Untitled")} (${t}, ${configuration === "delta" ? "Delta" : "Bravo"}).`);
1142
1287
  if (committeeProposer) {
@@ -1199,9 +1344,10 @@ async function withForumSection(out, forumUrl) {
1199
1344
  }
1200
1345
  }
1201
1346
  async function continuumDaoExplainProposal(args) {
1347
+ const committeeAddresses = await fetchContinuumDaoCommitteeAddresses();
1202
1348
  if (args.id != null && String(args.id).trim() !== "") {
1203
1349
  const { proposal } = await continuumDaoFetchProposal({ id: args.id });
1204
- return withForumSection(explainProposalRecord(proposal), args.forumUrl);
1350
+ return withForumSection(explainProposalRecord(proposal, committeeAddresses), args.forumUrl);
1205
1351
  }
1206
1352
  const want = (args.onchainId ?? "").trim();
1207
1353
  if (!want) throw new Error("explain_proposal: pass id or onchainId");
@@ -1215,14 +1361,14 @@ async function continuumDaoExplainProposal(args) {
1215
1361
  const id = asRecord(hit)?.id;
1216
1362
  if (id != null) {
1217
1363
  const { proposal } = await continuumDaoFetchProposal({ id: Number(id) });
1218
- return withForumSection(explainProposalRecord(proposal), args.forumUrl);
1364
+ return withForumSection(explainProposalRecord(proposal, committeeAddresses), args.forumUrl);
1219
1365
  }
1220
- return withForumSection(explainProposalRecord(hit), args.forumUrl);
1366
+ return withForumSection(explainProposalRecord(hit, committeeAddresses), args.forumUrl);
1221
1367
  }
1222
1368
  exports.PROPOSAL_TYPE_LABELS = void 0; var APPROVE_RE, DENY_SIG_RE, LINEA_HOME_CHAIN_IDS;
1223
1369
  var init_explainProposal = __esm({
1224
1370
  "src/protocols/evm/continuum-dao/explainProposal.ts"() {
1225
- init_constants();
1371
+ init_committeeList();
1226
1372
  init_forum();
1227
1373
  init_governance();
1228
1374
  exports.PROPOSAL_TYPE_LABELS = ["Admin", "Constitution", "Decision", "Election", "Treasury"];
@@ -1568,7 +1714,7 @@ function summarizeNote(args) {
1568
1714
  return parts.join(" ");
1569
1715
  }
1570
1716
  function votingPowerShortfallBody(args) {
1571
- const committee = isContinuumDaoCommitteeProposer(args.account) ? " This is a ContinuumDAO Committee address \u2014 Committee is not exempt from proposalThreshold()." : "";
1717
+ const committee = addressInCommitteeList(args.account, args.committeeAddresses ?? []) ? " This is a ContinuumDAO Committee address \u2014 Committee is not exempt from proposalThreshold()." : "";
1572
1718
  return `${args.account} has veCTM voting power ${args.votes}, below live proposalThreshold() ${args.threshold}. On-chain rule: max(1000e18 ve power, 1% of total voting power). Delegation applies at this address (fetch_delegates).` + committee;
1573
1719
  }
1574
1720
  function votingPowerWarning(args) {
@@ -1699,7 +1845,13 @@ async function continuumDaoSimulateProposal(args) {
1699
1845
  }
1700
1846
  const executeOk = source !== "foundry_required" && batchResults.every((b) => b.ok);
1701
1847
  const ok = canPropose && proposeOk && executeOk;
1702
- const warning = votingPowerWarning({ account, votes: power.votes, threshold: power.threshold });
1848
+ const committeeAddresses = await fetchContinuumDaoCommitteeAddresses();
1849
+ const warning = votingPowerWarning({
1850
+ account,
1851
+ votes: power.votes,
1852
+ threshold: power.threshold,
1853
+ committeeAddresses
1854
+ });
1703
1855
  const foundry = buildFoundryProposalSimulatePlan({
1704
1856
  chainId,
1705
1857
  governor: gov,
@@ -1715,6 +1867,7 @@ async function continuumDaoSimulateProposal(args) {
1715
1867
  votes: power.votes,
1716
1868
  threshold: power.threshold,
1717
1869
  canPropose,
1870
+ committeeAddresses,
1718
1871
  ...warning ? { warning } : {},
1719
1872
  propose: proposeOk ? { ok: true } : { ok: false, error: proposeError },
1720
1873
  execute: { ok: executeOk, source, batches: batchResults },
@@ -1724,7 +1877,7 @@ async function continuumDaoSimulateProposal(args) {
1724
1877
  }
1725
1878
  var init_simulateProposal = __esm({
1726
1879
  "src/protocols/evm/continuum-dao/simulateProposal.ts"() {
1727
- init_constants();
1880
+ init_committeeList();
1728
1881
  init_explainProposal();
1729
1882
  init_foundryProposalScript();
1730
1883
  init_governance();
@@ -1922,6 +2075,56 @@ async function finalizeGov(args, to, data, fallbackGas, evmType, extra, purposeS
1922
2075
  buildBatchMeta: ({ gasLimit }) => meta2(evmType, args.chainId, to, extra, gasLimit)
1923
2076
  });
1924
2077
  }
2078
+ async function assertProposalTypeMatchesForum(forumKey, type, forumUrl) {
2079
+ const thread = await continuumDaoForumFetchThread({ url: forumKey, index: 0, forumUrl });
2080
+ const section = String(thread?.section || "").trim().toLowerCase();
2081
+ const expected = FORUM_SECTION_TO_PROPOSAL_TYPE[section];
2082
+ if (expected == null) {
2083
+ throw new Error(
2084
+ `Forum thread is not in a Governance proposal section (section: ${section || "unknown"}).`
2085
+ );
2086
+ }
2087
+ if (expected !== type) {
2088
+ throw new Error(`Proposal type ${type} does not match forum section ${section} (expected type ${expected}).`);
2089
+ }
2090
+ }
2091
+ async function buildProposeCatalog(args) {
2092
+ assertProposalCatalogConstants();
2093
+ if (!args.description && args.description !== "") {
2094
+ throw new Error("description is required to register the proposal catalog.");
2095
+ }
2096
+ if (!Number.isInteger(args.type) || args.type < 0 || args.type > 4) {
2097
+ throw new Error("type must be 0\u20134 (Admin, Constitution, Decision, Election, Treasury).");
2098
+ }
2099
+ await assertProposalTypeMatchesForum(args.forumKey, args.type, args.forumUrl);
2100
+ const hashed = await continuumDaoHashProposal({
2101
+ chainId: args.chainId,
2102
+ rpcUrl: args.rpcUrl,
2103
+ governor: args.governor,
2104
+ targets: args.targets,
2105
+ values: args.values,
2106
+ calldatas: args.calldatas,
2107
+ description: args.descriptionHashInput
2108
+ });
2109
+ const payload = proposalCatalogDocument({
2110
+ onchainId: hashed.proposalId,
2111
+ title: args.title.trim(),
2112
+ description: args.description,
2113
+ proposer: args.proposer,
2114
+ forumKey: args.forumKey,
2115
+ type: args.type,
2116
+ configuration: args.configuration,
2117
+ pendingOnChain: true,
2118
+ ...args.configuration === 1 ? {
2119
+ nWinners: args.nWinners,
2120
+ options: args.catalogOptions ?? (args.options || []).map((option) => ({
2121
+ label: option.label,
2122
+ actions: stampLineaCatalogActions(option.actions)
2123
+ }))
2124
+ } : { actions: args.catalogActions ?? stampLineaCatalogActions(args.actions) }
2125
+ });
2126
+ return { payload, canonical: proposalCatalogCanonical(payload) };
2127
+ }
1925
2128
  async function requireProposalThreshold(args) {
1926
2129
  const power = await continuumDaoFetchVotingPower({
1927
2130
  chainId: args.chainId,
@@ -1931,11 +2134,13 @@ async function requireProposalThreshold(args) {
1931
2134
  });
1932
2135
  if (BigInt(power.votes) < BigInt(power.threshold)) {
1933
2136
  const { votingPowerRefuse: votingPowerRefuse2 } = await Promise.resolve().then(() => (init_simulateProposal(), simulateProposal_exports));
2137
+ const committeeAddresses = await fetchContinuumDaoCommitteeAddresses();
1934
2138
  throw new Error(
1935
2139
  votingPowerRefuse2({
1936
2140
  account: args.executorAddress,
1937
2141
  votes: power.votes,
1938
- threshold: power.threshold
2142
+ threshold: power.threshold,
2143
+ committeeAddresses
1939
2144
  })
1940
2145
  );
1941
2146
  }
@@ -1978,7 +2183,25 @@ async function buildEvmMultisignBodyContinuumDaoProposeBravo(args) {
1978
2183
  },
1979
2184
  "continuum-dao propose bravo"
1980
2185
  );
1981
- return { ...built, proposalArgs };
2186
+ const proposalCatalog = await buildProposeCatalog({
2187
+ configuration: 0,
2188
+ title: args.title,
2189
+ description: args.description ?? "",
2190
+ type: Number(args.type),
2191
+ forumKey,
2192
+ forumUrl: args.forumUrl,
2193
+ proposer: args.executorAddress,
2194
+ chainId: args.chainId,
2195
+ rpcUrl: args.rpcUrl,
2196
+ governor: gov,
2197
+ targets: proposalArgs.targets,
2198
+ values: proposalArgs.values,
2199
+ calldatas: proposalArgs.calldatas,
2200
+ descriptionHashInput: proposalArgs.description,
2201
+ actions: args.actions,
2202
+ catalogActions: args.catalogActions
2203
+ });
2204
+ return { ...built, proposalArgs, proposalCatalog };
1982
2205
  }
1983
2206
  async function buildEvmMultisignBodyContinuumDaoProposeDelta(args) {
1984
2207
  const forumKey = assertContinuumDaoForumTopicKey(args.forumKey, args.forumUrl);
@@ -2019,7 +2242,26 @@ async function buildEvmMultisignBodyContinuumDaoProposeDelta(args) {
2019
2242
  },
2020
2243
  "continuum-dao propose delta"
2021
2244
  );
2022
- return { ...built, proposalArgs };
2245
+ const proposalCatalog = await buildProposeCatalog({
2246
+ configuration: 1,
2247
+ title: args.title,
2248
+ description: args.description ?? "",
2249
+ type: Number(args.type),
2250
+ forumKey,
2251
+ forumUrl: args.forumUrl,
2252
+ proposer: args.executorAddress,
2253
+ chainId: args.chainId,
2254
+ rpcUrl: args.rpcUrl,
2255
+ governor: gov,
2256
+ targets: proposalArgs.targets,
2257
+ values: proposalArgs.values,
2258
+ calldatas: proposalArgs.calldatas,
2259
+ descriptionHashInput: proposalArgs.description,
2260
+ options: args.options,
2261
+ catalogOptions: args.catalogOptions,
2262
+ nWinners: Number(args.nWinners)
2263
+ });
2264
+ return { ...built, proposalArgs, proposalCatalog };
2023
2265
  }
2024
2266
  async function requireVoteEligible(args) {
2025
2267
  const st = await continuumDaoFetchProposalState({
@@ -2321,7 +2563,7 @@ function bucketGovernorState(state) {
2321
2563
  function asRecord2(value) {
2322
2564
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
2323
2565
  }
2324
- function parseBackendProposal(raw) {
2566
+ function parseBackendProposal(raw, committeeAddresses) {
2325
2567
  const row = asRecord2(raw);
2326
2568
  if (!row) return null;
2327
2569
  const onchainId = String(row.onchainId ?? row.onchain_id ?? row.proposalId ?? "").trim();
@@ -2338,7 +2580,7 @@ function parseBackendProposal(raw) {
2338
2580
  configuration: typeof row.configuration === "number" ? row.configuration : void 0,
2339
2581
  governorAddress: isConfiguredAddress(governorRaw) ? viem.getAddress(governorRaw) : void 0,
2340
2582
  proposer,
2341
- committeeProposer: proposer ? isContinuumDaoCommitteeProposer(proposer) : void 0
2583
+ committeeProposer: proposer ? addressInCommitteeList(proposer, committeeAddresses ?? []) : void 0
2342
2584
  };
2343
2585
  }
2344
2586
  function isLegacyContinuumDaoGovernor(addr2) {
@@ -2372,7 +2614,8 @@ async function continuumDaoFetchLiveProposals(args) {
2372
2614
  const completedLimit = Math.min(Math.max(Number(args.completedLimit) || 8, 0), 20);
2373
2615
  const listed = await continuumDaoFetchProposals();
2374
2616
  const rawList = Array.isArray(listed.proposals) ? listed.proposals : [];
2375
- const parsed = rawList.map(parseBackendProposal).filter((p) => p != null);
2617
+ const committeeAddresses = await fetchContinuumDaoCommitteeAddresses();
2618
+ const parsed = rawList.map((row) => parseBackendProposal(row, committeeAddresses)).filter((p) => p != null);
2376
2619
  const ordered = [...parsed].sort((a, b) => (a.id ?? 0) - (b.id ?? 0));
2377
2620
  const latest = ordered.length > limit ? ordered.slice(ordered.length - limit) : ordered;
2378
2621
  const chainId = args.chainId != null && String(args.chainId).trim() !== "" ? Number(args.chainId) : NaN;
@@ -2449,13 +2692,15 @@ async function continuumDaoRegisterProposal(payload) {
2449
2692
  if (!res.ok) throw new Error(`proposals/create: ${res.status} ${await res.text()}`);
2450
2693
  return { ok: true, result: await res.json() };
2451
2694
  }
2452
- exports.CONTINUUM_DAO_PROPOSE_FALLBACK = void 0; exports.CONTINUUM_DAO_VOTE_FALLBACK = void 0; exports.CONTINUUM_DAO_EXECUTE_FALLBACK = void 0; exports.CONTINUUM_DAO_CANCEL_FALLBACK = void 0; exports.CONTINUUM_DAO_GOV_EVM_TYPES = void 0; exports.governorWriteAbi = void 0; var governorReadAbi; exports.GOVERNOR_STATE = void 0; exports.GOVERNOR_STATE_LABELS = void 0;
2695
+ exports.CONTINUUM_DAO_PROPOSE_FALLBACK = void 0; exports.CONTINUUM_DAO_VOTE_FALLBACK = void 0; exports.CONTINUUM_DAO_EXECUTE_FALLBACK = void 0; exports.CONTINUUM_DAO_CANCEL_FALLBACK = void 0; exports.CONTINUUM_DAO_GOV_EVM_TYPES = void 0; exports.governorWriteAbi = void 0; var governorReadAbi, FORUM_SECTION_TO_PROPOSAL_TYPE; exports.GOVERNOR_STATE = void 0; exports.GOVERNOR_STATE_LABELS = void 0;
2453
2696
  var init_governance = __esm({
2454
2697
  "src/protocols/evm/continuum-dao/governance.ts"() {
2455
2698
  init_defiEvmClient();
2456
2699
  init_buildBatch();
2457
2700
  init_constants();
2701
+ init_committeeList();
2458
2702
  init_forum();
2703
+ init_proposalCatalog();
2459
2704
  exports.CONTINUUM_DAO_PROPOSE_FALLBACK = 550000n;
2460
2705
  exports.CONTINUUM_DAO_VOTE_FALLBACK = 220000n;
2461
2706
  exports.CONTINUUM_DAO_EXECUTE_FALLBACK = 800000n;
@@ -2484,6 +2729,13 @@ var init_governance = __esm({
2484
2729
  "function hasVoted(uint256 proposalId, address account) view returns (bool)",
2485
2730
  "function proposalSnapshot(uint256 proposalId) view returns (uint256)"
2486
2731
  ]);
2732
+ FORUM_SECTION_TO_PROPOSAL_TYPE = {
2733
+ admin: 0,
2734
+ constitution: 1,
2735
+ decision: 2,
2736
+ election: 3,
2737
+ treasury: 4
2738
+ };
2487
2739
  exports.GOVERNOR_STATE = {
2488
2740
  Pending: 0,
2489
2741
  Active: 1,
@@ -2560,6 +2812,8 @@ var continuumDaoMarketplaceProtocolModule = {
2560
2812
 
2561
2813
  // src/protocols/evm/continuum-dao/index.ts
2562
2814
  init_constants();
2815
+ init_committeeList();
2816
+ init_proposalCatalog();
2563
2817
 
2564
2818
  // src/protocols/evm/continuum-dao/escrowRules.ts
2565
2819
  init_constants();
@@ -5790,8 +6044,8 @@ function emptyMarketplaceIndexCache() {
5790
6044
  function getMarketplaceIndexMemoryCache(chainId) {
5791
6045
  return memoryCache.get(chainId) ?? null;
5792
6046
  }
5793
- function setMarketplaceIndexMemoryCache(chainId, cache) {
5794
- memoryCache.set(chainId, cache);
6047
+ function setMarketplaceIndexMemoryCache(chainId, cache2) {
6048
+ memoryCache.set(chainId, cache2);
5795
6049
  }
5796
6050
  function arg(args, key, index) {
5797
6051
  const value = args[key] ?? args[index];
@@ -5941,9 +6195,9 @@ async function scanMarketplaceLogs(args) {
5941
6195
  { listings: prior.listings, offerings: prior.offerings, auctions: prior.auctions },
5942
6196
  now2
5943
6197
  );
5944
- const cache2 = { lastScannedBlock: head.toString(), ...derived2 };
5945
- setMarketplaceIndexMemoryCache(args.chainId, cache2);
5946
- return cache2;
6198
+ const cache3 = { lastScannedBlock: head.toString(), ...derived2 };
6199
+ setMarketplaceIndexMemoryCache(args.chainId, cache3);
6200
+ return cache3;
5947
6201
  }
5948
6202
  const logs = await getLogsChunked({
5949
6203
  client,
@@ -5960,9 +6214,9 @@ async function scanMarketplaceLogs(args) {
5960
6214
  });
5961
6215
  const now = Number((await client.getBlock({ blockTag: "latest" })).timestamp);
5962
6216
  const derived = applyDerivedStatuses(folded, now);
5963
- const cache = { lastScannedBlock: head.toString(), ...derived };
5964
- setMarketplaceIndexMemoryCache(args.chainId, cache);
5965
- return cache;
6217
+ const cache2 = { lastScannedBlock: head.toString(), ...derived };
6218
+ setMarketplaceIndexMemoryCache(args.chainId, cache2);
6219
+ return cache2;
5966
6220
  }
5967
6221
 
5968
6222
  // src/protocols/evm/continuum-dao/marketplaceCatalog.ts
@@ -6984,6 +7238,7 @@ exports.MARKET_ORDER_STATUS = MARKET_ORDER_STATUS;
6984
7238
  exports.VECTM_NODE_INFO_TUPLE = VECTM_NODE_INFO_TUPLE;
6985
7239
  exports.VOTE_CAST_EVENT = VOTE_CAST_EVENT;
6986
7240
  exports.VOTE_CAST_WITH_PARAMS_EVENT = VOTE_CAST_WITH_PARAMS_EVENT;
7241
+ exports.addressInCommitteeList = addressInCommitteeList;
6987
7242
  exports.applyDerivedStatuses = applyDerivedStatuses;
6988
7243
  exports.applyForumSectionCheck = applyForumSectionCheck;
6989
7244
  exports.applyMarketplaceEvent = applyMarketplaceEvent;
@@ -7003,6 +7258,7 @@ exports.assertIncreaseUnlockTime = assertIncreaseUnlockTime;
7003
7258
  exports.assertLiquidate = assertLiquidate;
7004
7259
  exports.assertLockDurationSeconds = assertLockDurationSeconds;
7005
7260
  exports.assertMerge = assertMerge;
7261
+ exports.assertProposalCatalogConstants = assertProposalCatalogConstants;
7006
7262
  exports.assertSplitExtracted = assertSplitExtracted;
7007
7263
  exports.assertTransfer = assertTransfer;
7008
7264
  exports.assertUndelegateNotAlreadySelf = assertUndelegateNotAlreadySelf;
@@ -7110,6 +7366,7 @@ exports.expectedForumSectionForProposalType = expectedForumSectionForProposalTyp
7110
7366
  exports.explainGovAction = explainGovAction;
7111
7367
  exports.explainProposalRecord = explainProposalRecord;
7112
7368
  exports.explorerBase = explorerBase;
7369
+ exports.fetchContinuumDaoCommitteeAddresses = fetchContinuumDaoCommitteeAddresses;
7113
7370
  exports.fetchContinuumDaoMarketplaceActivity = fetchContinuumDaoMarketplaceActivity;
7114
7371
  exports.fetchContinuumDaoMarketplaceAuctions = fetchContinuumDaoMarketplaceAuctions;
7115
7372
  exports.fetchContinuumDaoMarketplaceConfig = fetchContinuumDaoMarketplaceConfig;
@@ -7126,7 +7383,6 @@ exports.getMarketplaceIndexMemoryCache = getMarketplaceIndexMemoryCache;
7126
7383
  exports.governorAddressOnEvmChain = governorAddressOnEvmChain;
7127
7384
  exports.howVoted = howVoted;
7128
7385
  exports.isConfiguredAddress = isConfiguredAddress;
7129
- exports.isContinuumDaoCommitteeProposer = isContinuumDaoCommitteeProposer;
7130
7386
  exports.isContinuumDaoCtmOnAssetsChain = isContinuumDaoCtmOnAssetsChain;
7131
7387
  exports.isContinuumDaoLockChain = isContinuumDaoLockChain;
7132
7388
  exports.isContinuumDaoSupportedChainId = isContinuumDaoSupportedChainId;
@@ -7153,6 +7409,7 @@ exports.monthsOfFees = monthsOfFees;
7153
7409
  exports.normalizeGovConfiguration = normalizeGovConfiguration;
7154
7410
  exports.normalizeNodeInfo = normalizeNodeInfo;
7155
7411
  exports.orderStatusName = orderStatusName;
7412
+ exports.parseCommitteeAddressesFromConstitution = parseCommitteeAddressesFromConstitution;
7156
7413
  exports.pickFeeAlternativeExample = pickFeeAlternativeExample;
7157
7414
  exports.planMarketplaceSteps = planMarketplaceSteps;
7158
7415
  exports.preflightAttachVeCtm = preflightAttachVeCtm;
@@ -7167,6 +7424,8 @@ exports.preflightSplit = preflightSplit;
7167
7424
  exports.preflightTransfer = preflightTransfer;
7168
7425
  exports.preflightUndelegate = preflightUndelegate;
7169
7426
  exports.preflightWithdraw = preflightWithdraw;
7427
+ exports.proposalCatalogCanonical = proposalCatalogCanonical;
7428
+ exports.proposalCatalogDocument = proposalCatalogDocument;
7170
7429
  exports.proposalDescriptionHash = proposalDescriptionHash;
7171
7430
  exports.publicClient = publicClient2;
7172
7431
  exports.quoteContinuumDaoMarketplaceFeeAlternative = quoteContinuumDaoMarketplaceFeeAlternative;
@@ -7177,12 +7436,14 @@ exports.readMarketplaceFeePreviewFromChain = readMarketplaceFeePreviewFromChain;
7177
7436
  exports.readMinimumLockWei = readMinimumLockWei;
7178
7437
  exports.readVeCtmLockState = readVeCtmLockState;
7179
7438
  exports.requireGovernor = requireGovernor;
7439
+ exports.resetContinuumDaoCommitteeCache = resetContinuumDaoCommitteeCache;
7180
7440
  exports.resolveAttachGroupId = resolveAttachGroupId;
7181
7441
  exports.resolveGovernorProposalRef = resolveGovernorProposalRef;
7182
7442
  exports.resolveProposalCatalogRange = resolveProposalCatalogRange;
7183
7443
  exports.scanMarketplaceLogs = scanMarketplaceLogs;
7184
7444
  exports.searchContinuumDaoMarketplace = searchContinuumDaoMarketplace;
7185
7445
  exports.setMarketplaceIndexMemoryCache = setMarketplaceIndexMemoryCache;
7446
+ exports.stampLineaCatalogActions = stampLineaCatalogActions;
7186
7447
  exports.summarizeLiveProposals = summarizeLiveProposals;
7187
7448
  exports.summarizeProposalVotes = summarizeProposalVotes;
7188
7449
  exports.throwIfProposalSimulationFailed = throwIfProposalSimulationFailed;