Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: OGC CI

on:
push:
branches: [ main, develop, ci-runner ]
pull_request:
branches: [ main, develop ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install pipx and AlgoKit
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install algokit==2.9.0
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Verify AlgoKit installation
run: algokit --version

- name: Start LocalNet
run: |
algokit localnet start
sleep 10 # Give LocalNet time to fully start

- name: Install Poetry
run: |
python -m pip install poetry==1.8.3
poetry --version

- name: Find project directory
id: find-project
run: |
# Find directory with pyproject.toml
PROJECT_DIR=$(find . -name "pyproject.toml" -type f | head -1 | xargs dirname)
if [ -z "$PROJECT_DIR" ]; then
echo "No pyproject.toml found, trying common patterns..."
for pattern in "*contracts*/projects/*" "*contracts*" "contracts" "."; do
if find $pattern -name "*.py" -path "*/smart_contracts/*" 2>/dev/null | head -1; then
PROJECT_DIR=$(find $pattern -name "*.py" -path "*/smart_contracts/*" 2>/dev/null | head -1 | xargs dirname | xargs dirname)
break
fi
done
fi
echo "PROJECT_DIR=$PROJECT_DIR" >> $GITHUB_OUTPUT
echo "Found project directory: $PROJECT_DIR"

- name: Install dependencies
working-directory: ${{ steps.find-project.outputs.PROJECT_DIR }}
run: |
if [ -f "pyproject.toml" ]; then
poetry install --no-interaction --no-root
else
echo "No pyproject.toml found, installing with pip"
pip install beaker-pyteal pyteal py-algorand-sdk algokit-utils python-dotenv setuptools
fi

- name: Build contracts
working-directory: ${{ steps.find-project.outputs.PROJECT_DIR }}
run: |
# Find and build any vault/contract files
for contract in *vault*.py *contract*.py; do
if [ -f "$contract" ]; then
echo "Building $contract..."
if [ -f "pyproject.toml" ]; then
poetry run python "$contract"
else
python "$contract"
fi
fi
done
# List any artifacts created
find . -name "artifacts" -type d -exec ls -la {} \; 2>/dev/null || echo "No artifacts directory found"

- name: Run tests
working-directory: ${{ steps.find-project.outputs.PROJECT_DIR }}
run: |
# Find and run test files
for test in test_*.py *_test.py; do
if [ -f "$test" ]; then
echo "Running $test..."
if [ -f "pyproject.toml" ]; then
poetry run python "$test"
else
python "$test"
fi
fi
done

- name: Run demos
working-directory: ${{ steps.find-project.outputs.PROJECT_DIR }}
run: |
# Find and run demo files
for demo in *demo*.py demo_*.py; do
if [ -f "$demo" ]; then
echo "Running $demo..."
if [ -f "pyproject.toml" ]; then
poetry run python "$demo"
else
python "$demo"
fi
fi
done

- name: Stop LocalNet
if: always()
run: algokit localnet stop
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.7
127 changes: 127 additions & 0 deletions DEMO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# OGC Demo Commands

## πŸ“ Where to Run Commands

**All commands must be run from:**
```bash
/Users/eltonbaidoo/OGC/ogc-contracts/projects/ogc-contracts/
```

## πŸš€ Quick Start

### 1. Navigate & Activate
```bash
cd ~/OGC/ogc-contracts/projects/ogc-contracts
source "$(poetry env info --path)/bin/activate"
python --version # Should show 3.13.x
```

### 2. Create OGC Token
```bash
python create_ogc_token.py
```
**Expected Output:**
```
πŸͺ™ Creating OGC Token...
βœ… OGC Token Created!
Asset ID: 1033
Total Supply: 1,000,000,000 OGC
Creator: VYXZFE4BGH...
```

### 3. Verify Token
```bash
python verify_token.py
```
**Expected Output:**
```
πŸ” Verifying OGC Token...
βœ… OGC Token Found!
Asset ID: 1033
Name: OGC Token
Unit: OGC
Total: 1,000,000,000
```

### 4. Demo ALGO Vault
```bash
python ogc_demo.py
```
**Expected Output:**
```
πŸš€ OGC - Out The Groupchat Demo
🎯 Goal: 2.0 ALGO
βœ… Fund Created: APP_ID 1036
πŸ’° Total: 1.5 ALGO
⏳ Need 0.5 more ALGO
```

### 5. Run Tests
```bash
python test_vault.py
```
**Expected Output:**
```
πŸ§ͺ Testing OGC Vault Basic Flow
βœ… Deployed: APP_ID 1037
βœ… Contribution test passed: 0.5 ALGO
🏁 Tests PASSED
```

## 🎯 One-Liner Commands

### Full Demo Sequence
```bash
cd ~/OGC/ogc-contracts/projects/ogc-contracts && source "$(poetry env info --path)/bin/activate" && python create_ogc_token.py && python verify_token.py && python ogc_demo.py
```

### Quick Token Demo
```bash
python create_ogc_token.py && python verify_token.py
```

### Quick Vault Demo
```bash
python ogc_demo.py && python test_vault.py
```

## πŸ› οΈ Makefile Commands

```bash
make demo # Run ogc_demo.py
make test # Run test_vault.py
make build # Build working_vault.py
make ci # Run full pipeline
```

## πŸ“Š What Each Command Does

| Command | Purpose | Output |
|---------|---------|---------|
| `create_ogc_token.py` | Mints OGC token on LocalNet | Asset ID number |
| `verify_token.py` | Confirms token exists | Token details |
| `ogc_demo.py` | Shows group funding scenario | ALGO vault demo |
| `test_vault.py` | Tests contract functions | Test results |
| `working_vault.py` | Builds smart contract | Artifacts created |

## 🎀 For Hackathon Presentation

**Run in this order:**
1. `python create_ogc_token.py` - "We minted OGC token"
2. `python verify_token.py` - "Token verified on Algorand"
3. `python ogc_demo.py` - "Group funding demo"
4. `python test_vault.py` - "All tests pass"

## πŸ”§ Troubleshooting

**If commands fail:**
```bash
# Check you're in right directory
pwd # Should show: /Users/eltonbaidoo/OGC/ogc-contracts/projects/ogc-contracts

# Check environment is active
which python # Should show venv path

# Reactivate if needed
source "$(poetry env info --path)/bin/activate"
```
62 changes: 62 additions & 0 deletions PROJECT_STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# OGC Project Status Overview

## βœ… What's Working

### Local Development
- ALGO vault contracts (working_vault.py)
- OGC token creation (1B tokens, 6 decimals)
- Full demo scripts (LocalNet)
- CI/CD pipeline (GitHub Actions)

### TestNet Ready
- Wallet format detection (Universal vs Legacy)
- Balance checking scripts
- ALGO sending scripts
- Contract deployment scripts
- Sender contract (can send ALGO to any wallet)

## 🎯 Your Current Setup

### Saved Legacy Wallet
- **Address**: `ZHMX3URT56ZLWQY3Y74CRXVOAVEOELOAVMXJZDT76IFORLPWMWMPJVAEN4`
- **Format**: 25-word mnemonic (Python SDK compatible)

### Available Scripts
- **Check formats**: `universal_wallet.py`
- **Check balances**: `check_any_balance.py`
- **Send ALGO**: `flexible_send.py`
- **Deploy contracts**: `deploy_sender.py`, `deploy_receiver.py`
- **Contract operations**: `send_from_contract.py`

## ❓ What We Need to Know

1. **Do you have contracts deployed?** (Need APP_IDs)
2. **Which wallet are you using?** (Universal 24-word or Legacy 25-word)
3. **What do you want to test?** (Send to contract, send from contract, check balances)

## πŸš€ Next Steps

**Tell me what you want to test and I'll guide you through it!**

## πŸ“ Project Structure

```
OGC/
β”œβ”€β”€ PROJECT_STATUS.md # This file
β”œβ”€β”€ SETUP.md # Development setup
β”œβ”€β”€ TANGIBLE_DEMO.md # Demo commands
└── ogc-contracts/projects/ogc-contracts/
β”œβ”€β”€ working_vault.py # Main ALGO vault
β”œβ”€β”€ create_ogc_token.py # Token creation
β”œβ”€β”€ full_demo.py # Complete demo
β”œβ”€β”€ universal_wallet.py # Wallet format handler
β”œβ”€β”€ flexible_send.py # ALGO sender
└── check_any_balance.py # Balance checker
```

## 🎯 Demo Ready

- **Local Demo**: Full ALGO vault + token creation working
- **TestNet Demo**: Scripts ready for live transactions
- **CI/CD**: Automated testing and building
- **Documentation**: Setup guides and command references
Loading
Loading