Skip to content

xlm: Soroban SAC token transfers to contract addresses#236

Merged
conorpp merged 1 commit intomainfrom
feat/xlm-token-burn
Apr 7, 2026
Merged

xlm: Soroban SAC token transfers to contract addresses#236
conorpp merged 1 commit intomainfrom
feat/xlm-token-burn

Conversation

@cordialsys-agent
Copy link
Copy Markdown
Contributor

Summary

  • Migrate Stellar SDK from stellar/go to stellar/go-stellar-sdk v0.4.0 (adds Soroban support)
  • Add support for token transfers to Soroban contract (C...) addresses via Stellar Asset Contract (SAC) invocation
  • When destination is a C address, the driver builds an InvokeHostFunction operation calling the SAC transfer(from, to, amount) function
  • Soroban simulation via secondary_url (Soroban RPC) provides resource fees and authorization entries

How it works

  1. FetchTransferInput detects C-address destination, builds a temporary tx, simulates via Soroban RPC
  2. Simulation results (SorobanData, auth entries, resource fee) are stored in TxInput
  3. Builder constructs InvokeHostFunction operation with the SAC contract derived from the token asset
  4. Transaction includes SorobanTransactionData extension and combined fee (inclusion + resource)

Config

Requires secondary_url in chain config pointing to Soroban RPC:

XLM:
  url: "https://horizon-testnet.stellar.org"
  secondary_url: "https://soroban-testnet.stellar.org"

Test plan

Tested live on Stellar testnet with YLDS token:

  • Normal YLDS transfer (Payment op) — 532306e0
  • YLDS transfer with fee-payer — 359f4552
  • YLDS to contract C address (SAC InvokeHostFunction) — d405ff77
  • YLDS to contract C address with fee-payer — c896e377

Also verified no regressions on mainnet:

  • Normal XLM transfer — 98bdd85c
  • USDC token transfer — 2a381808
  • XLM with fee-payer — 66893adb

🤖 Generated with Claude Code

@conorpp
Copy link
Copy Markdown
Contributor

conorpp commented Apr 3, 2026

  ┌─────┬─────────┬─────────────────────────────┬──────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
  │  #  │ Network │            Test             │   Hash   │                                                   Explorer                                                    │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 1   │ Testnet │ YLDS transfer               │ 5b6de503 │ https://testnet.stellarchain.io/transactions/5b6de50305598129f646e5960ae7cb7401801b89f9ca4cdf78dbb99ce4748e59 │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 2   │ Testnet │ YLDS + fee-payer            │ 05e6a56f │ https://testnet.stellarchain.io/transactions/05e6a56fa735c217ded63b3a6db3dc03ef3e7c1a7144f56388478ff7874eb7a3 │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 3   │ Testnet │ YLDS → contract C addr      │ 06f12e11 │ https://testnet.stellarchain.io/transactions/06f12e11c0c75af18a8c904cadc5fed51ad6b3c39cea4c4702cd0873496a6a00 │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 4   │ Testnet │ YLDS → contract + fee-payer │ cab663c3 │ https://testnet.stellarchain.io/transactions/cab663c3e0935c19a4fc4ed63b8cfa020706bb7038373836cb67dd5f6a29227b │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 5   │ Testnet │ XLM transfer                │ 59db75c7 │ https://testnet.stellarchain.io/transactions/59db75c73c771047481f659067b6cc17b87f00eb30b98c781a334b5e49725903 │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 6   │ Testnet │ XLM + fee-payer             │ 00957c36 │ https://testnet.stellarchain.io/transactions/00957c36f4f5692321477f0c2e1fda2aa7632860e922109f955e2a979797e81a │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 7   │ Mainnet │ XLM transfer                │ 1660a21f │ https://stellarchain.io/transactions/1660a21fbd43d91fc6aff74a9f505a5d423d7b648073088f2e24871b40849f61         │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 8   │ Mainnet │ XLM + fee-payer             │ 6dc76f50 │ https://stellarchain.io/transactions/6dc76f506f3a1ab2748941b53f185a724930e981992678d23b20e38b2f40a53f         │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 9   │ Mainnet │ USDC transfer               │ 3950cdb2 │ https://stellarchain.io/transactions/3950cdb2ae1b1c8f71da35e48d69daec415990f8483ff8979b1228327e3f1570         │
  ├─────┼─────────┼─────────────────────────────┼──────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ 10  │ Mainnet │ USDC + fee-payer            │ b5528e95 │ https://stellarchain.io/transactions/b5528e952a4956ce70a9ef10e24eeb7555419b58f8c14f5e2f825fb290f2684b         │
  └─────┴─────────┴─────────────────────────────┴──────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

@conorpp conorpp merged commit d1b5d85 into main Apr 7, 2026
14 checks passed
@conorpp conorpp deleted the feat/xlm-token-burn branch April 7, 2026 12:44
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.

3 participants