docs(contracts): record dust-position entry_time gaming constraint - #594
Conversation
|
@pheobeayo is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@pheobeayo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
collinsezedike
left a comment
There was a problem hiding this comment.
The content here is accurate, both notes check out against the actual contract behavior. One inline fix needed before this can merge.
| | `Balance(address)` | Persistent | Per-address mUSDC share balance (`i128`) | | ||
| | `Entry(address)` | Persistent | Per-address deposit entry timestamp (`u64`) | | ||
| | `Principal(address)` | Persistent | Per-address net USDC deposited, not yet withdrawn (`i128`) | | ||
| | `Principal(address)` | Persistent | Per-address net USDC deposited, not yet withdrawn (`i128`) | No newline at end of file |
There was a problem hiding this comment.
This file is missing its trailing newline at the end. This isn't just style, it'll fail Lint & Typecheck since pnpm format:check (Prettier) enforces a trailing newline and this file isn't excluded in .prettierignore. Add the newline back and this is good to go.
|
@pheobeayo this PR also has merge conflicts against |
fixed! |
collinsezedike
left a comment
There was a problem hiding this comment.
@pheobeayo I fixed the trailing-newline issue directly and restored a sentence the dust-gaming edit had accidentally dropped (transfer-out addresses still self-heal to 0 on next read, that's a separate case from the dust constraint this PR adds). Merging now.
cba1ab7 to
93102ad
Compare
Summary
Entry(address)/get_entry_time():deposit()only stamps a fresh entry time whenBalance(caller)was0, andwithdraw()only clears it on a full exit — so leaving a dust balance after a partial withdrawal lets a much later, much larger top-up inherit the original day-one timestamp instead of getting a fresh one.entry_timecurrently has zero functional consequence beyond display, so there's nothing to fix yet. This records the constraint now so it can't be silently missed if a duration-gated feature (fee discount, loyalty multiplier, vesting) is ever built against the raw value later.get_entry_time()that any such feature should read a size-weighted average timestamp on top-up rather than rawentry_time, so a large late deposit meaningfully pulls the entry time forward.apps/docs/architecture/vault-contract.md, the canonical referencedocs/contracts.mdalready points readers to for this contract.Test plan
pnpm lint && pnpm typecheck && pnpm testpass locallydeposit()andget_entry_time()so it's visible from either entry pointCloses #577