harb/onchain
johba b276392e7a chore: gardener housekeeping 2026-03-23
- Update all AGENTS.md watermarks to HEAD (224edcc)
- onchain/AGENTS.md: document VWAPTracker _hasRecenterTick guard (#609),
  overflow guard for slots 0-7 (#997), Floor Ratchet defeated (#1067),
  fee-income delta_bps audit trail (#1084)
- landing/AGENTS.md: document SecurityInfo.vue component (#147)

Issues actioned via API:
- Unblocked #1099, #1100, #1101 (all prereqs 1031/997/1067/1054 closed)
- Created #1134 bundled backlog: onchain source quality cleanup (4 dust items)
- Closed dust #601, #627, #739, #741 → bundled into #1134
2026-03-23 07:04:19 +00:00
..
.claude chore: analysis tooling, research artifacts, and code quality 2026-02-13 18:22:03 +00:00
.github/workflows chore: forge init 2024-03-12 10:00:53 +01:00
.husky Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
analysis fix: onchain/analysis/PARAMETER_SEARCH_RESULTS.md shows stale unconditional pseudocode (#893) 2026-03-17 09:47:37 +00:00
lib feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
script fix: Fee-income calculation model needs documentation to make delta_bps auditable (#1084) 2026-03-23 03:23:23 +00:00
src fix: _isPriceStable fallback interval can still revert on pools with very short history (#610) 2026-03-22 20:31:04 +00:00
test fix: _isPriceStable fallback interval can still revert on pools with very short history (#610) 2026-03-22 20:31:04 +00:00
.claude-code-supervisor.yml fix: refactor AGENTS.md into progressive-disclosure structure (#184) 2026-02-23 09:46:35 +00:00
.gas-snapshot chore: analysis tooling, research artifacts, and code quality 2026-02-13 18:22:03 +00:00
.gitignore fix: Details (#205) 2026-02-24 18:01:53 +00:00
.lintstagedrc.json Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
.secret.local start stack from container (#40) 2025-10-02 17:11:22 +02:00
.solhint.json Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
.solhintignore Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
AGENTS.md chore: gardener housekeeping 2026-03-23 2026-03-23 07:04:19 +00:00
foundry.toml fix: revm evaluator — UUPS bypass, deployedBytecode, graceful attack ops 2026-03-12 19:54:58 +00:00
hAIrberger.md refactor: Complete project renaming from HARB/Harberger to KRAIKEN 2025-08-19 11:05:08 +02:00
lcov.info fix: Test coverage: Stake.sol to 100% (#284) 2026-02-26 04:28:47 +00:00
package-lock.json Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
package.json Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51) 2025-10-04 15:17:09 +02:00
README.md docs: consolidate and update all documentation for launch readiness 2026-02-13 19:22:34 +00:00
remappings.txt fix: Test coverage: LiquidityManager + Optimizer + OptimizerV3 to 100% (#285) 2026-02-26 02:41:02 +00:00
UNISWAP_V3_MATH.md more docs 2025-08-18 00:16:09 +02:00

KRAIKEN Onchain

Solidity contracts for the KRAIKEN protocol. Built with Foundry.

Contracts

Contract Description
Kraiken.sol ERC20 token with mint/burn controlled by LiquidityManager. VERSION=2.
LiquidityManager.sol Three-position Uniswap V3 strategy (Anchor, Discovery, Floor).
Stake.sol Harberger-tax staking with snatching auctions and discrete tax brackets.
OptimizerV3.sol UUPS upgradeable. Binary bear/bull parameter selection from staking sentiment.
VWAPTracker.sol Volume-weighted average price with directional recording and compression.

Setup

git submodule update --init --recursive
cd lib/uni-v3-lib && npm install && cd ../..
forge build
forge test

Deploy

source .env
forge script script/BaseSepoliaDeploy.sol:BaseSepoliaDeploy --slow --broadcast --verify --rpc-url ${BASE_SEPOLIA_RPC_URL}

See docs/DEPLOYMENT_RUNBOOK.md for production deployment.

Deployments

Base Mainnet

Contract Address
Kraiken 0x45caa5929f6ee038039984205bdecf968b954820
Stake 0xed70707fab05d973ad41eae8d17e2bcd36192cfc
LiquidityManager 0x7fd4e645ce258dd3942eddbeb2f99137da8ba13b

Base Sepolia

Contract Address
Kraiken 0x22c264Ecf8D4E49D1E3CabD8DD39b7C4Ab51C1B8
Stake 0xe28020BCdEeAf2779dd47c670A8eFC2973316EE2
LiquidityManager 0x3d6a8797693a0bC598210782B6a889E11A2340Cd

Research & Analysis

The analysis/ directory contains fuzzing scripts, parameter sweep tools, and security analysis:

Key findings: critical sqrt price bug fixed, 1050-combo 4D parameter sweep completed, floor ratchet vulnerability identified. See the research report for details.

ABI Architecture

Contract ABIs flow through the stack via kraiken-lib/src/abis.ts, which imports directly from out/ (forge build artifacts). Run forge build to update ABIs across all consumers (ponder, web-app).

References