@continuumdao/ctm-mpc-defi 0.2.54 → 0.2.55

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
- `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.
30
+ `build_propose_bravo_multisign` and `build_propose_delta_multisign` POST `/proposals/create` (Ed25519, `pendingOnChain`) **before** the multi-sign request is submitted. Pass `description`, `type` (0–4), and a `name` on every action input so the catalog matches the forum section. If that POST fails, or the created id cannot be read back, the sign request is not created. `ctm_continuum_dao_register_proposal` retries the same POST and, when the onchainId already exists, updates that row instead of creating a second proposal. 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
 
@@ -69,7 +69,7 @@ When a proposal has a `forumKey`, fetch that thread (`ctm_continuum_dao_forum_re
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
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.
72
+ 6. If the catalog POST failed, retry with `register_proposal` and the same `forumKey`, `description`, `type`, input names, and `onchainId`. A 409 updates the existing row. 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
 
@@ -260,9 +260,10 @@ function checksumOrEmpty(value) {
260
260
  if (!raw) return "";
261
261
  return viem.getAddress(raw);
262
262
  }
263
- function normalizeInput(inp) {
263
+ function normalizeInput(inp, index) {
264
+ const explicit = String(inp?.name || "").trim();
264
265
  return {
265
- name: String(inp?.name || ""),
266
+ name: explicit || `arg${index}`,
266
267
  type: String(inp?.type || ""),
267
268
  value: String(inp?.value ?? "")
268
269
  };
@@ -279,7 +280,7 @@ function normalizeAction(action) {
279
280
  target: checksumOrEmpty(action.target),
280
281
  value: String(action.value || "0"),
281
282
  signature: String(action.signature || ""),
282
- inputs: (action.inputs || []).map(normalizeInput)
283
+ inputs: (action.inputs || []).map((inp, index) => normalizeInput(inp, index))
283
284
  };
284
285
  }
285
286
  function assertProposalCatalogConstants() {
@@ -2684,13 +2685,25 @@ async function buildEvmMultisignBodyContinuumDaoCastVoteBravoFromMcp(args) {
2684
2685
  }
2685
2686
  async function continuumDaoRegisterProposal(payload) {
2686
2687
  assertContinuumDaoForumTopicKey(payload.forumKey);
2688
+ const body = JSON.stringify(payload);
2687
2689
  const res = await fetch(`${exports.CONTINUUM_DAO_GOVERNANCE_API}/proposals/create`, {
2688
2690
  method: "POST",
2689
2691
  headers: { "Content-Type": "application/json" },
2690
- body: JSON.stringify(payload)
2692
+ body
2691
2693
  });
2692
- if (!res.ok) throw new Error(`proposals/create: ${res.status} ${await res.text()}`);
2693
- return { ok: true, result: await res.json() };
2694
+ const text = await res.text();
2695
+ if (res.status === 409) {
2696
+ const repair = await fetch(`${exports.CONTINUUM_DAO_GOVERNANCE_API}/proposals/repair`, {
2697
+ method: "POST",
2698
+ headers: { "Content-Type": "application/json" },
2699
+ body
2700
+ });
2701
+ const repairText = await repair.text();
2702
+ if (!repair.ok) throw new Error(`proposals/repair: ${repair.status} ${repairText}`);
2703
+ return { ok: true, result: JSON.parse(repairText) };
2704
+ }
2705
+ if (!res.ok) throw new Error(`proposals/create: ${res.status} ${text}`);
2706
+ return { ok: true, result: JSON.parse(text) };
2694
2707
  }
2695
2708
  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;
2696
2709
  var init_governance = __esm({