-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feat/dynamic contract address fetching #36
Conversation
✅ Deploy Preview for curate-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
WalkthroughThe updates encompass various enhancements and fixes across the web and subgraph directories. Key changes include adding a new dependency, updating URLs, dynamically setting contract addresses, and improving script functionalities. These modifications aim to streamline the handling of addresses, enhance error handling, and improve the overall user experience by making the system more dynamic and responsive. Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant WebApp
participant Subgraph
participant Contract
User ->> WebApp: Request Case Overview
WebApp ->> Contract: Fetch Dispute ID
Contract -->> WebApp: Return Dispute ID
WebApp ->> Subgraph: Query Main Curate Address
Subgraph -->> WebApp: Return Main Curate Address
WebApp ->> User: Display Case Overview with Updated URL
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 5
Outside diff range and nitpick comments (5)
web/src/pages/Home/Highlights/index.tsx (1)
Line range hint
83-83
: Avoid using array indices as keys in React lists.Consider using unique identifiers or properties from the data objects as keys to improve performance and prevent potential issues with React's rendering.
Also applies to: 86-86
web/src/pages/AllLists/RegistriesFetcher.tsx (1)
Line range hint
57-57
: Specify all dependencies in the useEffect hook.- }, [itemsData]); + }, [itemsData, registryIds]);web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx (1)
Line range hint
93-93
: Specify all dependencies in the useEffect hook.- }, [config, totalCostToSubmit]); + }, [config, totalCostToSubmit, address, listData, setListData, publicClient.getGasPrice, chain?.id, publicClient.estimateContractGas]);web/src/utils/submitListUtils.ts (2)
Line range hint
14-14
: Replace the delete operator with an undefined assignment for better performance.- delete listMetadata.policyURI; + listMetadata.policyURI = undefined;
Line range hint
93-148
: Use optional chaining to simplify the code.Consider refactoring the code to use optional chaining for better readability and safety.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/*.lock
Files selected for processing (13)
- web/.gitignore (1 hunks)
- web/package.json (1 hunks)
- web/scripts/generateBuildInfo.sh (1 hunks)
- web/src/components/ActionButton/index.tsx (1 hunks)
- web/src/components/InformationCards/RegistryInformationCard/Policies.tsx (2 hunks)
- web/src/consts/arbitration.ts (1 hunks)
- web/src/consts/index.ts (2 hunks)
- web/src/layout/Header/navbar/Explore.tsx (2 hunks)
- web/src/pages/AllLists/RegistriesFetcher.tsx (2 hunks)
- web/src/pages/Home/Highlights/index.tsx (3 hunks)
- web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx (3 hunks)
- web/src/utils/submitListUtils.ts (3 hunks)
- web/wagmi.config.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- web/.gitignore
- web/package.json
Additional context used
Shellcheck
web/scripts/generateBuildInfo.sh
[info] 19-19: Double quote to prevent globbing and word splitting. (SC2086)
[style] 21-21: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. (SC2181)
[info] 22-22: Double quote to prevent globbing and word splitting. (SC2086)
[info] 31-31: Double quote to prevent globbing and word splitting. (SC2086)
Biome
web/src/components/ActionButton/index.tsx
[error] 50-50: This hook does not specify all of its dependencies: isItem (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 50-50: This hook does not specify all of its dependencies: refetch (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 50-50: This hook does not specify all of its dependencies: toggleModal (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
web/src/pages/Home/Highlights/index.tsx
[error] 58-58: This hook does not specify all of its dependencies: registryIds (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 83-83: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 86-86: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.web/src/pages/AllLists/RegistriesFetcher.tsx
[error] 57-57: This hook does not specify all of its dependencies: registryIds (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx
[error] 93-93: This hook does not specify all of its dependencies: address (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: listData (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: setListData (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: publicClient.getGasPrice (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: chain?.id (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: publicClient.estimateContractGas (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
web/src/utils/submitListUtils.ts
[error] 14-14: Avoid the delete operator which can impact performance. (lint/performance/noDelete)
Unsafe fix: Use an undefined assignment instead.
[error] 93-93: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 99-99: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 105-105: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 136-136: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 142-142: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
[error] 148-148: Change to an optional chain. (lint/complexity/useOptionalChain)
Unsafe fix: Change to an optional chain.
Additional comments not posted (6)
web/src/consts/arbitration.ts (2)
1-6
: Dynamic setting of arbitration-related addresses enhances flexibility and maintainability.
7-7
: Clarify the purpose of the TODO comment.Please provide more details on the intended implementation or removal of the TODO comment.
web/src/consts/index.ts (1)
2-2
: Proper use of dynamic configuration forMAIN_CURATE_ADDRESS
.Also applies to: 27-27
web/src/layout/Header/navbar/Explore.tsx (1)
1-1
: Efficient use ofuseMemo
and dynamic data fetching for link generation.Also applies to: 6-8, 56-68
web/src/components/InformationCards/RegistryInformationCard/Policies.tsx (1)
9-9
: Correct implementation of dynamic data fetching for registry details.Also applies to: 63-63
web/src/components/ActionButton/index.tsx (1)
53-53
: Correct update of the URL path for case overview.
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- web/src/layout/Header/navbar/Explore.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- web/src/layout/Header/navbar/Explore.tsx
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: 1
Outside diff range and nitpick comments (3)
subgraph/scripts/update.sh (2)
Line range hint
14-14
: Optimize command usage by avoiding unnecessarycat
.- address=$(cat "$artifact" | jq '.address') + address=$(jq '.address' < "$artifact") - blockNumber="$(cat "$artifact" | jq '.receipt.blockNumber')" + blockNumber="$(jq '.receipt.blockNumber' < "$artifact")"Also applies to: 18-18
Tools
Shellcheck
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 45-45: Double quote to prevent globbing and word splitting. (SC2086)
Line range hint
26-26
: Ensure proper quoting to prevent word splitting and globbing.- for f in $(yq e .dataSources[$dataSourceIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]') + for f in "$(yq e .dataSources[$dataSourceIndex].mapping.abis[].file subgraph.yaml -o json -I 0 | jq -sr '.[]')" - f2=$(echo $f | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|") + f2=$(echo "$f" | sed "s|\(.*\/deployments\/\).*\/|\1$hardhatNetwork\/|")Also applies to: 28-28, 45-45
Tools
Shellcheck
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 45-45: Double quote to prevent globbing and word splitting. (SC2086)
web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx (1)
Line range hint
93-93
: Add missing dependencies touseEffect
to ensure correct re-rendering.- }, [config, totalCostToSubmit]); + }, [config, totalCostToSubmit, address, listData, setListData, publicClient.getGasPrice, chain?.id, publicClient.estimateContractGas]);
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
web/src/assets/svgs/icons/check-circle-outline.svg
is excluded by!**/*.svg
Files selected for processing (3)
- subgraph/scripts/update.sh (2 hunks)
- web/src/pages/SubmitList/AdvancedParameters/index.tsx (1 hunks)
- web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx (3 hunks)
Files skipped from review due to trivial changes (1)
- web/src/pages/SubmitList/AdvancedParameters/index.tsx
Additional context used
Shellcheck
subgraph/scripts/update.sh
[style] 14-14: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[style] 18-18: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[info] 26-26: Double quote to prevent globbing and word splitting. (SC2086)
[style] 28-28: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 28-28: Double quote to prevent globbing and word splitting. (SC2086)
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 45-45: Double quote to prevent globbing and word splitting. (SC2086)
[warning] 60-60: Quote this to prevent word splitting. (SC2046)
[info] 65-65: Double quote to prevent globbing and word splitting. (SC2086)
[info] 65-65: Double quote to prevent globbing and word splitting. (SC2086)
[info] 65-65: Double quote to prevent globbing and word splitting. (SC2086)
[info] 72-72: Double quote to prevent globbing and word splitting. (SC2086)
[info] 72-72: Double quote to prevent globbing and word splitting. (SC2086)
Biome
web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx
[error] 93-93: This hook does not specify all of its dependencies: address (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: listData (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: setListData (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: publicClient.getGasPrice (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: chain?.id (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
[error] 93-93: This hook does not specify all of its dependencies: publicClient.estimateContractGas (lint/correctness/useExhaustiveDependencies)
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
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: 2
Outside diff range and nitpick comments (2)
subgraph/scripts/update.sh (1)
Line range hint
14-14
: Consider using more efficient command structures instead ofcat
.# Replace: address=$(cat "$artifact" | jq '.address') blockNumber=$(cat "$artifact" | jq '.receipt.blockNumber') # With: address=$(jq '.address' < "$artifact") blockNumber=$(jq '.receipt.blockNumber' < "$artifact")Also applies to: 18-18
Tools
Shellcheck
[error] 26-26: Since you double quoted this, it will not word split, and the loop will only run once. (SC2066)
[info] 26-26: Double quote to prevent globbing and word splitting. (SC2086)
[style] 28-28: See if you can use ${variable//search/replace} instead. (SC2001)
[error] 43-43: Since you double quoted this, it will not word split, and the loop will only run once. (SC2066)
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
web/src/pages/Home/Highlights/index.tsx (1)
Line range hint
83-83
: Avoid using array indices as keys in React components.Using indices as keys can lead to performance issues and bugs when the order of items changes. Consider using unique, stable identifiers as keys.
Also applies to: 86-86
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- subgraph/scripts/update.sh (2 hunks)
- web/scripts/generateBuildInfo.sh (1 hunks)
- web/src/components/ActionButton/index.tsx (2 hunks)
- web/src/pages/Home/Highlights/index.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- web/scripts/generateBuildInfo.sh
- web/src/components/ActionButton/index.tsx
Additional context used
Shellcheck
subgraph/scripts/update.sh
[style] 14-14: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[style] 18-18: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[error] 26-26: Since you double quoted this, it will not word split, and the loop will only run once. (SC2066)
[info] 26-26: Double quote to prevent globbing and word splitting. (SC2086)
[style] 28-28: See if you can use ${variable//search/replace} instead. (SC2001)
[error] 43-43: Since you double quoted this, it will not word split, and the loop will only run once. (SC2066)
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
[warning] 59-59: Quote this to prevent word splitting. (SC2046)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 70-70: Double quote to prevent globbing and word splitting. (SC2086)
[info] 70-70: Double quote to prevent globbing and word splitting. (SC2086)
Biome
web/src/pages/Home/Highlights/index.tsx
[error] 83-83: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
[error] 86-86: Avoid using the index of an array as key property in an element. (lint/suspicious/noArrayIndexKey)
This is the source of the key value.
The order of the items may change, and this also affects performances and component state.
Check the React documentation.
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: 3
Outside diff range and nitpick comments (1)
subgraph/scripts/update.sh (1)
Line range hint
14-14
: Optimize command usage by avoiding unnecessarycat
.# Replace: address=$(cat "$artifact" | jq '.address') blockNumber="$(cat "$artifact" | jq '.receipt.blockNumber')" # With: address=$(jq '.address' < "$artifact") blockNumber=$(jq '.receipt.blockNumber' < "$artifact")Also applies to: 18-18
Tools
Shellcheck
[info] 26-26: Double quote to prevent globbing and word splitting. (SC2086)
[style] 28-28: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- subgraph/scripts/update.sh (2 hunks)
Additional context used
Shellcheck
subgraph/scripts/update.sh
[style] 14-14: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[style] 18-18: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. (SC2002)
[info] 26-26: Double quote to prevent globbing and word splitting. (SC2086)
[style] 28-28: See if you can use ${variable//search/replace} instead. (SC2001)
[info] 43-43: Double quote to prevent globbing and word splitting. (SC2086)
[style] 45-45: See if you can use ${variable//search/replace} instead. (SC2001)
[warning] 59-59: Quote this to prevent word splitting. (SC2046)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 63-63: Double quote to prevent globbing and word splitting. (SC2086)
[info] 70-70: Double quote to prevent globbing and word splitting. (SC2086)
[info] 70-70: Double quote to prevent globbing and word splitting. (SC2086)
update
script in subgraph to handle templatesCOURT_SITE
as envPR-Codex overview
The focus of this PR is to update addresses and improve contract handling.
Detailed summary
listOfListsAddresses.ts
and addedgeneratedMainCurateAddress.json
.arbitration.ts
andSubmitListButton.tsx
.MAIN_CURATE_ADDRESS
in various components.Summary by CodeRabbit
New Features
@kleros/kleros-v2-contracts
version0.3.2
.Improvements
MAIN_CURATE_ADDRESS
across multiple components for consistency.Chores
.gitignore
to includegeneratedMainCurateAddress.json
.update.sh
script to update ABIs paths for Hardhat networks.