harb/onchain
openhands 58c3e62f3d fix: refactor AGENTS.md into progressive-disclosure structure (#184)
- Root AGENTS.md: 350+ lines → 68 lines (map, not encyclopedia)
- New docs/dev-environment.md (67 lines): Docker, dev.sh, ports, pitfalls
- New docs/ci-pipeline.md (73 lines): Woodpecker setup, monitoring, debugging
- New docs/testing.md (41 lines): Foundry, E2E, version validation
- New docs/codeberg-api.md (32 lines): .netrc auth, API usage
- Updated stale model refs in .claude-code-supervisor.yml files
- Sub-component AGENTS.md files unchanged
- Context docs (PRODUCT-TRUTH, ARCHITECTURE, UX-DECISIONS) unchanged
2026-02-23 09:46:35 +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 chore: analysis tooling, research artifacts, and code quality 2026-02-13 18:22:03 +00:00
lib feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
script feat: deployment scripts, E2E tests, and documentation 2026-02-13 18:21:49 +00:00
src feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01:00
test feat/ponder-lm-indexing (#142) 2026-02-18 00:19:05 +01: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 chore: analysis tooling, research artifacts, and code quality 2026-02-13 18:22:03 +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 docs: consolidate and update all documentation for launch readiness 2026-02-13 19:22:34 +00:00
deployments-local.json feat: deployment scripts, E2E tests, and documentation 2026-02-13 18:21:49 +00:00
foundry.toml feature/ci (#84) 2026-02-02 19:24:57 +01:00
hAIrberger.md refactor: Complete project renaming from HARB/Harberger to KRAIKEN 2025-08-19 11:05:08 +02: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 basic shift implementation 2024-03-28 21:50:22 +01: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