Skip to content

Conversation

@jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Oct 8, 2025

PR-Codex overview

This PR focuses on enhancing the CurateV2 contract by modifying event emissions to include evidence data and removing the evidenceModule from the ArbitrationParams structure, streamlining the arbitration process.

Detailed summary

  • Updated RequestSubmitted event to include _evidence parameter.
  • Added RequestChallenged event with _evidence parameter.
  • Removed evidenceModule from ArbitrationParams structure.
  • Simplified calls to ArbitrationParams by excluding evidenceModule.
  • Emitted evidence directly in the RequestSubmitted and RequestChallenged events.

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

Summary by CodeRabbit

  • New Features

    • Evidence is now included directly in submission and challenge events.
    • Added a RequestChallenged event to surface evidence on challenges.
  • Refactor

    • Simplified arbitration parameters by removing the evidence module dependency.
    • Updated RequestSubmitted event to include an evidence field.
    • Routes that previously relied on an external evidence submission flow now pass evidence via events.
  • Documentation

    • Integrators should update listeners to handle the new/changed event payloads (RequestSubmitted now includes evidence; new RequestChallenged event).

@netlify
Copy link

netlify bot commented Oct 8, 2025

Deploy Preview for curate-v2 ready!

Name Link
🔨 Latest commit 4180b92
🔍 Latest deploy log https://app.netlify.com/projects/curate-v2/deploys/68e693b8c4a5020008403026
😎 Deploy Preview https://deploy-preview-86--curate-v2.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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

The change removes the EvidenceModule from arbitration parameters and shifts evidence handling to events. RequestSubmitted now includes an evidence string, and a new RequestChallenged event carries challenge evidence. Initialization and arbitration parameter updates no longer reference evidenceModule. Evidence submission calls are removed in favor of emitting event data.

Changes

Cohort / File(s) Summary
Contracts — evidence flow and arbitration params
contracts/src/CurateV2.sol
Removed evidenceModule from ArbitrationParams; updated initialize and changeArbitrationParams to set only arbitrator and arbitratorExtraData. Modified RequestSubmitted to (bytes32, uint256, string) and added RequestChallenged(bytes32, uint256, string). Replaced prior evidence-module submissions with emitting evidence via events (empty string when absent). Adjusted request submit/challenge paths accordingly.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant C as CurateV2
  participant A as Arbitrator (configured)

  rect rgb(240,248,255)
  note over C: New flow (events carry evidence)
  U->>C: submitItem/removeItem(..., evidence)
  C-->>U: emit RequestSubmitted(itemID, requestID, evidence)
  U->>C: challengeRequest(..., evidence)
  C-->>U: emit RequestChallenged(itemID, requestID, evidence)
  C->>A: createDispute(..., arbitratorExtraData)
  A-->>C: ruling(...)
  end
Loading
sequenceDiagram
  autonumber
  participant U as User
  participant C as CurateV2
  participant EM as EvidenceModule
  participant A as Arbitrator

  rect rgb(253,246,227)
  note over C,EM: Prior flow (removed)
  U->>C: submit/challenge(..., evidence)
  C->>EM: submitEvidence(itemID, requestID, evidence)
  EM-->>C: ack
  C->>A: createDispute(...)
  A-->>C: ruling(...)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Refactor/evidence refactors #49 — Also refactors CurateV2 evidence handling to pass evidence through function params and events, aligning with this event-based approach.

Suggested reviewers

  • kemuru

Poem

A hare taps logs with gentle cheer,
“No modules now—events are here!”
With strings of proof in tidy rows,
The chains of bytes tell all it knows.
Hop, emit, and off we go—
The court will hear what rabbits show. 🐇✨

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 “No evidence submission by the contract” directly reflects the core change of removing on-chain evidence submission logic from the contract and aligns with the modifications described in the summary. It is concise and clearly communicates the primary intent of the pull request in a single sentence without extraneous detail. Teammates scanning the history will immediately understand that the contract’s evidence submission pathway has been removed.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/no-evidence

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc5502a and 4180b92.

📒 Files selected for processing (1)
  • contracts/src/CurateV2.sol (6 hunks)
⏰ 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). (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (6)
contracts/src/CurateV2.sol (6)

69-72: LGTM! Clean removal of evidenceModule field.

The struct simplification aligns with the PR objective of moving evidence handling to events. This is a breaking change that downstream consumers will need to handle.


134-135: LGTM! Event signature correctly updated.

The addition of the _evidence parameter allows evidence data to be captured in event logs without contract storage, which is gas-efficient. Note that this is a breaking change for existing event listeners and indexers.


137-141: LGTM! New event enhances evidence tracking.

The RequestChallenged event mirrors the structure of RequestSubmitted, providing consistent evidence capture for both submission and challenge flows.


384-384: Consider accepting evidence parameter in addItem() for consistency.

The addItem() function emits RequestSubmitted with an empty evidence string, while removeItem() accepts an _evidence parameter. This creates an API inconsistency where registrants cannot provide evidence at submission time, but removal requesters can.

Is this intentional? If registration requests should also support evidence, consider updating the function signature:

-function addItem(string calldata _item) external payable {
+function addItem(string calldata _item, string calldata _evidence) external payable {
     // ... existing code ...
-    emit RequestSubmitted(itemID, getRequestID(itemID, item.requestCount - 1), "");
+    emit RequestSubmitted(itemID, getRequestID(itemID, item.requestCount - 1), _evidence);

If the current design is intentional (registrations don't need evidence), consider documenting this behavior in the function's NatSpec.


417-417: LGTM! Evidence correctly emitted in event.

The removeItem() function correctly passes the _evidence parameter to the RequestSubmitted event, allowing evidence to be captured in event logs.


468-468: LGTM! Challenge evidence correctly emitted.

The challengeRequest() function correctly emits the new RequestChallenged event with the provided _evidence parameter, maintaining the evidence trail for challenges.


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

@jaybuidl jaybuidl requested review from kemuru and tractorss October 8, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract: do not interact with the EvidenceModule, rely on a custom event and the data mappings instead.

2 participants