fix(escrow): align Soroban invocations with mergefi-contracts + PR-opened webhook (#157, #158, #161, #168) - #220
Merged
chonilius merged 2 commits intoAug 26, 2026
Conversation
…PR-opened webhook Addresses MergeFi#157, MergeFi#158, MergeFi#161, MergeFi#168. MergeFi#158 - EscrowService.fund() now submits the real escrow::fund signature (issue_id: u64, sponsor, token, amount: i128, deadline: u64) instead of [funder, uuidReference, amount]. issue_id is the linked GitHub issue id for bounties (threaded from BountiesService) or a deterministic FNV-1a-64 hash of the parent UUID for milestone/pool escrows; token comes from stellar.assetContractIds; deadline from the bounty/milestone or the configured default window. New Escrow.onChainId / Escrow.deadline columns (+ migration) persist the key so release/refund reuse it. MergeFi#161 - EscrowService.release() and splitRelease() converge on the contract's single release(issue_id, recipients: Vec<(Address, u32)>) entrypoint; the non-existent split_release method is gone. A single recipient is the [(addr, 10_000)] degenerate case. SorobanClientService.toScVal encodes the (Address, u32) tuple vector. MergeFi#157 - EscrowService resolves the deployed contract per escrow instance (maintenance-pool deployment for pool escrows, bounty escrow contract otherwise), persists it on Escrow.contractId, and threads it through every soroban.invoke(..., { contractId }) call - fund/release/splitRelease/ releasePartial/poolWithdraw/refund. stellar.maintenancePoolContractId is restored as live config. MergeFi#168 - GithubWebhooksService.handlePullRequest handles opened/reopened PRs, moving a linked CLAIMED bounty to IN_REVIEW when the PR is actually opened rather than only synthetically at merge time. Also repairs duplicated imports/declarations in escrow.service.spec.ts left by an earlier main merge (blocked tsc).
|
@Jaydbrown is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Jaydbrown 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #157
Resolves #158
Resolves #161
Resolves #168
What
Aligns
EscrowService/SorobanClientServicewith the realmergefi-contractsinterface (contracts/escrow/src/lib.rs), and makesGithubWebhooksServicereact to a PR being opened.#158 —
fund()sends the realescrow::fundpayloadfund()invoked('fund', [funderAddress, uuidReferenceId, amount])— three args, notoken, nodeadline, and a Postgres UUID where the contract wants au64 issue_id. It now submitsfund(issue_id: u64, sponsor: Address, token: Address, amount: i128, deadline: u64):BountiesService.fund), or a deterministic FNV‑1a‑64 hash of the parent UUID for milestone / maintenance-pool escrows (which belong on the sibling contracts — see EscrowService never passes contractId to soroban.invoke() — maintenancePoolContractId is completely dead configuration #157). Persisted on the newEscrow.onChainIdcolumn sorelease/refundreuse the exact keyfundcreated.Escrow.assetvia newstellar.assetContractIdsconfig.now + ESCROW_DEADLINE_SECONDS(default 90d). Persisted onEscrow.deadline.New migration
1784800000000-AddEscrowOnChainIdAndDeadline(both columns nullable, no backfill — prior rows dry-ran).#161 —
release/splitReleaseconverge on one entrypointThe deployed contract has no
split_release; team splits and single-recipient payouts both go throughrelease(issue_id, recipients: Vec<(Address, u32)>). Both service methods now build an(address, basisPoints)tuple list and call one privateinvokeRelease(); a lone recipient is the[(addr, 10_000)]case.SorobanClientService.toScValgained recursive Vec /(Address, u32)tuple encoding. Public/escrow/:id/split-releaseroute and DTOs are unchanged.#157 — every invocation targets the escrow instance's own contract
EscrowServicenever passed acontractIdtosoroban.invoke(), somaintenancePoolContractIdwas dead.fund()now resolves the deployed contract per escrow (pool deployment for pool escrows, bounty escrow contract otherwise), persists it onEscrow.contractId, and every call —fund/release/splitRelease/releasePartial/poolWithdraw/refund— passes{ contractId }through.stellar.maintenancePoolContractIdis restored as live config (.env.example, README,configuration.ts).#168 — bounty moves to IN_REVIEW when a PR is opened
handlePullRequestreturned[]for every non-merge action, somarkInReviewonly ever fired synthetically at merge time. Added anopened/reopenedbranch that resolves each linked issue's bounty and callsmarkInReviewwhen the PR is actually opened; bounties not inCLAIMEDare left untouched.Incidental
escrow.service.spec.tshad duplicatedentities/enumsimports and twopaymentRepodeclarations from an earliermainmerge (1b58a30) that failstsc— collapsed to one set.Notes
main(c0ff5ff), including thepoolWithdrawwork —poolWithdrawis threaded through the same{ contractId }/onChainKeyForhelpers.mergefi-milestones/mergefi-maintenance-poolis noted in the README roadmap.escrow.service,soroban-client.service,github-webhooks.service,bounties.servicespecs.