Skip to content

Latest commit

 

History

History
262 lines (187 loc) · 6.81 KB

File metadata and controls

262 lines (187 loc) · 6.81 KB

Airdrop Button Usage Guide

What Happens When You Click "Get Test Tokens"

The button will try to mint tokens automatically. There are two possible outcomes:


✅ Scenario 1: You ARE the Mint Authority (Success)

When This Happens:

  • You created the BASE and QUOTE token mints
  • Your wallet is set as the mint authority
  • The button can mint tokens directly

What the Button Does:

  1. ✅ Creates your token accounts (ATAs) if they don't exist
  2. ✅ Mints 1,000 BASE tokens (with 9 decimals)
  3. ✅ Mints 10,000 QUOTE tokens (with 6 decimals)
  4. ✅ Shows success message
  5. ✅ Refreshes your balances in the header

Result:

✅ Successfully airdropped 1000 BASE and 10000 QUOTE tokens!

Perfect for demos! Just click and go.


⚠️ Scenario 2: You're NOT the Mint Authority (Most Common)

When This Happens:

  • Someone else created the tokens
  • You're using existing test tokens
  • Your wallet isn't the mint authority

What the Button Shows:

⚠️ You're not the mint authority. Use CLI commands below to get tokens.

📋 Step-by-step instructions:

1. Get SOL for fees:
   solana airdrop 2

2. Create token accounts (if needed):
   spl-token create-account DeRQ3edcNvwH8XjEVtFiqLN8uiABcojbyjxhcE5LLj8x
   spl-token create-account D3VykNoT3ne9Rkn6tSy7ssGvhSq3NGN7mWtqQss4jADM

3. Mint test tokens:
   spl-token mint DeRQ3edcNvwH8XjEVtFiqLN8uiABcojbyjxhcE5LLj8x 1000
   spl-token mint D3VykNoT3ne9Rkn6tSy7ssGvhSq3NGN7mWtqQss4jADM 10000

[View detailed guide →]

What You Need to Do:

  1. Copy the commands from the yellow box
  2. Open your terminal
  3. Paste and run each command
  4. Come back to the app
  5. Your balances will update automatically

Note: The mint commands will only work if you're the mint authority or if the tokens have no freeze/mint authority (open minting).


🎯 For Your Demo: Recommended Setup

Option A: Create Your Own Test Tokens (Best for Demos)

Before your demo, create tokens where YOU are the mint authority:

# 1. Switch to devnet
solana config set --url devnet

# 2. Airdrop some SOL
solana airdrop 2

# 3. Create BASE token (9 decimals)
spl-token create-token --decimals 9
# Save this address as BASE_MINT

# 4. Create QUOTE token (6 decimals)
spl-token create-token --decimals 6
# Save this address as QUOTE_MINT

# 5. Create a market with these tokens
# Use your app's "Create Market" page

Now the button will work! You're the mint authority.

Option B: Use Existing Tokens

If you want to use the existing tokens (DeRQ3... and D3VykN...):

  1. Click the "Get Test Tokens" button
  2. Copy the commands it shows
  3. Run them in terminal
  4. You're good to go!

🚀 Demo Flow Examples

Fast Demo (You're Mint Authority):

You: "Let me show you how easy it is to get started"
Action: Click "Get Test Tokens"
Result: Instant success! Tokens appear
You: "And now I can trade immediately"
Impact: 😲 Wow, that was smooth!

Standard Demo (Not Mint Authority):

You: "The app helps guide users to get test tokens"
Action: Click "Get Test Tokens"
Result: Shows step-by-step CLI commands
You: "It provides copy-paste ready commands"
You: "And links to the full documentation"
Impact: 👍 Good UX, helpful guidance


🔧 Troubleshooting

Error: "Simulation failed"

Cause: You're not the mint authority
Fix: Use the CLI commands shown in the yellow box

Error: "User rejected the request"

Cause: You clicked "Reject" in your wallet
Fix: Click the button again and approve the transaction

Error: "Insufficient SOL"

Cause: You don't have SOL for transaction fees
Fix: Run solana airdrop 2 first

Tokens Don't Appear After Running Commands

Cause: Commands worked but UI hasn't refreshed
Fix: Click the refresh button (🔄) next to your balances in the header

Commands Say "Error: Account not found"

Cause: You might be on wrong network (mainnet vs devnet)
Fix: Run solana config set --url devnet


📝 Current Token Addresses (Devnet)

From your deployment:

BASE Token (9 decimals):

DeRQ3edcNvwH8XjEVtFiqLN8uiABcojbyjxhcE5LLj8x

QUOTE Token (6 decimals):

D3VykNoT3ne9Rkn6tSy7ssGvhSq3NGN7mWtqQss4jADM

To use these:

# Create accounts
spl-token create-account DeRQ3edcNvwH8XjEVtFiqLN8uiABcojbyjxhcE5LLj8x
spl-token create-account D3VykNoT3ne9Rkn6tSy7ssGvhSq3NGN7mWtqQss4jADM

# Mint tokens (only works if you're the authority)
spl-token mint DeRQ3edcNvwH8XjEVtFiqLN8uiABcojbyjxhcE5LLj8x 1000
spl-token mint D3VykNoT3ne9Rkn6tSy7ssGvhSq3NGN7mWtqQss4jADM 10000

🎬 Before Your Next Demo

Recommended Pre-Demo Checklist:

  1. Create fresh test tokens where you're the authority

    spl-token create-token --decimals 9  # BASE
    spl-token create-token --decimals 6  # QUOTE
  2. Update your constants.ts with new addresses (optional)

    export const BASE_MINT = new PublicKey("YOUR_NEW_BASE_MINT");
    export const QUOTE_MINT = new PublicKey("YOUR_NEW_QUOTE_MINT");
  3. Create a market with your new tokens

    • Use the "Create Market" page in your app
  4. Test the airdrop button

    • Should work instantly since you're the authority
  5. Create 2-3 demo wallets and fund them

    # For each demo wallet
    solana-keygen new -o demo-wallet-1.json
    # Import to Phantom
    # Click airdrop button

Now you have instant token claiming for smooth demos!


💡 Pro Tips

For CEO/Investor Demos:

  • ✅ Use tokens where you're the mint authority
  • ✅ Pre-fund a demo wallet before the meeting
  • ✅ Have backup wallet ready if something goes wrong
  • ✅ Show the CLI commands as a "fallback feature"

For Developer Showcases:

  • ✅ Show both scenarios (authority vs no authority)
  • ✅ Explain why mint authority matters
  • ✅ Show the helpful error messages
  • ✅ Demonstrate the CLI guide integration

For User Testing:

  • ✅ Most users won't be mint authority
  • ✅ The CLI commands should be clear
  • ✅ Consider adding a "Copy" button in future
  • ✅ Link to airdrop guide is crucial

🔮 Future Enhancements (Optional)

  1. Backend Faucet Service:

    • Users don't need mint authority
    • You control distribution
    • Rate limiting per wallet
    • Better for public demos
  2. Copy Button:

    • One-click copy for each command
    • Less error-prone than manual copy
  3. Video Tutorial:

    • Embedded walkthrough
    • Shows terminal usage
    • Helps non-technical users
  4. Token Request Form:

    • Users submit their wallet
    • You approve and send tokens
    • Good for controlled demos

Bottom Line:

The button works perfectly if you're the mint authority (instant tokens). If not, it shows helpful CLI commands with full token addresses. Either way, users get clear guidance on how to proceed!