Skip to content

fix(splitter): add claimable fallback for failed payouts (#260) - #366

Merged
Spagero763 merged 2 commits into
tributary-protocol:mainfrom
Sam-Rytech:fix-260-claimable-fallback
Jul 27, 2026
Merged

fix(splitter): add claimable fallback for failed payouts (#260)#366
Spagero763 merged 2 commits into
tributary-protocol:mainfrom
Sam-Rytech:fix-260-claimable-fallback

Conversation

@Sam-Rytech

Copy link
Copy Markdown
Contributor

Description

This PR addresses the issue where payout() pushes to every recipient in a single transaction, causing the entire payout to revert if a single recipient cannot receive the token (e.g. no trustline or unfunded destination).

To resolve this, a claimable fallback has been implemented:

  • Uses client.try_transfer() in payout to pre-check transfers for Recipient::Account.
  • If the transfer is impossible or fails, it falls back to crediting the token amount to a new AccountBalance in persistent storage rather than reverting.
  • Added pub fn claim(...) to the Splitter so the blocked recipient can manually withdraw the funds once their trustline is resolved.
  • Follows the conservation of funds (paid + claimable == amount in).

Closes #260

@Sam-Rytech
Sam-Rytech requested a review from Spagero763 as a code owner July 22, 2026 09:17
@Spagero763
Spagero763 merged commit 5cf5ee5 into tributary-protocol:main Jul 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One un-receivable recipient blocks the whole payout: add a claimable fallback

2 participants