-
Notifications
You must be signed in to change notification settings - Fork 48
Release #2012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…cting an internal function
…ata sources not deployed e.g. DisputeKitShutter on testnet
…or-multiple-dispute-kit-above-id-1
…ple-dispute-kit-above-id-1 feat: subgraph support for shutter disputekit in devnet
…Send solidity version
fix(DK): no empty addresses after draw
Contracts: use SafeSend for ETH transfers
…e and saved 171 bytes
Chore/devnet upgrade 20250801
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🔭 Outside diff range comments (2)
contracts/deployments/arbitrumSepolia/KlerosCore.json (1)
1666-1679
: Fix the wrapped-native token address in Arbitrum-Sepolia deploymentOur sanity check shows the
_wNative
argument incontracts/deployments/arbitrumSepolia/KlerosCore.json
is incorrect:
- Current value (
.execute.args[0]
):
0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511
- Canonical Arbitrum-Sepolia WETH9:
0x8Aa68E18D7Fb913F4Fd79E12F1e7E5727E6dB112
Using the wrong address will break fee routing. Please update the
_wNative
parameter passed toinitialize
:--- a/contracts/deployments/arbitrumSepolia/KlerosCore.json +++ b/contracts/deployments/arbitrumSepolia/KlerosCore.json @@ -1666,7 +1666,7 @@ { "internalType": "address", "name": "_wNative", - "type": "address", "value": "0xAEE953CC26DbDeA52beBE3F97f281981f2B9d511" + "type": "address", "value": "0x8Aa68E18D7Fb913F4Fd79E12F1e7E5727E6dB112" }contracts/deployments/arbitrum/SortitionModuleNeo.json (1)
128-141
: Inconsistent_courtID
type across staking events.
StakeDelayed
emits_courtID
asuint96
, whileStakeSet
still usesuint256
.
This breaks type consistency for off-chain indexers (subgraph, bots) that expect a uniform ABI.-event StakeSet(address indexed _address, uint256 _courtID, …); +event StakeSet(address indexed _address, uint96 indexed _courtID, …);Align both events to
uint96
(the type used in storage) and, ideally, mark the parameterindexed
for easier filtering.Also applies to: 170-183
🧹 Nitpick comments (13)
contracts/deployments/arbitrumSepolia/DisputeKitClassic.json (2)
787-804
: Parameter naming mismatch may confuse integrators
getNumberOfRounds(uint256 _localDisputeID)
takes a local ID, unlike most view helpers that take_coreDisputeID
.
Add NatSpec to the contract—or at least an inline comment—to avoid accidental misuse.
1086-1098
: ExposewNative()
only when non-zeroFront-end and subgraph code should treat a zero address as unset and fall back to native token logic to avoid accidental transfers to
address(0)
.contracts/CHANGELOG.md (5)
5-5
: Reference spec name is incorrect
The de-facto standard is “Keep a Changelog”, not “Common Changelog”.-The format is based on [Common Changelog](https://common-changelog.org/). +The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
20-20
: Awkward phrasing
“a more number of iterations” reads oddly. Simplify to “more iterations”.-Draw jurors with a more number of iterations to account for ineligible jurors by the keeper bot +Draw jurors with more iterations to handle ineligible jurors (keeper bot)
37-42
: Inconsistent “Breaking” bullet formatting
Some bullets use**Breaking:**
, others**Breaking**:
. Pick one style (the first is more common).- **Breaking**: Make `KlerosCoreBase.draw()` return the number of drawn jurors + **Breaking:** Make `KlerosCoreBase.draw()` return the number of drawn jurors(Apply the same fix to Lines 40-42 for consistency.)
50-52
: Grammar – missing preposition
Insert “for” and tighten wording.-Add Gated dispute kit with support a dynamic token address for the Gated dispute kit using the dispute `extraData` +Add Gated dispute kit that supports a dynamic token address via dispute `extraData`
60-61
: Grammar – wrong preposition
Should be “remove … from”, not “to”.-Remove the parameter `_alreadyTransferred` to the staking functions. +Remove the `_alreadyTransferred` parameter from the staking functions..gitignore (1)
208-209
: Double-check the contents of.env.project
and.env.vault
These two files are now forced back into version control. If they contain real secrets rather than redacted placeholders, consider keeping only scrubbed templates here and loading actual secrets from a secure store in CI/CD.
contracts/deployments/arbitrum/DisputeKitClassicNeo.json (1)
916-944
: On-chainhashVote
may be mis-used
Because it accepts a full justification string, calling it on-chain costs unnecessary gas. The intended pattern is to compute the hash client-side. Consider adding a NatSpec note or renaming tohashVoteOffchain
to discourage accidental on-chain calls.contracts/deployments/arbitrum/SortitionModuleNeo.json (1)
598-603
:initialize4
adds another initializer without deprecating the previous ones.Multiple public initializers increase the surface for mis-configuration. Consider:
- Renaming the new initializer to
initialize
and gating it withreinitializer(4)
, or- Explicitly disabling the earlier
initialize*
functions after upgrading.This prevents accidental calls on an already-initialized proxy.
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json (3)
486-504
: Public mapping accessor may leak unnecessary data & incur gas
coreDisputeIDToActive(uint256) → bool
is now externally callable.
Consider marking itinternal
+ exposing a dedicated getter that reverts on unknown IDs to spare 2,100 gas per call and avoid letting crawlers poll random IDs.
787-804
:getNumberOfRounds()
– clarify whether return is 0- or 1-basedDocs and UI counters must agree; otherwise the last round may be skipped in pagination.
916-944
: On-chainhashVote()
duplicates off-chain logicBecause it’s a pure function, all consumers can (and should) hash locally to save ~25k gas per call.
Unless audit requirements mandate an on-chain reference, you could drop this to slim the byte-code.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
.dockerignore
(1 hunks).github/workflows/contracts-testing.yml
(1 hunks).gitignore
(1 hunks)contracts/.solcover.js
(1 hunks)contracts/CHANGELOG.md
(1 hunks)contracts/README.md
(5 hunks)contracts/deploy/00-home-chain-arbitration-neo.ts
(4 hunks)contracts/deploy/upgrade-all.ts
(2 hunks)contracts/deployments/arbitrum/DisputeKitClassicNeo.json
(7 hunks)contracts/deployments/arbitrum/DisputeKitGatedNeo.json
(1 hunks)contracts/deployments/arbitrum/DisputeKitGatedNeo_Proxy.json
(1 hunks)contracts/deployments/arbitrum/DisputeKitGatedShutterNeo.json
(1 hunks)contracts/deployments/arbitrum/DisputeKitGatedShutterNeo_Proxy.json
(1 hunks)contracts/deployments/arbitrum/DisputeKitShutterNeo.json
(1 hunks)contracts/deployments/arbitrum/DisputeKitShutterNeo_Proxy.json
(1 hunks)contracts/deployments/arbitrum/KlerosCoreNeo.json
(6 hunks)contracts/deployments/arbitrum/SortitionModuleNeo.json
(11 hunks)contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
(7 hunks)contracts/deployments/arbitrumSepolia/DisputeKitGated.json
(1 hunks)contracts/deployments/arbitrumSepolia/DisputeKitGatedShutter.json
(1 hunks)contracts/deployments/arbitrumSepolia/DisputeKitShutter.json
(1 hunks)contracts/deployments/arbitrumSepolia/KlerosCore.json
(6 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
(9 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGated.json
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGatedShutter.json
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json
(1 hunks)
✅ Files skipped from review due to trivial changes (9)
- .github/workflows/contracts-testing.yml
- .dockerignore
- contracts/.solcover.js
- contracts/deployments/arbitrum/DisputeKitShutterNeo_Proxy.json
- contracts/deployments/arbitrum/DisputeKitGatedShutterNeo_Proxy.json
- contracts/deployments/arbitrum/DisputeKitGatedNeo_Proxy.json
- contracts/deployments/arbitrum/DisputeKitGatedShutterNeo.json
- contracts/deployments/arbitrum/DisputeKitShutterNeo.json
- contracts/deployments/arbitrum/DisputeKitGatedNeo.json
🚧 Files skipped from review as they are similar to previous changes (7)
- contracts/deploy/upgrade-all.ts
- contracts/README.md
- contracts/deployments/arbitrumSepolia/DisputeKitGated.json
- contracts/deployments/arbitrumSepolia/DisputeKitGatedShutter.json
- contracts/deployments/arbitrumSepoliaDevnet/DisputeKitShutter.json
- contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGatedShutter.json
- contracts/deployments/arbitrumSepolia/DisputeKitShutter.json
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: jaybuidl
PR: kleros/kleros-v2#1746
File: contracts/config/courts.v2.mainnet-neo.json:3-5
Timestamp: 2024-11-19T17:18:39.007Z
Learning: In `contracts/config/courts.v2.mainnet-neo.json`, the General Court (id: 1) intentionally references itself as its parent (`"parent": 1`). This self-reference is acceptable and should not be flagged as an issue in future reviews.
Learnt from: kemuru
PR: kleros/kleros-v2#1702
File: web/src/pages/Home/TopJurors/JurorCard/index.tsx:10-11
Timestamp: 2024-10-08T16:23:56.291Z
Learning: In the `kleros-v2` codebase, the property `totalResolvedDisputes` should remain and should not be renamed to `totalResolvedVotes`.
📚 Learning: in `usegenesisblock.ts`, within the `useeffect` hook, the conditions (`isklerosuniversity`, `isklero...
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1744
File: web/src/hooks/useGenesisBlock.ts:9-31
Timestamp: 2024-11-19T05:31:48.701Z
Learning: In `useGenesisBlock.ts`, within the `useEffect` hook, the conditions (`isKlerosUniversity`, `isKlerosNeo`, `isTestnetDeployment`) are mutually exclusive, so multiple imports won't execute simultaneously, and race conditions are not a concern.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in `contracts/config/courts.v2.mainnet-neo.json`, the general court (id: 1) intentionally references...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1746
File: contracts/config/courts.v2.mainnet-neo.json:3-5
Timestamp: 2024-11-19T17:18:39.007Z
Learning: In `contracts/config/courts.v2.mainnet-neo.json`, the General Court (id: 1) intentionally references itself as its parent (`"parent": 1`). This self-reference is acceptable and should not be flagged as an issue in future reviews.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
contracts/deployments/arbitrum/KlerosCoreNeo.json
contracts/deployments/arbitrum/SortitionModuleNeo.json
📚 Learning: in `contracts/config/courts.v2.mainnet-neo.json`, the `minstake` parameter is denominated in pnk, no...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1746
File: contracts/config/courts.v2.mainnet-neo.json:167-170
Timestamp: 2024-11-19T16:31:08.965Z
Learning: In `contracts/config/courts.v2.mainnet-neo.json`, the `minStake` parameter is denominated in PNK, not ETH.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
contracts/deployments/arbitrum/KlerosCoreNeo.json
contracts/deployments/arbitrum/SortitionModuleNeo.json
contracts/deployments/arbitrumSepolia/KlerosCore.json
📚 Learning: in `kleros-sdk/src/sdk.ts`, the `publicclient` type is used and should not be flagged as unused....
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/sdk.ts:1-3
Timestamp: 2024-10-22T10:23:15.789Z
Learning: In `kleros-sdk/src/sdk.ts`, the `PublicClient` type is used and should not be flagged as unused.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in `web/src/hooks/queries/usepopulateddisputedata.ts`, the query and subsequent logic only execute w...
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: web/src/hooks/queries/usePopulatedDisputeData.ts:58-61
Timestamp: 2024-10-14T13:58:25.708Z
Learning: In `web/src/hooks/queries/usePopulatedDisputeData.ts`, the query and subsequent logic only execute when `disputeData.dispute?.arbitrableChainId` and `disputeData.dispute?.externalDisputeId` are defined, so `initialContext` properties based on these values are safe to use without additional null checks.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
contracts/deployments/arbitrum/DisputeKitClassicNeo.json
contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
📚 Learning: in the `contracts/src/rng/chainlinkrng.sol` contract, the `requestrandomness` function is restricted...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1778
File: contracts/src/rng/ChainlinkRNG.sol:135-153
Timestamp: 2024-12-07T11:39:10.927Z
Learning: In the `contracts/src/rng/ChainlinkRNG.sol` contract, the `requestRandomness` function is restricted to being called only by the `SortitionModule`, which does not send concurrent requests. Therefore, it's acceptable not to handle multiple random number requests concurrently in this context.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in the landing component, it's safe to pass `dispute?.dispute?.arbitrated.id as 0x${string}` to `use...
Learnt from: tractorss
PR: kleros/kleros-v2#1982
File: web/src/pages/Resolver/Landing/index.tsx:62-62
Timestamp: 2025-05-15T06:50:40.859Z
Learning: In the Landing component, it's safe to pass `dispute?.dispute?.arbitrated.id as 0x${string}` to `usePopulatedDisputeData` without additional null checks because the hook internally handles undefined parameters through its `isEnabled` flag and won't execute the query unless all required data is available.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: next.js recommends using the `useeffect` hook to set `isclient` and using `suppresshydrationwarning`...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1582
File: web-devtools/src/app/(main)/ruler/SelectArbitrable.tsx:88-90
Timestamp: 2024-10-09T10:22:41.474Z
Learning: Next.js recommends using the `useEffect` hook to set `isClient` and using `suppressHydrationWarning` as a workaround for handling hydration inconsistencies, especially when dealing with data like `knownArbitrables` that may differ between server-side and client-side rendering. This approach is acceptable in TypeScript/React applications, such as in `web-devtools/src/app/(main)/ruler/SelectArbitrable.tsx`.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in this typescript project, when a file (such as `kleros-sdk/src/requests/gqlclient.ts`) exports onl...
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/requests/gqlClient.ts:18-18
Timestamp: 2024-10-24T08:16:02.749Z
Learning: In this TypeScript project, when a file (such as `kleros-sdk/src/requests/gqlClient.ts`) exports only a single entity, it's acceptable to use default exports instead of named exports.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in typescript code using ethers.js version 6, `contract.target` should be used instead of `contract....
Learnt from: jaybuidl
PR: kleros/kleros-v2#1620
File: contracts/test/arbitration/draw.ts:84-84
Timestamp: 2024-11-05T11:32:11.238Z
Learning: In TypeScript code using ethers.js version 6, `contract.target` should be used instead of `contract.address` to access a contract's address.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: in ethers v6, `ethers.tobehex` is the correct method to convert numbers to hex strings....
Learnt from: jaybuidl
PR: kleros/kleros-v2#1620
File: contracts/test/arbitration/draw.ts:98-98
Timestamp: 2024-11-05T11:32:29.452Z
Learning: In Ethers v6, `ethers.toBeHex` is the correct method to convert numbers to hex strings.
Applied to files:
contracts/deploy/00-home-chain-arbitration-neo.ts
📚 Learning: the variables 'arbitrablechainid' and 'externaldisputeid' are required by the context to have upperc...
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1703
File: kleros-sdk/src/utils/getDispute.ts:38-40
Timestamp: 2024-10-21T10:32:16.970Z
Learning: The variables 'arbitrableChainID' and 'externalDisputeID' are required by the context to have uppercase 'ID', so they should remain unchanged even if the corresponding source properties use 'Id'.
Applied to files:
contracts/deployments/arbitrum/DisputeKitClassicNeo.json
contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
📚 Learning: in solidity, a public state variable automatically implements a corresponding external view function...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1805
File: contracts/src/proxy/UUPSProxiable.sol:127-129
Timestamp: 2025-01-22T00:55:35.842Z
Learning: In Solidity, a public state variable automatically implements a corresponding external view function with the same name. For example, `string public constant override version = "0.8.0"` implements the abstract `function version() external view returns (string memory)`.
Applied to files:
contracts/deployments/arbitrum/DisputeKitClassicNeo.json
contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
contracts/deployments/arbitrum/KlerosCoreNeo.json
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
contracts/deployments/arbitrumSepolia/KlerosCore.json
📚 Learning: in `contracts/config/courts.v2.mainnet-neo.json`, the general court (id: 1) can have its `parent` id...
Learnt from: jaybuidl
PR: kleros/kleros-v2#1746
File: contracts/config/courts.v2.mainnet-neo.json:3-17
Timestamp: 2024-11-19T16:09:41.467Z
Learning: In `contracts/config/courts.v2.mainnet-neo.json`, the General Court (ID: 1) can have its `parent` ID set to itself (`"parent": 1`), as there is no parent court with ID 0 currently.
Applied to files:
contracts/deployments/arbitrum/SortitionModuleNeo.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
- GitHub Check: SonarCloud
- GitHub Check: Mend Security Check
- GitHub Check: SonarCloud
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
🔇 Additional comments (37)
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGated.json (1)
1209-1224
: Constructor arg ↔ current implementation mismatch – verify upgrade historyThe constructor argument
_implementation
recorded in"args"[0]
is
0x89BF27c2148873E0ae4d8c6253C2e4423dF959aF
, whereas the"implementation"
field later in the artifact is
0xA27EedcEA916BC1ab91720cE70c56666E854F55e
.Unless an upgradeTo/upgradeToAndCall transaction was executed immediately after deployment, this divergence means the artifact no longer reflects the live implementation behind the proxy.
Down-stream tools (frontend ABIs, subgraph handlers, scripts) that rely on this file to locate the logic contract may interact with an outdated address.Action items
- Confirm on-chain whether the proxy was upgraded from
0x89BF…
to0xA27E…
.- If the upgrade is intentional, update
"args"
(or remove it) so that the artifact’s internal state is self-consistent, or document the upgrade block/tx in a separate migration record.- Re-generate the deployment artifact after each upgrade to avoid silent desynchronisation.
contracts/deployments/arbitrumSepolia/DisputeKitClassic.json (6)
486-504
: Double-check public mapping exposure for dispute activity
coreDisputeIDToActive(uint256) → bool
is now publicly exposed.
If multiple cores will ever share the same dispute-kit instance, a single mapping keyed only by_coreDisputeID
can collide across cores. Consider either:- mapping(uint256 => bool) coreDisputeIDToActive; + mapping(address core => mapping(uint256 coreDisputeID => bool)) coreDisputeIDToActive;or deploying separate kits per core to avoid clashes.
757-785
: Return-value order must match consumer expectations
getLocalDisputeRoundID
now returns(localDisputeID, localRoundID)
.
Verify that every off-chain helper (keeper bot, subgraph, UI hooks) consumes the tuple in the same positional order; otherwise data-mix-ups will silently propagate.
916-944
: Align vote-hashing algorithm across layers
hashVote(uint256 _choice, uint256 _salt, string _justification)
is a pure helper.
Ensure the exact same ABI-encoded hashing (likelykeccak256(abi.encode(_choice, _salt, _justification))
) is re-implemented in:• the frontend
VoteWithCommit*
components
• keeper scripts that pre-compute commitsAny deviation will brick commit/reveal.
953-967
: Initializer signature change – update all deploy/upgrade scripts
initialize
now requires_wNative
.
Scripts that previously passed only governor & core will revert. Confirm that:
contracts/deploy/upgrade-all.ts
is already adapted (looks so from PR text).- The address supplied in this artefact (
0x...
) really is the canonical wrapped ETH for Arbitrum Sepolia.
1183-1188
: Compiler & bytecode hash drift
solc
bumped to 0.8.28 andsolcInputHash
changed.
Make sure every dependent kit/contract compiled together; mixed-compiler upgrades in the same diamond/proxy tree can yield storage-layout incompatibilities.
1189-1193
: Upgrade execution sanity checkThe
execute
stanza shows a directreinitialize
call with the wrapped token address.
Confirm this transaction was sent via the governor and not by EOAs, maintaining the UUPS proxy security model.contracts/deployments/arbitrumSepolia/KlerosCore.json (5)
1329-1336
: Confirm every caller handles the newnbDrawnJurors
return value
draw()
now returns auint256 nbDrawnJurors
.
• Keeper-bot scripts, dispute-kit contracts, Subgraph handlers, and any off-chain services that used to calldraw()
for its side-effects only must now read & consume (or safely ignore) the returned value.
• Failing to do so in Solidity can leave the return data on the stack and causestack too deep
issues when the result is forwarded.Consider grepping for
.draw(
across the repo to ensure all call-sites have been updated.
1801-1813
: Re-initialisation surface – confirm access control & version gating
reinitialize(address _wNative)
is now publicly exposed. If not protected by:
- a versioned
reinitializer(#)
modifier and- an
onlyGovernor
/guardian
check (or similar),any account could alter core fee-token logic post-deployment.
Please confirm the underlying Solidity uses
initializer
/reinitializer
with_initialized < X
guard plus role checks.
1868-1885
:transferBySortitionModule
must be strictlySortitionModuleOnly
Moving PNK from core to jurors is sensitive. Ensure the function is:
•
onlySortitionModule
(or an internal call),
• emits an event for indexing, and
• performssafeTransfer
.
1924-1936
: Good addition –wNative()
view accessorProviding an accessor for the wrapped-native address improves frontend & subgraph UX.
2030-2041
: Deployment metadata drift – compiler / pragma mismatchThe ABI reports
solc 0.8.28
while source pragmas in the embedded provenance (pragma solidity ^0.8.24;
). This is legal but worth tracking; inadvertent minor-version jumps can change opcode costs (e.g., PUSH0 in 0.8.20).Confirm CI is compiling every contract with 0.8.28 consistently and that audit tooling covers this version bump.
contracts/deployments/arbitrum/DisputeKitClassicNeo.json (7)
486-504
: NewcoreDisputeIDToActive
getter looks fine but double-check downstream usage
The added view neatly exposes dispute liveness and keeps naming in line withcoreDisputeIDToLocal
. Make sure the subgraph and any front-end helpers now prefer this on-chain source over cached state.
757-785
: Confirm consumers are updated forgetLocalDisputeRoundID
The twin return values will break existing helpers that assumed a single uint. Search the TS/JS codebase for.getLocalDisputeRoundID(
and adapt typings accordingly.
786-804
:getNumberOfRounds
– check off-chain pagination logic
Adding this utility is welcome. However, some UIs iterate withroundId < dispute.rounds.length
; please migrate those loops to call this getter to avoid under/over-fetching.
956-960
:initialize
signature changed – validate proxy bootstrap path
The constructor‐supplied_data
(line 1181) encodes the old 2-arg initializer, so_wNative
is not set duringUUPSProxy
construction. You compensate with a follow-upreinitialize
, but be sure:
initialize()
now blocks re-entry (AlreadyInitialized
)reinitialize()
is version-gated (initializer(2)
/reinitializer
) and access-controlled (onlyGovernor)- Zero-address
_wNative
is rejected.
1086-1098
:wNative()
getter added – good
Exposing the wrapped native token is useful for UI fee calculations. No issues spotted.
1183-1186
: Compiler metadata mismatch
metadata.compiler.version
is0.8.28
, but the embedded source pragma is^0.8.24
. While compatible, it can confuse sourcify/etherscan verification. Regenerate the proxy stub with matching pragma or pin the pragma to0.8.28
.
1189-1193
: Deployment script now callsreinitialize
– ensure idempotency
numDeployments
bumped to 3 andexecute.methodName
isreinitialize
. Confirm that replaying the deployment script on fresh networks does not callreinitialize
twice (would revert) and that migration scripts guard onInitialized(version)
events.contracts/deployments/arbitrum/SortitionModuleNeo.json (1)
396-399
: LegacyalreadyTransferred
flag still present indelayedStakes
tuple.The PR notes that the “alreadyTransferred” bookkeeping was removed, yet the ABI for
delayedStakes
still exposes this boolean.
Please confirm that the storage layout truly needs to keep the flag; if not, drop it to avoid misleading integrators.contracts/deploy/00-home-chain-arbitration-neo.ts (6)
9-9
: LGTM - Good cleanup of unused imports.Removing the unused
RandomizerRNG
import improves code cleanliness while keeping the necessary imports.
13-13
: LGTM - Simplified destructuring removes unused property.Only extracting the
deploy
method that's actually used in the script is good practice.
35-35
: LGTM - Correctly adds WETH support to dispute kit.The addition of
weth.target
as a constructor argument aligns with the PR objective to introduce WETH token support across core contracts and dispute kits.
84-84
: LGTM - Correctly implements updated KlerosCoreNeo interface.The addition of
weth.target
parameter aligns with the updated initialization function signature that now requires the wrapped native token address.
126-146
: LGTM - Correctly implements new dispute kit deployments.The three new dispute kits (Shutter, Gated, and GatedShutter) are properly deployed with consistent constructor arguments and correctly registered with the core contract. This aligns with the PR objective to introduce new dispute kits.
148-148
: LGTM - Good addition of clarifying comment.The comment improves code readability by clearly marking the snapshot proxy deployment section.
contracts/deployments/arbitrum/KlerosCoreNeo.json (6)
1400-1406
: LGTM - Draw function correctly returns number of drawn jurors.The updated return type
uint256 nbDrawnJurors
aligns with the AI summary stating that thedraw
function was modified to return the number of jurors drawn during the draw operation.
1749-1754
: LGTM - Initialize function correctly adds WETH parameter.The addition of the
address _wNative
parameter aligns with the AI summary noting that the initialize function signature was extended to include the wrapped native token address for protocol-wide WETH support.
1889-1901
: LGTM - Reinitialize function properly supports contract upgrades.The new
reinitialize
function with the_wNative
parameter follows standard upgrade patterns and allows existing contracts to be upgraded with WETH support, as mentioned in the AI summary.
1956-1973
: LGTM - New transfer function properly supports sortition module operations.The
transferBySortitionModule
function provides the necessary permissioned token transfer interface for the sortition module, as described in the AI summary, enhancing the protocol's token management capabilities.
2012-2024
: LGTM - wNative function properly exposes wrapped token address.The new view function correctly provides access to the wrapped native token address, completing the WETH integration by allowing external queries of the configured token.
2118-2129
: LGTM - Deployment metadata correctly reflects contract upgrade.The updated metadata shows proper progression: increased deployment count to 3, updated Solidity compiler to 0.8.28, new implementation address, and execute method calling
reinitialize
with the WETH token address, all consistent with the protocol upgrade.contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json (5)
2-2
: New proxy address introduced – check downstream configs
"address": "0xeEEbbbff8f377dCFc7d4F7876C531db0d22720e1"
supersedes the previous Classic DK proxy.
Please update environment variables, subgraphnetworks.json
, hard-coded addresses in keeper/SDK scripts, and any CI secrets that whitelist the old address.
324-352
:alreadyDrawn()
ABI addition – make sure indexers & bots are upgradedThe new view helps keeper bots avoid double draws. Ensure:
- Subgraph mappings listen for it (or fetch it) before emitting
JurorDrawn
.- Front-end queries are regenerated (
typechain
/wagmi
).Missing updates will silently break draw workflows.
757-785
: Tuple order ofgetLocalDisputeRoundID()
– double-check TypeChain typingsThe function returns
(localDisputeID, localRoundID)
.
Type generation tools sometimes reorder unnamed tuple fields; bump the SDK and re-generate types to avoid mis-mapping.
1086-1098
: ExposewNative()
– front-end & payout logic must now rely on itReplace hard-coded WETH/WMATIC addresses with this getter to stay chain-agnostic.
1189-1193
: Deployment executesreinitialize
– confirm the intended upgrade pathUsing
execute.methodName = "reinitialize"
on first deployment is unusual for a UUPS proxy.
Make sure:
- The proxy was already initialized once (upgrade scenario).
- The storage gap is respected.
Otherwise, you might be locking the proxy in an uninitialized state.
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
|
Contract changes
V0.11.0
V0.10.0
PR-Codex overview
This PR focuses on enhancing the dispute resolution system by introducing new components and updating existing ones, particularly around the
Shutter
dispute kit, along with various improvements in the codebase for better functionality and maintainability.Detailed summary
AllCasesButton
component.SeeAllCasesButton
andSeeAllJurorsButton
components.JustificationArea
import paths.disputeKit
to theStakingResult
enum.REACT_APP_SHUTTER_API
.disputeKit
structure.package.json
files.DisputeKitGatedShutterProxy
andDisputeKitShutterProxy
.Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Chores