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

feat: deploy base sepolia #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: deploy base sepolia #13

wants to merge 2 commits into from

Conversation

royvardhan
Copy link
Contributor

@royvardhan royvardhan commented Jan 27, 2025

Summary by CodeRabbit

  • New Features

    • Added deployment support for Base Sepolia testnet.
    • Reintroduced deployment target for Europa testnet.
  • Configuration Updates

    • Updated network configurations and addresses for new testnet deployments.
    • Added chain ID and RPC details for Base Sepolia network.
  • Deployment Enhancements

    • Expanded deployment infrastructure to support additional blockchain networks.
    • Introduced new state configurations for deployment processes.

Copy link

coderabbitai bot commented Jan 27, 2025

Walkthrough

This pull request introduces support for the Base Sepolia testnet across multiple configuration files. The changes include adding deployment targets in the Makefile, creating a new state.json file with deployment addresses, updating network configurations in the static quoter package, and modifying the Hardhat configuration to support the new network. The primary focus is on enabling deployment and interaction with the Base Sepolia testnet.

Changes

File Change Summary
packages/deploy/Makefile Added two deployment targets: deploy_europa_testnet and deploy_base_sepolia
packages/deploy/state.json New file with deployment addresses for various application components
packages/static-quoter/constants/addresses.json Added baseSepolia network section with vapordexV2 factory address
packages/static-quoter/deploy/vapordexV2.ts Added baseSepolia to allowedNetworks and network-specific handling
packages/static-quoter/deployments/baseSepolia/.chainId Added chain ID 84532
packages/static-quoter/hardhat.config.ts Added Base Sepolia RPC configuration, network settings, and named accounts

Sequence Diagram

sequenceDiagram
    participant Developer
    participant Makefile
    participant HardhatConfig
    participant Deployment
    
    Developer->>Makefile: Trigger deploy_base_sepolia
    Makefile->>HardhatConfig: Use Base Sepolia network config
    HardhatConfig->>Deployment: Deploy with specified parameters
    Deployment-->>Developer: Deployment complete
Loading

Possibly related PRs

  • deploy europa and curtis #12: The changes in the main PR are directly related to the addition of the deploy_europa_testnet target in the Makefile, which is also modified in the retrieved PR to include the same target, indicating a shared focus on deployment configurations for the Europa testnet.

Suggested reviewers

  • mejiasd3v

Poem

🚀 A rabbit's deployment tale unfolds,
Base Sepolia's network now takes hold!
With configs crisp and targets clear,
Our blockchain journey brings such cheer!
Testnet magic, code so bright,
Deployment dancing with delight! 🐰

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)

🪧 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.

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

🧹 Nitpick comments (1)
packages/static-quoter/hardhat.config.ts (1)

78-84: Consider adding Base Sepolia to etherscan configuration.

The configuration should include Base Sepolia's block explorer for contract verification.

 etherscan: {
   apiKey: ETHERSCAN_API_KEY,
   customChains: [
+    {
+      network: "baseSepolia",
+      chainId: 84532,
+      urls: {
+        apiURL: "https://api-sepolia.basescan.org/api",
+        browserURL: "https://sepolia.basescan.org"
+      }
+    },
     // ... other chains
   ]
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f766cc9 and 057d5c1.

📒 Files selected for processing (6)
  • packages/deploy/Makefile (1 hunks)
  • packages/deploy/state.json (1 hunks)
  • packages/static-quoter/constants/addresses.json (1 hunks)
  • packages/static-quoter/deploy/vapordexV2.ts (2 hunks)
  • packages/static-quoter/deployments/baseSepolia/.chainId (1 hunks)
  • packages/static-quoter/hardhat.config.ts (5 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/deploy/state.json
🔇 Additional comments (4)
packages/static-quoter/deployments/baseSepolia/.chainId (1)

1-1: LGTM! Chain ID is correct for Base Sepolia.

The chain ID 84532 matches Base Sepolia's official network identifier.

packages/static-quoter/deploy/vapordexV2.ts (1)

16-16: Verify the Base Sepolia factory address configuration.

The integration follows the correct pattern, but we should verify the factory address configuration.

Also applies to: 43-45

packages/deploy/Makefile (1)

18-18: Consider adjusting gas parameters for Base Sepolia.

The current configuration uses -c 3 for gas price multiplier. Verify if this is optimal for Base Sepolia's gas dynamics.

✅ Verification successful

Gas multiplier is consistent with other testnet deployments

The current -c 3 configuration aligns with other testnet deployments in the codebase and follows the established pattern for testnet environments.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check recent gas prices on Base Sepolia

# Get recent gas prices from Base Sepolia
if [ -n "$BASE_SEPOLIA_RPC" ]; then
  echo "Recent gas prices on Base Sepolia:"
  curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}' $BASE_SEPOLIA_RPC | jq
fi

Length of output: 15


Script:

#!/bin/bash
# Search for gas-related configurations and Base Sepolia mentions
echo "Searching for gas configurations in deployment files:"
rg -i "gas|sepolia" packages/deploy/ -A 2 -B 2

echo -e "\nChecking for deployment documentation:"
fd "README|DEPLOY" --type f --exec cat {}

Length of output: 34173

packages/static-quoter/constants/addresses.json (1)

131-136: LGTM! The new network configuration follows the established structure.

The "baseSepolia" section maintains consistency with other network configurations in the file.

Let's verify the factory address exists on Base Sepolia:

✅ Verification successful

Factory address is properly integrated and deployed ✅

The address 0x3C88Aa61A1C15c8028530e0115884F85c839a795 is correctly configured as the vapordexV2 factory for Base Sepolia and has been successfully deployed and verified through deployment artifacts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the vapordexV2 factory contract exists on Base Sepolia

# Use etherscan API to check contract existence
curl -s "https://api-sepolia.basescan.org/api?module=contract&action=getabi&address=0x3C88Aa61A1C15c8028530e0115884F85c839a795"

Length of output: 197


Script:

#!/bin/bash
# Search for files containing the factory address
echo "=== Files containing the factory address ==="
rg -l "0x3C88Aa61A1C15c8028530e0115884F85c839a795"

echo -e "\n=== Checking for Base Sepolia related files ==="
rg -l -i "base.?sepolia"

echo -e "\n=== Looking for deployment or configuration files ==="
fd -e json -e ts -e js -e md . | rg -i "(deploy|config|constant|address)"

Length of output: 4863


Script:

#!/bin/bash
echo "=== Checking vapordexV2 deployment script ==="
cat packages/static-quoter/deploy/vapordexV2.ts

echo -e "\n=== Checking deployment state ==="
cat packages/deploy/state.json | grep -A 5 -B 5 "0x3C88Aa61A1C15c8028530e0115884F85c839a795"

echo -e "\n=== Checking Base Sepolia deployment artifact ==="
cat packages/static-quoter/deployments/baseSepolia/UniswapV3StaticQuoter.json

Length of output: 68862

@@ -17,6 +17,7 @@ const ETHERSCAN_API_KEY = process.env.SNOWTRACE_API_KEY;
const DOGECHAIN_RPC = process.env.DOGECHAIN_RPC ?? "";
const EUROPA_TESTNET_RPC = process.env.EUROPA_TESTNET_RPC ?? "";
const CURTIS_RPC = process.env.CURTIS_RPC ?? "";
const BASE_SEPOLIA_RPC = process.env.BASE_SEPOLIA_RPC ?? "";
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

BASE_SEPOLIA_RPC environment variable is not documented

The environment variable is missing from packages/static-quoter/.env.sample while other RPC endpoints, including test networks like Fuji, are documented. Add BASE_SEPOLIA_RPC to maintain consistency with the project's documentation pattern.

  • Add BASE_SEPOLIA_RPC= to packages/static-quoter/.env.sample
🔗 Analysis chain

Verify BASE_SEPOLIA_RPC environment variable.

Ensure the environment variable is properly documented and added to the deployment environment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if BASE_SEPOLIA_RPC is documented

# Check if BASE_SEPOLIA_RPC is mentioned in .env.example or similar files
fd -t f -e example -e sample -e template | xargs grep -l "BASE_SEPOLIA_RPC"

Length of output: 75


Script:

#!/bin/bash
# Broader search for environment variable documentation and similar patterns

# Check for any .env files
echo "=== Checking .env files ==="
fd -t f "^\.env" --hidden

# Check README files for RPC documentation
echo -e "\n=== Checking README files for RPC documentation ==="
fd -t f "README" -e md | xargs grep -l "RPC"

# Check for similar RPC configurations in the codebase
echo -e "\n=== Checking for RPC patterns ==="
rg "process\.env\.[A-Z_]*RPC" --type ts

Length of output: 1208


Script:

#!/bin/bash
# Check content of relevant files for BASE_SEPOLIA_RPC documentation

echo "=== Content of .env.sample ==="
cat packages/static-quoter/.env.sample

echo -e "\n=== RPC Documentation in deploy README ==="
grep -A 5 -B 5 "RPC" packages/deploy/README.md

Length of output: 1285

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

🧹 Nitpick comments (2)
packages/static-quoter/deploy/vapordexV2.ts (2)

9-20: Improve error message readability.

The error message could be more user-friendly by formatting the network list.

-    throw new Error(`Wrong network! Only "${allowedNetworks}" supported`);
+    throw new Error(`Wrong network! Only ${allowedNetworks.join(', ')} supported`);

55-61: Consider enabling skipIfAlreadyDeployed for production networks.

Setting skipIfAlreadyDeployed: false means the contract will be redeployed even if it already exists. This could be wasteful in terms of gas and potentially disruptive for production networks.

Consider adding a condition to enable skipping for production networks:

   const deployResult: any = await deploy(contractName, {
     from: deployer,
     contract: contractName,
-    skipIfAlreadyDeployed: false,
+    skipIfAlreadyDeployed: !['fuji', 'telosTestnet', 'europaTestnet', 'baseSepolia'].includes(network.name),
     log: true,
     args,
   });
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 057d5c1 and cce5150.

📒 Files selected for processing (3)
  • packages/static-quoter/constants/addresses.json (1 hunks)
  • packages/static-quoter/deploy/vapordexV2.ts (1 hunks)
  • packages/static-quoter/hardhat.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/static-quoter/constants/addresses.json
  • packages/static-quoter/hardhat.config.ts
🔇 Additional comments (2)
packages/static-quoter/deploy/vapordexV2.ts (2)

1-8: LGTM! Clean imports and function declaration.

The imports are appropriate for a Hardhat deployment script, and the function declaration is well-structured.


22-50: Verify Base Sepolia factory address configuration.

Ensure that the Base Sepolia factory address is properly configured in the addresses file.

✅ Verification successful

🏁 Script executed:

#!/bin/bash
# Description: Verify Base Sepolia factory address configuration

# Check if the factory address exists and is valid
jq -e '.baseSepolia.protocols.vapordexV2.factory' packages/static-quoter/constants/addresses.json

# Verify the address format
jq -r '.baseSepolia.protocols.vapordexV2.factory' packages/static-quoter/constants/addresses.json | grep -E '^0x[a-fA-F0-9]{40}$' || echo "Invalid address format"

Length of output: 315


Base Sepolia configuration verified.

The addresses file in packages/static-quoter/constants/addresses.json has the Base Sepolia factory address correctly set to "0x3C88Aa61A1C15c8028530e0115884F85c839a795" and it adheres to the proper Ethereum address format.

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.

1 participant