From 25d7e04e8af733b79bc2487e278cc2e3717b8279 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 31 Jan 2026 16:57:50 +0000 Subject: [PATCH 1/6] fix: rename BlockhashRNG.sol to BlockHashRNG.sol for case consistency The contract name is BlockHashRNG but the file was named BlockhashRNG.sol. This case mismatch caused forge tests to fail on case-sensitive filesystems. https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- contracts/src/rng/{BlockhashRNG.sol => BlockHashRNG.sol} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename contracts/src/rng/{BlockhashRNG.sol => BlockHashRNG.sol} (100%) diff --git a/contracts/src/rng/BlockhashRNG.sol b/contracts/src/rng/BlockHashRNG.sol similarity index 100% rename from contracts/src/rng/BlockhashRNG.sol rename to contracts/src/rng/BlockHashRNG.sol From 9bfefd1c76d4aa3618003df6b13b8f7c6cbfeaeb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 14:20:18 +0000 Subject: [PATCH 2/6] docs: add CLAUDE.md with development environment notes Documents Foundry setup, dependency installation, test running, project structure, and known issues for future reference. https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- CLAUDE.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..1c0bc492b --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,48 @@ +# Claude Code Notes for kleros-v2 + +## Development Environment Setup + +### Foundry Installation + +```bash +# Install foundryup (if not already installed) +curl -L https://foundry.paradigm.xyz | bash + +# Run foundryup to install/update forge, cast, anvil, chisel +export PATH="$PATH:/root/.foundry/bin" && foundryup +``` + +### Dependencies + +```bash +# Install npm dependencies (required for OpenZeppelin, etc.) +yarn install + +# Foundry submodules (forge-std, solmate) are auto-installed on first forge command +``` + +### Running Tests + +```bash +# Run from repo root (foundry.toml is at root, contracts config in contracts/foundry.toml) +export PATH="$PATH:/root/.foundry/bin" && forge test +``` + +## Project Structure + +- `contracts/src/` - Solidity source files +- `contracts/test/foundry/` - Foundry test files +- `contracts/foundry.toml` - Foundry configuration (Solc 0.8.30, Cancun EVM, via-ir enabled) +- `remappings.txt` - Import path remappings for both Foundry and Hardhat + +## Known Issues + +### Case Sensitivity + +File names must match contract names exactly (Linux is case-sensitive): + +- Contract `BlockHashRNG` must be in file `BlockHashRNG.sol`, not `BlockhashRNG.sol` + +## Audit Context + +This codebase contains fixes for the Certora security audit. Related PR: https://github.com/kleros/kleros-v2/pull/2209 From c78c0f5531225fc80494d7adac9d6728512a1d16 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 14:22:45 +0000 Subject: [PATCH 3/6] docs: clarify monorepo structure in CLAUDE.md Reorganized to show this is a monorepo with multiple packages. Contracts-specific notes are now under a dedicated section. https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- CLAUDE.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1c0bc492b..da12a55dc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,20 @@ # Claude Code Notes for kleros-v2 -## Development Environment Setup +## Monorepo Structure + +This is a Yarn workspaces monorepo with multiple packages: + +- `contracts/` - Solidity smart contracts (Foundry + Hardhat) +- `web/` - Frontend application +- `kleros-sdk/` - SDK package +- `kleros-app/` - App package +- `subgraph/` - TheGraph subgraph definitions +- `bots/` - Automation bots +- `services/` - Backend services + +Shared configs: `eslint-config/`, `prettier-config/`, `tsconfig/` + +## Contracts Package ### Foundry Installation @@ -28,16 +42,14 @@ yarn install export PATH="$PATH:/root/.foundry/bin" && forge test ``` -## Project Structure +### Contracts Structure - `contracts/src/` - Solidity source files - `contracts/test/foundry/` - Foundry test files - `contracts/foundry.toml` - Foundry configuration (Solc 0.8.30, Cancun EVM, via-ir enabled) - `remappings.txt` - Import path remappings for both Foundry and Hardhat -## Known Issues - -### Case Sensitivity +### Contracts Known Issues File names must match contract names exactly (Linux is case-sensitive): From e8879bd341aa1b733eba5d7d77ed040c971a6e2b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 14:23:14 +0000 Subject: [PATCH 4/6] chore: add foundry.lock for reproducible builds https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- contracts/foundry.lock | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 contracts/foundry.lock diff --git a/contracts/foundry.lock b/contracts/foundry.lock new file mode 100644 index 000000000..a65f78491 --- /dev/null +++ b/contracts/foundry.lock @@ -0,0 +1,8 @@ +{ + "lib/forge-std": { + "rev": "8f24d6b04c92975e0795b5868aa0d783251cdeaa" + }, + "lib/solmate": { + "rev": "3998897acb502fa7b480f505138a6ae1842e8d10" + } +} \ No newline at end of file From 31325f7cc3f428357db3c4aa281381f430c77d7a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 14:39:23 +0000 Subject: [PATCH 5/6] docs: add coding style and work style to CLAUDE.md https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- CLAUDE.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index da12a55dc..9f420db60 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,7 @@ # Claude Code Notes for kleros-v2 +Work style: telegraph; noun-phrases ok; drop filler/grammar; min tokens + ## Monorepo Structure This is a Yarn workspaces monorepo with multiple packages: @@ -55,6 +57,12 @@ File names must match contract names exactly (Linux is case-sensitive): - Contract `BlockHashRNG` must be in file `BlockHashRNG.sol`, not `BlockhashRNG.sol` +### Coding Style + +- Function params: `_` prefix, no suffix +- Internal functions: `_` prefix, no `Internal` suffix +- Upgradeable contracts: `version` defined only in derived contracts, not base: `string public constant override version = "0.0.1";` + ## Audit Context This codebase contains fixes for the Certora security audit. Related PR: https://github.com/kleros/kleros-v2/pull/2209 From 7224cb7d0cd2c3e543d90c51bbe0821a04f41e5c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Feb 2026 14:43:37 +0000 Subject: [PATCH 6/6] docs: rewrite CLAUDE.md in telegraphic style https://claude.ai/code/session_01YY3fcURdNYaGjSga7oXMju --- CLAUDE.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9f420db60..90ce637ca 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,17 +4,17 @@ Work style: telegraph; noun-phrases ok; drop filler/grammar; min tokens ## Monorepo Structure -This is a Yarn workspaces monorepo with multiple packages: +Yarn workspaces monorepo: -- `contracts/` - Solidity smart contracts (Foundry + Hardhat) -- `web/` - Frontend application -- `kleros-sdk/` - SDK package -- `kleros-app/` - App package -- `subgraph/` - TheGraph subgraph definitions -- `bots/` - Automation bots -- `services/` - Backend services +- `contracts/` - Solidity (Foundry + Hardhat) +- `web/` - Frontend +- `kleros-sdk/` - SDK +- `kleros-app/` - App +- `subgraph/` - TheGraph definitions +- `bots/` - Automation +- `services/` - Backend -Shared configs: `eslint-config/`, `prettier-config/`, `tsconfig/` +Shared: `eslint-config/`, `prettier-config/`, `tsconfig/` ## Contracts Package @@ -48,21 +48,21 @@ export PATH="$PATH:/root/.foundry/bin" && forge test - `contracts/src/` - Solidity source files - `contracts/test/foundry/` - Foundry test files -- `contracts/foundry.toml` - Foundry configuration (Solc 0.8.30, Cancun EVM, via-ir enabled) -- `remappings.txt` - Import path remappings for both Foundry and Hardhat +- `contracts/foundry.toml` - Foundry config (Solc 0.8.30, Cancun EVM, via-ir enabled) +- `remappings.txt` - Import path remappings (Foundry + Hardhat) ### Contracts Known Issues -File names must match contract names exactly (Linux is case-sensitive): +File names must match contract names exactly (Linux case-sensitive): -- Contract `BlockHashRNG` must be in file `BlockHashRNG.sol`, not `BlockhashRNG.sol` +- `BlockHashRNG` contract → `BlockHashRNG.sol`, not `BlockhashRNG.sol` ### Coding Style - Function params: `_` prefix, no suffix - Internal functions: `_` prefix, no `Internal` suffix -- Upgradeable contracts: `version` defined only in derived contracts, not base: `string public constant override version = "0.0.1";` +- Upgradeable `version`: define in derived only, not base: `string public constant override version = "0.0.1";` ## Audit Context -This codebase contains fixes for the Certora security audit. Related PR: https://github.com/kleros/kleros-v2/pull/2209 +Certora security audit fixes. PR: https://github.com/kleros/kleros-v2/pull/2209