Skip to content

feat: enable native token refund - #141

Merged
s2imonovic merged 4 commits into
developfrom
feat/native-refund
Jul 1, 2026
Merged

s2imonovic merged 4 commits into
developfrom
feat/native-refund

Conversation

@s2imonovic

@s2imonovic s2imonovic commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

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_request with 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 by set_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.

@s2imonovic
s2imonovic requested a review from a team as a code owner July 1, 2026 16:37
@codecov-commenter

codecov-commenter commented Jul 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
programs/gateway/src/instructions/refund.rs 0.00% 22 Missing ⚠️
programs/gateway/src/lib.rs 0.00% 3 Missing ⚠️
programs/gateway/src/contexts.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@s2imonovic
s2imonovic merged commit 0ee7e43 into develop Jul 1, 2026
12 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.

4 participants