https://github.com/ap211unitech/solana-escrow
Secure Token Swaps, No Middlemen. Powered by Solana.
https://github.com/ap211unitech/solana-escrow
anchor rust solana spl-token
Last synced: about 2 months ago
JSON representation
Secure Token Swaps, No Middlemen. Powered by Solana.
- Host: GitHub
- URL: https://github.com/ap211unitech/solana-escrow
- Owner: ap211unitech
- License: mit
- Created: 2025-08-18T17:26:27.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-08-19T04:29:25.000Z (11 months ago)
- Last Synced: 2025-10-22T01:33:00.364Z (9 months ago)
- Topics: anchor, rust, solana, spl-token
- Language: Rust
- Homepage:
- Size: 101 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🔄 Solana Escrow App
The **Escrow App** is a Solana smart contract built using [Anchor](https://www.anchor-lang.com/) that allows users to securely exchange SPL tokens in a trustless way.
Each offer is backed by a **dedicated vault account**, ensuring tokens are locked until the offer is either taken by another user or canceled by the maker, ensuring fairness and eliminating counterparty risk.
---
## 📜 Overview
The program supports:
- **Make Offer**:
A user (maker) creates an offer by locking a specified amount of `Token A` in a vault, while specifying how much `Token B` they expect in return.
- **Take Offer**:
Another user (taker) accepts an existing offer by sending the required `Token B` amount to the maker. In return, the taker receives the locked `Token A` from the vault.
- **Cancel Offer**:
The maker can cancel their offer before it's taken, retrieving their locked tokens from the vault and closing appropriate accounts.
## ⚙️ Program Structure
```plaintext
src/
├─ instructions/ # Business logic for each instruction
├─ states/ # Account data structures for offer
├─ constants.rs
├─ utils.rs
└─ lib.rs # Program entry point
```
## 🛠️ Building & Deploying
### 1. Install Prerequisites
- Solana CLI
- Anchor CLI
- Rust (latest stable)
- Quick setup (https://solana.com/docs/intro/installation)
### 2. Clone Repository
```
git clone https://github.com/ap211unitech/solana-escrow.git
cd solana-escrow
```
### 3. Build Program
```
anchor build
```
### 4. Running Tests
```
solana-test-validator (keep it running in a seperate terminal)
```
and
```
anchor test --skip-local-validator
```
## 📄 License
MIT License © 2025 Arjun Porwal