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

Deploy emergency pause #840

Merged
merged 4 commits into from
Oct 24, 2024
Merged

Deploy emergency pause #840

merged 4 commits into from
Oct 24, 2024

Conversation

0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Oct 24, 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>

Copy link
Contributor

coderabbitai bot commented Oct 24, 2024

Walkthrough

The pull request introduces the EmergencyPauseFacet with version 1.0.0 across various deployment configuration files, replacing previously empty entries. This new facet is added at the address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61, enhancing the functionality of the LiFiDiamond architecture by enabling emergency pause capabilities. The changes maintain the existing structure of the JSON files, with no alterations to other facets or their versions.

Changes

File Path Change Summary
deployments/_deployments_log_file.json No changes reported.
deployments/arbitrum.diamond.json Added EmergencyPauseFacet with version 1.0.0 at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/arbitrum.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/aurora.diamond.json Added EmergencyPauseFacet with empty fields; updated CelerIMFacetMutable to version 2.0.0; relocated StandardizedCallFacet and StargateFacetV2 with version updates.
deployments/aurora.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/avalanche.diamond.json Added EmergencyPauseFacet with version 1.0.0 at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/avalanche.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
deployments/base.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/base.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/blast.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/boba.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/bsc.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/bsc.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
deployments/celo.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/celo.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
deployments/fantom.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/fantom.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/fraxtal.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/fraxtal.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; updated LiFiDEXAggregator.
deployments/fuse.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/fuse.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/gnosis.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/gnosis.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/gravity.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/gravity.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; restored Receiver.
deployments/immutablezkevm.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/immutablezkevm.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/kaia.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/kaia.json New entry for EmergencyPauseFacet at address 0x5b4dd05850A3f373500e7fC90E94b581A45ACBFa; retained Receiver.
deployments/linea.diamond.json Updated entry for facet at address 0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96 to EmergencyPauseFacet with version 1.0.0.
deployments/linea.json New entry for EmergencyPauseFacet at address 0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96.
deployments/mainnet.diamond.json Updated entry for facet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 to EmergencyPauseFacet with version 1.0.0.
deployments/mainnet.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/mantle.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/metis.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/metis.json New entry for EmergencyPauseFacet at address 0xD5734b44Bb7Ada52ea6503088612E70a2a612371; moved LiFiDEXAggregator.
deployments/mode.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/moonbeam.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/moonbeam.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/moonriver.diamond.json Updated entry for facet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 to EmergencyPauseFacet with version 1.0.0.
deployments/moonriver.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
deployments/opbnb.diamond.json Updated entry for facet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 to EmergencyPauseFacet with version 1.0.0.
deployments/opbnb.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/optimism.diamond.json Updated entry for facet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 to EmergencyPauseFacet with version 1.0.0.
deployments/optimism.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/polygon.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/polygon.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/polygonzkevm.diamond.json Updated entry for facet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 to EmergencyPauseFacet with version 1.0.0.
deployments/polygonzkevm.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; updated LiFiDEXAggregator.
deployments/rootstock.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/rootstock.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
deployments/scroll.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/scroll.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/sei.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/sei.json Removed LiFiDEXAggregator; added EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61.
deployments/taiko.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/taiko.json New entry for EmergencyPauseFacet at address 0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96; retained Receiver.
deployments/xlayer.diamond.json Added EmergencyPauseFacet with version 1.0.0.
deployments/xlayer.json New entry for EmergencyPauseFacet at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61; retained LiFiDEXAggregator.
foundry.toml Updated evm_version from 'paris' to 'shanghai'.
lib/openzeppelin-contracts Updated subproject commit reference.
script/deploy/_targetState.json Added EmergencyPauseFacet and other facets to multiple configurations; removed some existing facets.
script/deploy/zksync/022_deploy_emergency_pause_facet.ts Introduced deployment script for EmergencyPauseFacet.
script/helperFunctions.sh Updated updateDiamondLogs function to streamline operations by removing "staging" environment.

Possibly related PRs

Suggested reviewers

  • ezynda3

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@lifi-action-bot lifi-action-bot marked this pull request as draft October 24, 2024 02:15
@0xDEnYO 0xDEnYO marked this pull request as ready for review October 24, 2024 02:22
@0xDEnYO 0xDEnYO enabled auto-merge (squash) October 24, 2024 02:23
@lifi-action-bot
Copy link
Collaborator

Test Coverage Report

Line Coverage: 76.20% (1685 / 2211 lines)
Function Coverage: 85.07% ( 359 / 422 functions)
Branch Coverage: 35.67% ( 193 / 541 branches)
Test coverage (76.20%) is above min threshold (74%). Check passed.

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.

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments.

Actionable comments posted: 6

🧹 Outside diff range and nitpick comments (18)
script/deploy/zksync/022_deploy_emergency_pause_facet.ts (2)

36-36: Add deployment status validation.

Consider enhancing the deployment logs with:

  1. Emergency pause configuration parameters
  2. Diamond integration status
-  await updateDeploymentLogs('EmergencyPauseFacet', deployedFacet, isVerified)
+  await updateDeploymentLogs('EmergencyPauseFacet', deployedFacet, isVerified, {
+    diamondAddress: diamond.address,
+    integrationStatus: 'success',
+    timestamp: Date.now()
+  })

41-42: Consider adding deployment order tags.

For an emergency feature, explicit ordering in the deployment sequence is crucial.

-  func.tags = ['DeployEmergencyPauseFacet']
+  func.tags = ['DeployEmergencyPauseFacet', 'EmergencyFeatures', 'CoreInfrastructure']
deployments/mantle.json (1)

27-28: Document the emergency pause mechanism.

Consider adding documentation about:

  1. The relationship between LiFiDEXAggregator and EmergencyPauseFacet
  2. The emergency pause activation process
  3. The impact on other facets when paused

Would you like me to help create a documentation template for this feature?

deployments/opbnb.diamond.json (1)

Line range hint 1-90: Document other facet names and versions.

Many facets in the configuration have empty name and version fields. This makes it difficult to:

  1. Track deployed versions
  2. Understand the purpose of each facet
  3. Maintain proper upgrade paths

Consider documenting the names and versions of other facets for better maintainability and traceability.

deployments/fuse.diamond.json (1)

57-58: Consider adding deployment verification steps.

Given the critical nature of an emergency pause feature, consider adding post-deployment verification steps to ensure the feature works as expected across all chains.

Suggested additions to the deployment process:

  1. Automated pause/unpause test post-deployment
  2. Verification of pause propagation across all affected facets
  3. Documentation of emergency response procedures
deployments/sei.diamond.json (1)

61-62: Consider version management strategy for critical security feature.

For a critical security feature like emergency pause:

  1. Consider starting with version 1.0.0-rc (release candidate) to indicate initial deployment phase
  2. Document upgrade path and version compatibility matrix
  3. Ensure version bumping strategy is defined for security patches
deployments/moonbeam.diamond.json (1)

73-74: Document emergency pause functionality.

Consider adding documentation that covers:

  1. The conditions under which emergency pause can be activated
  2. The scope of functionality that gets paused
  3. The authorization model for pause/unpause operations

Would you like me to help create a documentation template for this critical functionality?

deployments/metis.diamond.json (1)

73-74: Security considerations for emergency pause deployment.

Please ensure the following security measures are in place:

  1. The facet implementation has proper event emissions for pause/unpause actions
  2. There's a clear process documented for emergency response
  3. The diamond cut parameters for adding this facet are correctly specified

Would you like me to help create a deployment verification checklist or emergency response documentation?

deployments/arbitrum.json (1)

51-51: Architecture recommendation: Document emergency pause triggers and recovery process.

Given the critical nature of emergency pause functionality:

  1. Ensure there's clear documentation about what triggers constitute an emergency
  2. Document the process for activating and deactivating the pause
  3. Define the recovery process and responsible parties

Would you like me to help create a documentation template covering these aspects?

deployments/mainnet.json (1)

59-59: Document emergency pause procedures and access controls.

Given the critical nature of emergency pause functionality:

  1. Add documentation in the repository explaining:
    • Emergency pause activation/deactivation procedures
    • Access control hierarchy
    • Recovery procedures
  2. Consider adding integration tests specifically for emergency scenarios

Would you like me to help create this documentation or open an issue to track this task?

deployments/linea.diamond.json (1)

117-118: Ensure proper version documentation.

The version 1.0.0 indicates this is the initial release of the EmergencyPauseFacet. Please ensure that:

  1. The version follows semantic versioning
  2. Changes are documented in the changelog
  3. The implementation has undergone security review as per PR checklist
deployments/avalanche.diamond.json (1)

Line range hint 1-140: Clean up empty facet entries in configuration.

The configuration contains several facet entries with empty Name/Version:

  • 0xf7993A8df974AD022647E63402d6315137c58ABf
  • 0x0b5726b7348efBdA8620D5C374F85Cbe8f040B6a
  • 0x5D3675D698A3DD53E3457951e1dEbEF717A29A72
  • 0xF965f52046D7095d5080bD31459601F4Eb24f72D

These should either be documented or removed to maintain clean configuration.

deployments/base.diamond.json (1)

Line range hint 38-42: Consider cleaning up empty facet entries.

There are several facet entries with empty Name/Version fields. These might be deprecated or removed facets:

  • 0x6039935fc13e548517C2c3cEeb81A952C69c8A3b
  • 0xF965f52046D7095d5080bD31459601F4Eb24f72D
  • 0x00990C0FfBB7eAB014351652aFB65AaE00db43A4

Consider removing these entries if they are no longer in use to maintain cleaner configuration.

Also applies to: 71-74, 100-104

deployments/polygon.diamond.json (1)

145-146: Consider documenting emergency procedures.

Given the critical nature of emergency pause functionality, consider adding documentation that outlines:

  1. Conditions under which emergency pause should be activated
  2. Authorization process for emergency actions
  3. Communication procedures during emergencies

Would you like me to help create a template for the emergency procedures documentation?

deployments/optimism.diamond.json (2)

145-146: Confirm version management strategy.

The facet is being introduced with version 1.0.0. Please ensure:

  1. The version follows semantic versioning
  2. The implementation has undergone preliminary security audit as per PR requirements
  3. The version is consistent across all network deployments

145-146: Document emergency procedures.

Consider adding documentation that outlines:

  • Conditions under which emergency pause should be activated
  • Authorization process for pause/unpause actions
  • Impact on other facets during pause state

Would you like me to help create a documentation template for emergency procedures?

deployments/arbitrum.diamond.json (1)

145-146: Validate deployment configuration.

The facet configuration appears correct with:

  • Name: "EmergencyPauseFacet"
  • Version: "1.0.0" (follows semantic versioning)
  • Address: 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61

Given the critical nature of emergency pause functionality:

  1. Ensure the facet is properly initialized during deployment
  2. Consider implementing a time-delay mechanism for unpausing to prevent immediate reactivation after a security incident
  3. Document the emergency procedures and access control matrix
deployments/mainnet.diamond.json (1)

Line range hint 174-185: Consider emergency pause impact on periphery contracts.

The emergency pause functionality should account for the following periphery contracts:

  • Executor: 0x2dfaDAB8266483beD9Fd9A292Ce56596a2D1378D
  • FeeCollector: 0xbD6C7B0d2f68c2b7805d88388319cfB6EcB50eA9
  • Various Receivers

Please ensure:

  1. The pause mechanism properly handles in-flight transactions
  2. Clear documentation exists for the pause impact on each periphery contract
  3. Recovery procedures are defined for each affected component
🛑 Comments failed to post (6)
script/deploy/zksync/022_deploy_emergency_pause_facet.ts (1)

27-30: ⚠️ Potential issue

Critical: Verify variable naming and contract retrieval.

There's a potential issue in the variable naming:

  • Line 27 retrieves 'EmergencyPauseFacet' but assigns to accessManagerFacet
  • This could lead to confusion in maintenance

Apply this fix:

-  const accessManagerFacet = await ethers.getContract('EmergencyPauseFacet')
+  const emergencyPauseFacet = await ethers.getContract('EmergencyPauseFacet')
-  await addOrReplaceFacets([accessManagerFacet], diamond.address)
+  await addOrReplaceFacets([emergencyPauseFacet], diamond.address)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  const emergencyPauseFacet = await ethers.getContract('EmergencyPauseFacet')
  const diamond = await ethers.getContract(diamondContractName)

  await addOrReplaceFacets([emergencyPauseFacet], diamond.address)
deployments/aurora.diamond.json (1)

4-7: ⚠️ Potential issue

Complete the facet metadata.

The facet entry is missing both Name and Version fields. Based on the PR objectives and changes across other networks, this appears to be the EmergencyPauseFacet.

Apply this update:

  "0xf7993A8df974AD022647E63402d6315137c58ABf": {
-   "Name": "",
-   "Version": ""
+   "Name": "EmergencyPauseFacet",
+   "Version": "1.0.0"
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

      "0xf7993A8df974AD022647E63402d6315137c58ABf": {
        "Name": "EmergencyPauseFacet",
        "Version": "1.0.0"
      },
deployments/taiko.diamond.json (1)

61-62: 💡 Codebase verification

Based on the script results, I can now provide a final response as we have clear evidence about the address patterns across deployments:

Different EmergencyPauseFacet addresses detected across networks require documentation

The verification reveals three distinct patterns in EmergencyPauseFacet deployments:

  • Most production networks (mainnet, arbitrum, avalanche, etc.) use: 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61
  • Taiko and Linea use: 0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96
  • Other variations exist for specific networks:
    • Metis: 0xD5734b44Bb7Ada52ea6503088612E70a2a612371
    • Kaia: 0x5b4dd05850A3f373500e7fC90E94b581A45ACBFa
    • Staging environments use different addresses (e.g., 0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b)

While different addresses across networks can be valid (especially for staging), this variation should be explicitly documented to avoid confusion and ensure it's intentional rather than accidental.

🔗 Analysis chain

Verify address consistency across network deployments.

The EmergencyPauseFacet address in this Taiko deployment (0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96) differs from the address mentioned in the AI summary for other networks (0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61). While different addresses across networks are possible, this should be intentional and documented.

Let's verify the addresses across all deployment files:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check EmergencyPauseFacet addresses across all deployment files
# Expected: Different address for Taiko vs other networks should be intentional

echo "Checking EmergencyPauseFacet addresses across deployments:"
fd --extension json --exec grep -l "EmergencyPauseFacet" {} \; | \
  xargs jq -r '. | 
    to_entries[] | 
    select(.key == "LiFiDiamond") | 
    .value.Facets | 
    to_entries[] | 
    select(.value.Name == "EmergencyPauseFacet") | 
    "\(.key) in \(input_filename)"'

Length of output: 5988

deployments/base.diamond.json (1)

133-134: 💡 Codebase verification

Warning: EmergencyPauseFacet deployment addresses are not fully consistent

While the version "1.0.0" is consistent across all deployments, I noticed different deployment addresses being used:

  • Main address: 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 (most common)
  • Alternative addresses found:
    • 0xe07c030dDC7Fb9ca23b633b1028106DAA5fdbF96
    • 0xD5734b44Bb7Ada52ea6503088612E70a2a612371
    • 0x5b4dd05850A3f373500e7fC90E94b581A45ACBFa
    • 0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b
    • 0xf03AFcA857918BE01EBD6C6800Fc2974b8a9eBA2

This inconsistency in deployment addresses across chains should be investigated to ensure proper functionality and security across all environments.

🔗 Analysis chain

Verify consistent deployment across chains.

The EmergencyPauseFacet is being deployed at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 across multiple chains. Let's verify the consistency:


The output shows that the EmergencyPauseFacet is consistently deployed at address 0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61 across all deployment files. Let's verify the version consistency as well to ensure complete deployment consistency.

This will help us confirm that not only the address but also the version is consistent across all deployments.


Let me generate one more verification to specifically check the version consistency across deployment files:

This will help us confirm that the version "1.0.0" is consistently used across all deployments before making the final determination.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check EmergencyPauseFacet address consistency across all deployment files
echo "Checking EmergencyPauseFacet address consistency..."
fd -e json -e hjson . deployments/ --exec rg -A 2 '0x6F2baA7cd5F156CA1B132F7FF11E0fa2aD775F61'

Length of output: 10191


Script:

#!/bin/bash
# Check EmergencyPauseFacet version consistency across all deployment files
echo "Checking EmergencyPauseFacet version consistency..."
fd -e json -e hjson . deployments/ --exec rg -B 1 '"Version": "1.0.0"' | grep -B 1 'EmergencyPauseFacet'

Length of output: 8109


Script:

#!/bin/bash
# Get all EmergencyPauseFacet entries with their versions from deployment files
echo "Checking EmergencyPauseFacet version consistency..."
fd -e json -e hjson . deployments/ --exec rg -C 2 '"Name": "EmergencyPauseFacet"'

Length of output: 4338

script/deploy/_targetState.json (2)

31-31: ⚠️ Potential issue

Fix duplicate ReceiverAcrossV3 entries.

There are duplicate ReceiverAcrossV3 key entries in several network configurations. In JSON, when a key is defined multiple times, only the last definition takes effect, which could lead to unexpected behavior.

Remove the duplicate entries to ensure proper configuration:

  • Line 31 and others in mainnet
  • Line 139 and others in polygon
  • Line 389 and others in arbitrum
  • Line 486 and others in optimism
  • Line 798 and 802 in zksync
  • Line 936 and 949 in base

Also applies to: 139-139, 389-389, 486-486, 798-798, 802-802, 936-936, 949-949

🧰 Tools
🪛 Biome

[error] 31-31: The key ReceiverAcrossV3 was already declared.

This where a duplicated key was declared again.

If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.

(lint/suspicious/noDuplicateObjectKeys)


238-238: ⚠️ Potential issue

Fix OpBNBBridgeFacet configuration error.

The OpBNBBridgeFacet entry contains an error indicating that the source file path could not be found. This will prevent proper deployment of this facet.

Either:

  1. Add the missing OpBNBBridgeFacet contract to the source directory, or
  2. Remove this entry if the facet is not ready for deployment

@0xDEnYO 0xDEnYO merged commit 26a04dd into main Oct 24, 2024
12 of 13 checks passed
@0xDEnYO 0xDEnYO deleted the deploy-emergency-pause branch October 24, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants