Skip to content

feat(solana): support native SOL rewards for token locks - #8

Closed
arkoc wants to merge 1 commit into
main-add-solanafrom
codex/solana-native-reward
Closed

feat(solana): support native SOL rewards for token locks#8
arkoc wants to merge 1 commit into
main-add-solanafrom
codex/solana-native-reward

Conversation

@arkoc

@arkoc arkoc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add atomic SPL-principal + native-SOL-reward lock instruction
  • add matching redeem and refund instructions
  • keep SOL reward as lamports in the solver-lock PDA and represent the native reward mint with the System Program address
  • cover lock, redeem, and refund paths in the Anchor test suite

Safety

  • principal and reward are escrowed in the same transaction
  • redeem always sends SPL principal to the stored recipient and SOL reward according to the stored reward timelock
  • refund always returns both assets to the stored refund address
  • native-reward instructions reject non-SPL principal state and non-native reward state

Verification

  • cargo check -p train-htlc
  • cargo test -p train-htlc
  • Anchor IDL generation tests: 10 passed
  • ./node_modules/.bin/tsc --noEmit

The local Anchor validator suite was added but not executed here because Solana/Anchor CLI binaries are not installed in this environment.

@arkoc arkoc closed this Jul 30, 2026
@nerses-asaturyan
nerses-asaturyan deleted the codex/solana-native-reward branch July 31, 2026 09:27
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.

1 participant