You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The contract emits only aggregate events. SplitPaid, Deposited, and Distributed all carry { id, token, amount }: the total that went through the split. payout() computes the per-recipient breakdown via amounts() and then throws it away.
Nothing on-chain records who received what.
Why this matters
You cannot recompute the breakdown after the fact, because update_split() can change recipients and shares at any time. An indexer replaying a SplitPaid from ledger 100 has no way to know the share table as it existed at ledger 100: reading get_split today returns the current table. So historical payouts are permanently unreconstructible from chain data.
This directly blocks:
Show payout history inside the split detail view #63 (Show payout history inside the split detail view). Any history built today would either omit per-recipient amounts or compute them from the current shares, which is silently wrong for any split that was ever updated.
The indexer's value proposition generally. export-csv.mjs has an amount column but can never populate a per-recipient one.
Suggested fix
Emit a per-recipient leg alongside the aggregate. Either a PayoutLeg { id, token, recipient, amount } event per recipient inside payout(), or extend the existing events with a vector of legs.
Trade-off to weigh in the PR: a leg per recipient means up to MAX_RECIPIENTS (32) extra events per payment, which costs resources. Emitting one event carrying a vector is cheaper but harder to filter on by topic. Benchmark against #53 (worst-case 32-recipient payout cost).
Acceptance criteria
A payment through a split emits enough data to attribute an exact amount to each recipient, without reading current contract state.
Nested Recipient::Split legs are distinguishable from Recipient::Account legs.
Problem
The contract emits only aggregate events.
SplitPaid,Deposited, andDistributedall carry{ id, token, amount }: the total that went through the split.payout()computes the per-recipient breakdown viaamounts()and then throws it away.Nothing on-chain records who received what.
Why this matters
You cannot recompute the breakdown after the fact, because
update_split()can changerecipientsandsharesat any time. An indexer replaying aSplitPaidfrom ledger 100 has no way to know the share table as it existed at ledger 100: readingget_splittoday returns the current table. So historical payouts are permanently unreconstructible from chain data.This directly blocks:
export-csv.mjshas anamountcolumn but can never populate a per-recipient one.Suggested fix
Emit a per-recipient leg alongside the aggregate. Either a
PayoutLeg { id, token, recipient, amount }event per recipient insidepayout(), or extend the existing events with a vector of legs.Trade-off to weigh in the PR: a leg per recipient means up to
MAX_RECIPIENTS(32) extra events per payment, which costs resources. Emitting one event carrying a vector is cheaper but harder to filter on by topic. Benchmark against #53 (worst-case 32-recipient payout cost).Acceptance criteria
Recipient::Splitlegs are distinguishable fromRecipient::Accountlegs.