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/create2 testnets #327

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Deploy/create2 testnets #327

merged 4 commits into from
Jul 22, 2024

Conversation

ChiTimesChi
Copy link
Collaborator

@ChiTimesChi ChiTimesChi commented Jul 17, 2024

Description

Fixes # (issue)

Checklist

  • New Contracts have been tested
  • Lint has been run
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • New Features
    • Added support for multiple testnet chains, expanding functionality for developers.
    • Introduced a script to fetch and save chain IDs for specified blockchain networks.
  • Configuration Updates
    • Enhanced configuration files with new API endpoints and Etherscan URLs for additional testnets.
    • New JSON configurations for smart contract deployments on various test networks.
  • Documentation
    • Updated example environment variables to reflect new testnet configurations.

Copy link

coderabbitai bot commented Jul 17, 2024

Walkthrough

The recent changes enhance the configuration and deployment capabilities for various testnets in a blockchain development environment. New environment variables have been added for Arbitrum Sepolia, Base Sepolia, BNB Testnet, and Scroll Sepolia, along with the corresponding chain IDs and smart contract deployment configurations. A new script for fetching chain IDs has also been introduced, streamlining the setup process for developers working with these networks.

Changes

Files Change Summary
.env.example, foundry.toml Added API endpoints and Etherscan URLs for Arbitrum Sepolia, Base Sepolia, BNB Testnet, and Scroll Sepolia.
deployments/*/.chainId New files introduced containing specific chain IDs for each testnet.
deployments/*/Create2Factory.json New configuration files created for smart contract deployments on respective testnets, specifying contract addresses and constructor arguments.
script/chain-id.sh A new script added to fetch and save the chain ID for specified blockchain networks.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Environment
    participant Script
    participant Blockchain

    Developer->>Environment: Set up .env variables
    Developer->>Script: Run chain-id.sh
    Script->>Environment: Retrieve RPC URL
    Script->>Blockchain: Fetch chain ID
    Blockchain-->>Script: Return chain ID
    Script->>Environment: Save chain ID
Loading

🐰
In the meadow, new paths unfold,
With APIs and chains, a tale to be told.
Arbitrum hops, and Base joins the dance,
BNB and Scroll take their chance.
🥕 Let’s leap with joy, for progress is bright,
In this blockchain garden, all feels just right!
🌼


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.

@coveralls
Copy link

coveralls commented Jul 17, 2024

Pull Request Test Coverage Report for Build 10011267854

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 12.934%

Totals Coverage Status
Change from base Build 8485603958: 0.0%
Covered Lines: 664
Relevant Lines: 4684

💛 - Coveralls

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

Outside diff range, codebase verification and nitpick comments (4)
script/chain-id.sh (2)

21-25: Critical Issue: cast command not available

The cast command, which is essential for fetching the chain ID, is not available. This prevents the script from functioning as intended.

  • Ensure that the cast command is installed and available in the environment where the script is executed.
  • Verify the installation and configuration of the cast command before running the script.
Analysis chain

LGTM! Ensure the cast command is available and correctly configured.

The directory creation and chain ID fetching are appropriate. Verify that the cast command is available and correctly configured.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the cast command is available and correctly configured.

# Test: Check for the availability and configuration of the cast command.
# Expect: cast command is available and correctly configured.
if command -v cast &> /dev/null; then
  echo "cast command is available."
  cast --help | grep -q 'chain-id' && echo "cast command is correctly configured." || echo "cast command is not correctly configured."
else
  echo "cast command is not available."
fi

Length of output: 88


16-19: Critical Issue: Missing .env File

The .env file is missing, which is essential for sourcing environment variables and fetching the RPC URL. Please ensure that the .env file is present and contains the necessary variables.

  • Ensure the .env file exists in the root directory.
  • Verify that the .env file includes the required variables in the format CHAINNAME_API.
Analysis chain

LGTM! Ensure the .env file is correctly configured.

The environment variable sourcing and RPC URL fetching are appropriate. Verify that the .env file exists and contains the necessary variables.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the .env file exists and contains the necessary variables.

# Test: Check for the existence of the .env file and the required variables.
# Expect: .env file exists and contains the required variables.
if [ -f ".env" ]; then
  echo ".env file exists."
  grep -q '^[A-Z_]*_API=' .env && echo "Required variables are present." || echo "Required variables are missing."
else
  echo ".env file is missing."
fi

Length of output: 70

foundry.toml (1)

45-49: The provided RPC endpoints are not accessible.

The script indicates that the RPC endpoints for Arbitrum Sepolia, Base Sepolia, and Scroll Sepolia are not accessible. Ensure that the correct URLs are used and verify their accessibility.

  • arb_sepolia = "${ARB_SEPOLIA_API}"
  • base_sepolia = "${BASE_SEPOLIA_API}"
  • scroll_sepolia = "${SCROLL_SEPOLIA_API}"

Please replace the placeholders with the actual URLs and verify their accessibility.

Analysis chain

LGTM! Ensure the RPC endpoints are correct and accessible.

The added RPC endpoints for Arbitrum Sepolia, Base Sepolia, and Scroll Sepolia testnets are appropriate. Verify that the endpoints are correct and accessible.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the RPC endpoints are correct and accessible.

# Test: Check the accessibility of the RPC endpoints.
# Expect: RPC endpoints are accessible.
endpoints=(
  "https://arbitrum-sepolia.blockpi.network/v1/rpc/public"
  "https://base-sepolia.blockpi.network/v1/rpc/public"
  "https://scroll-sepolia.blockpi.network/v1/rpc/public"
)

for endpoint in "${endpoints[@]}"; do
  if curl --output /dev/null --silent --head --fail "$endpoint"; then
    echo "$endpoint is accessible."
  else
    echo "$endpoint is not accessible."
  fi
done

Length of output: 1051

.env.example (1)

98-109: Issues Found: API endpoints are not accessible

The API endpoints provided in the .env.example file for Arbitrum Sepolia, Base Sepolia, BNB Testnet, and Scroll Sepolia testnets are not accessible.

Please verify the URLs for correctness and ensure that the endpoints are accessible.

Analysis chain

LGTM! Ensure the API endpoints are correct and accessible.

The added API endpoints for Arbitrum Sepolia, Base Sepolia, BNB Testnet, and Scroll Sepolia testnets are appropriate. Verify that the endpoints are correct and accessible.

Also applies to: 118-121

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the API endpoints are correct and accessible.

# Test: Check the accessibility of the API endpoints.
# Expect: API endpoints are accessible.
endpoints=(
  "https://arbitrum-sepolia.blockpi.network/v1/rpc/public"
  "https://base-sepolia.blockpi.network/v1/rpc/public"
  "https://bsc-testnet.blockpi.network/v1/rpc/public"
  "https://scroll-sepolia.blockpi.network/v1/rpc/public"
)

for endpoint in "${endpoints[@]}"; do
  if curl --output /dev/null --silent --head --fail "$endpoint"; then
    echo "$endpoint is accessible."
  else
    echo "$endpoint is not accessible."
  fi
done

Length of output: 1385

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 885cbe0 and 67a5d29.

Files selected for processing (13)
  • .env.example (2 hunks)
  • deployments/arb_sepolia/.chainId (1 hunks)
  • deployments/arb_sepolia/Create2Factory.json (1 hunks)
  • deployments/base_sepolia/.chainId (1 hunks)
  • deployments/base_sepolia/Create2Factory.json (1 hunks)
  • deployments/bnb_testnet/.chainId (1 hunks)
  • deployments/bnb_testnet/Create2Factory.json (1 hunks)
  • deployments/eth_sepolia/Create2Factory.json (1 hunks)
  • deployments/op_sepolia/Create2Factory.json (1 hunks)
  • deployments/scroll_sepolia/.chainId (1 hunks)
  • deployments/scroll_sepolia/Create2Factory.json (1 hunks)
  • foundry.toml (2 hunks)
  • script/chain-id.sh (1 hunks)
Files skipped from review due to trivial changes (10)
  • deployments/arb_sepolia/.chainId
  • deployments/arb_sepolia/Create2Factory.json
  • deployments/base_sepolia/.chainId
  • deployments/base_sepolia/Create2Factory.json
  • deployments/bnb_testnet/.chainId
  • deployments/bnb_testnet/Create2Factory.json
  • deployments/eth_sepolia/Create2Factory.json
  • deployments/op_sepolia/Create2Factory.json
  • deployments/scroll_sepolia/.chainId
  • deployments/scroll_sepolia/Create2Factory.json
Additional comments not posted (5)
script/chain-id.sh (3)

1-3: LGTM!

The shebang and comments provide clear instructions and context for the script.


5-7: LGTM!

The color definitions are appropriate for enhancing the readability of error messages.


9-14: LGTM!

The argument handling and usage message are appropriate and enhance readability with color.

foundry.toml (1)

75-79: LGTM! Ensure the Etherscan configurations are correct and functional.

The added Etherscan configurations for Arbitrum Sepolia, Base Sepolia, and Scroll Sepolia testnets are appropriate. Verify that the configurations are correct and functional.

Verification successful

LGTM! The Etherscan configurations are correct and functional.

The added Etherscan configurations for Arbitrum Sepolia, Base Sepolia, and Scroll Sepolia testnets have been successfully verified and are functional.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the Etherscan configurations are correct and functional.

# Test: Check the functionality of the Etherscan configurations.
# Expect: Etherscan configurations are functional.
configs=(
  "https://api-sepolia.arbiscan.io/api"
  "https://api-sepolia.basescan.org/api"
  "https://api-sepolia.scrollscan.com/api"
)

for config in "${configs[@]}"; do
  if curl --output /dev/null --silent --head --fail "$config"; then
    echo "$config is functional."
  else
    echo "$config is not functional."
  fi
done

Length of output: 825

.env.example (1)

100-101: LGTM! Ensure the Etherscan configurations are correct and functional.

The added Etherscan configurations for Arbitrum Sepolia, Base Sepolia, BNB Testnet, and Scroll Sepolia testnets are appropriate. Verify that the configurations are correct and functional.

Also applies to: 104-105, 108-109, 120-121

Verification successful

The Etherscan configurations are correct and functional.

The following Etherscan configurations have been verified and are functional:

  • https://api-sepolia.arbiscan.io/api
  • https://api-sepolia.basescan.org/api
  • https://api-testnet.bscscan.com/api
  • https://api-sepolia.scrollscan.com/api
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the Etherscan configurations are correct and functional.

# Test: Check the functionality of the Etherscan configurations.
# Expect: Etherscan configurations are functional.
configs=(
  "https://api-sepolia.arbiscan.io/api"
  "https://api-sepolia.basescan.org/api"
  "https://api-testnet.bscscan.com/api"
  "https://api-sepolia.scrollscan.com/api"
)

for config in "${configs[@]}"; do
  if curl --output /dev/null --silent --head --fail "$config"; then
    echo "$config is functional."
  else
    echo "$config is not functional."
  fi
done

Length of output: 1091

@ChiTimesChi ChiTimesChi merged commit 8556305 into master Jul 22, 2024
8 of 10 checks passed
@ChiTimesChi ChiTimesChi deleted the deploy/create2-testnets branch July 22, 2024 12:44
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.

3 participants