Skip to content

Add unit tests for the creator fee split function distributing fees correctly between the protocol treasury and creator recipient #710

Description

@Chucks1093

Summary

The fee split function divides the total fee between the protocol treasury and the creator's fee recipient according to configured basis points. Unit tests should confirm the split is exact, that the two amounts sum to the total fee, and that no stroop is lost to rounding.

Scope

  • Test a total fee of 1000 stroops split 70/30 returns 700 to protocol and 300 to creator
  • Test a total fee of 1001 stroops split 70/30 — assert the remainder stroop goes to protocol (floor division)
  • Test a split of 100/0 returns the full fee to protocol and 0 to creator
  • Test a split of 0/100 returns 0 to protocol and the full fee to creator
  • Assert protocol_amount + creator_amount always equals total_fee

Acceptance Criteria

  • 70/30 split correct for even amounts
  • Remainder stroop assigned to protocol on odd amounts
  • 100/0 split assigns full fee to protocol
  • 0/100 split assigns full fee to creator
  • Sum of both amounts always equals total fee

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions