Commit graph

38 commits

Author SHA1 Message Date
openhands
c33bdbaad5 fix: address review feedback on fetch-events.ts (#315)
- Replace hardcoded Infura API key with INFURA_API_KEY env var; fail fast
  with a helpful message if unset and no --rpc-url is given
- Add onchain/script/backtesting/.gitignore (cache/) instead of relying on
  the opaque root pattern; remove force-tracked cache/.gitkeep (mkdirSync
  creates the directory at runtime)
- Document resume constraint: reliable only when both --start-block and
  --end-block are explicit, or --output is set
- Fix batch-number display: derive batchNum inside the loop from the actual
  `from` block so it stays correct when resumeFromBlock isn't BATCH_SIZE-aligned
- Guard log.logIndex === null consistently with blockNumber/transactionHash
- console.warn on decode errors instead of silently discarding them

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 22:45:40 +00:00
openhands
df89b8c2da fix: Backtesting #1: Event fetcher (Infura → JSON Lines cache) (#315)
Add onchain/script/backtesting/fetch-events.ts — a tsx script that:
- Fetches Swap/Mint/Burn events from a Uniswap V3 pool via Infura (Base mainnet)
- Batches eth_getLogs in 2 000-block chunks with 100 ms inter-batch delay
- Decodes each log with viem and writes one JSON Line per event
- Supports resume: reads last block from existing cache file on re-run
- Retries with exponential back-off on 429 / rate-limit errors
- Prints per-batch progress: "Fetching blocks X-Y... N events (B/T batches)"

Also adds package.json, tsconfig.json, and cache/.gitkeep.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 22:04:43 +00:00
openhands
4a6256b941 Revert "Merge pull request 'fix: Backtesting #6: Baseline strategies (HODL, full-range, fixed-width) + reporting (#320)' (#322) from fix/issue-320 into master"
This reverts commit 1e5ac0de80, reversing
changes made to 6526928b67.
2026-02-26 20:45:19 +00:00
openhands
99d9c563d6 fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams
OptimizerV3Push3 is an equivalence-proof contract with only isBullMarket().
It cannot serve as an ERC1967Proxy implementation because it has no initialize()
or getLiquidityParams(). The CI bootstrap was failing because the proxy
deployment reverted when calling initialize() on the Push3 implementation.

Switch deploy scripts to Optimizer.sol (the base UUPS contract) which has the
full interface required by ERC1967Proxy and LiquidityManager.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 19:37:12 +00:00
openhands
e925538309 fix: Remove dead Optimizer V2/V3 — Push3 is the active optimizer (#312)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 19:37:12 +00:00
openhands
9061f8e8f6 fix: Address AI review findings for backtesting baseline strategies (#320)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 16:39:47 +00:00
openhands
5205ea6f4a fix: Backtesting #6: Baseline strategies (HODL, full-range, fixed-width) + reporting (#320)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 16:11:15 +00:00
openhands
d64b63aff4 feat: deployment scripts, E2E tests, and documentation
- DeployBase: shared deployment logic with OptimizerV3 UUPS proxy
- DeployBaseMainnet: Base mainnet configuration (feeDest, WETH, factory)
- DeployLocal: local Anvil deployment with OptimizerV3
- UpgradeOptimizer: UUPS upgrade script for existing proxy
- DEPLOYMENT_RUNBOOK: step-by-step mainnet deployment guide
- E2E tests: recenter position verification, optimizer integration
- Landing page: updated docs for OptimizerV3 and protocol changes
- Remove dead DeployScript2.sol

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:21:49 +00:00
johba
d7c2184ccf Add Solidity linting with solhint, Foundry formatter, and pre-commit hooks (#51)
## Changes

### Configuration
- Added .solhint.json with recommended rules + custom config
  - 160 char line length (warn)
  - Double quotes enforcement (error)
  - Explicit visibility required (error)
  - Console statements allowed (scripts/tests need them)
  - Gas optimization warnings enabled
  - Ignores test/helpers/, lib/, out/, cache/, broadcast/

- Added foundry.toml [fmt] section
  - 160 char line length
  - 4-space tabs
  - Double quotes
  - Thousands separators for numbers
  - Sort imports enabled

- Added .lintstagedrc.json for pre-commit auto-fix
  - Runs solhint --fix on .sol files
  - Runs forge fmt on .sol files

- Added husky pre-commit hook via lint-staged

### NPM Scripts
- lint:sol - run solhint
- lint:sol:fix - auto-fix solhint issues
- format:sol - format with forge fmt
- format:sol:check - check formatting
- lint / lint:fix - combined commands

### Code Changes
- Added explicit visibility modifiers (internal) to constants in scripts and tests
- Fixed quote style in DeployLocal.sol
- All Solidity files formatted with forge fmt

## Verification
-  forge fmt --check passes
-  No solhint errors (warnings only)
-  forge build succeeds
-  forge test passes (107/107)

resolves #44

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/51
2025-10-04 15:17:09 +02:00
johba
769fa105b8 added web-app and landing 2025-09-23 14:18:04 +02:00
giteadmin
74143dfac7 Complete project rename from HARB/Harberg to KRAIKEN with KRK token symbol
- Renamed core contract from Harberg.sol to Kraiken.sol
- Updated token symbol from HARB to KRK
- Renamed TypeScript library from harb-lib to kraiken-lib
- Updated all contract imports and references across smart contracts
- Modified subgraph schema and source files for new naming
- Updated transaction bot dependencies and service references
- Fixed test files to use new contract and token names
- Updated documentation in CLAUDE.md and README.md
- Regenerated subgraph types and ABI files
- Added new deployment script (DeployScript2.sol)

All components compile successfully and tests pass.
Smart contracts:  Compilation and tests pass
TypeScript library:  Package renamed and configured
Subgraph:  Code generation and build successful
Transaction bot:  Dependencies updated

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-11 13:47:42 +02:00
giteadmin
77af20dcee beautified 2025-07-08 10:33:10 +02:00
giteadmin
31bc86fcd5 base deployment 2025-02-05 19:47:18 +01:00
giteadmin
78b48f1639 replaced sentiment with specific params 2025-02-01 21:51:03 +01:00
giteadmin
092f88a668 took out UBI and cleaned up 2025-01-23 13:21:49 +01:00
Jules Clown
97b5e249ac fix tests 2024-11-13 16:37:23 +01:00
giteadmin
bb34d0725f feature/simulations (#11)
this pull request:
- creates a unit test that can take any scenario file (default: `out/scenario.json` and play it back on the deployment
- during the playback a debug trace generated in `timeSeries.csv`
- extracts the sentimenter into a separate upgradeable contract

Co-authored-by: JulesCrown <admin@noip.localhost>
Co-authored-by: giteadmin <gite@admin.com>
Reviewed-on: http://gitea.loseyourip.com:4000/dark-meme-society/harb/pulls/11
2024-11-07 15:33:40 +00:00
JulesCrown
b4dfb03590 new deployment scripts 2024-09-17 15:48:59 +02:00
JulesCrown
2caef7ecb2 small cleanup 2024-09-10 19:13:43 +02:00
JulesCrown
b243874f02 added overflow checks 2024-07-18 07:35:39 +02:00
JulesCrown
694afbe9fe make slide and shift one function 2024-07-16 20:47:06 +02:00
JulesCrown
236469f023 added comments 2024-07-13 18:33:47 +02:00
JulesCrown
ed23b04bcd deployment 2024-06-25 10:33:33 +02:00
JulesCrown
c3afb0172f enable tests for token0isWeth 2024-06-25 09:38:23 +02:00
JulesCrown
36833cab7f staking test cleanup 2024-06-19 10:33:28 +02:00
JulesCrown
4b86637a40 small stuff 2024-05-15 19:46:23 +02:00
JulesCrown
ac708963c8 events for stats and fix for getUbiDue issue #3 2024-05-15 19:21:15 +02:00
JulesCrown
4845129fe3 deployment 2024-04-11 22:32:47 +02:00
JulesCrown
2314ff51c1 new deployment with public position counter 2024-03-18 12:42:30 +01:00
JulesCrown
4e895f57e9 LiqMan WIP 2024-03-14 17:31:16 +01:00
JulesCrown
e51f49c612 update deploy script 2024-03-14 12:48:14 +01:00
JulesCrown
b93664431f got UBI to work 2024-03-14 12:40:57 +01:00
JulesCrown
06581a0b8d first deployment 2024-03-12 20:22:10 +01:00
JulesCrown
307f98840b wip 2024-03-12 12:27:47 +01:00
JulesCrown
25538325c7 chore: forge init 2024-03-12 12:01:48 +01:00
JulesCrown
e62fb45ed5 wip 2024-03-12 11:38:16 +01:00
JulesCrown
8549b848b8 chore: forge init 2024-03-12 10:00:53 +01:00
JulesCrown
7decc4c32d subfolder 2024-02-27 17:55:38 +01:00