# GitHub Pages Setup Instructions for MetaMask Token List

**Date**: $(date)  
**Repository**: [Defi-Oracle-Meta-Blockchain/metamask-integration](https://github.com/Defi-Oracle-Meta-Blockchain/metamask-integration)

---

## 🎯 Goal

Enable GitHub Pages to host the MetaMask token list at a public URL so users can automatically discover tokens.

---

## 📋 Step-by-Step Instructions

### Step 1: Navigate to Repository Settings

1. Go to: https://github.com/Defi-Oracle-Meta-Blockchain/metamask-integration
2. Click **Settings** (top right of repository)
3. In left sidebar, click **Pages**

### Step 2: Configure GitHub Pages

**Under "Build and deployment"**:

1. **Source** section:
   - **Branch**: Select `main`
   - **Folder**: Select `/ (root)` ✅ **Recommended**
   - Click **Save**

2. **Visibility** (if available):
   - Public (default) - Recommended for token list
   - Private (Enterprise only) - If you need restricted access

### Step 3: Wait for Deployment

- GitHub Pages will build and deploy automatically
- Check the **Actions** tab to see deployment status
- Typically takes 1-2 minutes
- Green checkmark = Success ✅

### Step 4: Verify Token List URL

After deployment, your token list will be available at:

```
https://defi-oracle-meta-blockchain.github.io/metamask-integration/config/token-list.json
```

**Test it**:
```bash
curl https://defi-oracle-meta-blockchain.github.io/metamask-integration/config/token-list.json
```

Should return the JSON token list.

---

## ✅ What Happens After Setup

### Automatic Token Discovery

Once GitHub Pages is enabled, users can:

1. **Add Token List to MetaMask**:
   - Settings → Security & Privacy → Token Lists
   - Add custom token list
   - Enter: `https://defi-oracle-meta-blockchain.github.io/metamask-integration/config/token-list.json`
   - Click Add

2. **Tokens Automatically Imported**:
   - WETH9
   - WETH10
   - ETH/USD Price Feed

3. **Automatic Updates**:
   - When you update the token list and push to GitHub
   - GitHub Pages automatically rebuilds
   - Users get updated token list automatically

---

## 🔧 Alternative: Use /docs Folder

If you prefer to use the `/docs` folder:

1. **Move token list** (optional):
   ```bash
   # In repository
   mkdir -p docs/config
   cp config/token-list.json docs/config/
   git add docs/config/token-list.json
   git commit -m "Move token list to docs for GitHub Pages"
   git push
   ```

2. **Configure Pages**:
   - Branch: `main`
   - Folder: `/docs`

3. **URL** (same):
   ```
   https://defi-oracle-meta-blockchain.github.io/metamask-integration/config/token-list.json
   ```

---

## 📊 Current Token List Structure

**Location**: `config/token-list.json`

**Contents**:
- 3 tokens (WETH9, WETH10, Oracle)
- Correct decimals (18 for WETH, 8 for Oracle)
- Logo URLs (currently using Ethereum logo)

**Version**: 1.1.0

---

## 🔄 Updating the Token List

When you need to update the token list:

1. Edit `config/token-list.json`
2. Increment version number
3. Update timestamp
4. Commit and push:
   ```bash
   git add config/token-list.json
   git commit -m "Update token list v1.2.0"
   git push origin main
   ```
5. GitHub Pages automatically rebuilds (1-2 minutes)

---

## ✅ Verification Checklist

After enabling GitHub Pages:

- [ ] Pages enabled in repository settings
- [ ] Branch set to `main`
- [ ] Folder set to `/ (root)` or `/docs`
- [ ] Deployment successful (check Actions tab)
- [ ] Token list URL accessible via curl/browser
- [ ] JSON validates correctly
- [ ] Can add URL to MetaMask token lists
- [ ] Tokens appear in MetaMask after adding list

---

## 🎯 Expected Result

After setup, the token list will be:
- ✅ Publicly accessible via HTTPS
- ✅ Automatically discoverable in MetaMask
- ✅ Version controlled
- ✅ Automatically updated on changes
- ✅ CORS headers properly set (by GitHub Pages)

---

## 🔗 Related Documentation

- [GitHub Pages Setup Guide](../metamask-integration/docs/GITHUB_PAGES_SETUP.md)
- [Token List Hosting Guide](./METAMASK_TOKEN_LIST_HOSTING.md)
- [Quick Start Guide](/docs/01-getting-started/METAMASK_QUICK_START_GUIDE.md)

---

**Last Updated**: $(date)

