RoyaltiesReceiverV2 recalculates royalty shares on every payout using live values from Factory (creator/platform split and referral tier). Its accounting (PaymentSplitter-style) assumes shares are fixed over time. When shares change after any past releases (e.g., referral tier auto-increases), the newly computed entitlements implicitly apply the new shares to all historical inflows, causing over-allocation. As a result, release / releaseAll can revert and royalties can be frozen until substantial new funds arrive—sometimes indefinitely.
This formula is correct only if shares(account) has been constant since inception. If shares(account) increases later, the recomputed cumulative entitlement exceeds the funds actually received/retained by the contract, producing an oversized payment.
Referral tiers auto-increase with normal usage (no admin needed):
Therefore, shares can drift organically as the referral is exercised—no upgrade or admin action required.
T2: 10 ETH arrive. Creator pending = (10+100) × 80% − 80 = 8 ETH (ok), Referral pending = (10+100) × 5% − 0 = 5.5 ETH. If creator withdraws first, remaining balance may be < 5.5 ETH → referral withdrawal reverts; releaseAll can fully revert.
Impact Details
Permanent / long-lived freezing of royalties
When shares increase after earlier payouts, newly computed entitlements can exceed the contract balance, causing release / releaseAll to revert. Future small inflows may still be insufficient to cover the recomputed arrears, keeping royalties frozen.
Over/under-payment drift
If shares increase, affected payees are over-allocated relative to the actual historical split; if shares decrease, others are underpaid. The design no longer conserves balances across time, breaking accounting accuracy.
Severity (program scope mapping)
High/Critical: Permanent freezing of funds; asset accuracy/accounting drift; DoS of payout flows.
Produce suggested remediations (e.g., snapshotting fixed shares per release, storing historical totals per-account, or converting to per-inflow accounting), or
Draft a minimal patch suggestion to make shares static for accounting purposes while preserving referral mechanics.