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

updated foundry.toml with etherscanV2 links #926

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Conversation

0xDEnYO
Copy link
Contributor

@0xDEnYO 0xDEnYO commented Jan 15, 2025

Which Jira task belongs to this PR?

Why did I implement it this way?

Because it's easier for us to use etherscanV2 with a shared API key to save the effort for every developer to register in the block explorer of a newly added network

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>

Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

Walkthrough

The pull request involves two primary changes: updating the ReceiverAcrossV3 contract address in the deployments/base.json file and modifying the blockchain explorer API configurations in the foundry.toml file. The contract address change indicates an update to the address linked with the ReceiverAcrossV3 facet. The modifications to the foundry.toml file standardize the API endpoint URLs for various blockchain explorers, ensuring a consistent format with versioned API endpoints and chain-specific identifiers.

Changes

File Change Summary
deployments/base.json Updated ReceiverAcrossV3 contract address from 0xca6e6B692F568055adA0bF72A06D1EBbC938Fb23 to 0xe054A981c7985DCA8B0A9546BcA93BB54101aB0d.
foundry.toml Standardized blockchain explorer API URLs in [etherscan] section to use https://api.etherscan.io/v2/api?chainid=X format for multiple chains including Arbitrum, Base, Blast, BSC, Celo, and others. Added a new entry for Rootstock explorer.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b2c0861 and 42bc1c9.

📒 Files selected for processing (1)
  • deployments/base.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • deployments/base.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: generate-tag
  • GitHub Check: analyze

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.

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

🧹 Nitpick comments (1)
foundry.toml (1)

76-107: Consider adding API endpoint fallbacks.

While standardizing on etherscan.io/v2/api is good for maintenance, consider keeping the original network-specific URLs as fallbacks in case of API issues.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between eb12d93 and b2c0861.

📒 Files selected for processing (2)
  • deployments/base.json (1 hunks)
  • foundry.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
  • GitHub Check: analyze
🔇 Additional comments (3)
deployments/base.json (1)

43-43: Verify the new ReceiverAcrossV3 contract.

Let's verify that the new contract address is properly deployed and verified on Base network.

✅ Verification successful

✓ ReceiverAcrossV3 contract update is valid

The new contract address is properly configured with the correct dependencies:

  • Across SpokePool: 0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64
  • Executor: 0x4DaC9d1769b9b304cb04741DCDEb2FC14aBdF110
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new ReceiverAcrossV3 contract on Base network
# Expected results: Contract should be verified and match ReceiverAcrossV3 implementation

# Check if contract is verified and get contract name
curl -s -X GET "https://api.basescan.org/api?module=contract&action=getsourcecode&address=0xe054A981c7985DCA8B0A9546BcA93BB54101aB0d&apikey=${BASE_ETHERSCAN_API_KEY}" | jq -r '.result[0].ContractName'

# Get contract creation transaction
curl -s -X GET "https://api.basescan.org/api?module=account&action=txlist&address=0xe054A981c7985DCA8B0A9546BcA93BB54101aB0d&startblock=0&endblock=99999999&page=1&offset=1&sort=asc&apikey=${BASE_ETHERSCAN_API_KEY}" | jq -r '.result[0].from'

Length of output: 511


Script:

#!/bin/bash
# Search for any references to the new contract address
rg -i "0xe054A981c7985DCA8B0A9546BcA93BB54101aB0d"

# Search for files related to ReceiverAcrossV3
rg -i "ReceiverAcrossV3"

# Look for deployment documentation
fd -t f "README|DEPLOY" -X cat {}

Length of output: 42017


Script:

#!/bin/bash
# Check deployment scripts for ReceiverAcrossV3
rg -A 10 "ReceiverAcrossV3" script/deploy/facets/DeployReceiverAcrossV3.s.sol

# Compare implementation with other chains
rg -l "0xe054A981c7985DCA8B0A9546BcA93BB54101aB0d"

Length of output: 870


Script:

#!/bin/bash
# Check global config for ReceiverAcrossV3
cat config/global.json || echo "File not found"

# Check Base-specific config
cat config/base.json || echo "File not found"

# Check deployment requirements
cat script/deploy/resources/deployRequirements.json || echo "File not found"

Length of output: 23202


Script:

#!/bin/bash
# Check across configuration for Base network
cat config/across.json || echo "File not found"

# Find Executor contract address on Base
rg -i "Executor.*0x" deployments/base.json

Length of output: 6020

foundry.toml (2)

103-103: Verify Blockscout configuration for Rootstock.

The Rootstock entry correctly specifies the Blockscout verifier, which is essential for proper contract verification.


76-107: Verify chain IDs and API endpoint format.

The changes standardize most networks to use etherscan.io/v2/api with chainid parameter, which aligns with the PR objectives. However, let's verify the chain IDs match official network specifications.

✅ Verification successful

Chain IDs and API endpoints verified successfully

All chain IDs in the configuration match the official network specifications, and the API endpoint format is consistent with the standardization to etherscan.io/v2/api where applicable, with appropriate use of network-specific explorers and blockscout verifiers where needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify chain IDs against EIP-155 registry
# Expected results: Chain IDs should match official specifications

# Clone chainid.network repository which maintains official chain ID registry
git clone --depth 1 https://github.com/ethereum-lists/chains.git
cd chains/_data/chains

# Check chain IDs for specific networks
echo "Verifying chain IDs..."
for chain in "arbitrum" "base" "blast" "bsc" "celo" "cronos" "fantom" "fraxtal" "gnosis" "linea" "moonbeam" "moonriver" "optimism" "polygon" "polygonzkevm" "scroll" "taiko" "worldchain"
do
  if [ -f "${chain}.json" ]; then
    echo "${chain}: $(jq .chainId ${chain}.json)"
  fi
done

Length of output: 4283


Script:

#!/bin/bash
# Fetch chain data from chainlist.org API
echo "Fetching chain data from chainlist.org..."
curl -s "https://chainid.network/chains.json" | jq -r '.[] | select(.chainId | tostring | match("42161|8453|81457|56|42220|25|250|252|100|59144|1284|1285|10|137|1101|534352|167000|480")) | "\(.name): \(.chainId)"'

# Also check specific network documentation
echo -e "\nChecking network documentation..."
curl -s "https://docs.blast.io/about/networks" | grep -i "chain.*id"
curl -s "https://docs.frax.com/fraxtal/networks" | grep -i "chain.*id"

Length of output: 9223

@0xDEnYO 0xDEnYO marked this pull request as ready for review January 15, 2025 07:58
@0xDEnYO 0xDEnYO enabled auto-merge (squash) January 15, 2025 08:00
@lifi-action-bot
Copy link
Collaborator

Test Coverage Report

Line Coverage: 78.66% (2238 / 2845 lines)
Function Coverage: 84.71% ( 388 / 458 functions)
Branch Coverage: 39.60% ( 221 / 558 branches)
Test coverage (78.66%) is above min threshold (76%). Check passed.

@0xDEnYO 0xDEnYO merged commit 89e6c70 into main Jan 15, 2025
22 checks passed
@0xDEnYO 0xDEnYO deleted the implement-etherscan-v2 branch January 15, 2025 08:06
@@ -73,37 +73,38 @@ base = "${ETH_NODE_URI_BASE}"

[etherscan]
mainnet = { key = "${MAINNET_ETHERSCAN_API_KEY}", chain = "1" }
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't checked that but the default url is: https://api.etherscan.io/api and doesn't have to be compatible with api key v2. I would add explicit url: https://api.etherscan.io/v2/api?chainid=1

@@ -73,37 +73,38 @@ base = "${ETH_NODE_URI_BASE}"

[etherscan]
mainnet = { key = "${MAINNET_ETHERSCAN_API_KEY}", chain = "1" }
arbitrum = { key = "${ARBITRUM_ETHERSCAN_API_KEY}", url = "https://api.arbiscan.io/api", chain = "42161" }
arbitrum = { key = "${ARBITRUM_ETHERSCAN_API_KEY}", url = "https://api.etherscan.io/v2/api?chainid=42161", chain = "42161" }
aurora = { key = "${AURORA_ETHERSCAN_API_KEY}", url = "https://explorer.mainnet.aurora.dev/api", chain = "1313161554", verifier = "blockscout" }
avalanche = { key = "${AVALANCHE_ETHERSCAN_API_KEY}", url = "https://api.snowtrace.io/api", chain = "43114" }
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

4 participants