Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Sep 12, 2025

PR-Codex overview

This PR introduces a new contract DisputeTemplateRegistryUniversityProxy, updates various references to DisputeTemplateRegistryUniversity, and modifies function calls to reflect changes in ownership and governance. It also updates deployment configurations and test files accordingly.

Detailed summary

  • Added DisputeTemplateRegistryUniversityProxy contract extending UUPSProxy.
  • Renamed disputeTemplateRegistry to DisputeTemplateRegistryUniversity in test files.
  • Changed owner to governor in execution.ts.
  • Updated deployment scripts to include DisputeTemplateRegistryUniversity.
  • Adjusted configurations in deployment files for DisputeTemplateRegistryUniversity.
  • Updated contract addresses in README.md and JSON files for deployment.

The following files were skipped due to too many changes: contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json, contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Proxy.json, contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json, contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json, contracts/deployments/arbitrumSepoliaDevnet.ts, contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json, contracts/deployments/devnet.viem.ts, contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity_Implementation.json, contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Implementation.json, contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Implementation.json

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Introduced Dispute Template Registry (University) on Arbitrum Sepolia Devnet.
    • Added leftover PNK tracking and withdrawal.
    • Expanded staking/draw functions, dispute/juror insights, and version getters.
  • Changes

    • Governance migrated from “governor” to “owner” across University contracts.
    • Updated University contract deployments on Arbitrum Sepolia (proxy/implementation refresh).
    • Event and error sets refined; function names aligned with ownership model.
  • Documentation

    • Devnet renamed to “V2 Devnet (unstable)” in README.
    • Minor formatting fix in network listings.

Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for kleros-v2-testnet ready!

Name Link
🔨 Latest commit 452246f
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet/deploys/68c4a9f87c3a7b0008c3d3d5
😎 Deploy Preview https://deploy-preview-2138--kleros-v2-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit 452246f
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-university/deploys/68c4a9f8b78e300008782732

Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 452246f
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-neo/deploys/68c4a9f858891400081a2832
😎 Deploy Preview https://deploy-preview-2138--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Walkthrough

Renames “Devnet” to “V2 Devnet (unstable)”, updates Arbitrum Sepolia University deployment addresses, introduces DisputeTemplateRegistryUniversity (UUPS proxy + implementation), upgrades University variants of DisputeKitClassic, KlerosCore, SortitionModule, and DisputeResolver with owner-based governance and ABI changes, adjusts deploy script and contract lookup utilities, expands proxy suite, and updates related tests.

Changes

Cohort / File(s) Summary
Docs
contracts/README.md
Renamed Devnet heading; updated Arbitrum Sepolia University addresses; minor bullet fix.
Deploy script flow
contracts/deploy/00-home-chain-arbitration-university.ts
Deploys DisputeTemplateRegistryUniversity (upgradeable) and returns early; updates DisputeKitClassicUniversity constructor args.
DisputeTemplateRegistryUniversity (new)
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json, .../DisputeTemplateRegistryUniversity_Proxy.json, .../DisputeTemplateRegistryUniversity_Implementation.json
Adds new UUPS proxy + implementation and deployment artifacts; initialize sets owner; exposes template management and upgrade functions.
DisputeKitClassicUniversity upgrades
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json, .../DisputeKitClassicUniversity_Proxy.json
ABI overhauled (owner model, hashVote, new getters, removed ONE_BASIS_POINT), new implementation/proxy, compiler settings updated.
KlerosCoreUniversity upgrades
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json, .../KlerosCoreUniversity_Proxy.json
Owner/instructor model, new functions/events, renamed methods, new proxy/implementation and metadata updates.
SortitionModuleUniversity upgrades
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json, .../SortitionModuleUniversity_Proxy.json
Staking/draw API changes, new errors/events, owner getter, additional stake management functions, redeployed proxy/impl.
DisputeResolverUniversity updates
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
Switch to owner governance, event signature change (removed templateUri), removed createDisputeForTemplateUri, compiler metadata updated.
Proxy suite expansion
contracts/src/proxy/KlerosProxies.sol
Adds DisputeTemplateRegistryUniversityProxy; broader proxy set reflected in deployment artifacts.
Contract retrieval config
contracts/deployments/contractsEthers.ts, contracts/deployments/contractsViem.ts, contracts/scripts/utils/contracts.ts
Wire university dispute template registry config/name; expose via per-core mappings.
Execution util
contracts/scripts/utils/execution.ts
governableAbi uses governor; reads governor() instead of owner().
Tests
contracts/test/integration/getContractsEthers.test.ts, contracts/test/integration/getContractsViem.test.ts
University mapping uses "DisputeTemplateRegistryUniversity" name.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Deployer
  participant Proxy as DTR University Proxy
  participant Impl as DTR University Impl
  participant Chain as Arbitrum Sepolia

  rect rgb(235, 245, 255)
  note over Deployer,Chain: Deployment flow (University)
  Deployer->>Chain: deploy Proxy(implementation, initData)
  Chain-->>Proxy: constructed
  Proxy->>Impl: delegatecall initialize(owner)
  Impl-->>Proxy: initialized
  end

  rect rgb(245, 235, 255)
  note over Deployer: Script early return after DTR deployment
  Deployer--x Chain: skip subsequent DK/Core/Sortition setup in this run
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • unknownunknown1
  • clesaege

Poem

A rabbit taps the devnet drum,
New proxies sprout—upgrades hum.
Owner rules where governor stood,
Kits and cores now understood.
Templates filed, addresses neat,
Sepolia’s garden feels complete.
Hop, deploy—another feat! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "University redeploy" concisely and accurately reflects the primary change set — redeploying and updating university-specific contracts and proxies (e.g., DisputeTemplateRegistryUniversity, KlerosCoreUniversity, SortitionModuleUniversity, DisputeKitClassicUniversity) on the devnet, so it is relevant and clear for a quick scan of PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/university-deploy-stable

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Comment @coderabbitai help to get the list of available commands and usage tips.

@jaybuidl jaybuidl added the Package: Contracts Court smart contracts label Sep 12, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for kleros-v2-testnet-devtools failed. Why did it fail? →

Name Link
🔨 Latest commit 452246f
🔍 Latest deploy log https://app.netlify.com/projects/kleros-v2-testnet-devtools/deploys/68c4a9f858c5980008306741

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json (1)

236-244: ABI surface changed — update callers, indexers, tests and deployment ABIs

  • Offchain & frontend: update draw callsites to the new return shape (destructure tuple / handle extra return values) — e.g. web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (draw call).
  • Keeper / scripts: fix core.draw usage/staticCall (keeperBot: contracts/scripts/keeperBot.ts casts staticCall to bigint — adjust to actual return).
  • Tests: update expectations for StakeSet and draw across contracts/test/arbitration/* and contracts/test/sortition/* (withArgs / destructuring as needed).
  • Subgraphs / indexers: update mappings and generated types in subgraph/core/src/SortitionModule.ts and subgraph/core-university/src/SortitionModule.ts, update tests (subgraph/core/tests/*), and run codegen after ABI changes (handle extended StakeSet params and add LeftoverPNK handler if present).
  • Deployments / ABIs: update contracts/deployments/* (devnet/testnet/mainnet/arbitrumSepoliaDevnet...) where StakeSet and related ABI entries are defined.
  • governor() migration: ripgrep found no TS/JS uses, but the search did not run over .sol files — scan Solidity sources for governor() and migrate to owner() for university deployments.
contracts/deploy/00-home-chain-arbitration-university.ts (1)

92-97: Use DisputeTemplateRegistryUniversity here

getContractOrDeployUpgradable currently requests "DisputeTemplateRegistry" — change to "DisputeTemplateRegistryUniversity" so the resolver wires to the university registry.

File: contracts/deploy/00-home-chain-arbitration-university.ts (lines 92–97)

-  const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistry", {
+  const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistryUniversity", {
     from: deployer,
     args: [deployer],
     log: true,
   });
🧹 Nitpick comments (7)
contracts/README.md (1)

77-110: Addresses update looks good; add provenance details for ops

Consider appending deployment tx hashes and block numbers next to each new address to ease verification and rollbacks.

contracts/test/integration/getContractsViem.test.ts (1)

214-216: Minor: clarify DEVNET path for “university” verification.

Add a brief comment explaining why university uses NETWORKS.DEVNET (artifacts live under arbitrumSepoliaDevnet) to avoid confusion.

-    await verifyDeployedAddresses(contracts, NETWORKS.DEVNET, universityContractMapping);
+    // University artifacts are stored under arbitrumSepoliaDevnet.
+    await verifyDeployedAddresses(contracts, NETWORKS.DEVNET, universityContractMapping);
contracts/scripts/utils/contracts.ts (1)

54-55: University mapping LGTM.

Correctly points to DisputeTemplateRegistryUniversity for university deployments.

Consider allowing getContractsFromNetwork/getContractNamesFromNetwork to accept an optional core override (env var or param) to support university without hardcoding network names.

contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json (2)

292-299: ABI change: _courtID/_parent now uint96 — update clients/subgraphs

CourtCreated now emits uint96 for IDs. Update any decoding schemas/types that assumed uint256.


1533-1561: ABI change: Round tuple expanded

getRoundInfo now includes drawnJurorFromCourtIDs (uint96[]) and a __gap field. Regenerate typings and adjust tuple decoding.

contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json (2)

812-822: Nit: getDegreeOfCoherencePenalty output name

The output is named pnkCoherence while the function denotes a penalty. Consider renaming in source for clarity in future builds (no on-chain impact).


1070-1097: Nit: hashVote’s third parameter is unnamed in ABI

Consider naming the string parameter (e.g., _saltedJustification) in source to improve autogenerated client typings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbc111a and 452246f.

📒 Files selected for processing (19)
  • contracts/README.md (2 hunks)
  • contracts/deploy/00-home-chain-arbitration-university.ts (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json (19 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json (3 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (10 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json (1 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json (18 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Proxy.json (2 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json (13 hunks)
  • contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity_Proxy.json (2 hunks)
  • contracts/deployments/contractsEthers.ts (2 hunks)
  • contracts/deployments/contractsViem.ts (2 hunks)
  • contracts/scripts/utils/contracts.ts (2 hunks)
  • contracts/scripts/utils/execution.ts (2 hunks)
  • contracts/src/proxy/KlerosProxies.sol (1 hunks)
  • contracts/test/integration/getContractsEthers.test.ts (1 hunks)
  • contracts/test/integration/getContractsViem.test.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-04T23:36:16.415Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#2126
File: contracts/src/arbitration/KlerosCore.sol:472-489
Timestamp: 2025-09-04T23:36:16.415Z
Learning: In this repo, KlerosCore emits AcceptedFeeToken and NewCurrencyRate events that are declared in contracts/src/arbitration/interfaces/IArbitratorV2.sol; implementations don’t need to redeclare these events.

Applied to files:

  • contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
  • contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json
📚 Learning: 2025-01-22T00:55:35.842Z
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/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json
  • contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json
📚 Learning: 2024-11-19T16:31:08.965Z
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/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json
🧬 Code graph analysis (1)
contracts/deploy/00-home-chain-arbitration-university.ts (2)
contracts/deploy/utils/deployUpgradable.ts (1)
  • deployUpgradable (37-89)
contracts/deployments/utils.ts (1)
  • deployments (3-16)
⏰ 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). (15)
  • GitHub Check: Redirect rules - kleros-v2-neo
  • GitHub Check: Header rules - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-university
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-neo
  • GitHub Check: Redirect rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-university
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Header rules - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-university
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Pages changed - kleros-v2-testnet
  • GitHub Check: Analyze (javascript)
  • GitHub Check: SonarCloud
  • GitHub Check: hardhat-tests
🔇 Additional comments (17)
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity_Proxy.json (1)

2-67: Proxy artifact refresh acknowledged

Proxy address, tx hash, and metadata updated; matches README. No issues.

contracts/deployments/contractsViem.ts (1)

22-24: Switch to DisputeTemplateRegistryUniversity config is correct

University mapping now points to the university-specific DTR config. LGTM.

Also applies to: 170-177

contracts/deployments/contractsEthers.ts (1)

21-23: University DTR wiring updated

Using devnetDtrUniversityConfig for university deployments is consistent with artifacts and tests.

Also applies to: 206-213

contracts/test/integration/getContractsEthers.test.ts (1)

89-90: Test mapping aligned with university artifact name

Switching to "DisputeTemplateRegistryUniversity" ensures address lookup matches deployments.

contracts/src/proxy/KlerosProxies.sol (1)

34-36: New DisputeTemplateRegistryUniversityProxy added

Consistent with UUPSProxy pattern and deployment artifacts. No issues.

contracts/test/integration/getContractsViem.test.ts (1)

69-69: Approve — DisputeTemplateRegistryUniversity rename is correct. Artifact exists at contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json and is referenced in deployments and tests (address present in contracts/deployments/arbitrumSepoliaDevnet.ts).

contracts/deploy/00-home-chain-arbitration-university.ts (1)

39-39: Initializer args: double-check WETH reference.

  • contracts/deploy/00-home-chain-arbitration-university.ts:39 — verify deployERC20AndFaucet returns an object with a .target (address) and that DisputeKitClassic.initialize(owner, zeroAddr, weth, 1) expects the weth address; if it expects an address, pass weth.target (or weth.address) instead of the contract instance.
contracts/scripts/utils/contracts.ts (1)

44-45: BASE mapping LGTM.

Keeps BASE behavior unchanged for the dispute template registry.

contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json (1)

1-446: Approve — UUPS implementation artifact looks correct; implementation address only referenced in deployments/docs

ABI, storage layout and events align. Repo search shows the implementation address 0xC3f638389635bF33E019c845FdaF2ed9bca3DF67 appears only in deployment artifacts and README (no occurrences in application/runtime code outside deployments).

Affected files:

  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json
  • contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json
  • contracts/deployments/arbitrumSepoliaDevnet.ts
  • contracts/deployments/devnet.viem.ts
  • contracts/README.md
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json (1)

1-81: Proxy wiring LGTM — verified

Constructor args point to the implementation; initializer selector matches initialize(address) (0xc4d66de8). diff failed in the sandbox (/dev/fd unavailable) but both addresses printed identically.

contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json (1)

296-303: LGTM: proxy wired to implementation and initialized with owner

Proxy address, implementation, and initializer args look consistent. No issues spotted here.

contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Proxy.json (1)

101-109: Confirm client compatibility with new compiler/bytecode settings

This proxy was rebuilt with Solidity 0.8.30 (viaIR, cancun). Ensure ABIs in downstream clients/subgraphs are regenerated against these artifacts to avoid decoder drift.

contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json (1)

58-61: Incorrect — DK initializer does not set core to 0x0

Constructor calldata (contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json, args[1])'s first 32‑byte argument is 0x000000000000000000000000f1C7c037891525E360C59f708739aC09A7670c59 (address 0xf1C7c037891525E360C59f708739aC09A7670c59), not 0x0.

Likely an incorrect or invalid review comment.

contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json (2)

1966-1974: Sanity-check initializer wiring (DK, prosecution module, owner/instructor)

Initializer embeds:

  • owner = 0xF1C7...c59
  • instructor = 0xF1C7...c59
  • jurorProsecutionModule = 0x000...000
  • disputeKit = 0x82F208...92F91 (DK Classic Univ)

Please confirm the prosecution module is intentionally unset (0x0). If not, plan a changeJurorProsecutionModule(address) call.


1387-1391: Function rename: executeOwnerProposal

Downstream code invoking executeGovernorProposal must be updated to executeOwnerProposal.

contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (1)

302-302: Good: Arbitrator wired to Core proxy

_arbitrator = 0xA34dBBD0E5e1d09bd683455f9dbC393797BC558f matches the Core proxy. Looks correct.

contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json (1)

1360-1366: Reconfirm initializer constants (core=0x0, wNative, jumpDKID)

  • _core is 0x0 here as well; ensure a changeCore follow-up is executed (see DK proxy comment).
  • _wNative = 0x3829A2486d53ee984a0ca2D76552715726b77138 — confirm this is the intended wrapped native on Arbitrum Sepolia.
  • _jumpDisputeKitID = 1 — confirm expected.

Comment on lines +27 to +34
await deployUpgradable(deployments, "DisputeTemplateRegistryUniversity", {
from: deployer,
contract: "DisputeTemplateRegistry",
args: [deployer],
log: true,
});

return;
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

⚠️ Potential issue

Early return aborts the rest of the deployment.

This return stops deploying DisputeKit, Sortition, KlerosCore, Resolver, and configuring rates. Remove it, and prefer idempotent getContractOrDeployUpgradable for the registry to align with the rest of the script.

-  await deployUpgradable(deployments, "DisputeTemplateRegistryUniversity", {
-    from: deployer,
-    contract: "DisputeTemplateRegistry",
-    args: [deployer],
-    log: true,
-  });
-
-  return;
+  // Ensure the university registry exists (UUPS proxy + implementation).
+  await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistryUniversity", {
+    from: deployer,
+    args: [deployer],
+    log: true,
+  });
📝 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
await deployUpgradable(deployments, "DisputeTemplateRegistryUniversity", {
from: deployer,
contract: "DisputeTemplateRegistry",
args: [deployer],
log: true,
});
return;
// Ensure the university registry exists (UUPS proxy + implementation).
await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistryUniversity", {
from: deployer,
args: [deployer],
log: true,
});
🤖 Prompt for AI Agents
In contracts/deploy/00-home-chain-arbitration-university.ts around lines 27-34,
the early "return" aborts the remainder of the deployment script and prevents
DisputeKit, Sortition, KlerosCore, Resolver and rate configuration from running;
remove the return and replace the direct deployUpgradable call for the registry
with the idempotent getContractOrDeployUpgradable pattern used elsewhere so the
registry is only deployed if missing and the script continues to execute the
remaining deployment and configuration steps.

Comment on lines +302 to 304
"0xA34dBBD0E5e1d09bd683455f9dbC393797BC558f",
"0xc852F94f90E3B06Da6eCfB61d76561ECfb94613f"
],
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

Critical: Template registry address doesn’t match the newly deployed University registry

DisputeResolverUniversity constructor arg _templateRegistry is 0xc852F94f90E3B06Da6eCfB61d76561ECfb94613f, while the newly deployed DisputeTemplateRegistryUniversity proxy in this PR is 0x75A5D16e9A699162506E4d79D68CF646e6600ba1. If this isn’t intentional, call changeTemplateRegistry(0x75A5...0ba1) to align.

To verify wiring locally:

If different, fix with (foundry example):

cast send 0x8a7902Ef9a5308C7DF0A68A28EEDd6D83436993D "changeTemplateRegistry(address)" 0x75A5D16e9A699162506E4d79D68CF646e6600ba1 --private-key $PK --rpc-url $RPC

🏁 Script executed:

#!/bin/bash
jq -r '.address' contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json
jq -r '.args[1]' contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json

Length of output: 85


Critical: Align DisputeResolverUniversity template registry address

DisputeTemplateRegistryUniversity (.address) = 0x75A5D16e9A699162506E4d79D68CF646e6600ba1 while DisputeResolverUniversity (.args[1]) = 0xc852F94f90E3B06Da6eCfB61d76561ECfb94613f — fix by either updating contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json to 0x75A5... or call changeTemplateRegistry(0x75A5D16e9A699162506E4d79D68CF646e6600ba1) on the deployed resolver. Example:
cast send <RESOLVER_ADDRESS> "changeTemplateRegistry(address)" 0x75A5D16e9A699162506E4d79D68CF646e6600ba1 --private-key $PK --rpc-url $RPC

🤖 Prompt for AI Agents
In contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
around lines 302–304, the resolver's template registry address in .args[1]
(0xc852F94f90E3B06Da6eCfB61d76561ECfb94613f) does not match the actual
DisputeTemplateRegistryUniversity.address
(0x75A5D16e9A699162506E4d79D68CF646e6600ba1); fix by either (A) updating
.args[1] in this JSON to 0x75A5D16e9A699162506E4d79D68CF646e6600ba1 so the
deployment metadata matches the registry, or (B) keep the JSON as-is and on the
deployed resolver call changeTemplateRegistry with
0x75A5D16e9A699162506E4d79D68CF646e6600ba1 (using your deployment/owner account)
to point the resolver to the correct registry.

Comment on lines 5 to 9
const governableAbi = [
{
inputs: [],
name: "owner",
name: "governor",
outputs: [
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 ABI compatibility: support both owner() and governor() getters

University deployments expose owner(), not governor(). Calling governor() will revert and break batching logic. Fallback to owner() first, then governor(); also guard tx.to for creation txs.

-const governableAbi = [
-  {
-    inputs: [],
-    name: "governor",
-    outputs: [
-      {
-        internalType: "address",
-        name: "",
-        type: "address",
-      },
-    ],
-    stateMutability: "view",
-    type: "function",
-  },
-];
+const ownerAbi = [
+  {
+    inputs: [],
+    name: "owner",
+    outputs: [{ internalType: "address", name: "", type: "address" }],
+    stateMutability: "view",
+    type: "function",
+  },
+];
+const governorAbi = [
+  {
+    inputs: [],
+    name: "governor",
+    outputs: [{ internalType: "address", name: "", type: "address" }],
+    stateMutability: "view",
+    type: "function",
+  },
+];
@@
-  const contract = await ethers.getContractAt(governableAbi, tx.to);
-  const owner = await contract.governor();
-  const isContract = (await ethers.provider.getCode(owner)).length > 2;
+  if (!tx.to) {
+    const signer = (await ethers.getSigners())[0];
+    await signer.sendTransaction(tx);
+    return;
+  }
+  let authority: string;
+  try {
+    authority = await (await ethers.getContractAt(ownerAbi, tx.to)).owner();
+  } catch {
+    authority = await (await ethers.getContractAt(governorAbi, tx.to)).governor();
+  }
+  const isContract = (await ethers.provider.getCode(authority)).length > 2;

Also applies to: 27-31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: Contracts Court smart contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant