# Known Issues and Mitigations

## Overview

This document lists known issues, limitations, and their mitigations. These have been identified during internal review and are documented for transparency.

---

## Critical Issues

*No unmitigated critical issues.*

---

## High Severity Issues

### H-1: Centralized Oracle Trust

**Description:** The reputation system relies on a centralized oracle for score updates and challenge resolution.

**Impact:** A compromised or malicious oracle could:
- Unfairly increase/decrease reputation scores
- Wrongly slash user stakes
- Resolve challenges incorrectly

**Current Mitigation:**
- Oracle is operated by the platform team
- All actions are logged on-chain
- Challenge system allows disputes

**Future Mitigation:**
- Multi-oracle implementation planned
- DAO governance for oracle selection
- Reputation bounds limit single updates

**Status:** Accepted with mitigations

---

## Medium Severity Issues

### M-1: Off-Chain Transfer Royalty Evasion

**Description:** Royalties can only be enforced on authorized marketplace sales. Direct wallet-to-wallet transfers bypass royalty payments.

**Impact:** Creators may lose royalty revenue on off-chain deals.

**Current Mitigation:**
- On-chain enforcement for marketplace sales
- ERC-2981 standard for royalty signaling
- Marketplace authorization system

**Future Mitigation:**
- Industry-wide solution needed
- NFT royalty enforcement EIPs in development

**Status:** Industry-wide limitation, mitigated where possible

---

### M-2: Upgrade Centralization

**Description:** Contract upgrades are controlled by a single owner address (multi-sig).

**Impact:** Multi-sig compromise could lead to malicious upgrades.

**Current Mitigation:**
- 3/5 multi-sig requirement
- 72-hour timelock on upgrades
- On-chain monitoring for scheduled upgrades
- Cancel capability during delay

**Future Mitigation:**
- DAO governance for upgrades
- Additional timelock signers

**Status:** Mitigated by timelock, monitoring planned

---

### M-3: Gas Griefing on Pull Payments

**Description:** A malicious contract could consume excessive gas in receive() when claiming payments.

**Impact:** Legitimate users might face higher gas costs.

**Current Mitigation:**
- Gas limits on external calls
- Pull pattern means users control timing

**Status:** Low impact, mitigated

---

### M-4: Sybil Resistance Limited

**Description:** Users can create multiple identities by using different addresses.

**Impact:** Reputation gaming through multiple accounts.

**Current Mitigation:**
- Minimum stake requirement (0.01 ETH) per identity
- Economic cost for Sybil attacks
- Slashing for detected gaming

**Future Mitigation:**
- Soul-bound identity exploration
- KYC integration option

**Status:** Partially mitigated

---

## Low Severity Issues

### L-1: Block Timestamp Dependency

**Description:** Some operations use `block.timestamp` for timing.

**Impact:** Miners have ~15 second manipulation window.

**Current Mitigation:**
- No critical timing-dependent operations
- Timelock uses minimum delays, not exact

**Status:** Low impact, acceptable

---

### L-2: Event Emission After State Change

**Description:** Some events are emitted after state changes rather than before.

**Impact:** Indexers might see inconsistent state during reorgs.

**Current Mitigation:**
- Standard event emission pattern
- Wait for confirmations before indexing

**Status:** Standard practice, acceptable

---

### L-3: No Withdrawal Deadline

**Description:** Pending royalties have no expiration date.

**Impact:** Funds may remain unclaimed indefinitely.

**Current Mitigation:**
- Users can claim at any time
- No lock-up periods

**Future Mitigation:**
- Consider timeout with treasury fallback

**Status:** Design choice, monitoring recommended

---

### L-4: Single Token Price

**Description:** Each access token has a single fixed price.

**Impact:** No dynamic pricing based on demand.

**Current Mitigation:**
- Creators can create new tokens with different prices
- Token price is transparent

**Status:** Design choice, not an issue

---

## Informational Issues

### I-1: Gas Optimization Opportunities

**Description:** Several gas optimizations are possible:
- Unchecked arithmetic in loops
- Storage variable caching
- Shorter error messages

**Impact:** Higher gas costs for users.

**Current Status:** Security prioritized over optimization.

**Future Plan:** Optimize after security audit.

---

### I-2: Limited Batch Sizes

**Description:** Batch operations are limited to prevent exceeding block gas limit.

**Impact:** Large operations require multiple transactions.

**Current Mitigation:**
- Reasonable limits set (100 for mints)
- Multiple transactions supported

**Status:** Design limitation, acceptable

---

### I-3: No Upgradability Pause

**Description:** Upgrades cannot be paused separately from contract pause.

**Impact:** Pausing affects all operations, not just upgrades.

**Current Mitigation:**
- Timelock provides 72h review window
- Separate pause for regular operations

**Status:** Acceptable design

---

## Resolved Issues

### R-1: Reentrancy in Withdrawal (Resolved)

**Original Issue:** Withdrawal function was vulnerable to reentrancy.

**Resolution:** Added ReentrancyGuard and CEI pattern.

**Commit:** [reference to fix commit]

---

### R-2: Missing Access Control (Resolved)

**Original Issue:** Some admin functions lacked proper access control.

**Resolution:** Added Ownable2Step and role-based modifiers.

**Commit:** [reference to fix commit]

---

### R-3: Flash Loan Vulnerability (Resolved)

**Original Issue:** Critical operations could be exploited via flash loans.

**Resolution:** Implemented FlashLoanGuard with block-based protection.

**Commit:** [reference to fix commit]

---

### R-4: Direct ETH Transfers (Resolved)

**Original Issue:** Direct ETH transfers to user addresses could fail.

**Resolution:** Implemented pull payment pattern for all withdrawals.

**Commit:** [reference to fix commit]

---

## Issue Tracking

| ID | Severity | Status | Target |
|----|----------|--------|--------|
| H-1 | High | Accepted | Post-launch |
| M-1 | Medium | Accepted | Industry solution |
| M-2 | Medium | Mitigated | Q2 2025 |
| M-3 | Medium | Mitigated | - |
| M-4 | Medium | Partial | Q3 2025 |
| L-1 | Low | Accepted | - |
| L-2 | Low | Accepted | - |
| L-3 | Low | Monitoring | Q1 2025 |
| L-4 | Low | Design | - |

---

## Reporting New Issues

During audit, please report issues via:
1. Secure document in shared folder
2. Severity classification (Critical/High/Medium/Low/Info)
3. Proof of concept if applicable
4. Recommended fix

We will:
1. Acknowledge within 4 hours
2. Triage within 24 hours
3. Provide fix timeline within 48 hours
