harb/onchain/script
openhands 297442083d fix: AttackRunner review findings — TVL accuracy, recenter capture, discovery ethValue
- **Bug**: `_positionEthValue` now sums both the ETH component and the KRK component
  (converted to ETH via `FullMath.mulDiv` at current sqrtPriceX96) so `lm_eth_total`
  correctly reflects LM TVL for all price ranges (below/in/above range).

- **Bug**: `recenter()` return value (`bool isUp` — price direction) is now captured in
  `_lastRecenterIsUp` state variable and emitted as `"recenter_is_up"` in every snapshot.
  Note: `recenter()` reverts on failure; `false` means price moved *down*, not a no-op.

- **Bug**: Discovery position now emits `"ethValue"` in its snapshot JSON object,
  matching the floor and anchor fields for symmetric automated parsing.

- **Warning**: `IStake.snatch` interface parameter renamed `taxRateIndex` → `taxRate` to
  match the actual `Stake.sol` signature (the value is a raw rate, not a lookup index).

- **Warning**: Unknown op codes in the JSONL file now emit a `console.log` warning
  instead of silently skipping, catching typos in attack sequences.

- **Nit**: `_setup()` now wraps 9 000 ETH (up from 1 000) to cover heavy buy sequences
  that would otherwise exhaust the adversary's WETH.

- **Nit**: `_computeVwapTick` documents the int128 overflow guard and its tick=0 sentinel
  meaning so callers can distinguish "VWAP unavailable" from tick zero.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 17:14:34 +00:00
..
backtesting fix: AttackRunner review findings — TVL accuracy, recenter capture, discovery ethValue 2026-03-11 17:14:34 +00:00
BaseDeploy.sol Complete project rename from HARB/Harberg to KRAIKEN with KRK token symbol 2025-07-11 13:47:42 +02:00
DeployBase.sol fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams 2026-02-26 19:37:12 +00:00
DeployBaseMainnet.sol fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams 2026-02-26 19:37:12 +00:00
DeployBaseSepolia.sol Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
DeployLocal.sol fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams 2026-02-26 19:37:12 +00:00
UpgradeOptimizer.sol fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams 2026-02-26 19:37:12 +00:00