Skip to content

docs(contracts): record dust-position entry_time gaming constraint - #594

Merged
collinsezedike merged 4 commits into
drydocs:mainfrom
pheobeayo:docs/entry-time-dust-gaming-constraint
Aug 26, 2026
Merged

docs(contracts): record dust-position entry_time gaming constraint#594
collinsezedike merged 4 commits into
drydocs:mainfrom
pheobeayo:docs/entry-time-dust-gaming-constraint

Conversation

@pheobeayo

Copy link
Copy Markdown
Contributor

Summary

  • Documents a known gaming vector in Entry(address)/get_entry_time(): deposit() only stamps a fresh entry time when Balance(caller) was 0, and withdraw() 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.
  • No code change: entry_time currently 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.
  • Adds guidance under get_entry_time() that any such feature should read a size-weighted average timestamp on top-up rather than raw entry_time, so a large late deposit meaningfully pulls the entry time forward.
  • Docs-only change to apps/docs/architecture/vault-contract.md, the canonical reference docs/contracts.md already points readers to for this contract.

Test plan

  • pnpm lint && pnpm typecheck && pnpm test pass locally
  • Docs-only change — no contract or test behavior affected; verified the note is placed under both deposit() and get_entry_time() so it's visible from either entry point

Closes #577

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

@pheobeayo is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@collinsezedike

Copy link
Copy Markdown
Collaborator

@pheobeayo this PR also has merge conflicts against main now, please rebase and resolve those alongside the newline fix above.

@pheobeayo

Copy link
Copy Markdown
Contributor Author

@pheobeayo this PR also has merge conflicts against main now, please rebase and resolve those alongside the newline fix above.

fixed!

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@collinsezedike
collinsezedike force-pushed the docs/entry-time-dust-gaming-constraint branch from cba1ab7 to 93102ad Compare August 26, 2026 11:46
@collinsezedike
collinsezedike merged commit 111283b into drydocs:main Aug 26, 2026
8 of 9 checks passed
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.

[Chore] Record the dust-position stale-entry_time gaming vector

2 participants