{"item":"stable-gas-starvation","commit":"ff1c192b3798542997f600091f2dc73ff05e4c40","forge":"1.8.3 (older than 1.9: no --use solar; per brief, reasoned from the code, no tests run)","verdict":"holds",
"findings":[],
"claims":[
{"id":"C1","result":"holds","evidence":"src/peg/StableModule.sol:768 reads g=gasleft() inside _pull right before the try-call, so outer depth (router, applyPending, harvest, recover) is irrelevant: the 1/64 kept by outer frames is already gone from g. With g>=5.25M the adapter gets ~63/64*g ~5.168M; heavy work two levels down (adapter->vault) needs W*(64/63)^2, three behind a proxy W*(64/63)^3 ~5.055M for W=4.9M, under 5.168M. Call-depth 1024 cannot be reached with >=5.25M left (needs ~(64/63)^1000 x gas). recover (433-441) has no catch: a starved withdraw reverts. No starving depth found for <=3 nested levels. Residual (info, not a property break at the stated rule): a vault whose 4.9M is spent 4+ levels deep needs 4.9M*(64/63)^4~5.218M>5.168M; the README:645 governance rule measures gas at the adapter, which does not bound nesting depth. NOT tested (forge 1.8.3)."},
{"id":"C2","result":"not-checked","evidence":"[fork] NOT RUN: no mainnet RPC used; forge 1.8.3."},
{"id":"C3","result":"holds","evidence":"A vault burning all gas in withdraw: _pull catches, g>=PULL_GAS, probe+share cut to 0 (777-789); views burning gas read unreadable (614); rebalance reverts Impaired when !readable (337); recover's uncaught withdraw reverts (440). Only abandonVault (418) drops it. Matches README:645 as written."},
{"id":"C4","result":"holds","evidence":"_view (611-617): ok := and(ok, gt(returndatasize(),31)) so <32 bytes or no code reads ok=false; _snap (599-605) then sets vault=0 via readable=false (not a 0 answer used as readable); _harvest (804-805) needs ok. Scratch memory 0..0x20 only, memory-safe."},
{"id":"C5","result":"holds","evidence":"Invariant: every catch of a vault call that continues either (a) writes nothing (views in _snap/_harvest: unreadable => no clock move, rebalance reverts Impaired, mint reverts Impaired, redeem only reprices at feeMax on idle) or (b) writes a refusal only when gasleft() measured in the SAME frame immediately before the call >= PULL_GAS (_pull 768,773). Routes catching vault failure: _pull (redeem 248, redeem frozen 284, rebalance 358) and _view (_snap, _harvest). Smaller replacement: forward an explicit gas amount (call{gas:PULL_GAS}) and require gasleft()>PULL_GAS*64/63+margin before, so the stipend is exact rather than 63/64-derived."}
],
"holds":[
{"property":"P1","tried":"Code reading of every _pull caller (redeem 248/284, rebalance 358) and recover 440: g is local to _pull, refusal writes (yieldBps=0, _clear, _report) are after `if (g < PULL_GAS) revert PullGas()` (773). Starved views before the pull set vaultLiquid=0 so no pull is attempted (redeem 240). Depth-limit route infeasible under EIP-150. No test run (forge 1.8.3 < 1.9)."},
{"property":"P2","tried":"_view uses staticcall(VIEW_GAS,...) (614): a burning view costs <=1M per read (redeem does <=4 reads); unreadable => vault counted 0, idle still served (liquidWad uses s.idle, 253) at feeMax since short=true. _harvest moves harvestedAt only if ok && v>b (805-806). A caller-starved view (gasleft<VIEW_GAS) reads unreadable but writes nothing durable: redeem reprices only the caller's own exit; rebalance/mint revert. No test run."}
],
"notRun":["C2 fork measurement (no RPC)","all Foundry tests: installed forge 1.8.3 lacks --use solar (brief requires 1.9+ else reason from code)"]}
