From 1105c6a662bc4c6f24ae87d3e3f9b8d3969a40c7 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Mon, 4 May 2026 16:47:55 +0400 Subject: [PATCH] docs: fix two stale cursor uses in NatSpec (#128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ICorporateActionsV1.getActionParameters: NatSpec described the input as "a cursor returned from one of the traversal getters" — but the return crosses the API boundary as data, so it's an actionId per the rename convention. Updated to actionId; same fix on the "mask the cursor's actionType" line below. - LibCorporateActionReceipt.accountIdCursor: comment claimed "1-based index" with "0 = never migrated". Stale post-PR-124: indexing is 0-based and `cursor == 0` is the bootstrap node (identity for splits), semantically "no real migration applied yet". Comment now matches. Doc-only — no code changes, no bytecode impact. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/interface/ICorporateActionsV1.sol | 6 +++--- src/lib/LibCorporateActionReceipt.sol | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/interface/ICorporateActionsV1.sol b/src/interface/ICorporateActionsV1.sol index 976b8d1..256455f 100644 --- a/src/interface/ICorporateActionsV1.sol +++ b/src/interface/ICorporateActionsV1.sol @@ -419,14 +419,14 @@ interface ICorporateActionsV1 { returns (uint256 prevActionId, uint256 actionType, uint64 effectiveTime); /// @notice Read the ABI-encoded parameters blob for a scheduled or - /// completed corporate action, given a cursor returned from one of the - /// traversal getters. + /// completed corporate action, given an `actionId` returned from one + /// of the traversal getters. /// /// @dev Intended for cross-contract consumers that need to apply the /// action (e.g. the receipt contract reading a stock split multiplier /// during its own rebase walk). For stock splits, the returned bytes /// decode to a single `Float` via `LibStockSplit.decodeParametersV1`. - /// Consumers should mask the cursor's `actionType` (via `nextOfType` / + /// Consumers should mask the action's `actionType` (via `nextOfType` / /// `prevOfType`) before calling this to ensure they know which decoder /// to apply. /// diff --git a/src/lib/LibCorporateActionReceipt.sol b/src/lib/LibCorporateActionReceipt.sol index e9ddf07..a4196f6 100644 --- a/src/lib/LibCorporateActionReceipt.sol +++ b/src/lib/LibCorporateActionReceipt.sol @@ -52,10 +52,13 @@ library LibCorporateActionReceipt { /// (`testReceiptStorageLayoutPin`) must be extended in every later PR /// that appends a new field. struct CorporateActionReceiptStorage { - /// Per-(holder, id) migration cursor — the 1-based index of the - /// last stock split node this `(holder, id)` pair was migrated - /// through, as seen on the vault's corporate-action linked list. - /// 0 = never migrated. + /// Per-(holder, id) migration cursor — the action id of the last + /// migration node this `(holder, id)` pair was migrated through, + /// as seen on the vault's corporate-action linked list. The + /// default 0 corresponds to the vault's bootstrap node (idx 0, + /// identity for splits), so a fresh `(holder, id)` pair's default + /// cursor of 0 is semantically equivalent to "no real migration + /// applied yet". mapping(address holder => mapping(uint256 id => uint256 cursor)) accountIdCursor; }