Skip to content
Draft

Release #2076

Show file tree
Hide file tree
Changes from 201 commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
f1fe7c9
feat(web): validation of the token address for ERC20/721/1155 types
jaybuidl Jul 22, 2025
4594536
chore: changed contracts viem dependency as peer dependency
jaybuidl Aug 5, 2025
5a81f9e
feat: dispute kit helper
jaybuidl Aug 5, 2025
4c2277b
chore: override viem resolution from viem@npm:2.x to npm:^2.23.2 beca…
jaybuidl Aug 5, 2025
efb2aad
chore: changelog
jaybuidl Aug 5, 2025
29aee53
Merge pull request #2066 from kleros/feat/contracts-disputekits-helper
jaybuidl Aug 5, 2025
e3ed3c9
chore: published @kleros/[email protected]
jaybuidl Aug 5, 2025
92852da
Merge branch 'dev' into feat/gated-dk-address-validation
tractorss Aug 5, 2025
c99b0c9
chore: refactors
tractorss Aug 5, 2025
7c74b70
fix: validation should fail if token gate address is empty
jaybuidl Aug 5, 2025
d78e212
Update web/src/pages/Resolver/Parameters/Court.tsx
tractorss Aug 6, 2025
77c8549
chore: enabled Hardhat viaIR compilation with solc v0.8.30, bumped ha…
jaybuidl Aug 7, 2025
0cdc07d
Merge pull request #2069 from kleros/chore/solc-0.8.30-viaIR
jaybuidl Aug 7, 2025
e41ee56
chore: viaIR compilation enabled for Foundry with explicit solc v0.8.30
jaybuidl Aug 7, 2025
9b1f5fd
Merge pull request #2073 from kleros/chore/solc-0.8.30-viaIR-foundry
jaybuidl Aug 7, 2025
2d94bfd
chore: changelog
jaybuidl Aug 7, 2025
bfe11a7
feat: rng fallback
jaybuidl Jul 24, 2025
63ecf4a
fix: re-added removed variables to preserve storage layout, marked as…
jaybuidl Jul 24, 2025
937fb97
feat(RNG): fallback contract update
unknownunknown1 Aug 6, 2025
752b64a
feat: court llms.txt, adding header `X-Robots-Tag: llms-txt`
jaybuidl Aug 6, 2025
9140890
Merge pull request #2067 from kleros/feat/court-llms-txt
jaybuidl Aug 7, 2025
4a72da5
fix: shutter flash
kemuru Aug 7, 2025
d3a1293
chore: better return structure
kemuru Aug 7, 2025
9d3ba90
fix: usevotingcontext dynamic disputekit hook calling
kemuru Aug 8, 2025
3080c8f
chore: comment tweaking
kemuru Aug 8, 2025
a8942cd
fix: add shutter api check
kemuru Aug 9, 2025
89848ea
chore: check that its not empty too just in case
kemuru Aug 9, 2025
a130a6a
Merge pull request #2077 from kleros/fix/add-shutter-api-check
jaybuidl Aug 11, 2025
b8628bb
fix: coverage script breaking after enabling viaIR
jaybuidl Aug 11, 2025
d10251b
chore: interfaces pragma set to any 0.8 solc version
jaybuidl Aug 12, 2025
41e8998
chore: changelog
jaybuidl Aug 12, 2025
34f6a65
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 12, 2025
da7eea1
refactor: minor improvement
jaybuidl Aug 12, 2025
a8f3415
chore: deployment script support for RNGWithFallback
jaybuidl Aug 12, 2025
78b3169
docs: metrics for upcoming audit
jaybuidl Aug 12, 2025
738ef2c
docs: metrics for upcoming audit
jaybuidl Aug 12, 2025
82f8b1c
feat: replace requires with custom errors
unknownunknown1 Aug 13, 2025
52f86ac
fix(web): return-undefined-data-if-not-token-gated
tractorss Aug 13, 2025
a374113
fix(web): disable-navigation-button-if-dispute-kit-undefined
tractorss Aug 13, 2025
a0cb09d
feat: replace requires with custom errors for the gateways
jaybuidl Aug 13, 2025
5353ccf
chore: changelog
jaybuidl Aug 13, 2025
831b062
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 13, 2025
3d211cc
refactor: removed CappedMath, moved SortitionSumTreeFactory to `klero…
jaybuidl Aug 13, 2025
95f2803
refactor: consolidated ALPHA_DIVISOR and ONE_BASIS_POINTS
jaybuidl Aug 13, 2025
277457c
feat(RNG): foundry test
unknownunknown1 Aug 14, 2025
d1910ca
fix(web): timeline-bug-fix
tractorss Aug 14, 2025
8d0edf4
chore: rabbit-review
tractorss Aug 14, 2025
c1bad1d
docs: comment
jaybuidl Aug 14, 2025
be33847
fix: typo in local variable
jaybuidl Aug 14, 2025
cabc743
chore: label text improvements
kemuru Aug 14, 2025
b19b82d
chore: add urgency and more clarity that it's right now
kemuru Aug 14, 2025
1dbfedf
feat: multi-dimensional degree of coherence for reward/penalties/pnk/eth
jaybuidl Aug 14, 2025
37bd43f
fix: no passing to voting period if commits are all cast
jaybuidl Aug 13, 2025
0a10ad2
chore: changelog
jaybuidl Aug 13, 2025
257870c
test: fix by warping to pass the period
jaybuidl Aug 15, 2025
4a451a5
chore: tweak didnotvote text
kemuru Aug 16, 2025
5ca5c3b
Merge pull request #2088 from kleros/chore/label-text-improvements
jaybuidl Aug 18, 2025
bd4e169
Merge pull request #2087 from kleros/fix/timeline-bug-fix
jaybuidl Aug 20, 2025
31efb24
feat(RNG): custom errors
unknownunknown1 Aug 20, 2025
96e48f8
Merge pull request #2090 from kleros/feat/multi-dimensional-coherence
jaybuidl Aug 20, 2025
0f31e0e
chore: changelog
jaybuidl Aug 20, 2025
d63d000
Merge branch 'dev' into feat/rng-fallback2
jaybuidl Aug 20, 2025
78f180a
chore: changelog
jaybuidl Aug 20, 2025
413a85a
Merge pull request #2054 from kleros/feat/rng-fallback2
jaybuidl Aug 20, 2025
9895c7c
refactor: using the template syntax for hardhat-deploy-ethers getCont…
jaybuidl Aug 20, 2025
2f711f3
feat: add available stake, effectivestake
kemuru Aug 20, 2025
da90234
Merge branch 'dev' into feat/add-available-and-staked-amounts-to-profile
kemuru Aug 20, 2025
0cadf21
feat: automatically stake PNK rewards instead of transferring them
jaybuidl Aug 20, 2025
e6572d5
chore: explicit-dispute-kit-selection
tractorss Aug 21, 2025
635aa6d
Merge branch 'dev' into feat/gated-dk-address-validation
tractorss Aug 21, 2025
9401c9b
Merge pull request #2098 from kleros/feat/add-available-and-staked-am…
jaybuidl Aug 22, 2025
8f4993d
fix: validate the token address by querying a non-zero address due to…
jaybuidl Aug 22, 2025
3b59568
Merge branch 'dev' into feat/gated-dk-address-validation
jaybuidl Aug 22, 2025
f02d718
Merge pull request #2052 from kleros/feat/gated-dk-address-validation
jaybuidl Aug 22, 2025
f2b2183
fix: penalties now applied to sortition tree stakes
jaybuidl Aug 23, 2025
03376da
Merge branch 'dev' into feat/autostake-pnk-rewards
jaybuidl Aug 25, 2025
524116c
chore: changelog
jaybuidl Aug 25, 2025
9618a6f
Merge pull request #2099 from kleros/feat/autostake-pnk-rewards
jaybuidl Aug 25, 2025
5468d55
refactor: minor variable rename, natspec
jaybuidl Aug 25, 2025
1aae950
feat: unstake juror if below minStake after penalty, simplified sub-c…
jaybuidl Aug 26, 2025
208e009
feat: let the dispute kit force an early court jump and override the …
jaybuidl Aug 25, 2025
42cc971
feat: added the current dispute kit as parameter to getNbVotesAfterAp…
jaybuidl Aug 26, 2025
057957e
chore: changelog
jaybuidl Aug 27, 2025
d0a9a80
refactor: adopt ERC-5313 by renaming governor to owner
jaybuidl Aug 27, 2025
f734873
chore: changelog
jaybuidl Aug 27, 2025
582b674
Merge branch 'dev' into fix/penalties-reduce-drawing-odds
jaybuidl Aug 27, 2025
e4d4bdb
feat(KlerosCore): allow to jump to a non-classic DK
unknownunknown1 Aug 27, 2025
1d37d89
feat(DK): update reinitializer
unknownunknown1 Aug 27, 2025
3ed7310
chore: minor comments tweaks
jaybuidl Aug 29, 2025
c9e7334
chore: deploy script tweak to make DisputeKitGatedShutter jump to Dis…
jaybuidl Aug 29, 2025
ea5b3a7
refactor: split the KlerosCore foundry tests into several files as it…
jaybuidl Aug 29, 2025
361fa55
Merge pull request #2115 from kleros/refactor/foundry-tests-split
jaybuidl Aug 29, 2025
6636c6d
Merge branch 'dev' into feat/dk-jump
jaybuidl Aug 29, 2025
e6114ba
fix: defensive guard added against jumpDisputeKitID not set
jaybuidl Aug 29, 2025
9d31252
chore: dynamically retrieve the disputeKitID in the deployment script
jaybuidl Aug 29, 2025
baf9695
feat: initial-features-implementation
tractorss Sep 2, 2025
4cc634f
Merge branch 'dev' into fix/penalties-reduce-drawing-odds
jaybuidl Sep 2, 2025
14fedbb
fix: minStake check after setStakePenalty should return the remaining…
jaybuidl Sep 2, 2025
63d3a64
test: cover dispute kit jump to non-classic scenario
jaybuidl Sep 2, 2025
e6e83ae
refactor: small functions rename
jaybuidl Sep 3, 2025
1d1f9f2
chore: changelog
jaybuidl Sep 3, 2025
b7888c2
refactor: extracted the sortition tree to a library
jaybuidl Aug 27, 2025
d3c215e
chore: changelog, natspec decorators
jaybuidl Aug 28, 2025
323ba18
test: coverage of SortitionTrees and optimization of stakePathID pack…
jaybuidl Aug 29, 2025
953bd95
Merge pull request #2107 from kleros/fix/penalties-reduce-drawing-odds
jaybuidl Sep 3, 2025
d794975
chore: changelog
jaybuidl Sep 3, 2025
62b0a50
fix: deploy script
jaybuidl Sep 3, 2025
a7cfba0
Merge pull request #2113 from kleros/refactor/sortition-trees-library
jaybuidl Sep 3, 2025
1ba64db
Merge branch 'dev' into feat/dk-jump
jaybuidl Sep 3, 2025
068df77
Merge pull request #2114 from kleros/feat/dk-jump
jaybuidl Sep 3, 2025
188f8d0
feat: support for recovery hash in Shutter DK
jaybuidl Aug 20, 2025
bd589e7
chore: removing foundry compilation restrictions, not working as expe…
jaybuidl Aug 21, 2025
6f92514
refactor: add underscore prefix to internal function getExpectedVoteH…
jaybuidl Sep 3, 2025
2cfeec4
chore: changelog
jaybuidl Sep 3, 2025
4aa2cd2
feat: applied the changes to the GatedShutter DK
jaybuidl Sep 3, 2025
b490c96
test: coverage for the shutter dispute kit including recovery flow
jaybuidl Sep 4, 2025
ef3a64c
chore: github contract testing workflow without coverage due to via-i…
jaybuidl Sep 4, 2025
fb6ca6a
chore: testing
jaybuidl Sep 4, 2025
5e987c4
Merge pull request #2100 from kleros/feat/shutter-recovery-hash
jaybuidl Sep 4, 2025
98f7eac
fix: guard against currentStake exceeding SortitionModuleNeo.maxStake…
jaybuidl Sep 4, 2025
030eedf
feat: reset of the proxies version and initializers ahead of the migr…
jaybuidl Sep 4, 2025
6ded616
Merge pull request #2125 from kleros/feat/migration-proxies-reset
jaybuidl Sep 4, 2025
63744e9
feat: added a arbitrableWhitelistEnabled flag to KlerosCoreNeo
jaybuidl Sep 4, 2025
262f940
feat: allow jurorNft to be address(0) which disables gating
jaybuidl Sep 4, 2025
bd210be
feat: only KlerosCore, no more KlerosCoreBase and KlerosCoreNeo
jaybuidl Sep 4, 2025
40714da
feat: only SortitionModule, no more SortitionModuleBase and Sortition…
jaybuidl Sep 4, 2025
758a809
test: extra init asserts in foundry tests
jaybuidl Sep 4, 2025
7a5d08d
fix: hardhat tests, deploy scripts, unnecessary virtual keyword
jaybuidl Sep 4, 2025
e9f8a0a
refactor: renamed 00-home-chain-arbitration-neo into 00-home-chain-ar…
jaybuidl Sep 4, 2025
923bd7b
chore: removed traces of Neo in many scripts and filenames
jaybuidl Sep 4, 2025
daa8bf9
chore: removed traces of Neo in more scripts
jaybuidl Sep 4, 2025
4e384c9
chore: updated audit METRICS files
jaybuidl Sep 4, 2025
8636c23
chore: rename of the arbitrum contract artifacts, no more Neo suffix …
jaybuidl Sep 4, 2025
36a2455
Merge pull request #2126 from kleros/feat/migration-no-more-neo
jaybuidl Sep 4, 2025
59ca8e1
fix: update storage layout
unknownunknown1 Sep 4, 2025
5dc39fa
feat(DK): struct gaps
unknownunknown1 Sep 5, 2025
79a458c
fix(SM): storage update
unknownunknown1 Sep 5, 2025
1ec4e02
docs: natspec update
unknownunknown1 Sep 8, 2025
f1ec484
fix(SM): shadow var
unknownunknown1 Sep 8, 2025
8b6e1f9
fix(web): invalid-dispute-vote-reveal
tractorss Sep 8, 2025
7a78b27
chore: rabbit-feedback
tractorss Sep 8, 2025
83a21bd
feat(web): dynamic-dispute-kit-feature-selection
tractorss Sep 9, 2025
6bea072
fix(web): neo-codegen
tractorss Sep 9, 2025
62d5723
Merge pull request #2134 from kleros/fix/invalid-dispute-vote-reveal
jaybuidl Sep 9, 2025
0e3fb9c
chore(web): rabbit-review
tractorss Sep 9, 2025
f77b92f
fix(web): incorrect-feature-selection
tractorss Sep 9, 2025
e41329b
feat: court features wording, sub-title styling
jaybuidl Sep 9, 2025
8f438dd
Merge branch 'dev' into feat/storage-gap
jaybuidl Sep 9, 2025
8032917
chore: storage optimisation by reordering Vote.voted
jaybuidl Sep 9, 2025
1b6c98a
chore: added storage gaps to KC Court, Dispute and Round, and removed…
jaybuidl Sep 9, 2025
568eb40
chore: foundry lint
jaybuidl Sep 9, 2025
96bb505
chore: event parameter tweaks
jaybuidl Sep 9, 2025
78833f3
chore: tweaked sortition module natspec, added the phase related func…
jaybuidl Sep 10, 2025
4530869
chore: replaced @dev natspec with @notice where relevant, fixed found…
jaybuidl Sep 10, 2025
cfdb1f4
chore: changelog
jaybuidl Sep 11, 2025
7c30463
Merge pull request #2127 from kleros/feat/storage-gap
jaybuidl Sep 11, 2025
e7578d2
fix: do not emit TokenAndETHShift for zero amounts, no zero transfer
jaybuidl Sep 10, 2025
bd983ca
chore: changelog
jaybuidl Sep 11, 2025
c97270a
Merge pull request #2135 from kleros/fix/no-zero-amount-shift
jaybuidl Sep 11, 2025
f1dd559
refactor: renamed event TokenAndEthShift into JurorRewardPenalty
jaybuidl Sep 11, 2025
fd465a4
chore: changelog
jaybuidl Sep 11, 2025
8ecf061
Merge pull request #2136 from kleros/refactor/rename-TokenAndEthShift…
jaybuidl Sep 11, 2025
41a5b77
refactor: minor internal function rename
jaybuidl Sep 11, 2025
cbc111a
chore: less optimizer iterations to shrink KlerosCore
jaybuidl Sep 11, 2025
452246f
chore: university contracts redeploy
jaybuidl Sep 12, 2025
e59e79b
feat: markdown editor and markdown renderer
kemuru Sep 15, 2025
e7971b8
fix: styling fixes, hack to make the text flicker appear
kemuru Sep 15, 2025
835eea4
chore: deploy-university-subgraph
tractorss Sep 16, 2025
d82188a
feat: style improvements
kemuru Sep 16, 2025
79e4210
fix: university deploy script
jaybuidl Sep 16, 2025
e1a3d05
chore: comments from ai reviews
kemuru Sep 16, 2025
55589e5
Merge pull request #2138 from kleros/chore/university-deploy-stable
jaybuidl Sep 16, 2025
9d4b286
feat: link popup warning, clean up codes
kemuru Sep 16, 2025
4f35c9d
Merge branch 'dev' into feat/markdown-editor-and-markdown-renderer
kemuru Sep 17, 2025
e3dc195
Potential fix for code scanning alert no. 96: Bad HTML filtering regexp
kemuru Sep 17, 2025
942fa9e
chore: dompurify in packagejson
kemuru Sep 17, 2025
20ae3a4
Potential fix for code scanning alert no. 97: Incomplete URL scheme c…
kemuru Sep 17, 2025
e2d7c81
feat: max height and scrollable on mobile
kemuru Sep 17, 2025
b9a7a97
Merge pull request #2141 from kleros/chore/university-migration
jaybuidl Sep 17, 2025
48abffb
Merge branch 'dev' into feat/markdown-editor-and-markdown-renderer
kemuru Sep 22, 2025
859834b
feat: switch to reactmarkdown, remark gfm, rehype raw and rehype sani…
kemuru Sep 22, 2025
56aaca8
chore: style impros resolver description
kemuru Sep 22, 2025
94e4783
chore: slight transition and coloring
kemuru Sep 22, 2025
a8d32b8
chore: small styling issue
kemuru Sep 22, 2025
0e96a87
Merge pull request #2140 from kleros/feat/markdown-editor-and-markdow…
jaybuidl Sep 23, 2025
6752cad
feat: fuzzing tests
unknownunknown1 Sep 23, 2025
65f84cf
feat: clear-choice-button
tractorss Sep 24, 2025
2842949
Merge branch 'dev' into feat/court-features
alcercu Sep 24, 2025
e827f63
Merge pull request #2117 from kleros/feat/court-features
alcercu Sep 24, 2025
6b74ebc
fix(DK): multiple commit fix
unknownunknown1 Sep 24, 2025
df07fbb
fix(DK): allow recommits without changing counter
unknownunknown1 Sep 30, 2025
835d45b
Merge branch 'feat/fuzzing-test' into dev
jaybuidl Sep 30, 2025
5b35be9
Merge branch 'dev' into fix/dk-multiple-commits
jaybuidl Sep 30, 2025
06db2d0
Merge pull request #2145 from kleros/fix/dk-multiple-commits
jaybuidl Sep 30, 2025
615effc
refactor: renamed error AppealPeriodIsOver into NotAppealPeriod
jaybuidl Oct 2, 2025
11f84f7
fix: typos, natspec, small gas optimisation
jaybuidl Oct 2, 2025
ec9e89c
fix: minor KlerosCore improvements from reviews
jaybuidl Oct 6, 2025
40d2240
docs: natspec fixes
jaybuidl Oct 6, 2025
45bcd0f
docs: natspec fixes
jaybuidl Oct 6, 2025
06cccaa
refactor: minor improvement to the DisputeResolver
jaybuidl Oct 6, 2025
7cb1275
Merge pull request #2154 from kleros/fix/contracts-review-round1
jaybuidl Oct 6, 2025
bc906e5
fix: autostake the token rewards in the court where the stake origina…
jaybuidl Oct 7, 2025
4d14f47
Merge pull request #2165 from kleros/autostake-reward-in-court-stake-…
jaybuidl Oct 7, 2025
e21d261
docs: natspec
jaybuidl Oct 8, 2025
cf59b86
feat: removal of externalDisputeID, pre-dispute evidence submission i…
jaybuidl Oct 8, 2025
f70050e
Merge pull request #2169 from kleros/feat/no-external-dispute-id
jaybuidl Oct 8, 2025
decd3e7
chore: metrics script
jaybuidl Oct 10, 2025
00be694
fix(DK): allow recurring DK
unknownunknown1 Oct 6, 2025
536e61c
test: withdrawFeesAndRewards() coverage for complex DK jump sequence
jaybuidl Oct 8, 2025
374b4f2
refactor: active/jump checks, no more _round param in withdrawFeesAnd…
jaybuidl Oct 13, 2025
f9fd944
fix: removed unnecessary isActive modifier on the shutter DKs
jaybuidl Oct 14, 2025
a0a3a67
Merge pull request #2174 from kleros/refactor/active-dk
jaybuidl Oct 14, 2025
a934ba5
Merge pull request #2159 from kleros/feat/recurring-dk-test
jaybuidl Oct 14, 2025
6b7e365
feat: removed an external call to Core in DK.createDispute()
jaybuidl Oct 14, 2025
5a46536
fix: token whitelist for DisputeKitGated and DisputeKitGatedShutter
jaybuidl Oct 14, 2025
bcbe228
test: updated with token whitelist coverage
jaybuidl Oct 14, 2025
83a8ba6
fix: support disputes with no token gate address specified
jaybuidl Oct 14, 2025
700738e
test: refactored to cover both shutter and gated DK combinations with…
jaybuidl Oct 14, 2025
cefa0cb
test: added coverage for missing token gate address in gated DKs
jaybuidl Oct 14, 2025
13f3708
fix: coderabbit review, fixed a test not making any assertions
jaybuidl Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 121 additions & 65 deletions .github/workflows/contracts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,73 +15,129 @@ on:
pull_request:
branches:
- "*"
permissions: # added using https://github.com/step-security/secure-workflows

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

Comment on lines +19 to 21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Grant actions: read so the cache can restore.

When you set a restrictive permissions block, unspecified scopes default to none. actions/cache requires actions: read for restore.

-permissions: # added using https://github.com/step-security/secure-workflows
-  contents: read
+permissions: # added using https://github.com/step-security/secure-workflows
+  contents: read
+  actions: read
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
actions: read
🤖 Prompt for AI Agents
.github/workflows/contracts-testing.yml around lines 19 to 21: the workflow’s
permissions block only sets contents: read but omits actions: read which
prevents actions/cache from restoring; update the permissions block to
explicitly include actions: read (e.g., add "actions: read" alongside contents:
read) so the cache restore step can access the actions permission.

jobs:
contracts-testing:
# *********************************************************************************** #
# ******************************* Hardhat Tests ************************************* #
# *********************************************************************************** #
hardhat-tests:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: false
egress-policy: block
allowed-endpoints: >
binaries.soliditylang.org:443
classic.yarnpkg.com:443
github.com:443
nightly.yarnpkg.com:443
nodejs.org:443
objects.githubusercontent.com:443
registry.yarnpkg.com:443
registry.npmjs.org:443
54.185.253.63:443

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Set up corepack (for yarn)
run: |
corepack enable
corepack prepare [email protected] --activate
yarn set version 4.9.2

- name: Setup Node.js environment
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20.x
cache: yarn

- name: Cache node modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-

- name: Install contracts dependencies
run: yarn workspace @kleros/kleros-v2-contracts install

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3.1

- name: Install lcov
run: sudo apt-get install -y lcov

- name: Run Hardhat and Foundry tests with coverage
run: yarn coverage
working-directory: contracts

- name: Upload a build artifact
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: code-coverage-report
path: contracts/coverage
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
disable-sudo: false
egress-policy: block
allowed-endpoints: >
binaries.soliditylang.org:443
classic.yarnpkg.com:443
github.com:443
nightly.yarnpkg.com:443
nodejs.org:443
objects.githubusercontent.com:443
registry.yarnpkg.com:443
registry.npmjs.org:443
54.185.253.63:443

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive

- name: Set up corepack (for yarn)
run: |
corepack enable
corepack prepare [email protected] --activate
yarn set version 4.9.2

- name: Setup Node.js environment
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20.x
cache: yarn

- name: Cache node modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-

Comment on lines +61 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Cache the Yarn Berry artifacts instead of npm/node_modules.

With Yarn 4 (PnP by default), ~/.npm and **/node_modules are often unused. Cache .yarn/cache and install state for real wins.

-      - name: Cache node modules
+      - name: Cache Yarn artifacts
         uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
-        env:
-          cache-name: cache-node-modules
         with:
-          path: |
-            ~/.npm
-            **/node_modules
-          key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
+          path: |
+            .yarn/cache
+            .yarn/install-state.gz
+          key: ${{ runner.os }}-yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
+          restore-keys: |
+            ${{ runner.os }}-yarn-${{ secrets.CACHE_VERSION }}-
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Cache node modules
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
- name: Cache Yarn artifacts
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
with:
path: |
.yarn/cache
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-yarn-${{ secrets.CACHE_VERSION }}-

- name: Install contracts dependencies
run: yarn workspace @kleros/kleros-v2-contracts install

Comment on lines +73 to +75
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix install step: Yarn v4 doesn’t support yarn workspace <name> install.

This will either no-op or fail unless the workspace defines an install script. Do a root install (Berry) and optionally focus the contracts workspace.

-      - name: Install contracts dependencies
-        run: yarn workspace @kleros/kleros-v2-contracts install
+      - name: Install dependencies
+        run: |
+          yarn install --immutable
+          yarn workspaces focus @kleros/kleros-v2-contracts
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install contracts dependencies
run: yarn workspace @kleros/kleros-v2-contracts install
- name: Install dependencies
run: |
yarn install --immutable
yarn workspaces focus @kleros/kleros-v2-contracts
🤖 Prompt for AI Agents
In .github/workflows/contracts-testing.yml around lines 73-75, the workflow uses
"yarn workspace @kleros/kleros-v2-contracts install", which fails under Yarn v4;
replace that step with a root install (e.g., "yarn install" or "yarn install
--immutable" for CI) and, if you want to limit deps to the contracts workspace,
follow with a workspace focus command such as "yarn workspaces focus
@kleros/kleros-v2-contracts --all" (or similar focus flags) so dependencies are
prepared for that specific workspace.

- name: Run Hardhat tests
run: yarn test
working-directory: contracts

# *********************************************************************************** #
# ******************************* Foundry Tests ************************************* #
# *********************************************************************************** #
# COMPILATION FAILS 🤬
# foundry-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
# with:
# disable-sudo: false
# egress-policy: block
# allowed-endpoints: >
# binaries.soliditylang.org:443
# classic.yarnpkg.com:443
# github.com:443
# nightly.yarnpkg.com:443
# nodejs.org:443
# objects.githubusercontent.com:443
# registry.yarnpkg.com:443
# registry.npmjs.org:443
# 54.185.253.63:443

# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# with:
# submodules: recursive

# - name: Set up corepack (for yarn)
# run: |
# corepack enable
# corepack prepare [email protected] --activate
# yarn set version 4.9.2

# - name: Setup Node.js environment
# uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
# with:
# node-version: 20.x
# cache: yarn

# - name: Cache node modules
# uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
# env:
# cache-name: cache-node-modules
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-

# # - name: Install contracts dependencies
# # run: yarn workspace @kleros/kleros-v2-contracts install

# - name: Install Foundry
# uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1.4.0

# - name: Run Foundry tests
# run: forge test --config-path ./foundry.toml
# working-directory: contracts

# - name: Run snapshot
# run: NO_COLOR=1 forge snapshot >> $GITHUB_STEP_SUMMARY
# working-directory: contracts
1 change: 1 addition & 0 deletions contracts/.solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const shell = require("shelljs");
module.exports = {
istanbulReporter: ["lcov"],
configureYulOptimizer: true,
irMinimum: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Unrecognized solcover option "irMinimum" — likely a no-op; remove to avoid confusion

I don’t see "irMinimum" in solidity-coverage’s documented options. With coverage.sh already forcing VIA_IR=false for Hardhat, this flag is unnecessary and potentially misleading.

Apply this diff to remove it:

-  irMinimum: true,

If you want an inline hint about IR for coverage runs, consider a comment:

   configureYulOptimizer: true,
+  // IR is disabled for coverage via scripts/coverage.sh (VIA_IR=false)

Optionally verify support via docs:


🌐 Web query:

Is there a documented `irMinimum` option supported by solidity-coverage's .solcover.js config?

💡 Result:

Yes. The .solcover.js config includes a documented irMinimum option: a boolean (default false) that “speeds up test execution times when solc is run in viaIR mode,” and it may not work for all projects.[1]

Details:

  • Location: Listed under Config Options in the solidity-coverage package docs.[1]
  • Purpose: Enable a faster path when compiling with Solidity’s viaIR; useful if your project compiles successfully under coverage with it enabled.[1]
  • Type/Default: Boolean, default false.[1]

You can set it in .solcover.js like:
module.exports = {
irMinimum: true
}

Mirrors of the same table appear in downstream copies of the docs as well.[2]

Citations:


Documented option “irMinimum” is redundant under VIA_IR=false

solidity-coverage does support irMinimum (boolean, default false) to speed up test runs when compiling via IR, but your coverage.sh script forces VIA_IR=false, so this setting has no effect and may confuse future maintainers.

• Location: contracts/.solcover.js (line 10)
• Suggested change:

-  irMinimum: true,
+  // IR is disabled for coverage via scripts/coverage.sh (VIA_IR=false), so `irMinimum` is redundant
🤖 Prompt for AI Agents
In contracts/.solcover.js around line 10, the irMinimum: true option is
redundant because coverage.sh forces VIA_IR=false; remove the irMinimum property
or conditionally set it only when IR is enabled (e.g., check process.env.VIA_IR
=== 'true' and only include irMinimum when true) so the config reflects the
actual compilation mode and avoids confusing future maintainers.

onCompileComplete: async function (_config) {
await run("typechain");
},
Expand Down
68 changes: 67 additions & 1 deletion contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,71 @@ All notable changes to this package will be documented in this file.

The format is based on [Common Changelog](https://common-changelog.org/).

## [0.11.0] - 2025-08-01
## [0.13.0] - 2025-08-07 (Not published yet)

### Changed

- **Breaking:** Rename `KlerosCore.TokenAndETHShift` into `KlerosCore.JurorRewardPenalty` ([#2136](https://github.com/kleros/kleros-v2/issues/2136))
- **Breaking:** Add event parameter `KlerosCore.TokenAndETHShift._degreeOfCoherencyFee` and renamed the other parameters to `_degreeOfCoherencyPnk`, `_amountPnk`, `_amountFee` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Move state variable `DisputeKitClassicBase.nbVotes` to the `Round` struct ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Stake the juror's PNK rewards instead of transferring them out ([#2099](https://github.com/kleros/kleros-v2/issues/2099))
- **Breaking:** Replace `require()` with `revert()` and custom errors outside KlerosCore for consistency and smaller bytecode ([#2084](https://github.com/kleros/kleros-v2/issues/2084))
- **Breaking:** Rename the interface from `RNG` to `IRNG` ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
- **Breaking:** Rename `governor` to `owner` in order to comply with the lightweight ownership standard [ERC-5313](https://eipsinsight.com/ercs/erc-5313) ([#2112](https://github.com/kleros/kleros-v2/issues/2112))
- **Breaking:** Apply the penalties to the stakes in the Sortition Tree ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
- **Breaking:** Make `SortitionModule.getJurorBalance().stakedInCourt` include the penalties ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
- Make `IDisputeKit.draw()` and `ISortitionModule.draw()` return the court ID from which the juror was drawn ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
- Rename `SortitionModule.setJurorInactive()` to `SortitionModule.forcedUnstakeAllCourts()` ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
- Make the primary VRF-based RNG fall back to `BlockhashRNG` if the VRF request is not fulfilled within a timeout ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
- Authenticate the calls to the RNGs to prevent 3rd parties from depleting the Chainlink VRF subscription funds ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
- Use `block.timestamp` rather than `block.number` for `BlockhashRNG` for better reliability on Arbitrum as block production is sporadic depending on network conditions. ([#2054](https://github.com/kleros/kleros-v2/issues/2054))
- Replace the `bytes32 _key` parameter in `SortitionTrees.createTree()` and `SortitionTrees.draw()` by `uint96 courtID` ([#2113](https://github.com/kleros/kleros-v2/issues/2113))
- Extract the sortition sum trees logic into a library `SortitionTrees` ([#2113](https://github.com/kleros/kleros-v2/issues/2113))
- Make `IDisputeKit.getDegreeOfCoherenceReward()` multi-dimensional so different calculations may be applied to PNK rewards, fee rewards and PNK penalties (future-proofing) ([#2090](https://github.com/kleros/kleros-v2/issues/2090))
- Consolidate the constant `ALPHA_DIVISOR` with `ONE_BASIS_POINTS` ([#2090](https://github.com/kleros/kleros-v2/issues/2090))
- Set the Hardhat Solidity version to v0.8.30 and enable the IR pipeline ([#2069](https://github.com/kleros/kleros-v2/issues/2069))
- Set the Foundry Solidity version to v0.8.30 and enable the IR pipeline ([#2073](https://github.com/kleros/kleros-v2/issues/2073))
- Widen the allowed solc version to any v0.8.x for the interfaces only ([#2083](https://github.com/kleros/kleros-v2/issues/2083))
- Bump `hardhat` to v2.26.2 ([#2069](https://github.com/kleros/kleros-v2/issues/2069))
- Bump `@kleros/vea-contracts` to v0.7.0 ([#2073](https://github.com/kleros/kleros-v2/issues/2073))

### Added

- **Breaking:** Add storage gap arrays to `KlerosCore` structs `Round`, `Dispute` and `Court` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Add storage gap arrays to `DisputeKitClassicBase` state variables and to the structs `Round`, `Dispute` and `Vote` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Add a new field `drawnJurorFromCourtIDs` to the `Round` struct in `KlerosCoreBase` and `KlerosCoreUniversity` ([#2107](https://github.com/kleros/kleros-v2/issues/2107))
- **Breaking:** Add a new state variable `jumpDisputeKitID` to the `DisputeKitClassicBase` contract ([#2114](https://github.com/kleros/kleros-v2/issues/2114))
- **Breaking:** Add a parameter `_recoveryCommit` to the event `DisputeKitShutter.CommitCastShutter` ([#2100](https://github.com/kleros/kleros-v2/issues/2100))
- **Breaking:** Add a storage variable `recoveryCommitments` to `DisputeKitShutter` ([#2100](https://github.com/kleros/kleros-v2/issues/2100))
- Allow the Shutter commitment to be recovered by the juror using only the salt and the choice, without having to provide the justification ([#2100](https://github.com/kleros/kleros-v2/issues/2100))
- Allow the dispute kits to force an early court jump and to override the number of votes after an appeal (future-proofing) ([#2110](https://github.com/kleros/kleros-v2/issues/2110))
- Allow the dispute kits to specify which new dispute kit to use when a court jump occurs ([#2114](https://github.com/kleros/kleros-v2/issues/2114))
- Allow stake changes to by-pass delayed stakes when initiated by the SortitionModule by setting the `_noDelay` parameter to `true` in `SortitionModule.validateStake()` ([#2107](https://github.com/kleros/kleros-v2/issues/2107))

### Removed

- **Breaking:** Remove unused event parameters `IArbitrableV2.DisputeRequest._templateUri` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Remove deprecated `SortitionModule` state variables `alreadyTransferred`, `randomNumberRequestBlock`, `rngLookahead` and `latestDelayedStakeIndex` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Remove struct variable `DisputeKitClassicBase.Round.nbVotes` ([#2097](https://github.com/kleros/kleros-v2/issues/2097))
- **Breaking:** Remove the `_block` parameter from `IRNG.requestRandomness()` and `IRNG.receiveRandomness()`, not needed for the primary VRF-based RNG ([#2054](https://github.com/kleros/kleros-v2/issues/2054))

### Fixed

- Do not pass to Voting period if all the commits are cast because it breaks the current Shutter auto-reveal process. ([#2085](https://github.com/kleros/kleros-v2/issues/2085))
- Do not emit the `KlerosCore.TokenAndETHShift` event if the both the PNK and fee amounts are zero ([#2135](https://github.com/kleros/kleros-v2/issues/2135))
- Do not make PNK or ETH transfers if the amounts are zero ([#2135](https://github.com/kleros/kleros-v2/issues/2135))

## [0.12.0] - 2025-08-05

### Changed

- **Breaking:** Make `viem` a peer dependency, it should be provided by the consuming package ([`4594536`](https://github.com/kleros/kleros-v2/commit/4594536c))

### Added

- Add helper function `getDisputeKitsViem` to retrieve a deployment's available dispute kit infos including their capabilities (`isShutter`, `isGated`) ([`5a81f9e`](https://github.com/kleros/kleros-v2/commit/5a81f9ec))

## [0.11.0] - 2025-08-02

### Changed

Expand Down Expand Up @@ -107,6 +171,8 @@ The format is based on [Common Changelog](https://common-changelog.org/).

## [0.8.1] - 2025-04-10

[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
Comment on lines +174 to +175
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Avoid adding a release link for an unpublished tag.

If 0.13.0 isn’t published, this link will 404. Add it only when the release is live.

-[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
+<!-- [0.13.0]: (add after publishing) -->

Optionally confirm release existence before merging:


🏁 Script executed:

#!/bin/bash
# Prints 200 if the tag exists, otherwise likely 404
curl -s -o /dev/null -w "%{http_code}\n" \
"https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]"

Length of output: 132


Remove unpublished release link for v0.13.0 in CHANGELOG.md

The 0.13.0 release tag currently returns 404, so we should not include its link until the release is live.

• File: contracts/CHANGELOG.md
Lines: 129–130

Recommended change:

-[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
+<!-- [0.13.0]: (add after publishing) -->
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[0.13.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
<!-- [0.13.0]: (add after publishing) -->
[0.12.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
🤖 Prompt for AI Agents
In contracts/CHANGELOG.md at lines 129 to 130, the release link for version
0.13.0 leads to a 404 error because the release is not yet published. Remove or
comment out the line containing the 0.13.0 release link to prevent broken links
in the changelog until the release is officially live.

[0.11.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.10.0]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
[0.9.4]: https://github.com/kleros/kleros-v2/releases/tag/@kleros%[email protected]
Expand Down
Loading
Loading