harb/onchain
Agent 47a02cab92 chore: gardener housekeeping 2026-04-05
AGENTS.md watermarks refreshed to HEAD (62ba6f2).

Content updates:
- root AGENTS.md: added Docker/LXD notes (apparmor=unconfined, umami port 3001),
  viem v2 slot0 array pattern to Key Patterns
- services/ponder/AGENTS.md: documented LM_ADDRESS, POOL_ADDRESS, and
  MINIMUM_BLOCKS_FOR_RINGBUFFER env vars; added zero-stats troubleshooting note
- web-app/AGENTS.md: added viem v2 slot0 array compat section

Grooming: no open issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 18:04:27 +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: bundled dust cleanup — onchain source quality (#1134) 2026-03-23 09:51:46 +00:00
src fix: bundled dust cleanup — onchain source quality (#1134) 2026-03-23 09:51:46 +00:00
test fix: bundled dust cleanup — onchain source quality (#1134) 2026-03-23 09:51:46 +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-04-05 2026-04-05 18:04:27 +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