Skip to content

fix: validate early_bird_fee_bps does not exceed platform fee at creation (#696) - #741

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
deborahairtel887-dotcom:fix/issue-696-validate-early-bird-fee-bps
Aug 31, 2026
Merged

fix: validate early_bird_fee_bps does not exceed platform fee at creation (#696)#741
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
deborahairtel887-dotcom:fix/issue-696-validate-early-bird-fee-bps

Conversation

@deborahairtel887-dotcom

Copy link
Copy Markdown
Contributor

Summary

Enforces that InvoiceOptions2.early_bird_fee_bps does not exceed platform_fee_bps read from contract storage during invoice creation. If early_bird_fee_bps > platform_fee_bps, create_invoice returns ContractError::InvalidAmount.

Changes

  • In contracts/split/src/lib.rs, read platform_fee_bps from contract storage and ensure early_bird_fee_bps <= platform_fee_bps, returning ContractError::InvalidAmount if early_bird_fee_bps > platform_fee_bps.
  • Added unit tests in contracts/split/src/test.rs:
    • test_create_invoice_early_bird_fee_exceeds_platform_fee_rejected: verifies rejection with ContractError::InvalidAmount when early_bird_fee_bps exceeds configured platform_fee_bps.
    • test_create_invoice_early_bird_fee_exceeds_default_zero_platform_fee_rejected: verifies rejection with ContractError::InvalidAmount when early_bird_fee_bps exceeds default zero platform fee.
    • test_create_invoice_early_bird_fee_equals_platform_fee_ok: verifies invoice creation succeeds when early_bird_fee_bps == platform_fee_bps.
    • test_create_invoice_early_bird_fee_less_than_platform_fee_ok: verifies invoice creation succeeds when early_bird_fee_bps < platform_fee_bps.

closes #696

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@deborahairtel887-dotcom 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

@Kingsman-99
Kingsman-99 merged commit 92a30a8 into Stellar-split:main Aug 31, 2026
1 of 4 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.

Validate early_bird_fee_bps does not exceed platform fee at creation

2 participants