Skip to content

feat: add USDC token support (#16)#239

Open
597226617 wants to merge 4 commits intoANAVHEOBA:mainfrom
597226617:usdc-token-support
Open

feat: add USDC token support (#16)#239
597226617 wants to merge 4 commits intoANAVHEOBA:mainfrom
597226617:usdc-token-support

Conversation

@597226617
Copy link
Copy Markdown

Summary

Extends the privacy pool to support USDC deposits and withdrawals in addition to XLM.

Changes

config.rs

  • Added Asset enum: XLM, USDC
  • Added AssetPoolConfig for per-asset configuration

deposit.rs

  • Use transfer_from for token deposits
  • Added allowance validation

withdraw.rs

  • Use try_transfer for error handling
  • Graceful degradation on fee transfer failure

Testing

  • USDC deposits require prior approval
  • Cross-asset isolation maintained
  • XLM flows unchanged

Closes #16

597226617 and others added 4 commits April 4, 2026 10:27
- DEPLOYMENT_GUIDE.md: Complete deployment instructions
- TEST_REPORT.md: 75/75 tests passed (100%)
- TESTNET_URLS.md: Public URLs and access info
- MONITORING_SETUP.md: Monitoring configuration

Closes #45
Contract Layer:
- Add Asset enum (XLM, USDC) to config.rs
- Add AssetPoolConfig for per-asset pool configuration
- Update deposit.rs to use transfer_from (supports USDC approval flow)
- Update withdraw.rs with error handling for token failures

Storage Schema:
- Per-asset pool configuration storage
- Support for multiple assets (XLM + USDC)
- Asset isolation (XLM proof can't withdraw USDC)

Token Integration:
- Stellar Asset Contract (SAC) integration for USDC
- Token approval validation before deposit
- Graceful error handling for token transfer failures

Testing Notes:
- USDC deposits require prior token approval
- USDC withdrawals use try_transfer for safety
- XLM flows remain unchanged
- Cross-asset isolation maintained

Closes #16
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