# Week 5 – Chaos & Integration Testing

#### Quest 1: Multi-Vault Mayhem (20 minutes)

**What you're doing:** Creating multiple vaults and using them simultaneously.

1. Create 5 different vaults (yes, 5!)

**Each with different configurations:**

* Vault 1: 3 guardians, 2/3 threshold
* Vault 2: 5 guardians, 3/5 threshold
* Vault 3: 10 guardians, 7/10 threshold
* Vault 4: 3 guardians, 1/3 threshold (auto-approval)
* Vault 5: 3 guardians, 3/3 threshold (maximum security)

3. Deposit different assets in each vault
4. Submit actions in multiple vaults at the same time
5. Switch between vaults rapidly
6. Try to confuse the system<br>

**Things to test:**

* Can you approve actions across vaults simultaneously?
* Does activity in Vault 1 affect Vault 2?
* Can the same guardian approve in multiple vaults?
* What happens if you submit the same action in multiple vaults?<br>

**✅ Quest Complete! You've stress-tested the multi-vault system.**

***

#### Quest 2: Edge Case Hunting (30 minutes)

**What you're doing:** Trying weird things to see what breaks.

**Try These:**

1. **Zero Amount Tests:**

* Try to deposit 0 tokens (should fail)
* Try to withdraw 0 tokens (should fail)
* Request transfer of 0 tokens (should fail)

2. **Empty Array Tests:**

* Try to deposit NFTs with empty selection (should fail)
* Try batch operation with nothing selected (should fail)

3. **Duplicate Tests:**

* Try to add same guardian twice (should fail)
* Try to deposit same NFT twice (should fail with "not owner")<br>

4. **Limit Tests:**

* Try to add 11 guardians (should fail, max is 10)
* Try to set threshold higher than guardian count (should fail)
* Try to deposit 6+ NFTs at once (check if it works or limits you)

5. **Timing Tests:**

* Submit action, immediately try to execute (should need approvals)
* Approve action, immediately disapprove (should fail - can't do both)

6. **Permission Tests:**

* Try to approve your own request (should fail)
* Try to use emergency withdrawal as guardian (should fail)
* Try to withdraw assets as non-owner (should fail)

**Document everything that:**

* ❌ Fails unexpectedly
* ❌ Gives confusing error messages
* ❌ Succeeds when it shouldn't
* ✅ Works correctly but could be clearer<br>

**✅ Quest Complete! You're a professional bug hunter.**

***

#### Quest 3: Gas Limit Testing (15 minutes)

**What you're doing:** Finding operations that use a lot of gas (transaction fees).

1. Test with 1 NFT: Deposit a single NFT, note gas used
2. Test with 2 NFTs: Deposit two NFTs, note gas used
3. Test with 3 NFTs: Note the pattern
4. Test with 5 NFTs: Check gas usage<br>
5. **Compare gas costs:**

* 5 separate transactions vs 1 batch transaction
* Which is more efficient?

6. **Test complex approvals:**

* Action with 3 guardians: note gas
* Same action with 10 guardians: note gas
* How much more expensive is high security?

**Report findings:**

* Which operations are most expensive?
* Are there ways to make them cheaper?
* Does batch really save gas?

<br>

**✅ Quest Complete! You understand gas efficiency.**

***

#### Quest 4: Mobile & Desktop Testing (20 minutes)

**What you're doing:** Testing the app on different devices and browsers.<br>

**Desktop Testing:**

1. Chrome: Do all Week 1-4 basic quests

* Does everything work?
* Are buttons clickable?
* Do modals display correctly?

2. Firefox: Repeat key actions

* Any visual differences?
* Any functionality broken?

3. Safari (if Mac): Test key flows

* Wallet connection works?
* Transactions confirm properly?

**Mobile Testing:**

4. Mobile Chrome (Android) or Safari (iOS):

* Can you connect wallet?
* Can you navigate the UI?
* Are buttons big enough to tap?
* Does text size work?
* Can you approve transactions in mobile wallet?

5. Test on tablet if available<br>

**Document:**

* Which device works best?
* Which has problems?
* Any layout issues?
* Any functionality that doesn't work on mobile?

✅ **Quest Complete! You've tested cross-platform.**

***

#### Quest 5: Transaction Failure Testing (15 minutes)

**What you're doing:** Testing what happens when transactions fail.

<br>

1. **Low gas test:**

* Set gas limit too low manually
* Submit transaction
* It will fail
* Does UI handle it gracefully?
* Can you retry?

2. **Reject transaction:**

* Start any action
* Click "Reject" in your wallet
* Does UI update correctly?
* Does it give helpful error message?

3. **Insufficient balance:**

* Try to withdraw more tokens than you have
* Should fail with clear message

4. **Network switch mid-transaction:**

* Start a transaction
* Switch networks in your wallet
* What happens?

5. **Disconnected wallet:**

* Start an action
* Disconnect wallet mid-process
* Does it detect this?
* Can you reconnect and continue?<br>

**✅ Quest Complete! You've tested error handling.**<br>

***

#### Quest 6: The Full Integration Test (30 minutes)

**What you're doing**: Complete end-to-end test of the entire system.

**The Complete Journey:**

1. ✅ Create vault with 5 guardians, 3/5 threshold
2. ✅ Mint all test assets
3. ✅ Deposit all 4 asset types
4. ✅ Submit withdrawal request
5. ✅ Get 3 guardian approvals
6. ✅ Execute withdrawal
7. ✅ Submit transfer to another address
8. ✅ Get guardian approvals
9. ✅ Execute transfer
10. ✅ Lock the vault
11. ✅ Verify deposits blocked
12. ✅ Request unlock
13. ✅ Get guardian approvals
14. ✅ Execute unlock
15. ✅ Initiate recovery (as guardian)
16. ✅ Get guardian approvals
17. ✅ Execute recovery
18. ✅ Verify new owner has control
19. ✅ Transfer vault ownership back via normal transfer
20. ✅ Withdraw remaining assets

**If you complete all 20 steps without errors: You've proven the system works end-to-end!**<br>

**Document any issues: Even small UX friction points matter.**

\
**✅ Quest Complete! You're a full-system expert.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.globalgold.finance/global-gold-1/product-mission-i-the-global-gold-vaults/week-5-chaos-and-integration-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
