Repository navigation
L-04: Pass consumed holdings to createHolding so consumer fields surv… - #129
Open
haseebrabbani wants to merge 1 commit into
Open
haseebrabbani wants to merge 1 commit into
haseebrabbani wants to merge 1 commit into
Conversation
haseebrabbani
requested review from
0xNeshi,
ericnordelo,
igingu and
pepebndc
as code owners
November 19, 2026 07:49
0xNeshi
force-pushed
the
audit-m1-02-l05
branch
from
November 19, 2026 10:37
20f5b0c to
56d7cac
Compare
0xNeshi
force-pushed
the
audit-m1-02-l04-v2
branch
from
November 19, 2026 10:44
d9a9edb to
44c2146
Compare
…ive re-creation HoldingOps takes the owner's per-holding state as a type parameter h. The three consumption operations return the consumed holding's view and state, and createHolding receives the states of the holdings that fund the new one: a transfer's or allocation's inputs, the locked funding on accept and settle (per instrument), the replaced locked holding on every return, and the exercised holding on an owner unlock. A mint and a settlement payout funded only by net credit get no sources. consumeByArchive @t returns the archived t, so holdingOpsFor @t builds a HoldingOps t. TokenHolding has no extra fields and ignores the sources. The custom example also ignores them: no source it sees is ever frozen. The HoldingOps docs and the utils README list the sources per path, state that a field the closure does not derive from them resets, and point restrictions on in-flight funds to a per-account contract. A new utils test suite tags each holding with its sources' tags and follows them through every re-creation path. Ports the design of 0xNeshi's audit-m1-02-l04 branch onto the L-05 hooks. Closes #89
0xNeshi
force-pushed
the
audit-m1-02-l04-v2
branch
from
November 19, 2026 13:14
44c2146 to
0ad2916
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89. Stacked on #116 (base
audit-m1-02-l05).HoldingOps his parameterised over the owner's per-holding state.fundHolding/deliverHolding/returnHoldingreturn(view, h);createHolding : [h] -> HoldingView -> Update ...receives the states of the holdings that fund the new one.consumeByArchive @treturns the archivedt;holdingOwnerUnlockImpltakes the exercised holding's state.TokenHoldingand the custom example ignore sources, so nothing changes for them. The example's freeze is tracked in CIP112:settleBatchImpl: forward each authorizer's own context to itsAllocation_Settle#82.HoldingOpshaddock and utilsREADME.mdlist the sources per path, warn that underived fields reset and that sources are order- and amount-agnostic, and point restrictions on in-flight funds to a per-account contract.Utils/Test/Sources.daml(10 scripts) tags each holding with its sources' tags through every re-creation path. Mutating the wiring fails them.AGENTS.mdcommands pass, including the token sandbox suite. All 10 Sources scripts pass on a static Canton sandbox, and a JSON Ledger API smoke passes 29/29 happy and 6/6 error paths.audit-m1-02-l04branch onto the L-05: Split consumeHolding into fund, deliver and return operations #116 hooks.