@continuumdao/ctm-mpc-defi 0.2.38 → 0.2.39

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.
@@ -151,7 +151,7 @@ Builders refuse requests that the dialog would disable or that VotingEscrow / Mu
151
151
  - **Transfer:** unattached; recipient not zero or self.
152
152
  - **Vote:** proposal must be Active; KeyGen snapshot votes > 0; `hasVoted` false. Delta weights include NOTA.
153
153
 
154
- Attach requires the claimed `nodeWithdrawAuthority` KeyGen that owns the NFT. `groupId` is implicit from that KeyGen (passed on-chain as the last `attachVeCtm` argument) and immediately binds the fee waiver — do not pick a different group. That KeyGen cannot attach a second NFT. A second group on the same node attaches after rotating `nodeWithdrawAuthority` to that group's secp256k1 KeyGen (anti-spoof: register/attach still require authority). Only governance detaches after `request detach`. Locked CTM must meet `veCtmThresholdPower` at attach. The monthly fee waiver and VPN then compare that NFT's `balanceOfNFTAt` at UTC month start to `veCtmThresholdPower` — do **not** tell the user to delegate votes to the KeyGen to meet that bar. Request detach refuses if not attached or already requested.
154
+ Attach and `increase_unlock_time` are unpaid (no month activation, no `globalNonce` bump). Do not wrap them with `syncBilling` / deposit. If current voting power is below `veCtmThresholdPower`, extend unlock first, then attach (same batch is fine). Attach requires the claimed `nodeWithdrawAuthority` KeyGen that owns the NFT. `groupId` is implicit from that KeyGen (passed on-chain as the last `attachVeCtm` argument) and immediately binds the fee waiver — do not pick a different group. That KeyGen cannot attach a second NFT. A second group on the same node attaches after rotating `nodeWithdrawAuthority` to that group's secp256k1 KeyGen (anti-spoof: register/attach still require authority). Only governance detaches after `request detach`. Locked CTM must meet `veCtmThresholdPower` at attach. The monthly fee waiver and VPN then compare that NFT's `balanceOfNFTAt` at UTC month start to `veCtmThresholdPower` — do **not** tell the user to delegate votes to the KeyGen to meet that bar. Request detach refuses if not attached or already requested.
155
155
 
156
156
  Attached locks block transfer / merge / split / withdraw / liquidate on-chain (`checkNotAttached`).
157
157
 
@@ -950,6 +950,7 @@ var CONTINUUM_DAO_DELEGATE_FALLBACK = 160000n;
950
950
  var CONTINUUM_DAO_TRANSFER_FALLBACK = 160000n;
951
951
  var CONTINUUM_DAO_ATTACH_FALLBACK = 450000n;
952
952
  var CONTINUUM_DAO_DETACH_FALLBACK = 220000n;
953
+ var INCREASE_UNLOCK_TIME_SIGNATURE = "increase_unlock_time(uint256,uint256)";
953
954
  var erc20Abi2 = viem.parseAbi([
954
955
  "function allowance(address owner, address spender) view returns (uint256)",
955
956
  "function approve(address spender, uint256 amount) returns (bool)"
@@ -1005,14 +1006,17 @@ function parseTokenId(raw) {
1005
1006
  if (id <= 0n) throw new Error("veCTM token id must be greater than zero.");
1006
1007
  return id;
1007
1008
  }
1009
+ function continuumDaoSignatureText(extra, chainId) {
1010
+ return JSON.stringify({
1011
+ kind: "ContinuumDAO",
1012
+ ...extra,
1013
+ chainId
1014
+ });
1015
+ }
1008
1016
  function meta(evmType, chainId, to, extra, gasLimit) {
1009
1017
  return {
1010
1018
  destinationAddress: to,
1011
- signatureText: JSON.stringify({
1012
- kind: "ContinuumDAO",
1013
- ...extra,
1014
- chainId
1015
- }),
1019
+ signatureText: continuumDaoSignatureText(extra, chainId),
1016
1020
  evm: { type: evmType, version: 1, chainId: String(chainId), protocolId: CONTINUUM_DAO_PROTOCOL_ID },
1017
1021
  continuumDao: { ...extra, gas: { baseGasUnits: gasLimit.toString() } }
1018
1022
  };
@@ -1191,6 +1195,7 @@ async function buildEvmMultisignBodyContinuumDaoIncreaseUnlockTime(args) {
1191
1195
  fallbackGas: CONTINUUM_DAO_INCREASE_UNLOCK_FALLBACK,
1192
1196
  buildBatchMeta: ({ gasLimit }) => meta("continuum_dao_increase_unlock_time", args.chainId, ve, {
1193
1197
  name: "VotingEscrow.increase_unlock_time",
1198
+ signature: INCREASE_UNLOCK_TIME_SIGNATURE,
1194
1199
  tokenId: tokenId.toString(),
1195
1200
  lockDurationSeconds: duration.toString()
1196
1201
  }, gasLimit)
@@ -1461,6 +1466,7 @@ async function buildEvmMultisignBodyContinuumDaoAttachVeCtm(args) {
1461
1466
  fallbackGas: CONTINUUM_DAO_ATTACH_FALLBACK,
1462
1467
  buildBatchMeta: ({ gasLimit }) => meta("continuum_dao_attach", args.chainId, wallet, {
1463
1468
  name: "MultiSignAgentWallet.attachVeCtm",
1469
+ signature: ATTACH_VECTM_SIGNATURE,
1464
1470
  nodeKey,
1465
1471
  tokenId: tokenId.toString(),
1466
1472
  groupId
@@ -2937,6 +2943,7 @@ exports.FORUM_IDEA_SECTION = FORUM_IDEA_SECTION;
2937
2943
  exports.FORUM_LOGIN_DELIVERY_KIND = FORUM_LOGIN_DELIVERY_KIND;
2938
2944
  exports.GOVERNOR_STATE = GOVERNOR_STATE;
2939
2945
  exports.GOVERNOR_STATE_LABELS = GOVERNOR_STATE_LABELS;
2946
+ exports.INCREASE_UNLOCK_TIME_SIGNATURE = INCREASE_UNLOCK_TIME_SIGNATURE;
2940
2947
  exports.MAXTIME_SECONDS = MAXTIME_SECONDS;
2941
2948
  exports.PROPOSAL_TYPE_LABELS = PROPOSAL_TYPE_LABELS;
2942
2949
  exports.PROPOSAL_TYPE_TO_FORUM_SECTION = PROPOSAL_TYPE_TO_FORUM_SECTION;
@@ -3035,6 +3042,7 @@ exports.continuumDaoMpaMailboxSend = continuumDaoMpaMailboxSend;
3035
3042
  exports.continuumDaoMpaRetract = continuumDaoMpaRetract;
3036
3043
  exports.continuumDaoProtocolModule = continuumDaoProtocolModule;
3037
3044
  exports.continuumDaoRegisterProposal = continuumDaoRegisterProposal;
3045
+ exports.continuumDaoSignatureText = continuumDaoSignatureText;
3038
3046
  exports.continuumDaoTechnocoreBind = continuumDaoTechnocoreBind;
3039
3047
  exports.ctmTokenAddressOnEvmChain = ctmTokenAddressOnEvmChain;
3040
3048
  exports.encodeContinuumDaoNodeInfo = encodeContinuumDaoNodeInfo;