Skip to content

The bounty state machine allows MERGED → REFUNDED, so a completed bounty's funds can be returned to the sponsor #795

Closed

Description

@chonilius

src/bounties/bounty-state-machine.ts:32-36:

  [BountyStatus.MERGED]: [
    BountyStatus.PAID,
    BountyStatus.RELEASE_FAILED,
    BountyStatus.REFUNDED,
  ],

MERGED means the linked PR was merged on GitHub — the work is done and accepted. BountiesService.refund admits the bounty's sponsor and the repository's maintainer (bounties.service.ts:257-265), and assertTransition(bounty.status, REFUNDED) passes from MERGED.

Why it matters: a sponsor can take the money back after the contributor's work has been merged, and the maintainer of the repository can do it on their behalf. The contributor has no recourse: the escrow refund pays the original funder, the bounty ends REFUNDED, and the only record that work was delivered is the mergedAt timestamp. This is the one transition in the table that lets a party unilaterally reverse a completed exchange.

The adjacent transitions are defensible — RELEASE_FAILED → REFUNDED is a genuine escape hatch when the payout cannot be made, and EXPIRED → REFUNDED is the normal unwind. MERGED → REFUNDED is neither.

Fix: remove it. Recovery from a stuck MERGED bounty should go through RELEASE_FAILED (retry the release) or an explicitly admin-gated dispute path that is distinguishable from an ordinary sponsor refund — not through the same endpoint a sponsor uses to cancel an unclaimed bounty. If a dispute flow is wanted, it needs its own status and its own authorization.

Activity

  1. added
    security
    on Nov 12, 2026
  2. yunyue-taste-it commented on Nov 12, 2026

    @yunyue-taste-it

    Implemented the fix and test verification in PR #859:
    #859

    • Removed from .
    • Added unit tests asserting is disallowed and throws .

    Base / EVM payout address:

  3. added
    Stellar Wave
    on Nov 19, 2026
  4. udoyechinenyevictoria commented on Nov 19, 2026

    @udoyechinenyevictoria

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

    Hello! Please can I work on this issue?

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

  5. jd-here-007 commented on Nov 19, 2026

    @jd-here-007
    Contributor

    @jd-here-007 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

    hi maintainer let me fix this please

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @jd-here-007 to this issue.

  6. drips-wave commented on Nov 19, 2026

    @drips-wave

    Congratulations, @jd-here-007! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

    🧑‍💻 @jd-here-007: 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. drips-wave commented on Nov 20, 2026

    @drips-wave

    This issue has been completed by @jd-here-007 as part of the Stellar Wave Program's 11th Wave 🥳

    😎 @jd-here-007: 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

Assignees

Labels

Stellar Wavesecurity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions