-
Notifications
You must be signed in to change notification settings - Fork 0
IKESI21/swap-smartContract
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# 🔄 Token Swap Program A Solana program demonstrating atomic token swaps using PDAs (Program Derived Addresses) and the Token 2022 Program. ## ✨ Overview This program enables users to: 1. 💫 Make token swap offers by: - Specifying the amount of token A they want to offer - Specifying the amount of token B they want in return - Depositing token A into a PDA-controlled vault 2. 🤝 Take existing offers by: - Paying the requested amount of token B to the offer maker - Receiving the offered token A from the vault The swap is atomic - either both transfers happen or neither does. 🔒 ## 🚀 Key Features - ⚡️ Supports both Legacy Token Program and Token 2022 Program - 🛡️ Uses PDAs for secure token custody - ✅ Fully tested with comprehensive test suite - 🔐 Implements proper account validation and security checks ## 🏗️ Program Architecture The program consists of two main instructions: ### 📤 Make Offer - Creates an offer account storing the trade details - Initializes a token vault controlled by the offer PDA - Transfers offered tokens from maker to vault ### 📥 Take Offer - Validates the offer terms - Transfers wanted tokens from taker to maker - Transfers offered tokens from vault to taker - Closes the offer account and vault ## 💻 Development ### Prerequisites - 🦀 Rust and Cargo - ☀️ Solana Tool Suite - ⚓️ Anchor Framework ### Building
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published