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

Fix rootstock verification and add handling for network-specific profile #987

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Feb 11, 2025

Which Jira task belongs to this PR?

Why did I implement it this way?

Rootstock requires evm london and solidity < 0.8.20
That's why with our current main branch setup we cannot deploy to rootstock.

Added some handling for re-compiling with different profile but then verification did not work anymore.
Needs further investigation. But postponed since low prio

Checklist before requesting a review

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>

@0xDEnYO 0xDEnYO added the WIP Work in progress label Feb 11, 2025
Copy link
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

This pull request updates network configuration files, deployment scripts, type definitions, and tests. In the configuration files, each network object now includes new properties for EVM and maximum Solidity versions with specific overrides for the "rootstock" network. The Foundry configuration is updated with a new profile and adjusted compiler settings along with an updated etherscan URL. Deployment and verification scripts have been modified to utilize a FOUNDRY_PROFILE variable. Additionally, type definitions and Solidity test files now support a range of compiler versions, and a new public function is added in a contract.

Changes

Files Change Summary
config/networks.json Added "evmVersion" and "maxSolcVersionForDeploy" to each network object, with "rootstock" using "london" and "0.8.19" respectively. Retained "gasZipChainId".
foundry.toml Updated [profile.default] with solc_version from 0.8.17 to 0.8.28 and evm_version from shanghai to cancun; added [profile.rootstock] and modified the etherscan URL for rootstock.
script/deploy/deploySingleContract.sh
script/helperFunctions.sh
Introduced the FOUNDRY_PROFILE variable for network-specific deployment settings and updated contract verification commands accordingly.
script/utils/viemScriptHelpers.ts Extended the Network type definition by adding evmVersion: string and maxSolcVersionForDeploy: string.
src/Periphery/ERC20Proxy.sol Added a new external function bla9000832().
test/solidity/... Changed Solidity version declarations from a fixed 0.8.17 to ^0.8.17 to allow for broader version compatibility.

Possibly related PRs

Suggested labels

AuditRequired, AuditCompleted

Suggested reviewers

  • ezynda3
  • maxklenk

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 February 11, 2025 07:28
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 comments (1)
src/Periphery/ERC20Proxy.sol (1)

1-50: ⚠️ Potential issue

Update the contract version.

The contract version at line 10 needs to be updated since there are changes to the contract.

Apply this diff to update the version:

-/// @custom:version 1.1.0
+/// @custom:version 1.2.0
🧰 Tools
🪛 GitHub Actions: VersionControlAndAuditVerification

[error] 1-1: The file changed but the file version was not updated. Please make sure to update a contract's version whenever there are changes in the file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1a481 and 46c9730.

📒 Files selected for processing (11)
  • config/networks.json (39 hunks)
  • foundry.toml (3 hunks)
  • script/deploy/deploySingleContract.sh (4 hunks)
  • script/helperFunctions.sh (5 hunks)
  • script/utils/viemScriptHelpers.ts (1 hunks)
  • src/Periphery/ERC20Proxy.sol (1 hunks)
  • test/solidity/Facets/GasZipFacet.t.sol (1 hunks)
  • test/solidity/Facets/RelayFacet.t.sol (1 hunks)
  • test/solidity/Helpers/WithdrawablePeriphery.t.sol (1 hunks)
  • test/solidity/Periphery/GasZipPeriphery.t.sol (1 hunks)
  • test/solidity/Periphery/Permit2Proxy.t.sol (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • test/solidity/Periphery/Permit2Proxy.t.sol
  • test/solidity/Facets/GasZipFacet.t.sol
  • test/solidity/Periphery/GasZipPeriphery.t.sol
  • test/solidity/Helpers/WithdrawablePeriphery.t.sol
  • test/solidity/Facets/RelayFacet.t.sol
👮 Files not reviewed due to content moderation or server errors (2)
  • script/utils/viemScriptHelpers.ts
  • script/deploy/deploySingleContract.sh
🧰 Additional context used
🧠 Learnings (1)
script/deploy/deploySingleContract.sh (1)
Learnt from: 0xDEnYO
PR: lifinance/contracts#782
File: script/deploy/deploySingleContract.sh:231-231
Timestamp: 2024-11-26T01:18:52.125Z
Learning: In the `deploySingleContract.sh` script, environment variable assignments preceding the `forge script` command (e.g., `DEPLOYSALT=$DEPLOYSALT ... forge script ...`) are acceptable and function correctly, even when variable expansions like `$DIAMOND_TYPE` and `$NETWORK` are used later in the same command.
🪛 GitHub Actions: VersionControlAndAuditVerification
src/Periphery/ERC20Proxy.sol

[error] 1-1: The file changed but the file version was not updated. Please make sure to update a contract's version whenever there are changes in the file.

🪛 Shellcheck (0.10.0)
script/deploy/deploySingleContract.sh

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

(SC2097)


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

(SC2098)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
🔇 Additional comments (18)
script/utils/viemScriptHelpers.ts (3)

25-26: LGTM!

The new properties evmVersion and maxSolcVersionForDeploy in the Network type support network-specific EVM and Solidity version requirements, which aligns with the PR objective of handling Rootstock network requirements.


25-26: LGTM! Type definitions align with network-specific requirements.

The new properties evmVersion and maxSolcVersionForDeploy in the Network type enable proper handling of network-specific EVM and Solidity version requirements, which is essential for supporting networks like Rootstock.


25-26: LGTM!

The addition of evmVersion and maxSolcVersionForDeploy properties to the Network type definition aligns with the PR objective to support network-specific EVM and Solidity versions.

foundry.toml (2)

25-27: LGTM!

The new rootstock profile with specific versions (solc_version = '0.8.19' and evm_version = 'london') aligns with the PR objective of supporting Rootstock network requirements.


3-4: Verify the default profile version updates.

The default profile's version updates need verification:

  • solc_version updated from '0.8.17' to '0.8.28'
  • evm_version updated from 'shanghai' to 'cancun'
✅ Verification successful

🌐 Web query:

Are Solidity 0.8.28 and EVM version 'cancun' stable and recommended for production use?

💡 Result:

Solidity 0.8.28 and the EVM "Cancun" version are production-ready with important caveats:

Solidity 0.8.28 Status

  • Stable release with critical improvements:

    • Full support for transient storage state variables (value types only)[1][3]
    • Up to 80% memory reduction in IR compilation[1]
    • Per-contract pipeline configuration avoids unnecessary bytecode generation[1]
    • Contains bug fixes for SMTChecker and Yul AST handling[3]
  • Recommended for projects needing:

    • Transient storage capabilities (EIP-1153)
    • Optimized compilation workflows
    • Latest security patches

EVM "Cancun" Status

  • Activated on Ethereum mainnet since March 13, 2024[6]
  • Key production-ready features:
    // Supported in Solidity ≥0.8.24
    transient uint256 counter; // EIP-1153 transient storage
    blobhash(0); // EIP-4844 blob transactions
    mcopy(dest, src, length); // EIP-5656 memory copy
  • Default EVM version in Solidity ≥0.8.25[6]

Considerations

  1. Transient storage limitations:

    • Only value types supported in v0.8.28 (reference types coming later)[1][3]
    • Requires dummy variables when modifying storage layout[1]
  2. Layer-2 compatibility:

    • Check specific chain support for Cancun features
    • Some L2s may require additional integration time[2][8]
  3. Testing requirements:

    # Recommended verification steps
    solc --evm-version cancun --via-ir contract.sol
    forge test --evm-version cancun

Projects using these versions should monitor Ethereum Foundation announcements and test extensively with their specific toolchain combinations[5][9]. Both are considered stable for production when properly validated against project requirements[6][10].

Citations:


Verification Successful: Default Profile Versions Are Correct

The external query confirms that both Solidity 0.8.28 and EVM version "cancun" are stable and production-ready, with necessary caveats noted (e.g., transient storage limitations). The default profile updates in the foundry.toml file are therefore verified.

  • Solidity 0.8.28 is stable and recommended for production.
  • EVM "cancun" is production ready and supported as the default version in Solidity ≥0.8.25.
script/deploy/deploySingleContract.sh (8)

93-93: LGTM!

The addition of the FOUNDRY_PROFILE variable with a default value of "default" provides a good foundation for network-specific profile handling.


96-104: LGTM!

The special handling for rootstock network is well-implemented:

  • Switches to rootstock profile
  • Cleans and rebuilds with updated settings
  • Provides clear user feedback

93-104: LGTM! Proper handling of rootstock-specific requirements.

The code correctly initializes the default profile and implements special handling for rootstock by:

  1. Setting the appropriate profile
  2. Cleaning and rebuilding with updated settings

413-413: LGTM! Consistent handling of profile in contract verification.

The FOUNDRY_PROFILE is correctly passed to all verifyContract calls, ensuring that contracts are verified using the appropriate compiler settings.

Also applies to: 418-418, 462-462, 467-467


93-94: LGTM!

The initialization of FOUNDRY_PROFILE with a default value provides a good fallback for networks that don't require special handling.


95-105: LGTM!

The special handling for rootstock is well-implemented:

  1. Clear user feedback about profile switching
  2. Proper environment variable export
  3. Cache clearing and rebuilding with updated settings

413-414: LGTM!

The contract verification calls correctly pass the FOUNDRY_PROFILE parameter to ensure the right compiler settings are used during verification.

Also applies to: 418-419, 462-463, 467-468


251-252: ⚠️ Potential issue

Fix variable assignment in forge script execution.

The current implementation has a potential issue with variable assignments in subshells. The FOUNDRY_PROFILE variable should be exported before the command.

Apply this diff to fix the variable assignment:

-      RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
+      export FOUNDRY_PROFILE
+      RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
⛔ Skipped due to learnings
Learnt from: 0xDEnYO
PR: lifinance/contracts#782
File: script/deploy/deploySingleContract.sh:231-231
Timestamp: 2024-11-26T01:18:52.125Z
Learning: In the `deploySingleContract.sh` script, environment variable assignments preceding the `forge script` command (e.g., `DEPLOYSALT=$DEPLOYSALT ... forge script ...`) are acceptable and function correctly, even when variable expansions like `$DIAMOND_TYPE` and `$NETWORK` are used later in the same command.
🧰 Tools
🪛 Shellcheck (0.10.0)

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

(SC2097)


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

(SC2098)

config/networks.json (3)

1-782: LGTM! Well-structured configuration file.

The configuration maintains a consistent structure across all networks with proper organization of properties.


602-621: Rootstock configuration aligns with network requirements.

The Rootstock network configuration correctly specifies:

  • EVM version as "london"
  • Maximum Solidity version as "0.8.19"

These settings align with Rootstock's requirements for EVM London version and Solidity version less than 0.8.20.


19-20: Verify EVM and Solidity version compatibility across networks.

All networks except Rootstock use:

  • EVM version: "shanghai"
  • Maximum Solidity version: "0.8.17"

Please verify that these versions are compatible with all networks, especially newer ones like Blast, Mode, and Fraxtal.

Run the following script to check if any networks have documented version requirements:

Also applies to: 39-40, 59-60, 79-80, 99-100, 119-120, 139-140, 159-160, 179-180, 199-200, 219-220, 239-240, 259-260, 279-280, 299-300, 319-320, 339-340, 359-360, 379-380, 399-400, 419-420, 439-440, 459-460, 479-480, 499-500, 519-520, 539-540, 559-560, 579-580, 599-600, 639-640, 659-660, 679-680, 699-700, 719-720, 739-740, 759-760, 779-780

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Search for network-specific version requirements in documentation.

# Test: Search for version requirements in README and docs.
fd -e md -e txt . --exec rg -i "evm|solidity|compiler" {}

Length of output: 6500


EVM & Solidity Versions Consistent Across Networks

I searched the project documentation for any network-specific version requirements and found no evidence of deviations from the baseline configuration. The use of "evmVersion": "shanghai" and "maxSolcVersionForDeploy": "0.8.17" appears to be uniform for all networks—including the newer ones like Blast, Mode, and Fraxtal—unless overridden by network-specific configs not present in the common docs.

script/helperFunctions.sh (2)

1414-1420: LGTM! Well-implemented profile parameter handling.

The changes properly add the new FOUNDRY_PROFILE parameter with a default value, ensuring backward compatibility for existing calls.

Also applies to: 1459-1462


1472-1472: LGTM! Consistent profile usage in verification commands.

The changes correctly apply the FOUNDRY_PROFILE parameter across all verification scenarios, both with and without constructor arguments. This implementation aligns with the PR objective to fix rootstock verification by enabling network-specific profiles.

Also applies to: 1481-1481, 1492-1492, 1499-1499

@@ -18,6 +18,8 @@ contract ERC20Proxy is WithdrawablePeriphery {
/// Constructor
constructor(address _owner) WithdrawablePeriphery(_owner) {}

function bla9000832() external {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove or implement the placeholder function.

The empty function bla9000832() appears to be a placeholder or test function. Either implement the intended functionality or remove it if not needed.

@@ -234,7 +248,7 @@ deploySingleContract() {
RAW_RETURN_DATA=$(FOUNDRY_PROFILE=zksync DEPLOYSALT=$DEPLOYSALT NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") ./foundry-zksync/forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --slow --zksync)
else
# try to execute call
RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix the variable assignment in the forge script command.

The FOUNDRY_PROFILE variable assignment in the forge script command is only seen by the forked process and won't be visible to the expansion.

Apply this diff to fix the variable assignment:

-      RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
+      export FOUNDRY_PROFILE=$FOUNDRY_PROFILE
+      RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
📝 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.

Suggested change
RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
export FOUNDRY_PROFILE=$FOUNDRY_PROFILE
RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
🧰 Tools
🪛 Shellcheck (0.10.0)

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

(SC2097)


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

(SC2098)


⚠️ Potential issue

Fix environment variable assignment in the forge script command.

The current assignment of FOUNDRY_PROFILE within the command is only visible to the forked process. Move the export statement before the command to ensure proper visibility.

Apply this fix:

-      RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
+      export FOUNDRY_PROFILE=$FOUNDRY_PROFILE
+      RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
📝 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.

Suggested change
RAW_RETURN_DATA=$(FOUNDRY_PROFILE=$FOUNDRY_PROFILE DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
export FOUNDRY_PROFILE=$FOUNDRY_PROFILE
RAW_RETURN_DATA=$(DEPLOYSALT=$DEPLOYSALT CREATE3_FACTORY_ADDRESS=$CREATE3_FACTORY_ADDRESS NETWORK=$NETWORK FILE_SUFFIX=$FILE_SUFFIX DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT=$DEFAULT_DIAMOND_ADDRESS_DEPLOYSALT DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS=$DEPLOY_TO_DEFAULT_DIAMOND_ADDRESS PRIVATE_KEY=$(getPrivateKey "$NETWORK" "$ENVIRONMENT") DIAMOND_TYPE=$DIAMOND_TYPE forge script "$FULL_SCRIPT_PATH" -f $NETWORK -vvvvv --json --broadcast --skip-simulation --legacy)
🧰 Tools
🪛 Shellcheck (0.10.0)

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

(SC2097)


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

(SC2098)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant