-
Notifications
You must be signed in to change notification settings - Fork 49
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
base: master
Are you sure you want to change the base?
Release #2012
Changes from all commits
1ff55f8
036e897
f20c9d4
54d83a7
9e8aa9e
7a5466b
1ca9066
29ef9a1
3925b6f
ad47783
349783f
f370669
3f532d2
20ee602
282b91d
411b384
367549c
30382a0
e5cf1df
e7a0759
dde0dc7
4e95c72
2b51d5e
4adedb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#! /usr/bin/env bash | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
declare -A rpcUrls | ||
rpcUrls["arbitrum"]=$(mesc url arbitrum_alchemy) | ||
rpcUrls["arbitrumSepolia"]=$(mesc url arbitrumSepolia_alchemy) | ||
rpcUrls["arbitrumSepoliaDevnet"]=$(mesc url arbitrumSepolia_alchemy) | ||
jaybuidl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# event Initialized(uint64 version); | ||
eventTopic=0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2 | ||
|
||
for c in arbitrum arbitrumSepolia arbitrumSepoliaDevnet; do | ||
echo "--------------------------------" | ||
echo "$c" | ||
echo "--------------------------------" | ||
for f in "$SCRIPT_DIR"/../deployments/"$c"/*_Proxy.json; do | ||
address=$(jq -r .address "$f") | ||
block=$(jq -r .receipt.blockNumber "$f") | ||
jaybuidl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
basename "$f" | ||
results=$(cast logs --from-block "$block" --to-block latest $eventTopic --address "$address" --rpc-url "${rpcUrls[$c]}" --json | jq -r .[].data) | ||
initializer=$(cast --to-dec "$(echo "$results" | tail -n1)") | ||
version=$(cast call --rpc-url "${rpcUrls[$c]}" "$address" "version()(string)" --json 2>/dev/null | jq -r '.[0]') | ||
echo "$initializer" @v"$version" | ||
echo | ||
done | ||
done |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -593,7 +593,8 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable | |||||||||||||||||
/// @dev Draws jurors for the dispute. Can be called in parts. | ||||||||||||||||||
/// @param _disputeID The ID of the dispute. | ||||||||||||||||||
/// @param _iterations The number of iterations to run. | ||||||||||||||||||
function draw(uint256 _disputeID, uint256 _iterations) external { | ||||||||||||||||||
/// @return nbDrawnJurors The total number of jurors drawn in the round. | ||||||||||||||||||
function draw(uint256 _disputeID, uint256 _iterations) external returns (uint256 nbDrawnJurors) { | ||||||||||||||||||
Dispute storage dispute = disputes[_disputeID]; | ||||||||||||||||||
uint256 currentRound = dispute.rounds.length - 1; | ||||||||||||||||||
Round storage round = dispute.rounds[currentRound]; | ||||||||||||||||||
|
@@ -616,6 +617,7 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable | |||||||||||||||||
} | ||||||||||||||||||
} | ||||||||||||||||||
round.drawIterations += i; | ||||||||||||||||||
return round.drawnJurors.length; | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
/// @dev Appeals the ruling of a specified dispute. | ||||||||||||||||||
|
@@ -981,18 +983,34 @@ abstract contract KlerosCoreBase is IArbitratorV2, Initializable, UUPSProxiable | |||||||||||||||||
(ruling, tied, overridden) = disputeKit.currentRuling(_disputeID); | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
/// @dev Gets the round info for a specified dispute and round. | ||||||||||||||||||
/// @dev This function must not be called from a non-view function because it returns a dynamic array which might be very large, theoretically exceeding the block gas limit. | ||||||||||||||||||
/// @param _disputeID The ID of the dispute. | ||||||||||||||||||
/// @param _round The round to get the info for. | ||||||||||||||||||
/// @return round The round info. | ||||||||||||||||||
function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) { | ||||||||||||||||||
return disputes[_disputeID].rounds[_round]; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
+986
to
993
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add bounds checking for array access. The function directly accesses Add input validation to provide better error handling: function getRoundInfo(uint256 _disputeID, uint256 _round) external view returns (Round memory) {
+ if (_disputeID >= disputes.length) revert InvalidDisputeID();
+ if (_round >= disputes[_disputeID].rounds.length) revert InvalidRoundNumber();
return disputes[_disputeID].rounds[_round];
} You'll need to add the corresponding custom error declarations: error InvalidDisputeID();
error InvalidRoundNumber(); 🤖 Prompt for AI Agents
|
||||||||||||||||||
|
||||||||||||||||||
/// @dev Gets the PNK at stake per juror for a specified dispute and round. | ||||||||||||||||||
/// @param _disputeID The ID of the dispute. | ||||||||||||||||||
/// @param _round The round to get the info for. | ||||||||||||||||||
/// @return pnkAtStakePerJuror The PNK at stake per juror. | ||||||||||||||||||
function getPnkAtStakePerJuror(uint256 _disputeID, uint256 _round) external view returns (uint256) { | ||||||||||||||||||
return disputes[_disputeID].rounds[_round].pnkAtStakePerJuror; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
999
to
1001
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add bounds checking for array access. Similar to Apply this fix: function getPnkAtStakePerJuror(uint256 _disputeID, uint256 _round) external view returns (uint256) {
+ if (_disputeID >= disputes.length) revert InvalidDisputeID();
+ if (_round >= disputes[_disputeID].rounds.length) revert InvalidRoundNumber();
return disputes[_disputeID].rounds[_round].pnkAtStakePerJuror;
} 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
|
||||||||||||||||||
/// @dev Gets the number of rounds for a specified dispute. | ||||||||||||||||||
/// @param _disputeID The ID of the dispute. | ||||||||||||||||||
/// @return The number of rounds. | ||||||||||||||||||
function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) { | ||||||||||||||||||
return disputes[_disputeID].rounds.length; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
1006
to
1008
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add bounds checking for dispute ID. The function should validate the Apply this fix: function getNumberOfRounds(uint256 _disputeID) external view returns (uint256) {
+ if (_disputeID >= disputes.length) revert InvalidDisputeID();
return disputes[_disputeID].rounds.length;
} 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||
|
||||||||||||||||||
/// @dev Checks if a given dispute kit is supported by a given court. | ||||||||||||||||||
/// @param _courtID The ID of the court to check the support for. | ||||||||||||||||||
/// @param _disputeKitID The ID of the dispute kit to check the support for. | ||||||||||||||||||
/// @return Whether the dispute kit is supported or not. | ||||||||||||||||||
function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) { | ||||||||||||||||||
return courts[_courtID].supportedDisputeKits[_disputeKitID]; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
1014
to
1016
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add bounds checking for court ID. The function should validate the Apply this fix: function isSupported(uint96 _courtID, uint256 _disputeKitID) external view returns (bool) {
+ if (_courtID >= courts.length) revert InvalidCourtID();
return courts[_courtID].supportedDisputeKits[_disputeKitID];
} Add the corresponding custom error declaration: error InvalidCourtID(); 🤖 Prompt for AI Agents
|
||||||||||||||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import React from "react"; | ||
import styled, { css } from "styled-components"; | ||
|
||
import { useParams } from "react-router-dom"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Apply consistent null safety pattern. Similar to EvidenceCard, consider adding type safety and null checking for the route parameter to maintain consistency across components. -import { useParams } from "react-router-dom";
+import { useParams } from "react-router-dom";
...
- const { id } = useParams();
+ const { id } = useParams<{ id: string }>(); Also applies to: 72-72 🤖 Prompt for AI Agents
|
||
|
||
import PaperclipIcon from "svgs/icons/paperclip.svg"; | ||
import PolicyIcon from "svgs/icons/policy.svg"; | ||
|
||
|
@@ -67,17 +69,23 @@ interface IPolicies { | |
} | ||
|
||
export const Policies: React.FC<IPolicies> = ({ disputePolicyURI, courtId, attachment }) => { | ||
const { id } = useParams(); | ||
|
||
return ( | ||
<Container> | ||
<StyledP>Policy documents:</StyledP> | ||
{!isUndefined(attachment) && !isUndefined(attachment.uri) ? ( | ||
<StyledInternalLink to={`/attachment/?title=${"Case Policy"}&url=${getIpfsUrl(attachment.uri)}`}> | ||
<StyledInternalLink | ||
to={`/attachment/?disputeId=${id}&title=${"Case Policy"}&url=${getIpfsUrl(attachment.uri)}`} | ||
> | ||
<StyledPaperclipIcon /> | ||
{attachment.label ?? "Attachment"} | ||
</StyledInternalLink> | ||
) : null} | ||
{isUndefined(disputePolicyURI) ? null : ( | ||
<StyledInternalLink to={`/attachment/?title=${"Dispute Policy"}&url=${getIpfsUrl(disputePolicyURI)}`}> | ||
<StyledInternalLink | ||
to={`/attachment/?disputeId=${id}&title=${"Dispute Policy"}&url=${getIpfsUrl(disputePolicyURI)}`} | ||
> | ||
<StyledPolicyIcon /> | ||
Dispute Policy | ||
</StyledInternalLink> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import styled, { css } from "styled-components"; | |
|
||
import Identicon from "react-identicons"; | ||
import ReactMarkdown from "react-markdown"; | ||
import { useParams } from "react-router-dom"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding null safety for the route parameter. The -import { useParams } from "react-router-dom";
+import { useParams } from "react-router-dom";
...
- const { id } = useParams();
+ const { id } = useParams<{ id: string }>();
+
+ if (!id) {
+ console.warn("Dispute ID not found in route parameters");
+ } Also applies to: 228-228 🤖 Prompt for AI Agents
|
||
|
||
import { Card } from "@kleros/ui-components-library"; | ||
|
||
|
@@ -224,6 +225,7 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ | |
fileURI, | ||
}) => { | ||
const profileLink = `/profile/1/desc/all?address=${sender}`; | ||
const { id } = useParams(); | ||
|
||
const transactionExplorerLink = useMemo(() => { | ||
return getTxnExplorerLink(transactionHash ?? ""); | ||
|
@@ -258,7 +260,7 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ | |
</BottomLeftContent> | ||
{fileURI && fileURI !== "-" ? ( | ||
<FileLinkContainer> | ||
<StyledInternalLink to={`/attachment/?title=${"Evidence File"}&url=${getIpfsUrl(fileURI)}`}> | ||
<StyledInternalLink to={`/attachment/?disputeId=${id}&title=${"Evidence File"}&url=${getIpfsUrl(fileURI)}`}> | ||
<AttachmentIcon /> | ||
<AttachedFileText /> | ||
</StyledInternalLink> | ||
|
Uh oh!
There was an error while loading. Please reload this page.