Skip to content

Fix: Enforce exact 10_000 basis points for custom payout curve weights - #324

Merged
dultimateade merged 1 commit into
dultimateade:mainfrom
pearlsslove:fix/payout-curve-fund-locking
Oct 21, 2026
Merged

dultimateade merged 1 commit into
dultimateade:mainfrom
pearlsslove:fix/payout-curve-fund-locking

Conversation

@pearlsslove

Copy link
Copy Markdown
Contributor

closes #181
closes #187

Fixes a critical vulnerability where custom weight validation allowed sums between 1 and 9,999 basis points, enabling market creators to lock user funds permanently by allocating less than 100% of the pool.

Changes:

  • validate_payout_curve now requires sum == 10_000 (exact 100% allocation)
  • Prevents partial pool allocations that would leave funds unclaimable
  • Old check (sum == 0 || sum > 10_000) allowed 9_999 to pass; now rejects

Testing:

  • Added test_custom_weights_exactly_10000_required to verify:
    • Rejects weights summing to 9_999 (0.01% under)
    • Rejects weights summing to 5_000 (50% of pool)
    • Rejects weights summing to 1
    • Accepts weights summing to exactly 10_000

Fixes a critical vulnerability where custom weight validation allowed sums
between 1 and 9,999 basis points, enabling market creators to lock user
funds permanently by allocating less than 100% of the pool.

Changes:
- validate_payout_curve now requires sum == 10_000 (exact 100% allocation)
- Prevents partial pool allocations that would leave funds unclaimable
- Old check (sum == 0 || sum > 10_000) allowed 9_999 to pass; now rejects

Testing:
- Added test_custom_weights_exactly_10000_required to verify:
  * Rejects weights summing to 9_999 (0.01% under)
  * Rejects weights summing to 5_000 (50% of pool)
  * Rejects weights summing to 1
  * Accepts weights summing to exactly 10_000
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

@dultimateade
dultimateade merged commit 21cd05b into dultimateade:main Oct 21, 2026
0 of 3 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

2 participants