Add strict payouts toggle via Sablier Lockup Tranched - #29
Merged
Conversation
The hourly/daily presets stream linearly — claimable grows every second and the interval is display-only. Real casino-style reloads need discrete drops: nothing claimable between them, then the day's chunk lands at once. The deployed v2.0 Lockup contract already exposes createWithDurationsLT (selector verified in Base mainnet bytecode); the app just never called it. - schedule.ts: computeTranches (even split, dust folds into the last tranche), sablierNetDeposit (replicates the contract's UD60x18 floor broker-fee math — tranche amounts must sum to it exactly or the create reverts), secondsUntilTimeOfDay (first drop anchors to the user's local time-of-day, rolling a day when closer than 15 minutes) - abis.ts: createWithDurationsLT entry - create page: fourth schedule tab (Daily reload) with drop-count and time-of-day inputs; both lock call sites consolidated into one fireLock so LL/LT branching can't drift; preview/calculator/confirm/success surfaces speak in drops with zero-between-drops copy per the honest- wording rule from the 2026-07-28 packet Verified beyond unit tests via eth_simulateV1 against the deployed Base Sepolia contract: faucet -> approve -> createWithDurationsLT succeeds with exact sums (fee-less and 0.5%-broker paths, 12 dusty amount/day combos), and reverts when the sum is off by one unit. Solana is excluded deliberately: the deployed SolSab program exposes only Lockup Linear instructions and upstream has no tranched work.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Per review: instead of a separate daily-reload tab with its own inputs, strict is now a payout-style toggle (Steady drip / Strict payouts) that applies to whatever preset or custom schedule is picked. The tranche list derives from the schedule's own cliff/window/cadence — the checkpoints the drip calculator was already displaying become the enforced unlock times, first payout at cliff + one interval. Presets now carry intervalSeconds, which also fixes the calculator previously assuming hourly cadence for the daily presets. Lock-until hides the toggle (already a single strict drop); Panic Lock falls back to drip with a note (no cadence to enforce). Sablier's tranche cap — verified empirically at exactly 500 (501 reverts) — is enforced at the form level with a clear error for over-cap combos like hourly x 30d.
The secondary-text ramp bottomed out at 0.60L on a 0.14L background — below comfortable contrast for the 11-12px helper lines and footnotes it colors, and captain-reported as hard to read on the payout-style helper. Lift the whole ramp (muted 0.70→0.76, subtle 0.66→0.72, faint 0.60→0.68) so hierarchy is preserved while the floor clears small-text legibility. Also bump the two smallest type sizes app-wide: 11px→12px (text-xs) and 10px→11px. Nothing user-facing renders below 11px now.
Strict streams have exact unlock times, so the vault card can finally answer 'when can I claim?' precisely: read getTranches once per stream (immutable — cached forever; linear streams revert and map to null), show 'Next payout in Xm Ys' ticking against the next tranche, and 'All payouts unlocked' when the schedule is done. Countdown gains a seconds tier so an hourly cadence visibly moves. Fallback schedule label for tranched streams without a stored preset label is 'Strict Payouts'.
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.
Adds a payout-style toggle — Steady drip / Strict payouts — that applies to any preset or custom schedule. Strict writes
createWithDurationsLT: the schedule's own cliff/window/cadence becomes an enforced tranche list, so the checkpoints the drip calculator displays are the actual on-chain unlock times. Nothing is claimable between payouts. First payout lands at cliff + one interval.Details:
schedule.ts:computeTranches(even split, dust folds into last tranche, 500-count cap),sablierNetDeposit(replicates Sablier's UD60x18 floor broker-fee math — tranche sums must match exactly or the create reverts),strictDropCount(same floor math as the calculator display)contracts.ts: presets carryintervalSeconds(also fixes the calculator assuming hourly cadence on daily presets)abis.ts:createWithDurationsLT(selector verified in deployed Base mainnet bytecode)fireLockVerification:
eth_simulateV1against the real Base Sepolia Sablier: faucet→approve→create succeeds with exact sums (fee-less and 0.5%-broker paths, dusty amounts), reverts when the sum is off by one unit🤖 Generated with Claude Code