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(Proxies): reviews #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix(Proxies): reviews #67

wants to merge 3 commits into from

Conversation

unknownunknown1
Copy link
Contributor

@unknownunknown1 unknownunknown1 commented Mar 18, 2025

Summary by CodeRabbit

  • New Features
    • Added support for wrapped native currency handling across multiple contracts.
    • Introduced a consolidated minimum gas limit configuration for enhanced transaction efficiency.
  • Bug Fixes
    • Improved fund transfer mechanisms by implementing safe sending practices to enhance reliability.
  • Refactor
    • Adjusted arbitration and relay operations to improve access control and support multiple relays.
  • Documentation
    • Reinstated and clarified key documentation details, including meta evidence and fund-handling guidelines.
    • Updated resource links for messaging protocols to ensure users have current reference information.

Copy link

coderabbitai bot commented Mar 18, 2025

Walkthrough

This pull request updates several Realitio cross-chain proxy contracts. In the foreign proxies (Arbitrum, Optimism, and ZkSync), the visibility of key arbitration functions is changed from public to external, and the relay logic is adjusted to allow multiple relays. Additionally, a new state variable wNative is introduced to handle wrapped native currency, and the SafeSend library is utilized for safer fund transfers. Documentation improvements include updated URLs and refined comments regarding ETH acceptance and Kleros answer denominations. Home proxies see updated documentation URLs without impacting contract functionality.

Changes

File(s) Change Summary
contracts/src/0.8/RealitioForeignProxyArbitrum.sol
contracts/src/0.8/RealitioForeignProxyOptimism.sol
contracts/src/0.8/RealitioForeignProxyZkSync.sol
Changed visibility of receiveArbitrationAcknowledgement and receiveArbitrationCancelation from public to external. Added wNative variable for wrapped native currency. Updated functions to use safeSend for fund transfers. Modified relayRule logic to allow relayed statuses.
contracts/src/0.8/RealitioForeignProxyOptimism.sol Replaced immutable minGasLimit with constant MIN_GAS_LIMIT (200,000) and updated related documentation to clarify gas limit usage and the Kleros answer offset.
contracts/src/0.8/RealitioHomeProxyArbitrum.sol Updated documentation URL for L2 to L1 messaging.
contracts/src/0.8/RealitioHomeProxyOptimism.sol Updated documentation URL in the @dev tag for messaging instructions.
contracts/src/0.8/RealitioHomeProxyZkSync.sol Updated documentation URLs related to L1-L2 messaging and proxy addressing, with no changes to contract logic.
contracts/deploy/foreign/arbitrum.js
contracts/deploy/foreign/optimism.js
contracts/deploy/foreign/zksync.js
Introduced wNative import and updated deployment logic to include wNative based on current chain ID. Restructured arguments for deployment functions.
contracts/deploy/shared/consts.js Added new constant wNatives mapping chain IDs to WETH addresses.
contracts/src/0.8/libraries/SafeSend.sol Introduced SafeSend library and WethLike interface for safe Ether transfers.

Possibly related PRs

  • Deployments refactor + Unichain/Base deployment #56: Changes involve modifications to the receiveArbitrationAcknowledgement and receiveArbitrationCancelation functions, specifically changing their visibility from public to external, and both utilize the wNative variable for handling wrapped native currency transactions.
  • Feat/gnosis proxy compiler bump #54: Similar modifications in function signatures for arbitration functions in Optimism and ZkSync proxies, including the introduction of the wNative variable.
  • Deployment v1.3.0 #62: Changes in the RealitioForeignProxyArbitrum contract regarding the addition of the wNative variable and modifications to the arbitration functions.

Suggested reviewers

  • unknownunknown1

Poem

I'm a hopping rabbit, full of cheer,
Watching functions change from far to near,
External calls now lead the way,
With updated docs to brighten the day.
Gas and rules now clearly defined,
Through CodeRabbit Inc., our code's aligned!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 77b9163 and ce4ea21.

📒 Files selected for processing (8)
  • contracts/deploy/02-foreign-proxy.js (2 hunks)
  • contracts/deploy/foreign/arbitrum.js (1 hunks)
  • contracts/deploy/foreign/optimism.js (1 hunks)
  • contracts/deploy/foreign/zksync.js (2 hunks)
  • contracts/deploy/shared/consts.js (2 hunks)
  • contracts/src/0.8/RealitioForeignProxyArbitrum.sol (20 hunks)
  • contracts/src/0.8/RealitioForeignProxyOptimism.sol (18 hunks)
  • contracts/src/0.8/RealitioForeignProxyZkSync.sol (19 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • contracts/deploy/shared/consts.js
  • contracts/deploy/foreign/zksync.js
  • contracts/deploy/foreign/optimism.js
  • contracts/src/0.8/RealitioForeignProxyZkSync.sol
  • contracts/src/0.8/RealitioForeignProxyOptimism.sol
🧰 Additional context used
🧬 Code Definitions (2)
contracts/deploy/02-foreign-proxy.js (1)
contracts/deploy/shared/consts.js (1) (1)
  • wNatives (10-13)
contracts/deploy/foreign/arbitrum.js (1)
contracts/deploy/shared/utils.js (3) (3)
  • getMetaEvidenceCID (14-25)
  • encodeExtraData (6-7)
  • eth (4-4)
🔇 Additional comments (15)
contracts/deploy/02-foreign-proxy.js (2)

1-1: Properly added wNatives import.

The addition of wNatives to the imports from shared module enables accessing wrapped native token addresses for different chains.


50-50: Good addition of wNative parameter.

The wNative parameter is correctly passed to the deployForeignProxy function, allowing the foreign proxy contracts to interact with the wrapped version of the native currency on each chain.

contracts/deploy/foreign/arbitrum.js (4)

1-1: ⚠️ Potential issue

Missing getChainId import issue remains unresolved.

The previous review correctly identified that getChainId() function is called but not defined or imported in this file.

This needs to be fixed by importing getChainId or defining it in the file:

-const { encodeExtraData, eth, getMetaEvidenceCID } = require("../shared");
+const { encodeExtraData, eth, getMetaEvidenceCID, getChainId } = require("../shared");

Or, if getChainId is from hardhat:

+const { network } = require("hardhat");
+
+async function getChainId() {
+  return network.config.chainId;
+}

18-28: Updated function signature with wNative parameter.

Correctly added wNative to the function parameters, matching the changes in the contract constructor.


39-40: Added wNative as first argument for deployment.

Properly added wNative as the first argument in the args array, ensuring it's passed to the contract constructor.


47-47: Changed l2 parameters format to prevent stack too deep.

L2 gas parameters are now passed as an array [l2GasLimit, gasPriceBid] instead of separate arguments, which helps avoid the "stack too deep" error in Solidity.

contracts/src/0.8/RealitioForeignProxyArbitrum.sol (9)

17-17: Added SafeSend library import.

Good addition of the SafeSend library import to handle native token transfers safely.


25-25: Properly set up SafeSend for payable addresses.

Using the SafeSend library for payable addresses enables safer ETH transfers throughout the contract.


68-68: Added wNative state variable.

Good addition of the wNative state variable to store the address of the wrapped version of the chain's native currency.


127-127: Updated constructor parameters and initialization.

The constructor has been properly updated to:

  1. Accept the wrapped native token address
  2. Use an array for L2 parameters to avoid stack too deep errors
  3. Correctly initialize the wNative state variable
  4. Assign L2 parameters from the array

This improves the contract's flexibility while maintaining backward compatibility.

Also applies to: 137-137, 139-139, 148-149


204-204: Changed function visibility from public to external.

The visibility of arbitration acknowledgement and cancelation functions has been properly changed from public to external, which is more gas efficient since these functions are only called externally.

Also applies to: 252-252


232-232: Replaced direct send with SafeSend for improved security.

All direct ETH transfers using send have been replaced with safeSend which includes the wNative parameter. This is a significant security improvement as it handles failed transfers more gracefully, preventing potential fund lockup.

Also applies to: 259-259, 286-287, 371-371, 412-412, 511-511


282-284: Improved relay logic to prevent intentional blocking.

The modification to allow multiple relays is an excellent security enhancement that prevents malicious actors from intentionally blocking the relay mechanism. The status check now allows both Ruled and Relayed states.

Also applies to: 483-483


425-425: Added clarifying comments about Kleros denomination offset.

The added comments clarify the important difference between Kleros denomination (which has a +1 offset) and Realitio format. This will help developers understand the contract better and prevent potential integration bugs.

Also applies to: 566-566, 591-591, 614-614, 641-641


698-702: Updated documentation with clearer explanation and references.

The updated documentation for the arbitrumGasFee function provides a clearer explanation of how user funds are checked and includes an updated URL to the Arbitrum documentation.


🪧 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 or @coderabbitai title 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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 18, 2025
Copy link

@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

🧹 Nitpick comments (4)
contracts/deploy/foreign/arbitrum.js (1)

38-38: Missing comma at the end of the array

According to the ESLint hint, a comma is missing after the array.

-      [l2GasLimit, gasPriceBid]
+      [l2GasLimit, gasPriceBid],
🧰 Tools
🪛 ESLint

[error] 38-38: Insert ,

(prettier/prettier)

contracts/src/0.8/libraries/SafeSend.sol (2)

17-24: Consider adding error handling for the WETH transfer

While the fallback mechanism is good, there's no error handling if the WETH transfer fails. This could silently mask issues.

function safeSend(address payable _to, uint256 _value, address _wethLike) internal {
    if (_to.send(_value)) return;

    WethLike(_wethLike).deposit{value: _value}();
-   WethLike(_wethLike).transfer(_to, _value);
+   bool success = address(WethLike(_wethLike)).call(
+       abi.encodeWithSelector(WethLike(_wethLike).transfer.selector, _to, _value)
+   );
+   require(success, "SafeSend: WETH transfer failed");
}

18-19: Consider using a NatSpec comment for the function

Adding NatSpec comments would improve documentation and readability.

+/**
+ * @notice Safely sends ETH to a recipient, with WETH fallback
+ * @param _to The recipient address
+ * @param _value The amount to send
+ * @param _wethLike The address of the wrapped native token contract
+ */
function safeSend(address payable _to, uint256 _value, address _wethLike) internal {
    if (_to.send(_value)) return;
contracts/src/0.8/RealitioForeignProxyOptimism.sol (1)

29-29: Consider making the gas limit value more explicit

The current comment mentions that setting the gas limit too high results in high fees, but doesn't explain why 200000 was chosen.

Consider adding a brief explanation of how the 200000 value was determined, to help future maintainers understand whether this value needs adjustment.

Also applies to: 28-28

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 22a0cb3 and 77b9163.

📒 Files selected for processing (8)
  • contracts/deploy/foreign/arbitrum.js (2 hunks)
  • contracts/deploy/foreign/optimism.js (2 hunks)
  • contracts/deploy/foreign/zksync.js (2 hunks)
  • contracts/deploy/shared/consts.js (2 hunks)
  • contracts/src/0.8/RealitioForeignProxyArbitrum.sol (20 hunks)
  • contracts/src/0.8/RealitioForeignProxyOptimism.sol (18 hunks)
  • contracts/src/0.8/RealitioForeignProxyZkSync.sol (19 hunks)
  • contracts/src/0.8/libraries/SafeSend.sol (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • contracts/src/0.8/RealitioForeignProxyZkSync.sol
  • contracts/src/0.8/RealitioForeignProxyArbitrum.sol
🧰 Additional context used
🪛 ESLint
contracts/deploy/foreign/optimism.js

[error] 47-47: 'getChainId' is not defined.

(no-undef)

contracts/deploy/foreign/zksync.js

[error] 26-26: 'getChainId' is not defined.

(no-undef)

contracts/deploy/foreign/arbitrum.js

[error] 25-25: 'getChainId' is not defined.

(no-undef)


[error] 38-38: Insert ,

(prettier/prettier)

🔇 Additional comments (16)
contracts/deploy/shared/consts.js (2)

10-13: Well-documented new wNative constant for WETH addresses

The addition of the wNative constant with clear comments indicating these are WETH addresses is well-structured and properly documented.


57-57: Properly exported the new constant

The wNative constant is correctly exported as part of the module exports.

contracts/deploy/foreign/zksync.js (2)

2-2: Updated imports to include wNative

The import statement has been correctly updated to include the wNative constant from the shared module.


30-31: Added wNative as constructor parameter

The addition of wNative[chainId] as the first parameter to the contract constructor aligns with the PR's objective to handle wrapped native currency.

contracts/deploy/foreign/optimism.js (2)

1-1: Updated imports to include wNative

The import statement has been correctly updated to include the wNative constant from the shared module.


51-52: Added wNative as constructor parameter

The addition of wNative[chainId] as the first parameter to the contract constructor aligns with the PR's objective to handle wrapped native currency.

contracts/deploy/foreign/arbitrum.js (2)

1-1: Updated imports to include wNative

The import statement has been correctly updated to include the wNative constant from the shared module.


30-31: Added wNative as constructor parameter

The addition of wNative[chainId] as the first parameter to the contract constructor aligns with the PR's objective to handle wrapped native currency.

contracts/src/0.8/libraries/SafeSend.sol (1)

1-24: Well-designed safety mechanism for ETH transfers

The SafeSend library provides a robust fallback mechanism for ETH transfers that might fail, using wrapped native tokens as a backup. The implementation follows good security practices.

contracts/src/0.8/RealitioForeignProxyOptimism.sol (7)

16-16: Good integration of SafeSend library

The SafeSend library import and usage along with the new wNative state variable provides a more robust mechanism for ETH transfers.

Also applies to: 23-23, 68-68


27-29: Helpful gas limit explanation

The added comments provide clear context about the gas limit considerations for cross-chain messaging.


97-98: Properly implemented wNative parameter

The constructor correctly accepts and initializes the new wNative parameter.

Also applies to: 108-108, 118-118


193-194: Improved ETH transfer safety

Replacing direct send calls with safeSend improves the robustness of the contract by handling failed transfers gracefully.

Also applies to: 220-220, 242-242, 314-314, 355-355


154-154: Consistent usage of MIN_GAS_LIMIT constant

Converting the previous immutable variable to a constant and using it consistently throughout the contract is a good practice.

Also applies to: 244-244, 420-420


256-257: Improved documentation for Kleros denomination offset

The added comments clarify the +1 offset in Kleros denomination compared to Realitio format, which helps prevent potential confusion.

Also applies to: 324-324, 367-367, 479-479, 504-504, 527-527, 554-554


16-16:

❓ Verification inconclusive

Verify the wNative addresses on deployment to each chain

Ensure that the correct WETH/WMATIC/etc. addresses are used when deploying to different chains.

Also applies to: 23-23, 68-68, 118-118


🏁 Script executed:

#!/bin/bash
# Check if there are any scripts or tests that handle deployment with the wNative parameter

echo "Checking deployment scripts for wNative parameter handling:"
rg -A 5 -B 5 "wNative" --type js

Length of output: 5430


Action Required: Verify Correct wNative Addresses Across Chains

Please double-check that the native token addresses (WETH, WMATIC, etc.) used in deployments are correct for each chain. Our deployment scripts reference the wNative mapping (defined in contracts/deploy/shared/consts.js) and pass wNative[chainId] to the proxies. In particular, verify the following:

  • In contracts/deploy/shared/consts.js, confirm that the addresses for each chain (e.g., mainnet, sepolia, Optimism, Arbitrum) are up to date and accurate.
  • Ensure that the deployment scripts (such as those in contracts/deploy/foreign/optimism.js, contracts/deploy/foreign/zksync.js, and contracts/deploy/foreign/arbitrum.js) properly use wNative[chainId] so that the correct native asset is deployed on each chain.
  • The same verification should apply to the lines indicated in RealitioForeignProxyOptimism.sol (lines 16, 23, 68, and 118).

@@ -23,9 +23,11 @@ async function deployForeignProxy({ deploy, from, parameters, homeNetworkName, h
const surplus = eth("0.03"); // The surplus will be automatically reimbursed when the dispute is created.
const l2GasLimit = 1500000; // Gas limit for a tx on L2.
const l2GasPerPubdataByteLimit = 800;
const chainId = await getChainId();
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing function definition for getChainId

The getChainId() function is called but not defined or imported in this file.

You need to either import this function or define it. This will cause a runtime error if not addressed.

-const { encodeExtraData, eth, getMetaEvidenceCID, wNative } = require("../shared");
+const { encodeExtraData, eth, getMetaEvidenceCID, wNative, getChainId } = require("../shared");

Or, if getChainId is from hardhat:

-const { ethers } = require("hardhat");
+const { ethers, network } = require("hardhat");
+
+async function getChainId() {
+  return network.config.chainId;
+}
📝 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
const chainId = await getChainId();
// Assuming this file is contracts/deploy/foreign/zksync.js
// Updated import to include getChainId
const { encodeExtraData, eth, getMetaEvidenceCID, wNative, getChainId } = require("../shared");
// ... other code in the file ...
async function deployContracts() {
// getChainId is now defined via the import
const chainId = await getChainId();
console.log("Chain ID:", chainId);
// ... rest of the deployment logic ...
}
deployContracts().catch(console.error);
Suggested change
const chainId = await getChainId();
// Using hardhat's network module for getChainId
const { ethers, network } = require("hardhat");
// Define getChainId inline
async function getChainId() {
return network.config.chainId;
}
// ... other code in the file ...
async function deployContracts() {
const chainId = await getChainId();
console.log("Chain ID:", chainId);
// ... rest of the deployment logic ...
}
deployContracts().catch(console.error);
🧰 Tools
🪛 ESLint

[error] 26-26: 'getChainId' is not defined.

(no-undef)

@@ -44,10 +44,11 @@ async function deployForeignProxy({ deploy, from, parameters, homeNetworkName, h
const { numberOfJurors, foreignBridge, variant } = parameters;
const metaEvidence = getMetaEvidenceCID(homeNetworkName);
const arbitratorExtraData = encodeExtraData(courts.oracle, numberOfJurors);
const chainId = await getChainId();
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing function definition for getChainId

The getChainId() function is called but not defined or imported in this file.

You need to either import this function or define it. This will cause a runtime error if not addressed.

-const { encodeExtraData, getMetaEvidenceCID, wNative } = require("../shared");
+const { encodeExtraData, getMetaEvidenceCID, wNative, getChainId } = require("../shared");

Or, if getChainId is from hardhat:

+const { network } = require("hardhat");
+
+async function getChainId() {
+  return network.config.chainId;
+}
📝 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
const chainId = await getChainId();
// At the top of the file in contracts/deploy/foreign/optimism.js
-const { encodeExtraData, getMetaEvidenceCID, wNative } = require("../shared");
+const { encodeExtraData, getMetaEvidenceCID, wNative, getChainId } = require("../shared");
...
// Later in the file
async function deployContract() {
const chainId = await getChainId();
// rest of deployment logic
}
Suggested change
const chainId = await getChainId();
// At the top of the file in contracts/deploy/foreign/optimism.js
const { encodeExtraData, getMetaEvidenceCID, wNative } = require("../shared");
+const { network } = require("hardhat");
+async function getChainId() {
+ return network.config.chainId;
+}
...
// Later in the file
async function deployContract() {
const chainId = await getChainId();
// rest of deployment logic
}
🧰 Tools
🪛 ESLint

[error] 47-47: 'getChainId' is not defined.

(no-undef)

Comment on lines 25 to 26
const chainId = await getChainId();

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Missing function definition for getChainId

The getChainId() function is called but not defined or imported in this file.

You need to either import this function or define it. This will cause a runtime error if not addressed.

-const { encodeExtraData, eth, getMetaEvidenceCID, wNative } = require("../shared");
+const { encodeExtraData, eth, getMetaEvidenceCID, wNative, getChainId } = require("../shared");

Or, if getChainId is from hardhat:

+const { network } = require("hardhat");
+
+async function getChainId() {
+  return network.config.chainId;
+}
📝 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
const chainId = await getChainId();
const { encodeExtraData, eth, getMetaEvidenceCID, wNative, getChainId } = require("../shared");
async function deploy() {
const chainId = await getChainId();
// ... rest of the deployment logic
}
deploy().catch(error => {
console.error(error);
process.exit(1);
});
Suggested change
const chainId = await getChainId();
const { encodeExtraData, eth, getMetaEvidenceCID, wNative } = require("../shared");
const { network } = require("hardhat");
async function getChainId() {
return network.config.chainId;
}
async function deploy() {
const chainId = await getChainId();
// ... rest of the deployment logic
}
deploy().catch(error => {
console.error(error);
process.exit(1);
});
🧰 Tools
🪛 ESLint

[error] 25-25: 'getChainId' is not defined.

(no-undef)

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