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

Diamond cut auto propose to safe #764

Merged
merged 6 commits into from
Aug 19, 2024
Merged

Diamond cut auto propose to safe #764

merged 6 commits into from
Aug 19, 2024

Conversation

0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Aug 15, 2024

Which Jira task belongs to this PR?

Why did I implement it this way?

Checklist before requesting a review

  • I have performed a self-review of my code
  • This pull request is as small as possible and only tackles one problem
  • I have added tests that cover the functionality / test the bug
  • I have updated any required documentation

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

Summary by CodeRabbit

  • New Features

    • Introduced version 1.0.1 entries for the LiFiDEXAggregator, updating deployment logs for multiple environments.
    • Improved the deployment script to differentiate handling between production and staging environments, enhancing deployment safety.
  • Bug Fixes

    • Enhanced error handling and variable scoping in deployment scripts to ensure better execution clarity and encapsulation.
  • Chores

    • Removed outdated entries for previous contract versions to maintain log accuracy and relevance.

Copy link
Contributor

coderabbitai bot commented Aug 15, 2024

Walkthrough

The recent updates enhance the deployment configuration across multiple JSON files by introducing new entries for the LiFiDEXAggregator under version 1.0.1 and adjusting verification statuses. The changes improve deployment logs by ensuring that the latest contract details are accurately captured. Additionally, modifications to deployment scripts enhance variable scoping and streamline error handling, while the control flow for deployments is refined based on the specified environment.

Changes

Files Grouped by Change Type Change Summary
deployments/_deployments_log_file.json Added new entry for version 1.0.1 of LiFiDEXAggregator and updated verification status of another contract.
deployments/mainnet.diamond.json Minor formatting fix with a newline added at the end of the file.
script/deploy/deploySingleContract.sh Changed variable scoping to local for improved encapsulation and updated error handling logic.
script/tasks/diamondUpdateFacet.sh Enhanced control flow for deployments based on ENVIRONMENT, differentiating between production and staging processes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeploymentScript
    participant Network
    participant ContractRegistry

    User->>DeploymentScript: Initiate Deployment
    DeploymentScript->>Network: Determine Environment
    alt Production
        DeploymentScript->>ContractRegistry: Deploy Contract
        ContractRegistry-->>DeploymentScript: Confirm Deployment
    else Staging
        DeploymentScript->>ContractRegistry: Deploy Staging Contract
        ContractRegistry-->>DeploymentScript: Confirm Staging Deployment
    end
    DeploymentScript-->>User: Deployment Complete
Loading

🐰 In the meadow, change is afoot,
New contracts dance, oh how they astute!
From bunnies to blocks, the updates are neat,
Hopping in code, where logic and data meet!
With every deploy, the blockchain will sing,
A digital world, where rabbits take wing! 🌼✨


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

Outside diff range, codebase verification and nitpick comments (2)
deployments/mainnet.diamond.json (1)

7-9: Initialize addresses for new entries before deployment.

The entries for GasRebateDistributor and LiFiDEXAggregator in deployments/mainnet.diamond.json currently have empty addresses. Ensure these are initialized with valid addresses to avoid potential issues during deployment.

  • GasRebateDistributor: ""
  • LiFiDEXAggregator: ""
Analysis chain

Verify the initialization of new entries.

The entries for GasRebateDistributor and LiFiDEXAggregator currently have empty addresses. Ensure that these are correctly initialized with valid addresses before deployment.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify initialization of new entries in mainnet.diamond.json.

# Test: Check for non-empty addresses for new entries.
rg --type json -A 5 $'"GasRebateDistributor": ""' deployments/mainnet.diamond.json
rg --type json -A 5 $'"LiFiDEXAggregator": ""' deployments/mainnet.diamond.json

Length of output: 899

script/deploy/safe/propose-to-safe.ts (1)

98-98: Update console logging for network.

Displaying chain.name in the console log provides clearer information about the network being used.

-    console.info('Network', chain.name)
+    console.info('Network Name', chain.name)
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 69b557f and f06be97.

Files selected for processing (19)
  • deployments/_deployments_log_file.json (15 hunks)
  • deployments/arbitrum.json (1 hunks)
  • deployments/aurora.json (1 hunks)
  • deployments/avalanche.json (1 hunks)
  • deployments/base.json (1 hunks)
  • deployments/bsc.json (1 hunks)
  • deployments/gravity.json (1 hunks)
  • deployments/linea.json (1 hunks)
  • deployments/mainnet.diamond.json (1 hunks)
  • deployments/mainnet.json (1 hunks)
  • deployments/mantle.json (1 hunks)
  • deployments/metis.json (1 hunks)
  • deployments/optimism.json (1 hunks)
  • deployments/polygon.json (1 hunks)
  • deployments/scroll.json (1 hunks)
  • deployments/sei.json (1 hunks)
  • script/deploy/deploySingleContract.sh (3 hunks)
  • script/deploy/safe/propose-to-safe.ts (3 hunks)
  • script/tasks/diamondUpdateFacet.sh (2 hunks)
Additional context used
Shellcheck
script/tasks/diamondUpdateFacet.sh

[warning] 116-116: This assignment is only seen by the forked process.

(SC2097)


[warning] 116-116: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 121-121: script is referenced but not assigned (did you mean 'SCRIPT'?).

(SC2154)


[warning] 123-123: Quote this to prevent word splitting.

(SC2046)


[warning] 127-127: This assignment is only seen by the forked process.

(SC2097)


[warning] 127-127: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 136-136: This assignment is only seen by the forked process.

(SC2097)


[warning] 136-136: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 142-142: Quote this to prevent word splitting.

(SC2046)


[warning] 146-146: This assignment is only seen by the forked process.

(SC2097)


[warning] 146-146: This expansion will not see the mentioned assignment.

(SC2098)

script/deploy/deploySingleContract.sh

[warning] 96-96: Declare and assign separately to avoid masking return values.

(SC2155)

Additional comments not posted (35)
deployments/mainnet.diamond.json (2)

11-11: Confirm the ReceiverStargateV2 address.

The entry for ReceiverStargateV2 has been added with a specific address. Ensure that this address is correct and corresponds to the intended contract.


9-9: Update the LiFuelFeeCollector address.

The address for LiFuelFeeCollector has been updated. Ensure that this change is reflected in all relevant documentation and that any dependencies are aware of the new address.

deployments/gravity.json (1)

20-20: Validate the new StargateFacetV2 address.

The address for StargateFacetV2 has been updated. Confirm that this address is correctly deployed and that any interactions with this facet are tested with the new address.

Verification successful

The new StargateFacetV2 address is tested in the codebase.

The StargateFacetV2 contract is referenced and tested in test/solidity/Facets/StargateFacetV2.t.sol. This file contains various tests and setups involving StargateFacetV2, indicating that interactions with this facet are indeed covered.

  • File: test/solidity/Facets/StargateFacetV2.t.sol

This confirms that the new address is being utilized in tests, ensuring its functionality is verified.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Validate the new StargateFacetV2 address.

# Test: Search for the new address usage in the codebase.
rg --type json -A 5 $'"StargateFacetV2": "0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61"' deployments/

Length of output: 2562


Script:

#!/bin/bash
# Search for references to StargateFacetV2 in the codebase, focusing on potential test files.
rg --type js --type ts --type py --type go --type rs --type java --type kt "StargateFacetV2" --glob "**/test/**" --glob "**/tests/**" -A 5

Length of output: 165


Script:

#!/bin/bash
# Retry the search for references to StargateFacetV2 in test files, excluding the unrecognized file type.
rg --type js --type ts --type py --type go --type java --type kt "StargateFacetV2" --glob "**/test/**" --glob "**/tests/**" -A 5

Length of output: 155


Script:

#!/bin/bash
# Retry the search for references to StargateFacetV2 in test files, excluding the unrecognized file type.
rg --type js --type ts --type py --type go --type java "StargateFacetV2" --glob "**/test/**" --glob "**/tests/**" -A 5

Length of output: 5559

deployments/sei.json (1)

24-24: Validate the new StargateFacetV2 address.

The address for StargateFacetV2 has been updated. Confirm that this address is correctly deployed and that any interactions with this facet are tested with the new address.

deployments/metis.json (1)

25-25: Verify the updated contract address.

The address for StargateFacetV2 has been updated. Ensure that this new address is correct and consistent across all relevant configurations.

Verification successful

Verified: Address Update for StargateFacetV2 in Metis Deployment

The updated address for StargateFacetV2 in deployments/metis.json is consistent with its intended use and does not conflict with other deployment configurations. This address is specific to the Metis deployment and is correctly reflected in the deployment log. Other deployments use different addresses, which is expected.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of the updated address across deployment files.

# Test: Check for the new address across deployment files. Expect: Consistent usage.
rg --type json '0xCb667deA2894ab64e8e75EACB0d5d027AC672e25'

Length of output: 257


Script:

#!/bin/bash
# Description: Verify if there are any other instances of the address or conflicting addresses for StargateFacetV2.

# Test: Check for any other instances of the address in the repository.
rg '0xCb667deA2894ab64e8e75EACB0d5d027AC672e25'

# Test: Check for any other addresses associated with StargateFacetV2 in the repository.
rg '"StargateFacetV2": "0x'

Length of output: 1743

deployments/mantle.json (1)

25-25: Verify the updated contract address.

The address for StargateFacetV2 has been updated. Ensure that this new address is correct and consistent across all relevant configurations.

Verification successful

Contract Address Consistency Verified

The updated contract address for StargateFacetV2 is consistently used across all relevant deployment files, including mantle.json, sei.json, polygon.json, scroll.json, optimism.json, mainnet.json, gravity.json, base.json, avalanche.json, aurora.json, bsc.json, and arbitrum.json. No inconsistencies were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of the updated address across deployment files.

# Test: Check for the new address across deployment files. Expect: Consistent usage.
rg --type json '0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61'

Length of output: 2447

deployments/scroll.json (1)

27-27: Verify the updated contract address.

The address for StargateFacetV2 has been updated. Ensure that this new address is correct and consistent across all relevant configurations.

deployments/aurora.json (1)

31-31: Verify the address update for StargateFacetV2.

Ensure that the new address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is correct and has been properly updated in all relevant parts of the system.

Verification successful

Address Update for StargateFacetV2 Verified

The new address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is consistently used across multiple deployment files. Other addresses found in specific staging and network files indicate intended configurations for those environments. No issues found with the update.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new address for StargateFacetV2 is used consistently across the codebase.

# Test: Search for the new address. Expect: Occurrences of the new address in relevant files.
rg --type json '0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61'

Length of output: 2447


Script:

#!/bin/bash
# Description: Search for any instances of the old address to ensure it has been fully replaced.

# Test: Search for the old address. Expect: No occurrences of the old address.
rg --type json '0xOLD_ADDRESS_HERE'

Length of output: 35


Script:

#!/bin/bash
# Description: Search for any addresses associated with StargateFacetV2 to identify potential old addresses.

# Test: Search for any address pattern related to StargateFacetV2.
rg --type json '"StargateFacetV2": "0x[a-fA-F0-9]{40}"'

Length of output: 1525

deployments/linea.json (1)

35-35: Verify the address update for StargateFacetV2.

Ensure that the new address 0x113E97921874646413572F2C43562463c378b6f5 is correct and has been properly updated in all relevant parts of the system.

Verification successful

Address Update Verified for StargateFacetV2

The new address 0x113E97921874646413572F2C43562463c378b6f5 for StargateFacetV2 is correctly updated in the deployments/linea.json and _deployments_log_file.json. Other deployment files use different addresses, which seems intentional for network-specific configurations. No issues found with the update.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new address for StargateFacetV2 is used consistently across the codebase.

# Test: Search for the new address. Expect: Occurrences of the new address in relevant files.
rg --type json '0x113E97921874646413572F2C43562463c378b6f5'

Length of output: 257


Script:

#!/bin/bash
# Description: Search for references to StargateFacetV2 and any occurrences of the old address to ensure complete updates.

# Test: Search for occurrences of StargateFacetV2.
rg 'StargateFacetV2'

# Test: Search for occurrences of the old address.
rg --type json '0xOLDADDRESS'  # Replace '0xOLDADDRESS' with the actual old address if known.

Length of output: 8191


Script:

#!/bin/bash
# Description: Verify the new address is consistently used across all deployment files.

# Test: Search for the new address in all deployment files.
rg --type json '0x113E97921874646413572F2C43562463c378b6f5' deployments/

# Test: Attempt to identify the old address by searching for any other similar addresses in deployment files.
rg --type json '"StargateFacetV2": "0x' deployments/

Length of output: 1793

deployments/base.json (1)

38-38: Verify the address update for StargateFacetV2.

Ensure that the new address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is correct and has been properly updated in all relevant parts of the system.

Verification successful

Address Update for StargateFacetV2 Verified

The new address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 for StargateFacetV2 is consistently updated across multiple deployment files, including mainnet.json, arbitrum.json, aurora.json, scroll.json, polygon.json, mantle.json, optimism.json, avalanche.json, sei.json, base.json, gravity.json, and bsc.json. This indicates a thorough update in these configurations.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new address for StargateFacetV2 is used consistently across the codebase.

# Test: Search for the new address. Expect: Occurrences of the new address in relevant files.
rg --type json '0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61'

Length of output: 2447

deployments/avalanche.json (1)

45-45: Verify the new address for StargateFacetV2.

Ensure that the updated address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is correct and reflects the intended deployment for StargateFacetV2. This consistency is crucial for the correct functioning of the system.

Verification successful

Address Consistency Verified for StargateFacetV2.

The address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is consistently used across all relevant deployment files, ensuring uniformity in the configuration.

  • Files checked include: avalanche.json, scroll.json, sei.json, optimism.json, polygon.json, mantle.json, mainnet.json, bsc.json, gravity.json, aurora.json, base.json, and arbitrum.json.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new address for StargateFacetV2 across all deployment files.

# Test: Search for the new address in all JSON files. Expect: Consistent address across all relevant files.
rg --type json '"StargateFacetV2": "0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61"'

Length of output: 1174

deployments/bsc.json (1)

47-47: Verify the new address for StargateFacetV2.

Ensure that the updated address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is correct and reflects the intended deployment for StargateFacetV2. This consistency is crucial for the correct functioning of the system.

deployments/optimism.json (1)

47-47: Verify the new address for StargateFacetV2.

Ensure that the updated address 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61 is correct and reflects the intended deployment for StargateFacetV2. This consistency is crucial for the correct functioning of the system.

script/deploy/safe/propose-to-safe.ts (3)

12-12: Streamline network handling with getViemChainForNetworkName.

The introduction of getViemChainForNetworkName simplifies the retrieval of chain information, reducing dependency on mappings and potential errors.


53-57: Directly use network name for configuration.

Replacing chainName with args.network in the configuration ensures that the network handling is more straightforward and less error-prone.


62-62: Ensure correct safe address usage.

Using args.network.toLowerCase() to access safeAddresses ensures consistency with the network names. Verify that all network names are correctly mapped in safeAddresses.

Verification successful

Safe address usage is correctly mapped.

The safeAddresses object contains correctly mapped network names in lowercase, ensuring consistent access with args.network.toLowerCase(). No issues found.

  • Located in config/global.json:
    • "mainnet"
    • "arbitrum"
    • "aurora"
    • "avalanche"
    • "base"
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all network names are correctly mapped in `safeAddresses`.

# Test: Check for network names in `safeAddresses` to ensure they match expected values.
rg --type json '"safeAddresses": {'

Length of output: 137


Script:

#!/bin/bash
# Description: Correct the regex pattern and verify that all network names are correctly mapped in `safeAddresses`.

# Corrected Test: Check for network names in `safeAddresses` to ensure they match expected values.
rg '"safeAddresses"\s*:\s*\{' --type json -A 5

Length of output: 487

deployments/arbitrum.json (1)

48-48: Verify the new contract address for StargateFacetV2.

The address has been updated to 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61. Ensure that this address is correct and has been verified for the Arbitrum network.

deployments/polygon.json (1)

51-51: Verify the new contract address for StargateFacetV2.

The address has been updated to 0x6e378C84e657C57b2a8d183CFf30ee5CC8989b61. Ensure that this address is correct and has been verified for the Polygon network.

deployments/mainnet.json (1)

56-56: Verify the new contract address integration.

The address for StargateFacetV2 has been updated. Ensure that this change is reflected and correctly integrated in all relevant parts of the system, such as deployment scripts and any logic that interacts with this contract.

script/tasks/diamondUpdateFacet.sh (1)

178-181: Ensure facet addresses are saved correctly.

The logic for saving facet addresses is conditional on the environment. Verify that this behavior aligns with the intended deployment strategy and that no necessary data is omitted in production.

Verification successful

Facet addresses handling aligns with deployment strategy.

The logic for saving facet addresses is intentionally designed to only execute in non-production environments. In production, facet addresses are updated in logs before the transaction is signed in a secure environment, ensuring security and integrity. This approach aligns with the intended deployment strategy.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the logic for saving facet addresses based on the environment.

# Test: Ensure that the facet addresses are saved correctly in non-production environments.
grep -r "saveDiamondFacets" script/

Length of output: 506


Script:

#!/bin/bash
# Extract the implementation of saveDiamondFacets function
ast-grep --lang bash --pattern 'function saveDiamondFacets() { $$$ }' script/helperFunctions.sh

# Search for comments or documentation related to saveDiamondFacets usage, especially in production environments
rg -A 3 "saveDiamondFacets" script/

Length of output: 1630

deployments/_deployments_log_file.json (15)

21478-21487: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21502-21511: Verify the unverified contract status.

The "VERIFIED" field is set to "false". Ensure that this is intentional and that the contract does not require verification.


21526-21535: Verify the unverified contract status.

The "VERIFIED" field is set to "false". Ensure this is intentional and that the contract does not require verification.


21550-21559: Verify the unverified contract status.

The "VERIFIED" field is set to "false". Ensure this is intentional and that the contract does not require verification.


21574-21583: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21598-21607: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21622-21631: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21646-21655: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21670-21679: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21694-21703: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21718-21727: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21742-21751: Verify the unverified contract status.

The "VERIFIED" field is set to "false". Ensure this is intentional and that the contract does not require verification.


21766-21775: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


21802-21811: Entry for version 1.0.1 looks good.

The entry is well-structured and the verification status is true.


Line range hint 21814-21819: New section for LiFiDEXAggregator looks good.

The structure is consistent with previous entries and appears correct.

script/tasks/diamondUpdateFacet.sh Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Outdated Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Outdated Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Show resolved Hide resolved
script/tasks/diamondUpdateFacet.sh Show resolved Hide resolved
script/deploy/deploySingleContract.sh Show resolved Hide resolved
0xDEnYO and others added 2 commits August 15, 2024 13:33
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
ezynda3
ezynda3 previously approved these changes Aug 16, 2024
@0xDEnYO 0xDEnYO enabled auto-merge (squash) August 16, 2024 11: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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f06be97 and 137f3f0.

Files selected for processing (4)
  • deployments/_deployments_log_file.json (2 hunks)
  • deployments/mainnet.diamond.json (1 hunks)
  • script/deploy/deploySingleContract.sh (3 hunks)
  • script/tasks/diamondUpdateFacet.sh (2 hunks)
Files skipped from review due to trivial changes (1)
  • deployments/mainnet.diamond.json
Files skipped from review as they are similar to previous changes (1)
  • deployments/_deployments_log_file.json
Additional context used
Shellcheck
script/tasks/diamondUpdateFacet.sh

[warning] 116-116: This assignment is only seen by the forked process.

(SC2097)


[warning] 116-116: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 127-127: This assignment is only seen by the forked process.

(SC2097)


[warning] 127-127: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 135-135: script is referenced but not assigned (did you mean 'SCRIPT'?).

(SC2154)


[warning] 136-136: This assignment is only seen by the forked process.

(SC2097)


[warning] 136-136: This expansion will not see the mentioned assignment.

(SC2098)


[warning] 142-142: Quote this to prevent word splitting.

(SC2046)


[warning] 146-146: This assignment is only seen by the forked process.

(SC2097)


[warning] 146-146: This expansion will not see the mentioned assignment.

(SC2098)

script/deploy/deploySingleContract.sh

[warning] 96-96: Declare and assign separately to avoid masking return values.

(SC2155)

Additional comments not posted (4)
script/tasks/diamondUpdateFacet.sh (3)

116-116: Fix variable assignment visibility.

The assignment to RAW_RETURN_DATA is only seen by the forked process. Ensure that the assignment is visible to the parent shell to avoid unexpected behavior.

- RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK -vvvv --json --silent --skip-simulation --legacy)
+ RAW_RETURN_DATA=$(NO_BROADCAST=true NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX USE_DEF_DIAMOND=$USE_MUTABLE_DIAMOND PRIVATE_KEY=$PRIVATE_KEY forge script "$UPDATE_SCRIPT" -f $NETWORK -vvvv --json --silent --skip-simulation --legacy)
Tools
Shellcheck

[warning] 116-116: This assignment is only seen by the forked process.

(SC2097)


[warning] 116-116: This expansion will not see the mentioned assignment.

(SC2098)


123-123: Quote command arguments to prevent word splitting.

The command arguments should be quoted to prevent unintended word splitting, which can lead to incorrect command execution.

- ts-node script/deploy/safe/propose-to-safe.ts --to "$DIAMOND_ADDRESS" --calldata "$FACET_CUT" --network "$NETWORK" --rpcUrl $(getRPCUrl $NETWORK) --privateKey "$SAFE_SIGNER_PRIVATE_KEY"
+ ts-node script/deploy/safe/propose-to-safe.ts --to "$DIAMOND_ADDRESS" --calldata "$FACET_CUT" --network "$NETWORK" --rpcUrl "$(getRPCUrl $NETWORK)" --privateKey "$SAFE_SIGNER_PRIVATE_KEY"

135-135: Correct uninitialized variable usage.

The variable script is referenced but not assigned. It seems like SCRIPT was intended. Verify and correct the variable usage.

- echoDebug "Calculating facet cuts for $script..."
+ echoDebug "Calculating facet cuts for $SCRIPT..."
Tools
Shellcheck

[warning] 135-135: script is referenced but not assigned (did you mean 'SCRIPT'?).

(SC2154)

script/deploy/deploySingleContract.sh (1)

96-96: Separate declaration and assignment to avoid masking return values.

Declare CONTRACT separately from its assignment to prevent masking any return values from the command substitution.

- local CONTRACT=$(echo $SCRIPT | sed -e 's/Deploy//')
+ local CONTRACT
+ CONTRACT=$(echo $SCRIPT | sed -e 's/Deploy//')
Tools
Shellcheck

[warning] 96-96: Declare and assign separately to avoid masking return values.

(SC2155)

@0xDEnYO 0xDEnYO merged commit 3d31159 into main Aug 19, 2024
9 of 12 checks passed
@0xDEnYO 0xDEnYO deleted the diamondCutAutoProposeToSafe branch August 19, 2024 08:22
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