Commit graph

37 commits

Author SHA1 Message Date
openhands
24fdcd3dcd fix: Stake.sol: exitPosition guard order (owner check before existence) (#307)
Check pos.creationTime == 0 before pos.owner != msg.sender so that
calling exitPosition on a non-existent position correctly reverts with
PositionNotFound instead of the misleading NoPermission(caller, 0x0).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 06:33:32 +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
400ab325ed refactor: Complete project renaming from HARB/Harberger to KRAIKEN
- Updated all production code references from 'harb' to 'kraiken'
- Changed 'Harberger tax' references to 'self-assessed tax'
- Updated function names (_getHarbToken -> _getKraikenToken)
- Modified documentation and comments to reflect new branding
- Updated token symbol from HARB to KRAIKEN in tests
- Maintained backward compatibility with test variable names

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 11:05:08 +02:00
johba
01471b7037 more docs 2025-08-18 00:16:09 +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
092f88a668 took out UBI and cleaned up 2025-01-23 13:21:49 +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
f738daff96 improve tax rate handling 2024-09-17 16:16:41 +02:00
JulesCrown
b4dfb03590 new deployment scripts 2024-09-17 15:48:59 +02:00
JulesCrown
b243874f02 added overflow checks 2024-07-18 07:35:39 +02:00
JulesCrown
dbc23802d2 added more gov params 2024-07-17 14:08:53 +02:00
JulesCrown
9f03bd9f5d cleanup 2024-07-16 20:59:42 +02:00
JulesCrown
ae8c3a1e4f added gov params 2024-07-16 19:47:39 +02:00
JulesCrown
236469f023 added comments 2024-07-13 18:33:47 +02:00
JulesCrown
ba298cfd50 cleanup 2024-07-13 14:56:24 +02:00
JulesCrown
76be65bb16 updated events 2024-06-23 08:45:54 +02:00
JulesCrown
54d2c2040a more staking tests 2024-06-21 15:57:23 +02:00
JulesCrown
36833cab7f staking test cleanup 2024-06-19 10:33:28 +02:00
JulesCrown
2b817c9331 more UBI tests 2024-06-18 09:49:57 +02:00
JulesCrown
b94f5559dd implemented minStake 2024-06-13 10:50:09 +02:00
JulesCrown
72abf097df staking tests 2024-06-13 08:28:42 +02:00
JulesCrown
39065a908e added fee payouts 2024-06-09 16:06:41 +02:00
JulesCrown
0d7a8e4814 enforce oracle check 2024-06-07 12:33:20 +02:00
JulesCrown
ec71bcd287 added price oracle 2024-06-07 11:22:22 +02:00
JulesCrown
3225be1084 add tax rate adjustment 2024-04-15 07:08:13 +02:00
JulesCrown
d9ee15f812 wip 2024-04-11 07:28:54 +02:00
JulesCrown
5a8c80e838 added harb-lib 2024-04-03 21:43:12 +02:00
JulesCrown
5ce676f045 wip 2024-03-28 19:55:01 +01: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
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
9279e0c045 first test pass 2024-03-12 15:29:59 +01:00
JulesCrown
307f98840b wip 2024-03-12 12:27:47 +01:00
JulesCrown
e62fb45ed5 wip 2024-03-12 11:38:16 +01:00
JulesCrown
7decc4c32d subfolder 2024-02-27 17:55:38 +01:00
Renamed from src/Stake.sol (Browse further)