Skip to content

fix and docs: resolve issues #63, #69, #68, #66 - #214

Merged
sweetsoul21 merged 2 commits into
Novatip:mainfrom
Rampop01:docs/limits-table
Oct 21, 2026
Merged

sweetsoul21 merged 2 commits into
Novatip:mainfrom
Rampop01:docs/limits-table

Conversation

@Rampop01

@Rampop01 Rampop01 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request addresses and resolves all 4 assigned issues:


Detailed Changes

1. Limits Quick Reference Table (Closes #63)

  • Added a Limits quick reference table to docs/CONTRACT.md near the top of the document.
  • Lists the basis point denominator (10_000, BPS_DENOM), maximum recipient count (20, MAX_RECIPIENTS), maximum message length (280 bytes, MAX_MESSAGE_LEN), maximum batch tips (10, MAX_BATCH_TIPS), and maximum jar ID length (33 bytes, MAX_JAR_SLUG_LEN + 1).
  • Documents the corresponding error code raised when each bound is exceeded (SplitOutOfRange/SplitSumNot100Pct, TooManyRecipients, MessageTooLong, BatchTooLarge, InvalidJarId).

2. Constructor Argument Validation (Closes #69)

  • Enforced that __constructor rejects an admin and token that are the same address (admin == token), preventing permanent deployment misconfigurations that would require jar redeployment and migration.
  • Documented the design rationale in an inline comment.
  • Added regression test constructor_rejects_admin_and_token_with_same_address covering the rejected case.

3. Checked Arithmetic in Minimum-Share & Overflow Guard (Closes #68)

  • Both the minimum-share guard and distribution loop use checked multiplication (checked_mul) with consistent error handling (AmountOverflow).
  • Added regression test compute_shares_overflow_fails_with_amount_overflow verifying that an amount overflowing i128 (such as i128::MAX) fails with typed Error::AmountOverflow instead of an untyped WASM trap.

4. Self-Recipient Share Accounting (Closes #66)

  • Verified that skipped self-transfers for a tipper who is also a recipient retain their portion and do not bleed into the final recipient's share.
  • Added regression test tipper_who_is_non_final_recipient_keeps_own_share covering a tipper holding a non-final share (3000 bps) alongside another recipient (7000 bps) when tipping 100, ensuring only 70 leaves the tipper and 30 remains with them.

Closes #63
Closes #69
Closes #68
Closes #66

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

@Rampop01 Rampop01 changed the title docs: add a limits quick reference fix and docs: resolve issues #63, #69, #68, #66 Oct 21, 2026
@Abioladory123 Abioladory123 reopened this Oct 21, 2026
@sweetsoul21
sweetsoul21 merged commit 415b619 into Novatip:main Oct 21, 2026
2 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

3 participants