Skip to content

CIP112: Forward each authorizer's own context to its Allocation_Settle - #127

Open
haseebrabbani wants to merge 1 commit into
audit-m1-02-l05from
cip112-settle-context
Open

haseebrabbani wants to merge 1 commit into
audit-m1-02-l05from
cip112-settle-context

Conversation

@haseebrabbani

Copy link
Copy Markdown
Collaborator

Closes #82. Stacked on #116 (L-05): base audit-m1-02-l05.

Utils

  • settleBatchImpl takes a selector AllocationView -> ChoiceContext -> ChoiceContext that picks the context each Allocation_Settle receives. Batch meta still never reaches an allocation.
  • The doc comment and README state the privacy conditions: empty settlementFactory_settleBatchExtraObservers, and a selector keyed on allocView.allocation.authorizer.
  • TokenRules passes \_ _ -> emptyChoiceContext, so its behaviour is unchanged. The signature break is folded into the Unreleased entry instead of a version bump, since the package is pre-release.

Custom example

Sandbox gate

settleBatchImpl takes a selector that picks the context each
Allocation_Settle receives, given the allocation's view and the batch's
choice context. The batch metadata still never reaches an allocation.
TokenRules forwards nothing, so its behaviour is unchanged. The doc comment
and the utils README state the two conditions that keep the batch context
private: no authorizer is an informee of the batch, and the selector keys
on the authorizer.

The custom example keeps its compliance freeze on a per-account
MyAccountStatus instead of a flag on MyHolding. A freeze no longer
re-creates holdings, so pending instructions and allocations complete once
the account is unfrozen. All three consumption operations, and the owner
unlock, read the status from the choice context and refuse a frozen
account. MyRules forwards each batch authorizer only its own status,
MyTransferInstruction_Expire takes extraArgs, and MyRules_OpenAccount opens
a status.

The sandbox gate gains the JSON Ledger API witness check from #119. A new
script uses it to show that each authorizer sees neither the batch context
nor the other authorizer's entry.

Closes #82
@0xNeshi
0xNeshi force-pushed the cip112-settle-context branch from 5a36154 to a52edb1 Compare November 19, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant