# Week 3 – Advanced Operations

### Quest 1: Transfer NFTs to Another Address (15 minutes)

**What you're doing:** Sending NFTs from your vault directly to another address (not withdrawing to yourself).

**The Scenario:** You want to send 1 NFT to a friend's address, but it needs to stay protected by guardians.

#### Understanding NFT Transfer vs Withdrawal

* **Withdrawal** = NFT goes back to the vault owner (you)
* **Transfer** = NFT goes to anyone you specify (friend, another wallet, etc.)
* **Both require guardian approval** for security
* **Note:** You already learned token transfers in Week 2 - now you're doing NFTs!

#### Step 1: Request the NFT Transfer

1. Go to your vault dashboard
2. Navigate to the **NFTs** page:
   * Click the "NFTs" tab in the bottom navigation, OR
   * Go to `/[vaultId]/nfts` in your browser
3. Make sure you have at least 1 NFT deposited in your vault
4. Click the **"Transfer"** button (in the bottom action bar)
5. **Step 1: Select NFT to Transfer**
   * Choose the NFT collection (Test NFT or Test Collectible)
   * Select 1 NFT from your vault (click on it)
   * Click **"Continue"** button at the bottom
6. **Step 2: Enter Recipient Address**
   * Enter your friend's wallet address (or another address you control for testing)
   * Make sure the address is valid (starts with 0x, 42 characters)
   * Click **"Continue"** button at the bottom
7. **Step 3: Review & Confirm Transfer**
   * Check all the details:
     * NFT: \[collection name] # \[token ID]
     * Recipient: \[the address you entered]
   * Click "Confirm Transfer"
   * You'll see "Creating Transfer Request..."
8. Success! - "Transfer Request Created!" message appears
9. Status shows: "Pending Guardian Approval" - this is normal!

#### Step 2: Approve as Guardians

1. Switch to your Guardian 1 wallet
2. Go to the vault dashboard (same vault)
3. Look at the **"Pending Transactions"** tab (should be selected by default)
4. You'll see the NFT transfer request in the list
5. Review the details (you can click "Details" to see full info)
6. Click the **"Approve"** button on the transaction
7. Confirm the transaction in your wallet
8. Status updates: "Pending (1/2)" or "Approval (1/2)"
9. Switch to your Guardian 2 wallet
10. Go to the vault dashboard
11. Click the **"Pending Transactions"** tab
12. Click **"Approve"** on the same NFT transfer request
13. Confirm the transaction
14. Status updates: "Pending (2/2)" or "Approval (2/2)" - **Transaction executes automatically!**

#### Step 3: Verify Transfer Completed

1. Switch back to your main wallet
2. Go to the vault dashboard
3. Click the **"History"** tab to see completed transactions
4. Find your NFT transfer - status should show **"Success"** or **"Confirmed"**
5. Check the recipient address on BaseScan:
   * Go to basescan.org
   * Paste the recipient address
   * Go to the "NFTs" tab
   * You should see the NFT in their collection!

#### What you learned

* NFT transfers work just like token transfers
* You can send NFTs to any address you specify
* Transfer requires guardian approval (same as withdrawal)
* The final guardian approval automatically executes the transfer
* This is useful for gifting NFTs or sending them to another wallet

✅ **Quest Complete!** You can now send NFTs to others securely.

***

### Quest 2: Batch Operations (Multiple NFTs at Once) (15 minutes)

**What you're doing:** Depositing and withdrawing multiple NFTs in a single transaction to save gas fees.

#### Step 1: Get More NFTs

**Important:** The Multiminter is on the home page. To access it:

1. **Navigate to the home page:**
   * Click the Global Gold logo in the top-left corner (if it's a link), OR
   * Manually navigate to `/` in your browser, OR
   * Use your browser's back button to return to the home page
2. **Once on the home page:**
   * Find the Multiminter section (usually near the top)
   * Click "Mint All" **multiple times** (3-5 times)
   * Each mint gives you 1 more NFT
   * You'll get multiple token IDs
3. **Check your wallet** - you should see multiple NFTs of the same collection

**Note:** If you created your vault before the Multiminter was added, you may need to navigate back to the home page manually using your browser's address bar (`/`).

#### Step 2: Batch Deposit

1. Go to your vault dashboard
2. Click the **"Deposit"** button (white button in the action bar)
3. Select the NFT collection (Test NFT or Test Collectible) from the dropdown
4. You'll see a list of NFTs you own from that collection
5. **Select 3 NFTs** (click checkboxes or click on them)
6. Click **"Continue"** button
7. Review the deposit details
8. Click **"Confirm Deposit"** or **"Deposit"** button
9. Approve the transaction in your wallet
10. **All 3 NFTs move to your vault in ONE transaction!**

#### Step 3: Batch Withdrawal

1. Go to your vault dashboard
2. Click the **"Withdraw"** button (outlined button in the action bar)
3. Select the NFT collection (Test NFT or Test Collectible) from the dropdown
4. You'll see NFTs currently in your vault from that collection
5. **Select 3 NFTs** (click checkboxes or click on them)
6. Click **"Continue"** button
7. Review the withdrawal details
8. Click **"Confirm Withdrawal"** or **"Request Withdrawal"** button
9. This creates a **guardian-protected withdrawal request**
10. Switch to your guardian wallets
11. Go to the vault dashboard and click **"Pending Transactions"** tab
12. Click **"Approve"** on the withdrawal request (repeat for each guardian)
13. **Once threshold is met, the withdrawal automatically executes**
14. All 3 NFTs come out at once!

#### What happened differently

* Much faster than withdrawing one at a time
* Saves gas fees

✅ **Quest Complete!** You're saving gas with batch operations.

***

### Quest 3: Test Token Balance Checker (5 minutes)

**What you're doing:** Using the balance checker to see everything in your vault.

1. Go to your vault dashboard
2. Look at the overview cards:
   * **Tokens card** (left): Shows total token value in USD
   * **NFTs card** (right): Shows total NFT count and preview thumbnails
3. **View detailed balances:**
   * Click the arrow icon on the Tokens card to go to `/[vaultId]/tokens` page
   * Or click the NFTs card to go to `/[vaultId]/nfts` page
   * These pages show detailed lists of all your assets
4. **Compare to blockchain explorer:**
   * Copy your vault's contract address (shown on dashboard)
   * Go to BaseScan (basescan.org)
   * Paste the vault address
   * Check token holdings - should match your dashboard!
5. **Try depositing more tokens**
6. **Watch the balance update:**
   * Refresh the dashboard or click the refresh button
   * The token value and NFT count should update

#### What you learned

* You can audit your vault anytime
* Balances are queried directly from the blockchain
* The UI makes it easy to see everything in one place

✅ **Quest Complete!** You can track your vault inventory.

***

### Quest 4: Understanding the Transaction Queue (15 minutes)

**What you're doing:** Learning how multiple pending requests are managed and executed in order.

#### The Request Queue System

When you submit multiple requests, they're added to a queue and processed in order. Understanding this helps you manage your vault efficiently.

#### Test the Queue System

1. **Submit Multiple Requests:**

   * Request 1: Withdraw 50 Token A
   * Request 2: Transfer 30 Token B to another address
   * Request 3: Withdraw 1 NFT

   All three requests are now **pending** in the queue!
2. **View Your Pending Requests:**
   * Go to your vault dashboard
   * Look at the transaction section (middle-right panel)
   * Click the **"Pending Transactions"** tab (it's the default tab, so it may already be selected)
   * You should see all 3 requests listed
3. **Understand the Queue Order:**
   * Requests are listed in order (oldest first)
   * They execute in order: first submitted = first executed (FIFO)
   * The first request must complete before the second can execute
   * You can see the blockchain request ID in the transaction list (if available)
4. **Approve Requests:**
   * Start with Request #1 (withdraw Token A)
   * Get Guardian 1 approval
   * Get Guardian 2 approval
   * **Request #1 executes** and tokens are withdrawn
5. **Now Request #2 Can Execute:**
   * Request #2 (transfer Token B) is now "next in queue"
   * Get guardian approvals for Request #2
   * **Request #2 executes** when threshold is met
6. **Finally Request #3:**
   * Request #3 (withdraw NFT) is now next
   * Get guardian approvals
   * **Request #3 executes**

#### Important Notes

* **Sequential Processing:** Requests execute one at a time, in order (FIFO - First In, First Out)
* **Queue Status:** You can see which request is "next" in the pending list (oldest pending request is first)
* **Emergency Exceptions:** Lock/unlock requests can execute out of order (emergency feature)
* **Blocking Transactions:** If a lock/unlock or threshold change is pending, you cannot submit NEW withdrawal/transfer requests (but existing pending requests will still execute)
* **7-Day Expiration:** Old requests expire after 7 days and are removed from queue

#### What You Learned

* Multiple requests can be pending at once
* They execute sequentially (first come, first served)
* You can see all pending requests in the dashboard
* Understanding the queue helps you plan your transactions

✅ **Quest Complete!** You understand how the transaction queue works.

***

### Quest 5: Transaction History Deep Dive (15 minutes)

**What you're doing:** Learning to read and understand your vault's transaction history and details.

#### Understanding Transaction Statuses

1. **Go to your vault dashboard**
2. **Look at the transaction section** - you'll see two tabs:
   * **"History"** tab (shows completed transactions)
   * **"Pending Transactions"** tab (shows pending requests)
3. **Click on the "History" tab** to see completed transactions
4. **Review different transaction statuses:**
   * **Pending** = Waiting for guardian approvals
   * **Approval** (or **Submitted**) = Submitted to blockchain, waiting for execution
   * **Success** (or **Confirmed** or **Executed**) = Successfully executed
   * **Failed** (or **Rejected**) = Transaction failed or was rejected

#### View Transaction Details

1. **Click on a Details link for a transaction** (deposit or withdrawal)
2. **Review the transaction details:**
   * Transaction hash (click to view on BaseScan)
   * Timestamp (when it was created/completed)
   * Action type (Deposit, Withdraw, Transfer, etc.)
   * Amount and token details
   * Guardian approvals
3. **Switch to the "Pending Transactions" tab** (if not already there)
4. **Click the "Details" link** on a pending transaction
5. **See the transaction details modal** showing:
   * Action type (e.g., "Transfer ERC721 NFT")
   * Status (e.g., "Pending" or "Approval")
   * Transaction hash (if available)
   * Created timestamp
   * For guardian transactions, you'll see approval status in the list (e.g., "Pending (1/2)")

#### Verify on Blockchain Explorer

1. **Find a completed transaction**
2. **Click the transaction hash** (or copy it)
3. **Open BaseScan** (basescan.org)
4. **Paste the transaction hash**
5. **Verify the details match:**
   * Token addresses match
   * Amounts match
   * Recipient addresses match
   * Status shows "Success"

#### What You Learned

* Transaction history shows everything that's happened in your vault
* You can verify all transactions on the blockchain explorer
* Pending transactions show approval progress and expiration timers
* Transaction details help you audit and track your vault activity

✅ **Quest Complete!** You can now audit and verify all vault transactions.

***

### Week 3 Tips

* **Remember:** The final guardian approval automatically executes
* **Batch operations** save gas - use them whenever you have multiple NFTs
* **NFT Transfer vs Withdrawal:** Transfer sends to any address, withdrawal sends back to you
* **Check balances** on both the UI and blockchain explorer to verify accuracy
* **Take screenshots** of your completed quests for your records

***

### Need Help?

**The approval never executes automatically?**

* Make sure the request is "next in queue" (not blocked by older pending requests)
* Lock/unlock requests can execute out of order as emergency features
* Check that you have enough guardian approvals to meet the threshold

**NFT transfer request not showing up?**

* Make sure you have NFTs deposited in your vault first
* Make sure you completed all 3 steps of the NFT transfer flow
* Check that the recipient address is valid (starts with 0x)
* Verify the transaction was submitted successfully

**Batch deposit isn't working?**

* Make sure you're selecting NFTs from the same collection
* Check that you own all the NFTs you're trying to deposit
* Verify you've approved the vault contract to transfer your NFTs

***

### Completion Reward

🎖️ **Master of Advanced Operations Badge**

* Efficient Gas User achievement
* Multi-Asset Manager title
