You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| MEDIUM | 3 | Acknowledged (hackathon-grade, acceptable) |
18
18
| LOW | 4 | Acknowledged |
19
19
| INFO | 5 | Acknowledged |
20
20
21
-
**Overall assessment:** The contracts are well-structured for a hackathon prototype. Three HIGH findings have been fixed (unchecked transferFrom, zero-address in createMarket, zero-address in mint). MEDIUM findings are acknowledged as acceptable for hackathon scope; production deployment would require additional hardening.
21
+
**Overall assessment:** The contracts are well-structured for a hackathon prototype. Five HIGH findings have been fixed (unchecked transferFrom, zero-address in createMarket, zero-address in mint, confidenceBp==0 no-op market, oracle revert on missing price). Invariant tests now exercise 99.8% of PredictionMarket code paths (previously 0% due to oracle bug). MEDIUM findings are acknowledged as acceptable for hackathon scope; production deployment would require additional hardening.
22
22
23
23
---
24
24
@@ -91,6 +91,34 @@ rewardPool += amount;
91
91
92
92
---
93
93
94
+
### H-5: `OwnerPriceOracle.getPrice()` reverts on missing price
`getPrice()` reverted with `PriceNotSet(assetKey)` when no price was set for an asset key, instead of returning `(0, 0)`. This broke the `PredictionMarket.resolve()` pattern where `exitPrice == 0` is checked after `getPrice()`. It also prevented invariant fuzzing of PredictionMarket because the handler's `_ensureOracle` called `getPrice()` to check existence, but the revert killed the call before the check.
101
+
102
+
**Remediation:** ✅ Fixed — removed the revert, now returns `(0, 0)` for unset prices. `exitPrice == 0` check in `PredictionMarket.resolve()` catches the missing price case correctly.
103
+
104
+
---
105
+
106
+
### H-6: Invariant tests were vacuously true (0% code coverage)
107
+
108
+
**File:**`test/PredictionMarket.invariant.t.sol`
109
+
**Impact:** False sense of security — 4 invariant tests passed without exercising any contract code
110
+
111
+
**Description:**
112
+
The PredictionMarket invariant handler had two bugs:
113
+
1. Used fuzzer-generated `agent` parameter (address with 0 tokens) instead of pre-funded agents
114
+
2.`_ensureOracle` called `oracle.getPrice()` which reverted on missing price (H-5)
115
+
116
+
Combined, these caused 100% of `createMarket` calls to revert. The `resolveMarket` and `settleMarket` handlers short-circuited (early return when `isCreated[traceHash]` is false), so all 4 invariant properties were vacuously true.
117
+
118
+
**Remediation:** ✅ Fixed — handler now uses pre-funded agents stored in constructor, and the oracle fix (H-5) allows `_ensureOracle` to check prices without revert. CreateMarket success rate is now 99.8%.
119
+
120
+
---
121
+
94
122
## MEDIUM
95
123
96
124
### M-1: Unbounded loop in `OwnerPriceOracle.setPrices`
0 commit comments