Skip to content

compute_split accepts duplicate recipients and 0-bps entries #540

Closed

Description

@chonilius

Problem

mergefi_common::compute_split only checks non-empty, Σbps == 10_000 and no self-payout. [(A, 5000), (A, 5000)] and [(A, 10000), (B, 0)] are both accepted. Duplicates make two separate transfers to the same address (wasting fees and confusing indexers). A 0-bps recipient gets a zero transfer that release silently skips, and it can still win a dust stroop. mergefi-backend rejects duplicates (#358 there), but the contract, which is the source of truth, doesn't.

Suggested fix

Reject bps == 0 and duplicate addresses with InvalidSplit, and add cases to test_fuzz.rs.

Related: #17

Activity

  1. urielit1313-creator commented on Oct 14, 2026

    @urielit1313-creator

    Submitted PR #595 addressing this issue by validating recipient addresses and shares in compute_split:

    • Rejects entries with bps == 0 with SplitError::InvalidSplit.
    • Rejects duplicate recipient addresses with SplitError::InvalidSplit.
    • Added unit tests in mergefi-common and integration test coverage in mergefi-escrow and mergefi-milestones.
    • 100% test pass rate across all suites with 0 Clippy warnings.

    Bounty Payout Address (Base USDC): 0xfE777c43e4B0A24fFA1527eD520d1E7f9ECED483

  2. added a commit that references this issue on Oct 16, 2026
  3. opencode13241-eng commented on Oct 19, 2026

    @opencode13241-eng

    traced loop in contracts/common/src/split.rs:59-67. missing zero-bps (bps == 0) and duplicate address guards before allocation loop. added SplitError::InvalidSplit checks + test_fuzz.rs cases. cargo test -p mergefi-common clean. please assign so i can open the pr.

  4. Michael997glitch commented on Oct 20, 2026

    @Michael997glitch

    @Michael997glitch has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi there, I'd like to contribute to this.

    I'm a software engineer with strong experience in JavaScript and building scalable web applications. I'm comfortable working across the stack, writing clean, maintainable code, and collaborating in open source environments.

    I understand what's being asked here and I'm confident I can implement this correctly and efficiently.

    Looking forward to contributing — please assign this issue to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Michael997glitch to this issue.

  5. ArtaXerxes-oss commented on Oct 20, 2026

    @ArtaXerxes-oss
    Contributor

    @ArtaXerxes-oss has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    i can solve this within few hours

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @ArtaXerxes-oss to this issue.

  6. drips-wave commented on Oct 20, 2026

    @drips-wave

    Congratulations, @ArtaXerxes-oss! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @ArtaXerxes-oss: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  7. grantfox-oss commented on Oct 20, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @ArtaXerxes-oss's PR #753 was approved and merged by @chonilius.

    🏆 @ArtaXerxes-oss: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (525 total points). Track your full progress on GrantFox.

    👏 Great work, @ArtaXerxes-oss! Keep contributing to MergeFi.

  8. drips-wave commented on Oct 20, 2026

    @drips-wave

    This issue has been completed by @ArtaXerxes-oss as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @ArtaXerxes-oss: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions