Skip to content
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

Merged
merged 9 commits into from
Jun 5, 2024

Conversation

Harman-singh-waraich
Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich commented Jun 3, 2024

  • Adds dynamic fetching for main Curate address
  • Adds dynamic fetching for arbitration related contracts
  • Updates update script in subgraph to handle templates
  • Need to add COURT_SITE as env
  • Updates Curation Policy to be fetched dynamically
  • Minor style fixes

PR-Codex overview

The focus of this PR is to update addresses and improve contract handling.

Detailed summary

  • Deleted listOfListsAddresses.ts and added generatedMainCurateAddress.json.
  • Updated addresses in arbitration.ts and SubmitListButton.tsx.
  • Fetch and use MAIN_CURATE_ADDRESS in various components.
  • Updated policies and addresses in multiple files.

The following files were skipped due to too many changes: web/src/pages/Home/Highlights/index.tsx, subgraph/scripts/update.sh, web/src/pages/AllLists/RegistriesFetcher.tsx

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

Summary by CodeRabbit

  • New Features

    • Introduced dynamic address handling for various modules based on the default chain.
    • Added a new dev dependency @kleros/kleros-v2-contracts version 0.3.2.
  • Improvements

    • Updated URL paths in the ActionButton component for better navigation.
    • Enhanced import and usage of MAIN_CURATE_ADDRESS across multiple components for consistency.
    • Improved script to retrieve and store main curate address dynamically.
  • Chores

    • Updated .gitignore to include generatedMainCurateAddress.json.
    • Extended update.sh script to update ABIs paths for Hardhat networks.

Copy link

netlify bot commented Jun 3, 2024

Deploy Preview for curate-v2 ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/curate-v2/deploys/66603e2e0a98f0f1e3613bfe
😎 Deploy Preview https://deploy-preview-36--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 site configuration.

Copy link
Contributor

coderabbitai bot commented Jun 3, 2024

Walkthrough

The 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

File(s) Change Summary
web/.gitignore Added generatedMainCurateAddress.json to ignored files.
web/package.json Added new dev dependency @kleros/kleros-v2-contracts version 0.3.2.
web/scripts/generateBuildInfo.sh Added script to retrieve main curate address and store it in a JSON file with error handling.
web/src/components/ActionButton/index.tsx Updated URL path for linking to a case overview.
web/src/components/InformationCards/RegistryInformationCard/Policies.tsx, web/src/pages/AllLists/RegistriesFetcher.tsx, web/src/pages/Home/Highlights/index.tsx, web/src/pages/SubmitList/NavigationButtons/SubmitListButton.tsx Updated usage of MAIN_CURATE_ADDRESS instead of listOfListsAddresses[DEFAULT_CHAIN].
web/src/consts/arbitration.ts Dynamically set addresses for KLEROS_ARBITRATOR, EVIDENCE_MODULE, and TEMPLATE_REGISTRY based on DEFAULT_CHAIN.
web/src/consts/index.ts Added import for GeneratedMainCurate and updated COURT_SITE and MAIN_CURATE_ADDRESS constants.
web/src/layout/Header/navbar/Explore.tsx Added imports and updated links array initialization for dynamic loading based on mainCurate data.
web/src/utils/submitListUtils.ts Introduced imports for netlifyUri and DEFAULT_CHAIN, updated URL construction and chain ID assignment logic.
web/wagmi.config.ts Extended function to read external contracts like KlerosCore and EvidenceModule.
subgraph/scripts/update.sh Added updateTemplates() function to update ABIs paths in subgraph configuration file.

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
Loading

Poem

In the realm of code, where changes flow,
New addresses dance, dynamic and slow.
URLs now lead to cases with grace,
Scripts fetch addresses, no errors to face.
Dependencies added, the web grows strong,
Here's to progress, where all things belong!
🌟🐰✨


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 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

Commits

Files that changed from the base of the PR and between 5f44cb5 and 16eb48b.

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 for MAIN_CURATE_ADDRESS.

Also applies to: 27-27

web/src/layout/Header/navbar/Explore.tsx (1)

1-1: Efficient use of useMemo 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.

web/scripts/generateBuildInfo.sh Outdated Show resolved Hide resolved
web/scripts/generateBuildInfo.sh Outdated Show resolved Hide resolved
web/src/components/ActionButton/index.tsx Show resolved Hide resolved
web/wagmi.config.ts Show resolved Hide resolved
web/src/pages/Home/Highlights/index.tsx Show resolved Hide resolved
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 16eb48b and 383ef68.

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

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: 1

Outside diff range and nitpick comments (3)
subgraph/scripts/update.sh (2)

Line range hint 14-14: Optimize command usage by avoiding unnecessary cat.

- 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 to useEffect 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

Commits

Files that changed from the base of the PR and between 383ef68 and e4986f9.

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.

@Harman-singh-waraich Harman-singh-waraich marked this pull request as ready for review June 4, 2024 16:52
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: 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 of cat.

# 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

Commits

Files that changed from the base of the PR and between e4986f9 and 6db296c.

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.

subgraph/scripts/update.sh Outdated Show resolved Hide resolved
@Harman-singh-waraich Harman-singh-waraich marked this pull request as draft June 4, 2024 17:12
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

Outside diff range and nitpick comments (1)
subgraph/scripts/update.sh (1)

Line range hint 14-14: Optimize command usage by avoiding unnecessary cat.

# 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

Commits

Files that changed from the base of the PR and between 6db296c and a1f66db.

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)

subgraph/scripts/update.sh Show resolved Hide resolved
subgraph/scripts/update.sh Show resolved Hide resolved
subgraph/scripts/update.sh Show resolved Hide resolved
@Harman-singh-waraich Harman-singh-waraich marked this pull request as ready for review June 5, 2024 10:41
@jaybuidl jaybuidl merged commit 91a0053 into master Jun 5, 2024
6 checks passed
@jaybuidl jaybuidl deleted the feat/dynamic-contract-address-fetching branch June 5, 2024 10:45
@coderabbitai coderabbitai bot mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants