Skip to content

smartcontractkit/solana-stablecoin-workshop

Repository files navigation

Chainlink Data Streams Oracle-Backed Cross-Chain Stablecoin Workshop

🎯 Overview

This repository contains a complete workshop implementation of an oracle-backed stablecoin system that integrates Chainlink Data Streams for real-time price feeds and Chainlink CCIP for cross-chain functionality on Solana and Ethereum.

Built on Official Chainlink Tools:

Workshop Content

  • Real-time price integration via Chainlink Data Streams SDK
  • Oracle program for on-chain price verification and storage
  • Stablecoin program with collateral management and minting logic
  • Cross-chain transfers using Chainlink CCIP
  • Multisig authority management with SPL Token multisig integration
  • Production-ready testing with comprehensive test suites

Workshop Instructors

  • Harry - Chainlink Data Streams and Oracle Program implementation
  • Jae - Stablecoin integration with Oracle Program and Cross-Chain CCIP configuration

Workshop Setup Guide

Ready to build? Follow the complete step-by-step guide:

β†’ INSTRUCTIONS.md - Complete prerequisites, installation, and deployment walkthrough

For Korean instructions, see INSTRUCTIONS_KR.md.

If you encounter any issues during the workshop, check the troubleshooting section in INSTRUCTIONS.md.

πŸ“ Project Structure

solana-stablecoin-workshop/
β”œβ”€β”€ README.md                    # This overview and instructions
β”œβ”€β”€ INSTRUCTIONS.md              # Complete step-by-step deployment guide
β”œβ”€β”€ oracle/                      # Chainlink Data Streams & Oracle Program
β”œβ”€β”€ cross-chain-stablecoin/      # Stablecoin & CCIP Integration
β”œβ”€β”€ solana-starter-kit/          # CCIP Solana integration scripts and libraries
└── smart-contract-examples/     # Ethereum smart contracts for CCIP

πŸ—οΈ System Architecture

graph LR
    subgraph "πŸ“Š Data Streams (Harry)"
        DS[Chainlink Data Streams<br/>Real-time SOL/USD]
        OC[Rust Client<br/>Fetches & Processes]
        OP[Oracle Program<br/>Verifies & Stores]
        
        DS --> OC --> OP
    end
    
    subgraph "πŸͺ™ Stablecoin System (Jae)"
        SP[Stablecoin Program<br/>Mint/Burn Logic]
        MS[SPL Token Multisig<br/>1-of-3 Authority]
        
        OP --> SP
        SP --> MS
    end
    
    subgraph "πŸŒ‰ Cross-Chain CCIP (Jae)"
        CP[CCIP Pool Program<br/>Solana Side]
        EP[Ethereum Pool<br/>ERC20 Token]
        
        MS --> CP
        CP <--> EP
    end
    
    subgraph "πŸ” Security & Testing"
        T1[Oracle Tests<br/>Real Data Streams]
        T2[Stablecoin Tests<br/>12 Test Suite]
        T3[Integration Tests<br/>End-to-End]
        
        OP -.-> T1
        SP -.-> T2
        CP -.-> T3
    end
Loading

πŸ› οΈ Built With

This workshop leverages key Chainlink development tools:

Core Dependencies

Development Tools

  • Solana CLI - Blockchain interaction and deployment
  • Rust - Oracle client and program development
  • TypeScript - Testing and deployment scripts
  • Hardhat - Ethereum smart contract deployment

πŸš€ Workshop Content

The workshop covers:

  • Phase 1: Oracle Program Deployment (Data Streams integration)
  • Phase 2: Stablecoin Program Deployment (Oracle integration)
  • Phase 3: CCIP Pool Setup (Cross-chain configuration)
  • Phase 4: Ethereum Side Deployment (ERC20 token and pool)
  • Phase 5: Cross-Chain Configuration (Solana ↔ Ethereum)
  • Phase 6: Testing and Token Operations (End-to-end validation)
  • Phase 7: Cross-Chain Transfer Execution (Live transfers)

πŸ§ͺ Testing

Comprehensive Test Suites

Each component includes thorough testing:

Oracle Tests (oracle/tests/)

cd oracle
anchor test  # Real Chainlink Data Streams integration

Stablecoin Tests (cross-chain-stablecoin/stablecoin-program/tests/)

cd cross-chain-stablecoin/stablecoin-program
./test-individual.sh all  # 12 comprehensive tests

# Individual test categories
./test-individual.sh oracle      # Oracle integration (3 tests)
./test-individual.sh stablecoin  # Program logic (4 tests)
./test-individual.sh integration # End-to-end (4 tests)
./test-individual.sh ccip        # CCIP multisig (1 test)

Test Coverage

  • βœ… Real Chainlink Data Integration - Live SOL/USD price feeds
  • βœ… Oracle Program Verification - On-chain price storage and retrieval
  • βœ… Stablecoin Minting/Burning - Complete collateral management
  • βœ… Cross-Program Invocation - Oracle ↔ Stablecoin integration
  • βœ… Multisig Authority - SPL Token multisig operations
  • βœ… CCIP Cross-Chain - Solana ↔ Ethereum transfers

🎯 Workshop Learning Objectives

Part 1: Chainlink Data Streams & Oracle (Harry)

  • Integrate real-time price feeds using Chainlink Data Streams SDK
  • Build Rust client for fetching and processing price reports
  • Implement Solana oracle program for on-chain price verification
  • Handle report compression, validation, and storage

Part 2: Stablecoin & Cross-Chain Integration (Jae)

  • Build oracle-backed stablecoin with collateral management
  • Implement Cross-Program Invocation (CPI) between programs
  • Configure SPL Token multisig for authority management
  • Set up CCIP for cross-chain token transfers
  • Deploy and configure Ethereum side components

πŸ“š Documentation

Each component includes comprehensive documentation:

πŸŽ‰ Workshop Outcomes

By completing this workshop, you will have:

βœ… Built a datastreams-backed stablecoin system
βœ… Implemented multisig authority management
βœ… Configured cross-chain transfers via CCIP
βœ… Deployed to both Solana and Ethereum networks

πŸ”— Resources

About

Superteam Korea Solana workshop

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published