Repository navigation
feat: enable native token refund - #141
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
skosito
approved these changes
Jul 1, 2026
julianrubino
approved these changes
Jul 1, 2026
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.
Add logic for native SOL refund.
Note
Medium Risk
Moves real SOL from the gateway PDA without TSS signatures; controls match SPL refunds but custody outflows warrant careful operational review.
Overview
Adds
refund_sol, mirroring the existing SPL refund path: only the PDA authority can move lamports from the gateway meta PDA to any recipient wallet.The handler shares
validate_refund_requestwith SPL refunds (authority + positive amount), caps refunds to lamports above rent-exempt minimum on the PDA, and transfers via direct lamport debit/credit. Deposits can stay paused; refunds are not blocked byset_deposit_paused.Anchor tests cover happy path, non-authority, insufficient balance, zero amount, and refund while deposits are paused.
Reviewed by Cursor Bugbot for commit bb04a9c. Configure here.