Skip to content

fix(bounties): atomic payouts, no merged refunds, expiry refunds, cheaper sign-in - #884

Merged
chonilius merged 4 commits into
MergeFi:mainfrom
jd-here-007:fix/issues-790-794-795-796-bounty-escrow-integrity
Nov 20, 2026
Merged

chonilius merged 4 commits into
MergeFi:mainfrom
jd-here-007:fix/issues-790-794-795-796-bounty-escrow-integrity

Conversation

@jd-here-007

Copy link
Copy Markdown
Contributor

What changed

Why

Each item matches its issue: a merged bounty could be refunded, the chain and the local ledger could diverge on payout or refund, expired funded bounties stranded their escrow, and new sign-ins paid up to 101 queries for one username.

How to verify by reading

  1. bounty-state-machine.ts: MERGED lists only PAID and RELEASE_FAILED.
  2. bounties.service.ts: markMergedAndRelease and refund each run inside bountyRepo.manager.transaction and pass manager to the escrow service.
  3. escrow.service.ts: release, splitRelease and refund take the optional manager.
  4. bounties.service.ts: expireOverdue ends with refundStrandedEscrows().
  5. users.service.ts: saveNewUser has no pre-insert lookup, and generateUniqueUsername is removed.

Notes

  • No tests were added and no checks were run, as requested.
  • Existing specs may encode the old behaviour. bounty-state-machine.spec.ts asserts MERGED -> REFUNDED is allowed, so that assertion needs updating.
  • If the escrow call fails, the lastFailure metadata written inside the transaction is rolled back with it. The failure is still raised to the caller.

Closes #790
Closes #794
Closes #795
Closes #796

@vercel

vercel Bot commented Nov 20, 2026

Copy link
Copy Markdown

@jd-here-007 is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 20, 2026

Copy link
Copy Markdown

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

@chonilius
chonilius merged commit e936327 into MergeFi:main Nov 20, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment